21 #include <TClonesArray.h> 22 #include <TDatabasePDG.h> 23 #include <TParticlePDG.h> 25 #include <THnSparse.h> 26 #include <TParticle.h> 28 #include <THashList.h> 34 #include "AliEMCALGeometry.h" 35 #include "AliAnalysisManager.h" 36 #include "AliVEventHandler.h" 60 fClassName(class_name),
61 fAccessMethodName(method_name)
63 std::stringstream what_str;
64 what_str <<
"ALICE event not found in class '" <<
fClassName <<
"' using method '" << method_name <<
"'.";
65 fWhat = what_str.str();
68 #if !(defined(__CINT__) || defined(__MAKECINT__)) 125 dphi = TVector2::Phi_mpi_pi(fMomentum.Phi() - jet.
Phi());;
126 deta = fMomentum.Eta() - jet.
Eta();
127 return TMath::Sqrt(dphi*dphi + deta*deta);
138 return GetDistance(jet, deta, dphi);
155 fReconstructed(kFALSE),
197 fD.SetPtEtaPhiE(0,0,0,0);
207 for (
auto &jet :
fJets) {
208 jet.second.fMomentum.SetPtEtaPhiE(0,0,0,0);
209 jet.second.fNConstituents = 0;
211 jet.second.fMaxChargedPt = 0;
212 jet.second.fMaxNeutralPt = 0;
219 Printf(
"Printing D Meson Jet object.");
220 Printf(
"D Meson: pT = %.3f, eta = %.3f, phi = %.3f, inv. mass = %.3f",
fD.Pt(),
fD.Eta(),
fD.
Phi_0_2pi(),
fD.M());
222 for (
auto &jet :
fJets) {
223 Printf(
"Jet %s: pT = %.3f, eta = %.3f, phi = %.3f", jet.first.c_str(), jet.second.Pt(), jet.second.Eta(), jet.second.Phi_0_2pi());
224 Printf(
"Jet N Consituents = %d", jet.second.fNConstituents);
233 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
234 if (it ==
fJets.end())
return 0;
238 if ((*it).second.Pt() > 0) {
239 TVector3 dvect =
fD.Vect();
240 TVector3 jvect = (*it).second.fMomentum.Vect();
245 ::Error(
"AliAnalysisTaskDmesonJetsSub::AliDmesonJetInfo::GetZ",
"Zero jet momentum!");
249 z = (dvect * jvect) / jetMom;
252 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
263 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
264 if (it ==
fJets.end())
return 0;
268 if ((*it).second.Pt() > 0) {
269 TVector3 dvect =
fD.Vect();
270 TVector3 jvect = (*it).second.fMomentum.Vect();
272 Double_t corrpt = (*it).second.fCorrPt > 0 ? (*it).second.fCorrPt : 0.;
273 jvect.SetPerp(corrpt);
281 z = (dvect * jvect) / jetMom;
296 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
297 if (it ==
fJets.end())
return 0;
321 dphi = TVector2::Phi_mpi_pi(
fD.Phi() - jet.
Phi());;
322 deta =
fD.Eta() - jet.
Eta();
323 return TMath::Sqrt(dphi*dphi + deta*deta);
343 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
344 if (it ==
fJets.end()) {
345 ::Error(
"AliAnalysisTaskDmesonJetsSub::AliDmesonJetInfo::GetJet",
"Could not find jet info for the jet definition '%s'!",
349 return &((*it).second);
358 std::map<std::string, AliJetInfo>::iterator it =
fJets.find(n);
359 if (it ==
fJets.end()) {
360 ::Error(
"AliAnalysisTaskDmesonJetsSub::AliDmesonJetInfo::GetJet",
"Could not find jet info for the jet definition '%s'!",
364 return &((*it).second);
405 std::map<std::string, AliJetInfo>::const_iterator it = source.
fJets.find(n);
406 if (it == source.
fJets.end())
return;
497 fPt = source.
fD.Pt();
569 fInvMass(source.fD.M()),
623 fDCA = recoDecay->GetDCA();
626 fPtK = recoDecay->PtProng(0);
627 fPtPi = recoDecay->PtProng(1);
628 fd0K = recoDecay->Getd0Prong(0);
629 fd0Pi = recoDecay->Getd0Prong(1);
633 fPtK = recoDecay->PtProng(1);
634 fPtPi = recoDecay->PtProng(0);
635 fd0K = recoDecay->Getd0Prong(1);
636 fd0Pi = recoDecay->Getd0Prong(0);
643 for (
Int_t ipr=0; ipr < 2; ipr++) {
644 Double_t diffIP = 0., errdiffIP = 0.;
647 if (errdiffIP > 0.) {
648 normdd0 = diffIP / errdiffIP;
655 normdd0 = diffIP > 0 ? 9999. : -9999.;
658 if (TMath::Abs(normdd0) > TMath::Abs(
fMaxNormd0)) {
696 f2ProngInvMass(source.fInvMass2Prong),
697 fDeltaInvMass(source.fD.M() - source.fInvMass2Prong)
754 fName(eng->GetName())
766 TH1* histAncestor =
nullptr;
767 TH1* histPrompt =
nullptr;
770 hname = TString::Format(
"%s/fHistPrompt",
fName.Data());
773 hname = TString::Format(
"%s/fHistAncestor",
fName.Data());
777 std::map<AliAODMCParticle*, Short_t> partons ;
783 if (applyKinCuts && !
fJetDefinitions->at(ij).IsJetInAcceptance(*jet)) {
784 hname = TString::Format(
"%s/%s/fHistRejectedJetPt",
fName.Data(),
fJetDefinitions->at(ij).GetName());
786 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi",
fName.Data(),
fJetDefinitions->at(ij).GetName());
788 hname = TString::Format(
"%s/%s/fHistRejectedJetEta",
fName.Data(),
fJetDefinitions->at(ij).GetName());
796 if (dmeson_pair.second.fParton) {
797 partons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
798 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
799 if (absPdgParton == 4) {
800 histPrompt->Fill(
"Prompt", 1);
802 else if (absPdgParton == 5) {
803 histPrompt->Fill(
"Non-Prompt", 1);
806 histPrompt->Fill(
"Unknown", 1);
810 histPrompt->Fill(
"Unknown", 1);
815 if (dmeson_pair.second.fAncestor) {
816 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
817 if (absPdgAncestor == 4) {
818 histAncestor->Fill(
"Charm", 1);
820 else if (absPdgAncestor == 5) {
821 histAncestor->Fill(
"Bottom", 1);
823 else if (absPdgAncestor == 2212) {
824 histAncestor->Fill(
"Proton", 1);
827 histAncestor->Fill(
"Unknown", 1);
831 histAncestor->Fill(
"Unknown", 1);
836 hname = TString::Format(
"%s/fHistRejectedDMesonPt",
fName.Data());
838 hname = TString::Format(
"%s/fHistRejectedDMesonPhi",
fName.Data());
840 hname = TString::Format(
"%s/fHistRejectedDMesonEta",
fName.Data());
844 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass",
fName.Data());
848 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass",
fName.Data());
851 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass",
fName.Data());
852 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
859 hname = TString::Format(
"%s/fHistPartonPt",
fName.Data());
861 hname = TString::Format(
"%s/fHistPartonEta",
fName.Data());
863 hname = TString::Format(
"%s/fHistPartonPhi",
fName.Data());
865 hname = TString::Format(
"%s/fHistPartonType",
fName.Data());
868 for (
auto parton : partons) {
869 if (!parton.first)
continue;
870 histPartonPt->Fill(parton.first->Pt());
871 histPartonEta->Fill(parton.first->Eta());
872 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
873 histPartonType->Fill(parton.second);
908 AliDebugGeneralStream(
"AliAnalysisTaskDmesonJetsSub::OutputHandlerTHnSparse::BuildOutputObject", 2) <<
"Now working on '" << jetDef.GetName() <<
"'" << std::endl;
918 title[dim] =
"#it{p}_{T,D} (GeV/#it{c})";
925 title[dim] =
"#eta_{D}";
931 title[dim] =
"#phi_{D} (rad)";
934 max[dim] = TMath::TwoPi();
939 title[dim] =
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})";
947 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
955 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
962 title[dim] =
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})";
967 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
975 title[dim] =
"#it{p}_{T,#pi} (GeV/#it{c})";
982 title[dim] =
"#it{z}_{D}";
989 title[dim] =
"#Delta R_{D-jet}";
992 max[dim] = radius * 1.5;
997 title[dim] =
"#eta_{D} - #eta_{jet}";
999 min[dim] = -radius * 1.2;
1000 max[dim] = radius * 1.2;
1005 title[dim] =
"#phi_{D} - #phi_{jet} (rad)";
1007 min[dim] = -radius * 1.2;
1008 max[dim] = radius * 1.2;
1012 title[dim] =
"#it{p}_{T,jet} (GeV/#it{c})";
1019 title[dim] =
"#eta_{jet}";
1025 title[dim] =
"#phi_{jet} (rad)";
1028 max[dim] = TMath::TwoPi();
1033 title[dim] =
"No. of constituents";
1040 hname = TString::Format(
"%s/%s/fDmesonJets",
fName.Data(), jetDef.GetName());
1042 for (
Int_t j = 0; j < dim; j++) {
1043 h->GetAxis(j)->SetTitle(title[j]);
1069 hname = TString::Format(
"%s/fHistRejectedDMesonPt",
fName.Data());
1071 hname = TString::Format(
"%s/fHistRejectedDMesonPhi",
fName.Data());
1073 hname = TString::Format(
"%s/fHistRejectedDMesonEta",
fName.Data());
1080 hname = TString::Format(
"%s/%s/fDmesonJets",
fName.Data(), jetDef.GetName());
1083 for (
auto& dmeson_pair : *fDmesonJets) {
1084 const AliJetInfo* jet = dmeson_pair.second.GetJet(jetDef.GetName());
1086 if (!jetDef.IsJetInAcceptance(*jet)) {
1087 hname = TString::Format(
"%s/%s/fHistRejectedJetPt",
fName.Data(), jetDef.GetName());
1089 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi",
fName.Data(), jetDef.GetName());
1091 hname = TString::Format(
"%s/%s/fHistRejectedJetEta",
fName.Data(), jetDef.GetName());
1118 std::map<std::string, AliJetInfo>::const_iterator it = DmesonJet.
fJets.find(n);
1119 if (it == DmesonJet.
fJets.end())
return kFALSE;
1121 for (
Int_t i = 0; i < h->GetNdimensions(); i++) {
1123 if (
title==
"#it{p}_{T,D} (GeV/#it{c})") contents[i] = DmesonJet.
fD.Pt();
1124 else if (
title==
"#eta_{D}") contents[i] = DmesonJet.
fD.Eta();
1127 else if (
title==
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M();
1128 else if (
title==
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M() - DmesonJet.
fInvMass2Prong;
1129 else if (
title==
"#it{p}_{T,#pi} (GeV/#it{c})") contents[i] = DmesonJet.
fSoftPionPt;
1130 else if (
title==
"#it{z}_{D}") contents[i] = z;
1131 else if (
title==
"#Delta R_{D-jet}") contents[i] = deltaR;
1132 else if (
title==
"#eta_{D} - #eta_{jet}") contents[i] = deltaEta;
1133 else if (
title==
"#phi_{D} - #phi_{jet} (rad)") contents[i] = deltaPhi;
1134 else if (
title==
"#it{p}_{T,jet} (GeV/#it{c})") contents[i] = (*it).second.Pt();
1135 else if (
title==
"#eta_{jet}") contents[i] = (*it).second.Eta();
1136 else if (
title==
"#phi_{jet} (rad)") contents[i] = (*it).second.Phi_0_2pi();
1137 else if (
title==
"No. of constituents") contents[i] = (*it).second.fNConstituents;
1139 AliWarningGeneralStream(
"AliAnalysisTaskDmesonJetsSub::OutputHandlerTHnSparse::FillHnSparse") <<
"Unable to fill dimension '" <<
title.Data() <<
"'!" << std::endl;
1153 fDataSlotNumber(-1),
1155 fCurrentDmesonJetInfo(0),
1177 classname =
"AliAnalysisTaskDmesonJetsSub::AliDmesonMCInfoSummary";
1185 classname =
"AliAnalysisTaskDmesonJetsSub::AliD0ExtendedInfoSummary";
1189 classname =
"AliAnalysisTaskDmesonJetsSub::AliD0InfoSummary";
1194 classname =
"AliAnalysisTaskDmesonJetsSub::AliDStarInfoSummary";
1199 TString treeName = TString::Format(
"%s_%s", taskName,
fName.Data());
1222 std::map<AliAODMCParticle*, Short_t> partons ;
1224 TH1* histAncestor =
nullptr;
1225 TH1* histPrompt =
nullptr;
1228 hname = TString::Format(
"%s/fHistPrompt",
fName.Data());
1231 hname = TString::Format(
"%s/fHistAncestor",
fName.Data());
1242 if (applyKinCuts && !
fJetDefinitions->at(ij).IsJetInAcceptance(*jet)) {
1243 hname = TString::Format(
"%s/%s/fHistRejectedJetPt",
fName.Data(),
fJetDefinitions->at(ij).GetName());
1245 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi",
fName.Data(),
fJetDefinitions->at(ij).GetName());
1247 hname = TString::Format(
"%s/%s/fHistRejectedJetEta",
fName.Data(),
fJetDefinitions->at(ij).GetName());
1256 if (dmeson_pair.second.fParton) {
1257 partons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
1258 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
1259 if (absPdgParton == 4) {
1260 histPrompt->Fill(
"Prompt", 1);
1262 else if (absPdgParton == 5) {
1263 histPrompt->Fill(
"Non-Prompt", 1);
1266 histPrompt->Fill(
"Unknown", 1);
1270 histPrompt->Fill(
"Unknown", 1);
1275 if (dmeson_pair.second.fAncestor) {
1276 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
1277 if (absPdgAncestor == 4) {
1278 histAncestor->Fill(
"Charm", 1);
1280 else if (absPdgAncestor == 5) {
1281 histAncestor->Fill(
"Bottom", 1);
1283 else if (absPdgAncestor == 2212) {
1284 histAncestor->Fill(
"Proton", 1);
1287 histAncestor->Fill(
"Unknown", 1);
1291 histAncestor->Fill(
"Unknown", 1);
1298 hname = TString::Format(
"%s/fHistRejectedDMesonPt",
fName.Data());
1300 hname = TString::Format(
"%s/fHistRejectedDMesonPhi",
fName.Data());
1302 hname = TString::Format(
"%s/fHistRejectedDMesonEta",
fName.Data());
1306 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass",
fName.Data());
1310 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass",
fName.Data());
1313 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass",
fName.Data());
1314 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
1321 hname = TString::Format(
"%s/fHistPartonPt",
fName.Data());
1323 hname = TString::Format(
"%s/fHistPartonEta",
fName.Data());
1325 hname = TString::Format(
"%s/fHistPartonPhi",
fName.Data());
1327 hname = TString::Format(
"%s/fHistPartonType",
fName.Data());
1330 for (
auto parton : partons) {
1331 if (!parton.first)
continue;
1332 histPartonPt->Fill(parton.first->Pt());
1333 histPartonEta->Fill(parton.first->Eta());
1334 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
1335 histPartonType->Fill(parton.second);
1371 TString event_class_name =
"AliAnalysisTaskDmesonJetsSub::AliEventInfoSummary";
1374 TString jet_class_name =
"std::vector<AliAnalysisTaskDmesonJetsSub::AliJetInfoSummary>";
1377 if (!jetDef.fRhoName.IsNull()) {
1379 jet_class_name =
"std::vector<AliAnalysisTaskDmesonJetsSub::AliJetInfoPbPbSummary>";
1385 d_meson_class_name =
"std::vector<AliAnalysisTaskDmesonJetsSub::AliDmesonMCInfoSummary>";
1398 d_meson_class_name =
"std::vector<AliAnalysisTaskDmesonJetsSub::AliD0ExtendedInfoSummary>";
1407 d_meson_class_name =
"AliAnalysisTaskDmesonJetsSub::AliD0InfoSummary";
1417 d_meson_class_name =
"AliAnalysisTaskDmesonJetsSub::AliDStarInfoSummary";
1438 template<
class EVENTTYPE,
class DMESONTYPE,
class JETTYPE>
1441 fCurrentEventInfo(),
1442 fCurrentDmesonInfo(),
1448 template<
class EVENTTYPE,
class DMESONTYPE,
class JETTYPE>
1460 template<
class EVENTTYPE,
class DMESONTYPE,
class JETTYPE>
1463 TString treeName = TString::Format(
"%s_%s", taskName,
fName.Data());
1477 template<
class EVENTTYPE,
class DMESONTYPE,
class JETTYPE>
1484 std::map<AliAODMCParticle*, Short_t> partons ;
1486 TH1* histAncestor =
nullptr;
1487 TH1* histPrompt =
nullptr;
1490 hname = TString::Format(
"%s/fHistPrompt",
fName.Data());
1493 hname = TString::Format(
"%s/fHistAncestor",
fName.Data());
1501 jetInfo.second.clear();
1505 DMESONTYPE dmeson_tree;
1506 dmeson_tree.Set(dmeson_pair.second);
1510 AliJetInfo* jet = dmeson_pair.second.GetJet(jetDef.GetName());
1512 if (applyKinCuts && !jetDef.IsJetInAcceptance(*jet)) {
1513 hname = TString::Format(
"%s/%s/fHistRejectedJetPt",
fName.Data(), jetDef.GetName());
1515 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi",
fName.Data(), jetDef.GetName());
1517 hname = TString::Format(
"%s/%s/fHistRejectedJetEta",
fName.Data(), jetDef.GetName());
1521 jet_tree.Set(dmeson_pair.second, jetDef.GetName());
1525 fCurrentJetInfo[jetDef.GetName()].push_back(jet_tree);
1529 if (dmeson_pair.second.fParton) {
1530 partons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
1531 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
1532 if (absPdgParton == 4) {
1533 histPrompt->Fill(
"Prompt", 1);
1535 else if (absPdgParton == 5) {
1536 histPrompt->Fill(
"Non-Prompt", 1);
1539 histPrompt->Fill(
"Unknown", 1);
1543 histPrompt->Fill(
"Unknown", 1);
1548 if (dmeson_pair.second.fAncestor) {
1549 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
1550 if (absPdgAncestor == 4) {
1551 histAncestor->Fill(
"Charm", 1);
1553 else if (absPdgAncestor == 5) {
1554 histAncestor->Fill(
"Bottom", 1);
1556 else if (absPdgAncestor == 2212) {
1557 histAncestor->Fill(
"Proton", 1);
1560 histAncestor->Fill(
"Unknown", 1);
1564 histAncestor->Fill(
"Unknown", 1);
1571 hname = TString::Format(
"%s/fHistRejectedDMesonPt",
fName.Data());
1573 hname = TString::Format(
"%s/fHistRejectedDMesonPhi",
fName.Data());
1575 hname = TString::Format(
"%s/fHistRejectedDMesonEta",
fName.Data());
1579 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass",
fName.Data());
1583 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass",
fName.Data());
1586 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass",
fName.Data());
1587 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
1590 for (
auto& jetInfo : fCurrentJetInfo) {
1591 jetInfo.second.pop_back();
1599 hname = TString::Format(
"%s/fHistPartonPt",
fName.Data());
1601 hname = TString::Format(
"%s/fHistPartonEta",
fName.Data());
1603 hname = TString::Format(
"%s/fHistPartonPhi",
fName.Data());
1605 hname = TString::Format(
"%s/fHistPartonType",
fName.Data());
1608 for (
auto parton : partons) {
1609 if (!parton.first)
continue;
1610 histPartonPt->Fill(parton.first->Pt());
1611 histPartonEta->Fill(parton.first->Eta());
1612 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
1613 histPartonType->Fill(parton.second);
1767 if (!jet)
return kFALSE;
1834 fD0Extended(kFALSE),
1843 fClusterContainers(),
1995 ::Error(
"AliAnalysisTaskDmesonJetsSub::AnalysisEngine::SetCandidateProperties",
"Candidate %d unknown!",
fCandidateType);
2040 fName +=
"_BackgroundOnly";
2043 fName +=
"_SignalOnly";
2046 fName +=
"_MCTruth";
2049 fName +=
"_D0Reflection";
2052 fName +=
"_OnlyWrongPIDAccepted";
2060 return fName.Data();
2075 ::Info(
"AliAnalysisTaskDmesonJetsSub::AnalysisEngine::AddJetDefinition",
"Jet definition '%s' has been added to analysis engine '%s'." 2076 "Total number of jet definitions is now %lu.",
2082 ::Warning(
"AliAnalysisTaskDmesonJetsSub::AnalysisEngine::AddJetDefinition",
"The same jet definition '%s' was already added in analysis engine '%s'.", def.
GetName(),
GetName());
2112 std::vector<AliHFJetDefinition>::iterator it =
fJetDefinitions.begin();
2146 for (
auto &jetdef :
fJetDefinitions) jetdef.SetChargedPtRange(min, max);
2154 for (
auto &jetdef :
fJetDefinitions) jetdef.SetNeutralPtRange(min, max);
2231 AliDebug(10,
"Checking if D0 meson is selected");
2233 if (isSelected == 0)
return kFALSE;
2235 Int_t MCtruthPdgCode = 0;
2247 AliAODMCParticle* aodMcPart =
static_cast<AliAODMCParticle*
>(
fMCContainer->GetArray()->At(mcLab));
2255 MCtruthPdgCode = aodMcPart->PdgCode();
2260 if (isSelected == 1) {
2261 if (i != 0)
return kFALSE;
2268 AliDebug(10,
"Selected as D0");
2275 else if (isSelected == 2) {
2276 if (i != 1)
return kFALSE;
2283 AliDebug(10,
"Selected as D0bar");
2290 else if (isSelected == 3) {
2291 AliDebug(10,
"Selected as either D0 or D0bar");
2296 if (i != 0)
return kFALSE;
2297 AliDebug(10,
"MC truth is D0");
2302 if (i != 1)
return kFALSE;
2303 AliDebug(10,
"MC truth is D0bar");
2312 AliDebug(10,
"Returning invariant mass with D0 hypothesis");
2316 AliDebug(10,
"Returning invariant mass with D0bar hypothesis");
2328 DmesonJet.
fD.SetPtEtaPhiM(Dcand->Pt(), Dcand->Eta(), Dcand->Phi(), invMassD);
2341 AliDebug(10,
"Checking if D* meson is selected");
2343 if (isSelected == 0)
return kFALSE;
2345 if ((i == 1 && DstarCand->Charge()>0) || (i == 0 && DstarCand->Charge()<0) || i > 1)
return kFALSE;
2347 Int_t MCtruthPdgCode = 0;
2352 Int_t pdgDgDStartoD0pi[2] = { 421, 211 };
2353 Int_t pdgDgD0toKpi[2] = { 321, 211 };
2356 AliDebug(10, Form(
"MC label is %d", mcLab));
2359 AliAODMCParticle* aodMcPart =
static_cast<AliAODMCParticle*
>(
fMCContainer->GetArray()->At(mcLab));
2367 MCtruthPdgCode = aodMcPart->PdgCode();
2368 AliDebug(10, Form(
"MC truth pdg code is %d",MCtruthPdgCode));
2373 Int_t absMCtruthPdgCode = TMath::Abs(MCtruthPdgCode);
2381 DmesonJet.
fD.SetPtEtaPhiM(DstarCand->Pt(), DstarCand->Eta(), DstarCand->Phi(), invMassD);
2402 Int_t absPdgPart = TMath::Abs(part->GetPdgCode());
2404 if (part->GetNDaughters() == 2) {
2406 AliAODMCParticle* d1 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(0)));
2407 AliAODMCParticle* d2 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(1)));
2413 Int_t absPdg1 = TMath::Abs(d1->GetPdgCode());
2414 Int_t absPdg2 = TMath::Abs(d2->GetPdgCode());
2416 if (absPdgPart == 421) {
2417 if ((absPdg1 == 211 && absPdg2 == 321) ||
2418 (absPdg1 == 321 && absPdg2 == 211)) {
2423 if (absPdgPart == 413) {
2424 if (absPdg1 == 421 && absPdg2 == 211) {
2430 else if (absPdg1 == 211 && absPdg2 == 421) {
2450 std::pair<AliAnalysisTaskDmesonJetsSub::EMesonOrigin_t, AliAODMCParticle*> result(
kUnknownQuark, 0);
2452 if (!part)
return result;
2453 if (!mcArray)
return result;
2455 static std::set<UInt_t> partons = { 4, 5 };
2459 result.second = parton;
2460 UInt_t absPdgParton = TMath::Abs(parton->GetPdgCode());
2461 if (absPdgParton == 4) result.first =
kFromCharm;
2462 else if (absPdgParton == 5) result.first =
kFromBottom;
2478 static std::set<UInt_t> pdgSet;
2494 AliAODMCParticle* result =
nullptr;
2496 Int_t mother = part->GetMother();
2497 while (mother >= 0) {
2498 AliAODMCParticle* mcGranma =
static_cast<AliAODMCParticle*
>(mcArray->At(mother));
2500 UInt_t abspdgGranma = TMath::Abs(mcGranma->GetPdgCode());
2503 if (pdgSet.empty() || pdgSet.count(abspdgGranma) > 0) {
2508 if (mother == mcGranma->GetMother()) {
2509 AliWarningClassStream() <<
"Particle " << mother <<
" (PDG=" << mcGranma->PdgCode() <<
") is the mother of itself!?" << std::endl;
2512 mother = mcGranma->GetMother();
2515 AliErrorClassStream() <<
"Could not retrieve mother particle " << mother <<
"!" << std::endl;
2527 jetDef.fJets.clear();
2551 std::map<AliHFJetDefinition*,Double_t> maxJetPt;
2555 std::array<int, 3> nAccCharm = {0};
2556 std::array<std::array<int, 3>, 5> nAccCharmPt = {{{0}}};
2558 for (
Int_t icharm = 0; icharm < nD; icharm++) {
2560 if (!charmCand)
continue;
2565 Int_t nMassHypo = 0;
2566 if (charmCand->Pt() > maxDPt) maxDPt = charmCand->Pt();
2567 for (
Int_t im = 0; im < 2; im++) {
2572 for (
auto& def : fJetDefinitions) {
2573 if (
FindJet(charmCand, DmesonJet, def,im)) {
2574 Double_t jetPt = DmesonJet.
fJets[def.GetName()].fMomentum.Pt();
2575 if (jetPt > maxJetPt[&def]) maxJetPt[&def] = jetPt;
2578 AliWarning(Form(
"Could not find jet '%s' for D meson '%s': pT = %.3f, eta = %.3f, phi = %.3f",
2586 for (
int i = 0; i < nAccCharmPt.size(); i++) {
2587 if (charmCand->Pt() < i)
break;
2588 nAccCharmPt[i][im]++;
2592 if (nMassHypo == 2) {
2597 for (
int i = 0; i < nAccCharmPt.size(); i++) {
2598 if (charmCand->Pt() < i)
break;
2599 nAccCharmPt[i][0]--;
2600 nAccCharmPt[i][1]--;
2601 nAccCharmPt[i][2]++;
2616 ntracks += track_cont->GetNAcceptEntries();
2619 for (
auto& def : fJetDefinitions) {
2620 if (!def.fRho)
continue;
2621 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt",
GetName(), def.GetName());
2624 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt",
GetName(), def.GetName());
2627 hname = TString::Format(
"%s/%s/fHistRhoVsCent",
GetName(), def.GetName());
2630 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent",
GetName(), def.GetName());
2633 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent",
GetName(), def.GetName());
2636 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks",
GetName(), def.GetName());
2639 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks",
GetName(), def.GetName());
2642 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks",
GetName(), def.GetName());
2646 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons",
GetName());
2651 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks",
GetName());
2654 for (
int i = 0; i < nAccCharmPt.size(); i++) {
2655 hname = TString::Format(
"%s/fHistNTotAcceptedDmesonsPt%d",
GetName(), i);
2660 hname = TString::Format(
"%s/fHistNAcceptedDmesonsPt%d",
GetName(), i);
2664 hname = TString::Format(
"%s/fHistNDmesons",
GetName());
2682 if (jetDef.
fRho) rho = jetDef.
fRho->GetVal();
2695 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason",
GetName(), jetDef.
GetName());
2699 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet",
GetName(), jetDef.
GetName());
2702 for (
Int_t i = 0; i < daughters.GetEntriesFast(); i++) {
2703 AliVParticle* daughter =
static_cast<AliVParticle*
>(daughters.At(i));
2704 if (!hftrack_cont->GetArray()->FindObject(daughter)) histDaughterNotInJet->Fill(daughter->Pt());
2712 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason",
GetName(), jetDef.
GetName());
2722 for (
UInt_t ijet = 0; ijet < jets_incl.size(); ++ijet) {
2725 Bool_t isDmesonJet = kFALSE;
2732 for (
UInt_t ic = 0; ic < constituents.size(); ++ic) {
2733 if (constituents[ic].user_index() == 0) {
2734 isDmesonJet = kTRUE;
2736 else if (constituents[ic].user_index() >= 100) {
2737 if (constituents[ic].pt() > maxChPt) maxChPt = constituents[ic].pt();
2740 else if (constituents[ic].user_index() <= -100) {
2741 totalNeutralPt += constituents[ic].pt();
2742 if (constituents[ic].pt() > maxNePt) maxChPt = constituents[ic].pt();
2748 DmesonJet.
fJets[jetDef.
GetName()].fMomentum.SetPxPyPzE(jets_incl[ijet].px(), jets_incl[ijet].py(), jets_incl[ijet].pz(), jets_incl[ijet].E());
2749 DmesonJet.
fJets[jetDef.
GetName()].fNConstituents = nConst;
2750 DmesonJet.
fJets[jetDef.
GetName()].fMaxChargedPt = maxChPt;
2751 DmesonJet.
fJets[jetDef.
GetName()].fMaxNeutralPt = maxNePt;
2752 DmesonJet.
fJets[jetDef.
GetName()].fNEF = totalNeutralPt / jets_incl[ijet].pt();
2753 DmesonJet.
fJets[jetDef.
GetName()].fArea = jets_incl[ijet].area();
2754 DmesonJet.
fJets[jetDef.
GetName()].fCorrPt = DmesonJet.
fJets[jetDef.
GetName()].fMomentum.Pt() - jets_incl[ijet].area() * rho;
2769 auto itcont = cont->all_momentum();
2770 for (AliEmcalIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
2771 UInt_t rejectionReason = 0;
2772 if (!cont->AcceptObject(it.current_index(), rejectionReason)) {
2773 if (rejectHist) rejectHist->Fill(AliEmcalContainer::GetRejectionReasonBitPosition(rejectionReason), it->first.Pt());
2779 if (rejectHist) rejectHist->Fill(6, it->first.Pt());
2783 Int_t uid = offset >= 0 ? it.current_index() + offset: -it.current_index() - offset;
2793 double flagSubjet=0;
2794 double xconstperp=0;
2796 fastjet::JetAlgorithm jet_algo(fastjet::cambridge_algorithm);
2797 double jet_radius_ca = 1.0;
2798 fastjet::JetDefinition jet_def(jet_algo, jet_radius_ca,static_cast<fastjet::RecombinationScheme>(0), fastjet::Best);
2802 fastjet::ClusterSequence cs_ca(particles, jet_def);
2803 std::vector<fastjet::PseudoJet> output_jets = cs_ca.inclusive_jets(0);
2804 output_jets = sorted_by_pt(output_jets);
2807 fastjet::PseudoJet jj = output_jets[0];
2808 fastjet::PseudoJet j1;
2809 fastjet::PseudoJet j2;
2811 while(jj.has_parents(j1,j2)){
2813 if(j1.perp() < j2.perp())
std::swap(j1,j2);
2815 vector < fastjet::PseudoJet > constitj1 = sorted_by_pt(j1.constituents());
2817 for(
Int_t j=0;j<constitj1.size();j++){
2818 if(constitj1[j].user_index()==0){
2819 xconstperp=constitj1[j].perp();
2823 double delta_R = j1.delta_R(j2);
2824 zg = j2.perp()/(j1.perp()+j2.perp());
2825 double yh=j1.e()+j2.e();
2826 double y = log(1.0/delta_R);
2827 double lnpt_rel = log(j2.perp()*delta_R);
2828 double frac=j1.perp()/output_jets[0].perp();
2829 double lundEntries[10] = {y, lnpt_rel, output_jets[0].perp(), nall, type, flagSubjet, xconstperp, invmass,yh,TMath::Abs(output_jets[0].eta())};
2831 hname = TString::Format(
"%s/%s/LundIterative",
GetName(), jetDef.
GetName());
2834 h->Fill(lundEntries);
2839 }
catch (fastjet::Error) { }
2855 std::array<int,2> nAccCharm = {0};
2856 std::array<std::array<int, 2>, 5> nAccCharmPt = {{{0}}};
2858 std::map<AliHFJetDefinition*, Double_t> maxJetPt;
2862 maxJetPt[&jetDef] = 0;
2864 if (jetDef.fRho) rho = jetDef.fRho->GetVal();
2865 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents",
GetName(), jetDef.GetName());
2868 switch (jetDef.fJetType) {
2885 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason",
GetName(), jetDef.GetName());
2892 for (
auto jet : jets_incl) {
2893 Int_t nDmesonsInJet = 0;
2895 for (
auto constituent : jet.constituents()) {
2896 Int_t iPart = constituent.user_index() - 100;
2897 if (constituent.perp() < 1e-6)
continue;
2900 ::Error(
"AliAnalysisTaskDmesonJetsSub::AnalysisEngine::RunParticleLevelAnalysis",
"Could not find jet constituent %d!", iPart);
2905 std::map<int, AliDmesonJetInfo>::iterator dMesonJetIt =
fDmesonJets.find(iPart);
2907 if (part->Pt() > maxDPt) maxDPt = part->Pt();
2908 std::pair<int, AliDmesonJetInfo> element;
2909 element.first = iPart;
2911 (*dMesonJetIt).second.fD.SetPxPyPzE(part->Px(), part->Py(), part->Pz(), part->E());
2912 (*dMesonJetIt).second.fDmesonParticle = part;
2913 (*dMesonJetIt).second.fSelectionType = part->PdgCode() > 0 ? 1 : 2;
2921 while (rs >>= 1) { p++; }
2922 (*dMesonJetIt).second.fPartonType = p;
2923 (*dMesonJetIt).second.fParton = origin.second;
2928 if (part->PdgCode() > 0) {
2936 for (
int i = 0; i < nAccCharmPt.size(); i++) {
2937 if (part->Pt() < i)
break;
2938 nAccCharmPt[i][im]++;
2942 (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.SetPxPyPzE(jet.px(), jet.py(), jet.pz(), jet.E());
2943 (*dMesonJetIt).second.fJets[jetDef.GetName()].fNConstituents = jet.constituents().size();
2944 (*dMesonJetIt).second.fJets[jetDef.GetName()].fArea = jet.area();
2945 (*dMesonJetIt).second.fJets[jetDef.GetName()].fCorrPt = (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.Pt() - jet.area() * rho;
2946 if (jet.perp() > maxJetPt[&jetDef]) maxJetPt[&jetDef] = jet.perp();
2949 if (nDmesonsInJet > 0) histNDmesonsVsNconstituents->Fill(jet.constituents().size(), nDmesonsInJet);
2955 for (
auto& def : fJetDefinitions) {
2956 if (!def.fRho)
continue;
2957 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt",
GetName(), def.GetName());
2960 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt",
GetName(), def.GetName());
2963 hname = TString::Format(
"%s/%s/fHistRhoVsCent",
GetName(), def.GetName());
2966 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent",
GetName(), def.GetName());
2969 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent",
GetName(), def.GetName());
2972 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks",
GetName(), def.GetName());
2975 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks",
GetName(), def.GetName());
2978 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks",
GetName(), def.GetName());
2982 if (
fDmesonJets.size() != nAccCharm[0]+nAccCharm[1]) AliError(Form(
"I found %lu mesons (%d)?",
fDmesonJets.size(), nAccCharm[0]+nAccCharm[1]));
2983 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons",
GetName());
2987 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks",
GetName());
2990 for (
int i = 0; i < nAccCharmPt.size(); i++) {
2991 hname = TString::Format(
"%s/fHistNTotAcceptedDmesonsPt%d",
GetName(), i);
2995 hname = TString::Format(
"%s/fHistNAcceptedDmesonsPt%d",
GetName(), i);
2999 hname = TString::Format(
"%s/fHistNDmesons",
GetName());
3051 for (
Int_t i = 0; i < nOutputTrees; i++){
3052 DefineOutput(2+i, TTree::Class());
3071 TFile* filecuts = TFile::Open(cutfname);
3072 if (!filecuts || filecuts->IsZombie()) {
3073 ::Error(
"AliAnalysisTaskDmesonJetsSub::LoadDMesonCutsFromFile",
"Input file not found: will use std cuts.");
3077 if (filecuts) analysiscuts =
dynamic_cast<AliRDHFCuts*
>(filecuts->Get(cutsname));
3079 if (!analysiscuts) {
3080 ::Error(
"AliAnalysisTaskDmesonJetsSub::LoadDMesonCutsFromFile",
"Could not find analysis cuts '%s' in '%s'.", cutsname.Data(), cutfname.Data());
3086 ::Info(
"AliAnalysisTaskDmesonJetsSub::LoadDMesonCutsFromFile",
"Cuts '%s' loaded from file '%s'", cutsname.Data(), cutfname.Data());
3089 return analysiscuts;
3123 if (!cutfname.IsNull()) {
3129 cutsname =
"D0toKpiCuts";
3132 cutsname =
"DStartoKpipiCuts";
3138 if (!cuttype.IsNull()) {
3139 cutsname += TString::Format(
"_%s", cuttype.Data());
3143 if (cuts) cuts->PrintAll();
3153 ::Info(
"AliAnalysisTaskDmesonJetsSub::AddAnalysisEngine",
"A new analysis engine '%s' has been added. The total number of analysis engines is %lu.", eng.
GetName(),
fAnalysisEngines.size());
3157 ::Info(
"AliAnalysisTaskDmesonJetsSub::AddAnalysisEngine",
"An analysis engine '%s' with %lu jet definitions has been found. The total number of analysis engines is %lu. A new jet definition '%s' is being added.", found_eng->
GetName(), found_eng->
fJetDefinitions.size(),
fAnalysisEngines.size(), jetDef.
GetName());
3161 if (found_eng->
fRDHFCuts != 0) ::Warning(
"AliAnalysisTaskDmesonJetsSub::AddAnalysisEngine",
"D meson cuts were already defined for this D meson type. They will be overwritten.");
3179 ::Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s", GetName());
3191 Int_t maxTracks = 6000;
3203 Int_t nbinsx[10] = {50,100,10,20,2,2,20,100,100,9};
3204 Double_t minx[10] = {0,-10,0,0,0,0,0,1.6,0,0};
3205 Double_t maxx[10] = {5,10,100,20,2,2,20,2,100,0.9};
3206 TString titlex[10]={
"log(1/deltaR)",
"log(zteta)",
"jet pt",
"n",
"type",
"flagSubjet",
"ptD",
"invmass",
"frac",
"abs(eta)"};
3211 hname =
"fHistCharmPt";
3212 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
3215 hname =
"fHistCharmEta";
3216 htitle = hname +
";#eta_{charm};counts";
3219 hname =
"fHistCharmPhi";
3220 htitle = hname +
";#phi_{charm};counts";
3223 hname =
"fHistBottomPt";
3224 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
3227 hname =
"fHistBottomEta";
3228 htitle = hname +
";#eta_{bottom};counts";
3231 hname =
"fHistBottomPhi";
3232 htitle = hname +
";#phi_{bottom};counts";
3235 hname =
"fHistHighestPartonPt";
3236 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
3239 hname =
"fHistHighestPartonType";
3240 htitle = hname +
";type;counts";
3243 hname =
"fHistNHeavyQuarks";
3244 htitle = hname +
";number of heavy-quarks;counts";
3247 ::Info(
"AliAnalysisTaskDmesonJetsSub::UserCreateOutputObjects",
"Allocating histograms for task '%s' (%lu analysis engines)", GetName(),
fAnalysisEngines.size());
3249 ::Info(
"AliAnalysisTaskDmesonJetsSub::UserCreateOutputObjects",
"Allocating histograms for analysis engine '%s' (%lu jet definitions)", param.GetName(), param.fJetDefinitions.size());
3253 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", param.GetName());
3254 htitle = hname +
";#it{N}_{tracks};#it{N}_{D};events";
3257 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", param.GetName());
3258 htitle = hname +
";;#it{N}_{D}";
3261 for (
int i = 0 ; i < 5; i++) {
3262 hname = TString::Format(
"%s/fHistNAcceptedDmesonsPt%d", param.GetName(), i);
3263 htitle = hname +
";#it{N}_{D};events";
3266 hname = TString::Format(
"%s/fHistNTotAcceptedDmesonsPt%d", param.GetName(), i);
3267 htitle = hname +
";;#it{N}_{D}";
3271 hname = TString::Format(
"%s/fHistNDmesons", param.GetName());
3272 htitle = hname +
";#it{N}_{D};events";
3275 hname = TString::Format(
"%s/fHistNEvents", param.GetName());
3276 htitle = hname +
";Event status;counts";
3278 h->GetXaxis()->SetBinLabel(1,
"Accepted");
3279 h->GetXaxis()->SetBinLabel(2,
"Rejected");
3281 hname = TString::Format(
"%s/fHistEventRejectionReasons", param.GetName());
3282 htitle = hname +
";Rejection reason;counts";
3285 hname = TString::Format(
"%s/fHistRejectedDMesonPt", param.GetName());
3286 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});counts";
3289 hname = TString::Format(
"%s/fHistRejectedDMesonEta", param.GetName());
3290 htitle = hname +
";#it{#eta}_{D};counts";
3293 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", param.GetName());
3294 htitle = hname +
";#it{#phi}_{D};counts";
3299 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", param.GetName());
3300 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
3307 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", param.GetName());
3308 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
3312 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
3313 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", param.GetName());
3314 htitle = hname +
";#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2});counts";
3321 hname = TString::Format(
"%s/fHistPartonPt", param.GetName());
3322 htitle = hname +
";#it{p}_{T,parton} (GeV/#it{c});counts";
3325 hname = TString::Format(
"%s/fHistPartonEta", param.GetName());
3326 htitle = hname +
";#eta_{parton};counts";
3329 hname = TString::Format(
"%s/fHistPartonPhi", param.GetName());
3330 htitle = hname +
";#phi_{parton};counts";
3333 hname = TString::Format(
"%s/fHistPartonType", param.GetName());
3334 htitle = hname +
";type;counts";
3337 hname = TString::Format(
"%s/fHistPrompt", param.GetName());
3338 htitle = hname +
";Type;counts";
3340 h->GetXaxis()->SetBinLabel(1,
"Unknown");
3341 h->GetXaxis()->SetBinLabel(2,
"Prompt");
3342 h->GetXaxis()->SetBinLabel(3,
"Non-Prompt");
3344 hname = TString::Format(
"%s/fHistAncestor", param.GetName());
3345 htitle = hname +
";Ancestor;counts";
3347 h->GetXaxis()->SetBinLabel(1,
"Unknown");
3348 h->GetXaxis()->SetBinLabel(2,
"Charm");
3349 h->GetXaxis()->SetBinLabel(3,
"Bottom");
3350 h->GetXaxis()->SetBinLabel(4,
"Proton");
3353 for (
auto& jetDef : param.fJetDefinitions) {
3354 ::Info(
"AliAnalysisTaskDmesonJetsSub::UserCreateOutputObjects",
"Allocating histograms for jet definition '%s'", jetDef.GetName());
3357 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents", param.GetName(), jetDef.GetName());
3358 htitle = hname +
";#it{N}_{constituents};#it{N}_{D};counts";
3362 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason", param.GetName(), jetDef.GetName());
3363 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
3367 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason", param.GetName(), jetDef.GetName());
3368 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
3372 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason", param.GetName(), jetDef.GetName());
3373 htitle = hname +
";Cluster rejection reason;#it{p}_{T,cluster} (GeV/#it{c});counts";
3377 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet", param.GetName(), jetDef.GetName());
3378 htitle = hname +
";#it{p}_{T,track} (GeV/#it{c});counts";
3381 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", param.GetName(), jetDef.GetName());
3382 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});counts";
3385 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", param.GetName(), jetDef.GetName());
3386 htitle = hname +
";#it{#eta}_{jet};counts";
3389 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", param.GetName(), jetDef.GetName());
3390 htitle = hname +
";#it{#phi}_{jet};counts";
3393 if (!jetDef.fRhoName.IsNull()) {
3394 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", param.GetName(), jetDef.GetName());
3395 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
3398 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", param.GetName(), jetDef.GetName());
3399 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
3402 hname = TString::Format(
"%s/%s/fHistRhoVsCent", param.GetName(), jetDef.GetName());
3403 htitle = hname +
";Centrality (%);#rho (GeV/#it{c} #times rad^{-1});counts";
3406 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", param.GetName(), jetDef.GetName());
3407 htitle = hname +
";Centrality (%);#it{p}_{T,jet} (GeV/#it{c});counts";
3410 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", param.GetName(), jetDef.GetName());
3411 htitle = hname +
";Centrality (%);#it{p}_{T,D} (GeV/#it{c});counts";
3414 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", param.GetName(), jetDef.GetName());
3415 htitle = hname +
";no. of tracks;#rho (GeV/#it{c} #times rad^{-1});counts";
3418 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", param.GetName(), jetDef.GetName());
3419 htitle = hname +
";no. of tracks;#it{p}_{T,jet} (GeV/#it{c});counts";
3422 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", param.GetName(), jetDef.GetName());
3423 htitle = hname +
";no. of tracks;#it{p}_{T,D} (GeV/#it{c});counts";
3426 hname = TString::Format(
"%s/%s/LundIterative",param.GetName(),jetDef.GetName());
3427 cout<<
"at the begining"<<hname<<endl;
3429 for (
Int_t j = 0; j < dimx; j++) {
3430 h->GetAxis(j)->SetTitle(titlex[j]);}
3437 param.fOutputHandler = tree_handler;
3445 AliError(Form(
"Number of data output slots %d not sufficient. Tree of analysis engine %s will not be posted!",
fNOutputTrees, param.GetName()));
3452 param.fOutputHandler = thnsparse_handler;
3460 param.fOutputHandler = qa_handler;
3468 param.fOutputHandler = tree_handler;
3476 AliError(Form(
"Number of data output slots %d not sufficient. Tree of analysis engine %s will not be posted!",
fNOutputTrees, param.GetName()));
3503 AliError(Form(
"This task need an AOD event (Task '%s'). Expect troubles...", GetName()));
3521 params.fRandomGen = rnd;
3523 for (
auto &jetdef: params.fJetDefinitions) {
3524 if (!jetdef.fRhoName.IsNull()) {
3525 jetdef.fRho =
dynamic_cast<AliRhoParameter*
>(fInputEvent->FindListObject(jetdef.fRhoName));
3527 ::Error(
"AliAnalysisTaskDmesonJetsSub::ExecOnce",
3528 "%s: Could not find rho object '%s' for engine '%s'",
3529 GetName(), jetdef.fRhoName.Data(), params.GetName());
3534 if (!params.fRDHFCuts) {
3536 ::Warning(
"AliAnalysisTaskDmesonJetsSub::ExecOnce",
3537 "%s: RDHF cuts not provided for engine '%s'.",
3538 GetName(), params.GetName());
3541 ::Error(
"AliAnalysisTaskDmesonJetsSub::ExecOnce",
3542 "%s: RDHF cuts not provided. Engine '%s' disabled.",
3543 GetName(), params.GetName());
3544 params.fInhibit = kTRUE;
3550 for (
auto cont_it : fParticleCollArray) {
3552 if (track_cont) params.fTrackContainers.push_back(track_cont);
3555 for (
auto cont_it :
fClusterCollArray) params.fClusterContainers.push_back(cont_it.second);
3560 params.fCandidateArray =
dynamic_cast<TClonesArray*
>(
fAodEvent->GetList()->FindObject(params.fBranchName.Data()));
3562 if (params.fCandidateArray) {
3565 className =
"AliAODRecoDecayHF2Prong";
3568 className =
"AliAODRecoCascadeHF";
3570 if (!params.fCandidateArray->GetClass()->InheritsFrom(className)) {
3571 ::Error(
"AliAnalysisTaskDmesonJetsSub::ExecOnce",
3572 "%s: Objects of type %s in %s are not inherited from %s! Task will be disabled!",
3573 GetName(), params.fCandidateArray->GetClass()->GetName(), params.fCandidateArray->GetName(), className.Data());
3574 params.fCandidateArray = 0;
3575 params.fInhibit = kTRUE;
3579 ::Error(
"AliAnalysisTaskDmesonJetsSub::ExecOnce",
3580 "Could not find candidate array '%s', skipping the event. Analysis engine '%s' will be disabled!",
3581 params.fBranchName.Data(), params.GetName());
3582 params.fInhibit = kTRUE;
3586 if (params.fMCMode !=
kNoMC) {
3587 if (!params.fMCContainer) {
3588 ::Error(
"AliAnalysisTaskDmesonJetsSub::ExecOnce",
3589 "No MC particle container was provided. Analysis engine '%s' will be disabled!",
3591 params.fInhibit = kTRUE;
3596 if (params.fTrackContainers.size() == 0 && params.fClusterContainers.size() == 0) {
3597 ::Error(
"AliAnalysisTaskDmesonJetsSub::ExecOnce",
3598 "No track container and no cluster container were provided. Analysis engine '%s' will be disabled!",
3600 params.fInhibit = kTRUE;
3618 if (eng.fInhibit)
continue;
3619 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3627 if (matchingAODdeltaAODlevel <= 0) {
3630 if (eng.fInhibit)
continue;
3631 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3639 eng.fDmesonJets.clear();
3640 if (eng.fInhibit)
continue;
3645 hname = TString::Format(
"%s/fHistNEvents", eng.GetName());
3647 Bool_t iseventselected = kTRUE;
3648 if (eng.fRDHFCuts) iseventselected = eng.fRDHFCuts->IsEventSelected(
fAodEvent);
3649 if (!iseventselected) {
3651 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3652 UInt_t bitmap = eng.fRDHFCuts->GetEventRejectionBitMap();
3656 if (label.IsNull())
break;
3666 AliDebug(2,
"Event selected");
3679 if (param.fInhibit)
continue;
3693 Int_t PdgHighParton = 0;
3694 for (
auto it = itcont.begin(); it != itcont.end(); it++) {
3696 if (part.first.Pt() == 0)
continue;
3698 Int_t PdgCode = part.second->GetPdgCode();
3701 if ((PdgCode < -9 || PdgCode > 9) && PdgCode != 21 && PdgCode != -21)
continue;
3703 AliDebugStream(5) <<
"Parton " << it.current_index() <<
3704 " with pdg=" << PdgCode <<
3705 ", px=" << part.first.Px() <<
3706 ", py=" << part.first.Py() <<
3707 ", pz=" << part.first.Pz() <<
3708 ", n daughters = " << part.second->GetNDaughters() <<
3713 if (part.second->GetNDaughters() == 0)
continue;
3716 if (highestPartonPt < part.first.Pt()) {
3717 highestPartonPt = part.first.Pt();
3718 PdgHighParton = PdgCode;
3722 if (PdgCode != 4 && PdgCode != 5 && PdgCode != -4 && PdgCode != -5)
continue;
3724 Bool_t lastInPartonShower = kTRUE;
3725 Bool_t hadronDaughter = kFALSE;
3726 for (
Int_t daughterIndex = part.second->GetFirstDaughter(); daughterIndex <= part.second->GetLastDaughter(); daughterIndex++){
3727 if (daughterIndex < 0) {
3728 AliDebugStream(5) <<
"Could not find daughter index!" << std::endl;
3733 AliDebugStream(5) <<
"Could not find particle with index " << daughterIndex <<
"!" << std::endl;
3736 Int_t daughterPdgCode = daughter->GetPdgCode();
3737 if (daughter->GetMother() != it.current_index()) {
3738 AliDebugStream(5) <<
"Particle " << daughterIndex <<
" with pdg=" << daughterPdgCode <<
3739 ", px=" << daughter->Px() <<
3740 ", py=" << daughter->Py() <<
3741 ", pz=" << daughter->Pz() <<
3742 ", is not a daughter of " << it.current_index() <<
3747 AliDebugStream(5) <<
"Found daughter " << daughterIndex <<
3748 " with pdg=" << daughterPdgCode <<
3749 ", px=" << daughter->Px() <<
3750 ", py=" << daughter->Py() <<
3751 ", pz=" << daughter->Pz() <<
3754 if (daughterPdgCode == PdgCode) lastInPartonShower = kFALSE;
3755 if (TMath::Abs(daughterPdgCode) >= 111 || (daughterPdgCode >= 81 && daughterPdgCode <= 100)) hadronDaughter = kTRUE;
3757 if (hadronDaughter) {
3758 AliDebugStream(5) <<
"This particle has at least a hadron among its daughters!" << std::endl;
3759 if (!lastInPartonShower) AliDebugStream(2) <<
"Odly, quark " << it.current_index() <<
" with PDG " << PdgCode <<
" (pt = " << part.first.Pt() <<
", eta = " << part.first.Eta() <<
") is not the last in the parton shower but at least a hadron found among its daughters?!" << std::endl;
3762 AliDebugStream(5) <<
"This particle does not have hadrons among its daughters!" << std::endl;
3763 if (lastInPartonShower) AliDebugStream(2) <<
"Odly, quark " << it.current_index() <<
" with PDG " << PdgCode <<
" (pt = " << part.first.Pt() <<
", eta = " << part.first.Eta() <<
") is the last in the parton shower but no hadron found among its daughters?!" << std::endl;
3767 if (PdgCode == 4 || PdgCode == -4) {
3772 else if (PdgCode == 5 || PdgCode == -5) {
3781 Int_t partonType = 0;
3782 Int_t absPdgHighParton = TMath::Abs(PdgHighParton);
3783 if (absPdgHighParton == 9 || absPdgHighParton == 21) {
3787 partonType = absPdgHighParton;
3801 TParticlePDG* part = TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg));
3806 if (nbins % 2 == 0) {
3807 minMass = mass - range / 2 - range / nbins / 2;
3808 maxMass = mass + range / 2 - range / nbins / 2;
3811 minMass = mass - range / 2;
3812 maxMass = mass + range / 2;
3827 label =
"NotSelTrigger";
3829 return label.Data();
3834 return label.Data();
3837 label =
"TooFewVtxContrib";
3839 return label.Data();
3842 label =
"ZVtxOutFid";
3844 return label.Data();
3849 return label.Data();
3852 label =
"OutsideCentrality";
3854 return label.Data();
3857 label =
"PhysicsSelection";
3859 return label.Data();
3862 label =
"BadSPDVertex";
3864 return label.Data();
3867 label =
"ZVtxSPDOutFid";
3869 return label.Data();
3872 label =
"CentralityFlattening";
3874 return label.Data();
3877 label =
"BadTrackV0Correl";
3879 return label.Data();
3882 return label.Data();
3914 ::Error(
"AddTaskDmesonJetsSub",
"No analysis manager to connect to.");
3919 AliVEventHandler* handler = mgr->GetInputEventHandler();
3921 ::Error(
"AddTaskDmesonJetsSub",
"This task requires an input event handler");
3927 if (handler->InheritsFrom(
"AliESDInputHandler")) {
3930 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
3935 if (ntracks ==
"usedefault") {
3936 if (dataType ==
kESD) {
3939 else if (dataType ==
kAOD) {
3947 if (nclusters ==
"usedefault") {
3948 if (dataType ==
kESD) {
3949 nclusters =
"CaloClusters";
3951 else if (dataType ==
kAOD) {
3952 nclusters =
"caloClusters";
3959 if (nMCpart ==
"usedefault") {
3960 nMCpart =
"mcparticles";
3963 TString name(
"AliAnalysisTaskDmesonJetsSub");
3964 if (strcmp(suffix,
"") != 0) {
3965 name += TString::Format(
"_%s", suffix.Data());
3970 if (!ntracks.IsNull()) {
3972 jetTask->AdoptParticleContainer(trackCont);
3975 if (!nMCpart.IsNull()) {
3977 partCont->SetEtaLimits(-1.5, 1.5);
3978 partCont->SetPtLimits(0, 1000);
3979 jetTask->AdoptParticleContainer(partCont);
3982 jetTask->AddClusterContainer(nclusters.Data());
3985 mgr->AddTask(jetTask);
3988 AliAnalysisDataContainer* cinput1 = mgr->GetCommonInputContainer();
3990 contname1 +=
"_histos";
3991 AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(contname1.Data(),
3992 TList::Class(), AliAnalysisManager::kOutputContainer,
3993 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3995 mgr->ConnectInput(jetTask, 0, cinput1);
3996 mgr->ConnectOutput(jetTask, 1, coutput1);
3998 for (
Int_t i = 0; i < nMaxTrees; i++) {
3999 TString contname = TString::Format(
"%s_tree_%d", name.Data(), i);
4000 AliAnalysisDataContainer *coutput = mgr->CreateContainer(contname.Data(),
4001 TTree::Class(),AliAnalysisManager::kOutputContainer,
4002 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
4003 mgr->ConnectOutput(jetTask, 2+i, coutput);
virtual void Reset()
Reset the current object.
Double_t fSoftPionPt
! Transverse momentum of the soft pion of the D* candidate
TString fBranchName
AOD branch where the D meson candidate are found.
Class that encapsulates event properties in a very compact structure (useful for pp simulation analys...
void SetRejectionReasonLabels(TAxis *axis)
Int_t fDataSlotNumber
! Data slot where the tree output is posted
void UserCreateOutputObjects()
static std::pair< AliAnalysisTaskDmesonJetsSub::EMesonOrigin_t, AliAODMCParticle * > IsPromptCharm(const AliAODMCParticle *part, TClonesArray *mcArray)
Double32_t fDeltaInvMass
< Difference between the Kpipi and the Kpi invariant masses in GeV/c2
ECandidateType_t fCandidateType
Candidate type.
virtual void Reset()
Reset the object.
void Reset()
Reset all fields to their default values.
Class that encapsulates jets.
TTree * fTree
! Output tree
friend bool operator==(const AnalysisEngine &lhs, const AnalysisEngine &rhs)
AliEMCALGeometry * fGeom
!emcal geometry
void SetDMesonCandidate(AliAODRecoDecay *c)
virtual void Set(const AliDmesonJetInfo &source, std::string n)
virtual void Set(const AliDmesonJetInfo &source)
AliD0ExtendedInfoSummary()
Bool_t fInhibit
!inhibit execution of the task
TList * fOutput
!output list
Double32_t fCorrZ
Z of the D meson after subtracting average background.
Lightweight class that encapsulates D0.
EventInfo * fEventInfo
! Object conatining the event information (centrality, pt hard, weight, etc.)
Double_t fPtHard
!event pt hard
Bool_t ExtractRecoDecayAttributes(const AliAODRecoDecayHF2Prong *Dcand, AliDmesonJetInfo &DmesonJet, UInt_t i)
EDataType_t
Switch for the data type.
UInt_t fEnabledAxis
Use bit defined in EAxis_t to enable axis in the THnSparse.
virtual ~AliAnalysisTaskDmesonJetsSub()
This is the standard destructor.
Double32_t fCosPointing
Cosine of the pointing angle.
virtual AliAODMCParticle * GetMCParticle(Int_t i=-1) const
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
std::map< int, AliDmesonJetInfo > * fDmesonJets
! Array containing the D meson jets
void SetChargedPtRange(Double_t min, Double_t max)
Double_t GetZ(std::string n) const
Double_t fTrackEfficiency
! Artificial tracking inefficiency (0...1) -> set automatically at ExecOnce by AliAnalysisTaskDmesonJ...
virtual void Reset()
Reset the object.
void SetJetPhiRange(Double_t min, Double_t max)
Float_t fMaxPt
! Histogram pt limit
std::map< int, AliDmesonJetInfo > fDmesonJets
! Array containing the D meson jets
AliHFJetDefinition * AddJetDefinition(EJetType_t type, Double_t r, EJetAlgo_t algo, ERecoScheme_t reco)
Double32_t fPtPi
Transverse momentum of the pion.
Double_t fEPV0
!event plane V0
virtual void Reset()
Reset the object.
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
const TObjArray & GetDaughterList() const
AliTLorentzVector fD
! 4-momentum of the D meson candidate
Float_t fPtBinWidth
Histogram pt bin width.
AliFJWrapper * fFastJetWrapper
! Fastjet wrapper
virtual void Reset()
Reset the object.
Double32_t fEta
Eta of the jet.
std::list< AnalysisEngine > fAnalysisEngines
Array of analysis parameters.
static AliAODMCParticle * FindParticleOrigin(const AliAODMCParticle *part, TClonesArray *mcArray, EFindParticleOriginMode_t mode, const std::set< UInt_t > &pdgSet)
Double_t fMinMass
! Min mass in histogram axis
Bool_t ExtractDstarAttributes(const AliAODRecoCascadeHF *DstarCand, AliDmesonJetInfo &DmesonJet, UInt_t i)
Double32_t fZ
Z of the D meson.
virtual void Set(const AliDmesonJetInfo &source)
Invariant mass of the D0 meson candidate in GeV/c2.
Double32_t fEta
Eta of the D meson.
Double_t fJetGhostArea
Area of the ghost particles.
Container with name, TClonesArray and cuts for particles.
Bool_t ExtractD0Attributes(const AliAODRecoDecayHF2Prong *Dcand, AliDmesonJetInfo &DmesonJet, UInt_t i)
TArrayI fPDGdaughters
List of the PDG code of the daughters.
TString fName
! Name of this object
EventInfo fEventInfo
! Event info (centrality, weight, pt hard etc.)
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
AliAODMCParticle * fParton
! pointer to the parton in the shower tree of the D meson (only for particle level D mesons) ...
virtual Bool_t FillOutput(Bool_t applyKinCuts)
static Int_t CheckMatchingAODdeltaAODevents()
AliDmesonJetInfo()
Default constructor.
Double32_t f2ProngInvMass
AnalysisEngine()
This is the default constructor, used for ROOT I/O purposes.
virtual void Set(const AliDmesonJetInfo &source)
Lightweight class that encapsulates D*.
Int_t fNMassBins
! Mass number of bins
virtual void UserCreateOutputObjects()
Creates the output containers.
Lightweight class that encapsulates D meson jets.
Int_t GetNConstituents() const
ECandidateType_t GetCandidateType() const
UInt_t fCandidatePDG
Candidate PDG.
Double_t fTrackEfficiency
Artificial tracking inefficiency (0...1)
virtual ~AnalysisEngine()
Float_t fPtBinWidth
! Histogram pt bin width
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
EMCMode_t GetMCMode() const
Int_t fDataSlotNumber
! Data slot where the tree output is posted
Double_t fRadius
Jet radius.
Double_t fMinNeutralPt
Minimum pt of the leading neutral particle (or cluster)
virtual Bool_t FillOutput(Bool_t applyKinCuts)
Double_t InvMassD0() const
ECandidateType_t fCandidateType
! Candidate type
AliAnalysisTaskDmesonJetsSub()
This is the default constructor, used for ROOT I/O purposes.
void SetRecombScheme(const fastjet::RecombinationScheme &scheme)
Int_t fNOutputTrees
Maximum number of output trees.
void AssignDataSlot(Int_t n)
Double_t Prodd0d0() const
AliAODEvent * fAodEvent
! AOD event
Bool_t FindJet(AliAODRecoDecayHF2Prong *Dcand, AliDmesonJetInfo &DmesonJet, AliHFJetDefinition &jetDef, Int_t numcand)
static AliAnalysisTaskDmesonJetsSub * AddTaskDmesonJetsSub(TString ntracks="usedefault", TString nclusters="usedefault", TString nMCpart="", Int_t nMaxTrees=2, TString suffix="")
Bool_t fRejectISR
Reject initial state radiation.
virtual Bool_t FillHistograms()
const AliVEvent * fEvent
! pointer to the ESD/AOD event
void RunAnalysis()
Run the analysis.
friend bool operator<(const AnalysisEngine &lhs, const AnalysisEngine &rhs)
EVENTTYPE fCurrentEventInfo
! Current event info
Double_t fInvMass2Prong
! 2-prong mass of the D* candidate (w/o the soft pion)
TRandom * fRandomGen
! Random number generator
static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco)
Bool_t fD0D0bar
! kTRUE if selected both as D0 and D0bar
static TString GenerateJetName(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius, AliParticleContainer *partCont, AliClusterContainer *clusCont, TString tag)
static void CalculateMassLimits(Double_t range, Int_t pdg, Int_t nbins, Double_t &minMass, Double_t &maxMass)
Double32_t fSelectionType
Selection type: D0, D0bar, both.
Double_t fMaxJetEta
Maximum jet eta.
Double32_t fPhi
Phi of the jet.
Double_t fMaxJetPhi
Maximum jet phi.
Bool_t IsJetInAcceptance(const AliJetInfo &jet) const
AliEventNotFound(const std::string &class_name, const std::string &method_name)
AliRDHFCuts * fRDHFCuts
D meson candidates cuts.
Select tracks based on specific prescriptions of HF analysis.
ERecoScheme_t fRecoScheme
Jet recombination scheme (pt scheme, E scheme, ...)
AliHFJetDefinition & operator=(const AliHFJetDefinition &source)
Output handler for D meson jet analysis.
Lightweight class that encapsulates D meson jets.
EBeamType_t fForceBeamType
forced beam type
UInt_t fAcceptedDecay
Bit mask with D meson decays that are accepted (only used for particle-level analysis) ...
AliHFAODMCParticleContainer * fMCContainer
! MC particle container
Double32_t fDCA
Distance of closest approach.
void SetNeutralPtRange(Double_t min, Double_t max)
const std::vector< fastjet::PseudoJet > & GetInclusiveJets() const
Double32_t fWeight
Centrality of the collision.
Double32_t fMaxNormd0
max norm d0
virtual void Reset()
Reset the object.
std::vector< AliTrackContainer * > fTrackContainers
! Track containers
AliDmesonInfoSummary * fCurrentDmesonJetInfo
! Current D meson jet info
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
TObject * FindObject(const char *name) const
Find an object inside the container.
virtual void Set(const AliDmesonJetInfo &source)
THistManager * fHistManager
! Histograms
Double_t GetDistance(const AliJetInfo &jet, Double_t &deta, Double_t &dphi) const
void RunParticleLevelAnalysis()
Run a particle level analysis.
void Init(const AliEMCALGeometry *const geom, Int_t runNumber)
Initialize the analysis engine.
Byte_t GetSelectionTypeSummary() const
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t CosThetaStarD0bar() const
angle of K
void SetJetPtRange(Double_t min, Double_t max)
AliAODMCParticle * fAncestor
! pointer to the ancestor particle in the shower tree of the D meson (only for particle level D meson...
void SetJetEtaRange(Double_t min, Double_t max)
Lightweight class that encapsulates D0.
AliDmesonJetInfo & operator=(const AliDmesonJetInfo &source)
UInt_t fRejectedOrigin
Bit mask with D meson origins that are rejected (used for MC analysis, i.e. signal-only, background-only and particle-level)
UChar_t fNDaughters
Number of daughters.
std::vector< DMESONTYPE > fCurrentDmesonInfo
! Current D meson jet info
Int_t fMCLabel
! MC label, i.e. index of the generator level D meson (only for detector level D meson candidates) ...
Double32_t fPt
Transverse momentum of the jet in GeV/c.
std::string fWhat
Error message.
AnalysisEngine * AddAnalysisEngine(ECandidateType_t type, TString cutfname, TString cuttype, EMCMode_t bkgMode, EJetType_t jettype, Double_t jetradius, TString rhoName="")
void IterativeDeclustering(Int_t jetnum, Double_t type, AliHFJetDefinition &jetDef, Double_t invm)
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
friend bool operator<(const AliHFJetDefinition &lhs, const AliHFJetDefinition &rhs)
virtual void Set(const AliDmesonJetInfo &source)
Double_t Phi_0_2pi() const
UInt_t fEnabledAxis
! Use bit defined in EAxis_t to enable axis in the THnSparse
Bool_t fApplyKinematicCuts
Apply jet kinematic cuts.
void SetAlgorithm(const fastjet::JetAlgorithm &algor)
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
const char * GetName() const
Bool_t IsAnyJetInAcceptance(const AliDmesonJetInfo &dMesonJet) const
AliHFJetDefinition()
This is the default constructor, used for ROOT I/O purposes.
Bool_t fRejectISR
! Reject initial state radiation
AliRDHFCuts * LoadDMesonCutsFromFile(TString cutfname, TString cutsname)
AliAODTrack * GetBachelor() const
TClonesArray * fCandidateArray
! D meson candidate array
TString fCandidateName
Candidate name.
TString fName
! Name of this object
THistManager * fHistManager
! Histograms
Bool_t fD0Extended
Store extended information in the tree (only for D0 mesons)
std::vector< AliClusterContainer * > fClusterContainers
! Cluster containers
static OutputHandlerTTreeExtendedBase * GenerateOutputHandler(AnalysisEngine *eng)
EJetType_t fJetType
Jet type (charged, full, neutral)
Bool_t fD0Extended
! Store extended information in the tree (only for D0 mesons)
TString fRhoName
Name of the object that holds the average background value.
Double_t fMaxMass
Max mass in histogram axis.
AliFJWrapper * fFastJetWrapper
! Fastjet wrapper
AnalysisEngine & operator=(const AnalysisEngine &source)
void FillPartonLevelHistograms()
Fill histograms with parton-level information.
Double32_t fCosThetaStar
Cosine of theta star.
Double_t fMinJetPt
Minimum jet pT.
Double32_t fPtK
Transverse momentum of the kaon.
std::string fClassName
Class name where the event was not found.
void SetCandidateProperties(Double_t range)
Bool_t IsD0Extended() const
void SetRDHFCuts(AliRDHFCuts *cuts)
Double_t GetCorrZ(std::string n) const
Double_t InvMassD0bar() const
OutputHandler()
Constructor.
Double32_t fd0d0
D0K * D0Pi.
virtual void Clear(const Option_t *="")
Double_t fMaxChargedPt
Transverse momentum of the leading charged particle (or track)
void RunDetectorLevelAnalysis()
Run a detector level analysis.
void AdoptRDHFCuts(AliRDHFCuts *cuts)
std::vector< AliHFJetDefinition > fJetDefinitions
Jet definitions.
AliJetInfoSummary ** fCurrentJetInfo
! Current jet info
const char * GetName() const
Generate a name for this jet definition.
void SetRejectedOriginMap(UInt_t m)
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
std::map< std::string, std::vector< JETTYPE > > fCurrentJetInfo
! Current jet info
Float_t fEventWeight
!event weight
const AliJetInfo * GetJet(std::string n) const
void SetAcceptedDecayMap(UInt_t m)
Double_t fMinJetPhi
Minimum jet phi.
void AddInputVectors(AliEmcalContainer *cont, Int_t offset, TH2 *rejectHist=0, Double_t eff=0.)
Double32_t fR
Distance between D meson and jet axis.
const AliMCParticleIterableMomentumContainer all_momentum() const
TTree * fTree
! Output tree
virtual void BuildOutputObject(const char *taskName)
Select MC particles based on specific prescriptions of HF analysis.
Double_t fMinJetEta
Minimum jet eta.
virtual void Set(const AliDmesonJetInfo &source, std::string n)
void SetGhostArea(Double_t gharea)
virtual void BuildOutputObject(const char *taskName)
void Print() const
Prints the content of this object in the standard output.
std::vector< fastjet::PseudoJet > GetJetConstituents(UInt_t idx) const
OutputHandlerTTreeExtendedBase()
Constructor.
static const char * GetHFEventRejectionReasonLabel(UInt_t &bitmap)
Double_t fMaxChargedPt
Maximum pt of the leading charged particle (or track)
virtual void BuildOutputObject(const char *taskName)
static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo)
Double_t Phi_0_2pi() const
Output handler for D meson jet analysis.
std::map< std::string, AliJetInfo > fJets
! list of jets
AliVParticle * fDmesonParticle
! pointer to the particle object
AliAODEvent * fAodEvent
! AOD event
Double_t fMaxMass
! Max mass in histogram axis
Double_t fCorrPt
Transverse momentum of the jet after subtracting the average background.
Bool_t IsSpecialPDGFound() const
Output handler for D meson jet analysis.
virtual void Reset()
Reset the current object.
virtual TObject * GetOutputObject() const
Bool_t fInhibit
Inhibit the task.
Look for the very first particle in the fragmentation tree.
std::vector< AliAnalysisTaskDmesonJetsSub::AliHFJetDefinition >::iterator FindJetDefinition(const AliHFJetDefinition &eng)
friend bool operator==(const AliHFJetDefinition &lhs, const AliHFJetDefinition &rhs)
void Reset()
Reset the object.
Lightweight class that encapsulates D meson jets for PbPb analysis.
virtual Int_t GetDataSlotNumber() const
Float_t fMaxPt
Histogram pt limit.
static EMesonDecayChannel_t CheckDecayChannel(const AliAODMCParticle *part, TClonesArray *mcArray)
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
Double_t fMinChargedPt
Minimum pt of the leading charged particle (or track)
OutputHandlerTTree()
Constructor.
Short_t fPartonType
! type of the parton in the shower tree (only for particle level D mesons)
Double32_t fPartonType
Parton type.
Bool_t FillHnSparse(THnSparse *h, const AliDmesonJetInfo &DmesonJet, std::string n)
Double32_t fArea
Area of the jet.
Bool_t IsSelected(TObject *obj)
AliHFAODMCParticleContainer * fMCContainer
! MC particle container
Double32_t fCorrPt
Transverse momentum of the jet in GeV/c after subtracting average background.
const char * what() const noexcept
virtual Bool_t FillOutput(Bool_t applyKinCuts)
Double_t InvMassD0() const
OutputHandlerTTreeExtended()
Constructor.
void SetEnabledAxis(UInt_t axis)
virtual void AddInputVector(Double_t px, Double_t py, Double_t pz, Double_t E, Int_t index=-99999)
Int_t PostDataFromAnalysisEngine(OutputHandler const *handler)
Double_t InvMassDstarKpipi() const
Struct that encapsulates analysis parameters.
virtual void BuildOutputObject(const char *taskName)
virtual Bool_t FillOutput(Bool_t applyKinCuts)
Bool_t fReconstructed
! Whether this D meson was reconstructed (only for particle level D mesons)
Double_t GetDistance(std::string n, Double_t &deta, Double_t &dphi) const
void Set(EventInfo event)
EOutputType_t fOutputType
Output type: none, TTree or THnSparse.
Byte_t fSelectionType
! for D0: 0=not selected, 1=D0, 2=D0bar
Double_t CosPointingAngle() const
Double32_t fN
Number of jet constituents.
Double_t CosThetaStarD0() const
void SetSpecialPDG(Int_t pdg)
Double_t fMaxNeutralPt
Maximum pt of the leading neutral particle (or cluster)
std::vector< AliAnalysisTaskDmesonJetsSub::AliHFJetDefinition > & GetJetDefinitions()
Output handler for D meson jet analysis.
Double32_t fInvMass
Invariant mass of the D0 meson candidate in GeV/c2.
Int_t GetNAcceptedParticles() const
EFindParticleOriginMode_t
void SetAreaType(const fastjet::AreaType &atype)
std::map< std::string, AliClusterContainer * > fClusterCollArray
cluster collection array
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
std::vector< AliHFJetDefinition > * fJetDefinitions
! Jet definitions
Int_t fJetAreaType
Jet area type.
EMCMode_t fMCMode
! MC mode: No MC (data and MC detector level), background-only (MC), signal-only (MC), MC truth (particle level)
EJetAlgo_t fJetAlgo
Jet algorithm (kt, anti-kt,...)
Container for MC-true particles within the EMCAL framework.
Lightweight class that encapsulates D meson jets.
AliRhoParameter * fRho
Object that holds the average background value.
Output handler for D meson jet analysis.
EMCMode_t fMCMode
MC mode: No MC (data and MC detector level), background-only (MC), signal-only (MC), MC truth (particle level)
std::list< AliAnalysisTaskDmesonJetsSub::AnalysisEngine >::iterator FindAnalysisEngine(const AnalysisEngine &eng)
void SetMakeGeneralHistograms(Bool_t g)
Double32_t fPhi
Phi of the D meson.
Double_t fMaxNeutralPt
Transverse momentum of the leading neutral particle (or cluster)
Double_t fMinMass
Min mass in histogram axis.
Double32_t fPt
Transverse momentum of the D meson in GeV/c.
Double32_t fPartonPt
Transverse momentum of the parton.
Double_t fCent
!event centrality
void SetCharge(EChargeCut_t c)
Double_t fMaxJetPt
Maximum jet pT.
Container for jet within the EMCAL jet framework.
THistManager fHistManager
Histogram manager.
void SetRejectISR(Bool_t b)
OutputHandlerTHnSparse()
Constructor.
void AssignDataSlot(Int_t n)
Int_t fNMassBins
Mass number of bins.
OutputHandler * fOutputHandler
! Output handler