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(
"AliAnalysisTaskDmesonJets::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(
"AliAnalysisTaskDmesonJets::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(
"AliAnalysisTaskDmesonJets::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(
"AliAnalysisTaskDmesonJets::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(
"AliAnalysisTaskDmesonJets::OutputHandlerTHnSparse::FillHnSparse") <<
"Unable to fill dimension '" <<
title.Data() <<
"'!" << std::endl;
1153 fDataSlotNumber(-1),
1155 fCurrentDmesonJetInfo(0),
1177 classname =
"AliAnalysisTaskDmesonJets::AliDmesonMCInfoSummary";
1185 classname =
"AliAnalysisTaskDmesonJets::AliD0ExtendedInfoSummary";
1189 classname =
"AliAnalysisTaskDmesonJets::AliD0InfoSummary";
1194 classname =
"AliAnalysisTaskDmesonJets::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 =
"AliAnalysisTaskDmesonJets::AliEventInfoSummary";
1374 TString jet_class_name =
"std::vector<AliAnalysisTaskDmesonJets::AliJetInfoSummary>";
1377 if (!jetDef.fRhoName.IsNull()) {
1379 jet_class_name =
"std::vector<AliAnalysisTaskDmesonJets::AliJetInfoPbPbSummary>";
1385 d_meson_class_name =
"std::vector<AliAnalysisTaskDmesonJets::AliDmesonMCInfoSummary>";
1398 d_meson_class_name =
"std::vector<AliAnalysisTaskDmesonJets::AliD0ExtendedInfoSummary>";
1407 d_meson_class_name =
"AliAnalysisTaskDmesonJets::AliD0InfoSummary";
1417 d_meson_class_name =
"AliAnalysisTaskDmesonJets::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(
"AliAnalysisTaskDmesonJets::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(
"AliAnalysisTaskDmesonJets::AnalysisEngine::AddJetDefinition",
"Jet definition '%s' has been added to analysis engine '%s'." 2076 "Total number of jet definitions is now %lu.",
2082 ::Warning(
"AliAnalysisTaskDmesonJets::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<AliAnalysisTaskDmesonJets::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)) {
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;
2768 auto itcont = cont->all_momentum();
2769 for (AliEmcalIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
2770 UInt_t rejectionReason = 0;
2771 if (!cont->AcceptObject(it.current_index(), rejectionReason)) {
2772 if (rejectHist) rejectHist->Fill(AliEmcalContainer::GetRejectionReasonBitPosition(rejectionReason), it->first.Pt());
2778 if (rejectHist) rejectHist->Fill(6, it->first.Pt());
2782 Int_t uid = offset >= 0 ? it.current_index() + offset: -it.current_index() - offset;
2799 std::array<int,2> nAccCharm = {0};
2800 std::array<std::array<int, 2>, 5> nAccCharmPt = {{{0}}};
2802 std::map<AliHFJetDefinition*, Double_t> maxJetPt;
2806 maxJetPt[&jetDef] = 0;
2808 if (jetDef.fRho) rho = jetDef.fRho->GetVal();
2809 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents",
GetName(), jetDef.GetName());
2812 switch (jetDef.fJetType) {
2829 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason",
GetName(), jetDef.GetName());
2836 for (
auto jet : jets_incl) {
2837 Int_t nDmesonsInJet = 0;
2839 for (
auto constituent : jet.constituents()) {
2840 Int_t iPart = constituent.user_index() - 100;
2841 if (constituent.perp() < 1e-6)
continue;
2844 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisEngine::RunParticleLevelAnalysis",
"Could not find jet constituent %d!", iPart);
2849 std::map<int, AliDmesonJetInfo>::iterator dMesonJetIt =
fDmesonJets.find(iPart);
2851 if (part->Pt() > maxDPt) maxDPt = part->Pt();
2852 std::pair<int, AliDmesonJetInfo> element;
2853 element.first = iPart;
2855 (*dMesonJetIt).second.fD.SetPxPyPzE(part->Px(), part->Py(), part->Pz(), part->E());
2856 (*dMesonJetIt).second.fDmesonParticle = part;
2857 (*dMesonJetIt).second.fSelectionType = part->PdgCode() > 0 ? 1 : 2;
2865 while (rs >>= 1) { p++; }
2866 (*dMesonJetIt).second.fPartonType = p;
2867 (*dMesonJetIt).second.fParton = origin.second;
2872 if (part->PdgCode() > 0) {
2880 for (
int i = 0; i < nAccCharmPt.size(); i++) {
2881 if (part->Pt() < i)
break;
2882 nAccCharmPt[i][im]++;
2886 (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.SetPxPyPzE(jet.px(), jet.py(), jet.pz(), jet.E());
2887 (*dMesonJetIt).second.fJets[jetDef.GetName()].fNConstituents = jet.constituents().size();
2888 (*dMesonJetIt).second.fJets[jetDef.GetName()].fArea = jet.area();
2889 (*dMesonJetIt).second.fJets[jetDef.GetName()].fCorrPt = (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.Pt() - jet.area() * rho;
2890 if (jet.perp() > maxJetPt[&jetDef]) maxJetPt[&jetDef] = jet.perp();
2893 if (nDmesonsInJet > 0) histNDmesonsVsNconstituents->Fill(jet.constituents().size(), nDmesonsInJet);
2899 for (
auto& def : fJetDefinitions) {
2900 if (!def.fRho)
continue;
2901 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt",
GetName(), def.GetName());
2904 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt",
GetName(), def.GetName());
2907 hname = TString::Format(
"%s/%s/fHistRhoVsCent",
GetName(), def.GetName());
2910 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent",
GetName(), def.GetName());
2913 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent",
GetName(), def.GetName());
2916 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks",
GetName(), def.GetName());
2919 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks",
GetName(), def.GetName());
2922 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks",
GetName(), def.GetName());
2926 if (
fDmesonJets.size() != nAccCharm[0]+nAccCharm[1]) AliError(Form(
"I found %lu mesons (%d)?",
fDmesonJets.size(), nAccCharm[0]+nAccCharm[1]));
2927 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons",
GetName());
2931 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks",
GetName());
2934 for (
int i = 0; i < nAccCharmPt.size(); i++) {
2935 hname = TString::Format(
"%s/fHistNTotAcceptedDmesonsPt%d",
GetName(), i);
2939 hname = TString::Format(
"%s/fHistNAcceptedDmesonsPt%d",
GetName(), i);
2943 hname = TString::Format(
"%s/fHistNDmesons",
GetName());
2995 for (
Int_t i = 0; i < nOutputTrees; i++){
2996 DefineOutput(2+i, TTree::Class());
3015 TFile* filecuts = TFile::Open(cutfname);
3016 if (!filecuts || filecuts->IsZombie()) {
3017 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Input file not found: will use std cuts.");
3021 if (filecuts) analysiscuts =
dynamic_cast<AliRDHFCuts*
>(filecuts->Get(cutsname));
3023 if (!analysiscuts) {
3024 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Could not find analysis cuts '%s' in '%s'.", cutsname.Data(), cutfname.Data());
3030 ::Info(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Cuts '%s' loaded from file '%s'", cutsname.Data(), cutfname.Data());
3033 return analysiscuts;
3067 if (!cutfname.IsNull()) {
3073 cutsname =
"D0toKpiCuts";
3076 cutsname =
"DStartoKpipiCuts";
3082 if (!cuttype.IsNull()) {
3083 cutsname += TString::Format(
"_%s", cuttype.Data());
3087 if (cuts) cuts->PrintAll();
3097 ::Info(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"A new analysis engine '%s' has been added. The total number of analysis engines is %lu.", eng.
GetName(),
fAnalysisEngines.size());
3101 ::Info(
"AliAnalysisTaskDmesonJets::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());
3105 if (found_eng->
fRDHFCuts != 0) ::Warning(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"D meson cuts were already defined for this D meson type. They will be overwritten.");
3123 ::Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s", GetName());
3135 Int_t maxTracks = 6000;
3146 hname =
"fHistCharmPt";
3147 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
3150 hname =
"fHistCharmEta";
3151 htitle = hname +
";#eta_{charm};counts";
3154 hname =
"fHistCharmPhi";
3155 htitle = hname +
";#phi_{charm};counts";
3158 hname =
"fHistBottomPt";
3159 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
3162 hname =
"fHistBottomEta";
3163 htitle = hname +
";#eta_{bottom};counts";
3166 hname =
"fHistBottomPhi";
3167 htitle = hname +
";#phi_{bottom};counts";
3170 hname =
"fHistHighestPartonPt";
3171 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
3174 hname =
"fHistHighestPartonType";
3175 htitle = hname +
";type;counts";
3178 hname =
"fHistNHeavyQuarks";
3179 htitle = hname +
";number of heavy-quarks;counts";
3182 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for task '%s' (%lu analysis engines)", GetName(),
fAnalysisEngines.size());
3184 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for analysis engine '%s' (%lu jet definitions)", param.GetName(), param.fJetDefinitions.size());
3188 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", param.GetName());
3189 htitle = hname +
";#it{N}_{tracks};#it{N}_{D};events";
3192 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", param.GetName());
3193 htitle = hname +
";;#it{N}_{D}";
3196 for (
int i = 0 ; i < 5; i++) {
3197 hname = TString::Format(
"%s/fHistNAcceptedDmesonsPt%d", param.GetName(), i);
3198 htitle = hname +
";#it{N}_{D};events";
3201 hname = TString::Format(
"%s/fHistNTotAcceptedDmesonsPt%d", param.GetName(), i);
3202 htitle = hname +
";;#it{N}_{D}";
3206 hname = TString::Format(
"%s/fHistNDmesons", param.GetName());
3207 htitle = hname +
";#it{N}_{D};events";
3210 hname = TString::Format(
"%s/fHistNEvents", param.GetName());
3211 htitle = hname +
";Event status;counts";
3213 h->GetXaxis()->SetBinLabel(1,
"Accepted");
3214 h->GetXaxis()->SetBinLabel(2,
"Rejected");
3216 hname = TString::Format(
"%s/fHistEventRejectionReasons", param.GetName());
3217 htitle = hname +
";Rejection reason;counts";
3220 hname = TString::Format(
"%s/fHistRejectedDMesonPt", param.GetName());
3221 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});counts";
3224 hname = TString::Format(
"%s/fHistRejectedDMesonEta", param.GetName());
3225 htitle = hname +
";#it{#eta}_{D};counts";
3228 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", param.GetName());
3229 htitle = hname +
";#it{#phi}_{D};counts";
3234 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", param.GetName());
3235 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
3242 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", param.GetName());
3243 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
3247 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
3248 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", param.GetName());
3249 htitle = hname +
";#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2});counts";
3256 hname = TString::Format(
"%s/fHistPartonPt", param.GetName());
3257 htitle = hname +
";#it{p}_{T,parton} (GeV/#it{c});counts";
3260 hname = TString::Format(
"%s/fHistPartonEta", param.GetName());
3261 htitle = hname +
";#eta_{parton};counts";
3264 hname = TString::Format(
"%s/fHistPartonPhi", param.GetName());
3265 htitle = hname +
";#phi_{parton};counts";
3268 hname = TString::Format(
"%s/fHistPartonType", param.GetName());
3269 htitle = hname +
";type;counts";
3272 hname = TString::Format(
"%s/fHistPrompt", param.GetName());
3273 htitle = hname +
";Type;counts";
3275 h->GetXaxis()->SetBinLabel(1,
"Unknown");
3276 h->GetXaxis()->SetBinLabel(2,
"Prompt");
3277 h->GetXaxis()->SetBinLabel(3,
"Non-Prompt");
3279 hname = TString::Format(
"%s/fHistAncestor", param.GetName());
3280 htitle = hname +
";Ancestor;counts";
3282 h->GetXaxis()->SetBinLabel(1,
"Unknown");
3283 h->GetXaxis()->SetBinLabel(2,
"Charm");
3284 h->GetXaxis()->SetBinLabel(3,
"Bottom");
3285 h->GetXaxis()->SetBinLabel(4,
"Proton");
3288 for (
auto& jetDef : param.fJetDefinitions) {
3289 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for jet definition '%s'", jetDef.GetName());
3292 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents", param.GetName(), jetDef.GetName());
3293 htitle = hname +
";#it{N}_{constituents};#it{N}_{D};counts";
3297 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason", param.GetName(), jetDef.GetName());
3298 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
3302 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason", param.GetName(), jetDef.GetName());
3303 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
3307 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason", param.GetName(), jetDef.GetName());
3308 htitle = hname +
";Cluster rejection reason;#it{p}_{T,cluster} (GeV/#it{c});counts";
3312 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet", param.GetName(), jetDef.GetName());
3313 htitle = hname +
";#it{p}_{T,track} (GeV/#it{c});counts";
3316 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", param.GetName(), jetDef.GetName());
3317 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});counts";
3320 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", param.GetName(), jetDef.GetName());
3321 htitle = hname +
";#it{#eta}_{jet};counts";
3324 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", param.GetName(), jetDef.GetName());
3325 htitle = hname +
";#it{#phi}_{jet};counts";
3328 if (!jetDef.fRhoName.IsNull()) {
3329 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", param.GetName(), jetDef.GetName());
3330 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
3333 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", param.GetName(), jetDef.GetName());
3334 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
3337 hname = TString::Format(
"%s/%s/fHistRhoVsCent", param.GetName(), jetDef.GetName());
3338 htitle = hname +
";Centrality (%);#rho (GeV/#it{c} #times rad^{-1});counts";
3341 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", param.GetName(), jetDef.GetName());
3342 htitle = hname +
";Centrality (%);#it{p}_{T,jet} (GeV/#it{c});counts";
3345 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", param.GetName(), jetDef.GetName());
3346 htitle = hname +
";Centrality (%);#it{p}_{T,D} (GeV/#it{c});counts";
3349 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", param.GetName(), jetDef.GetName());
3350 htitle = hname +
";no. of tracks;#rho (GeV/#it{c} #times rad^{-1});counts";
3353 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", param.GetName(), jetDef.GetName());
3354 htitle = hname +
";no. of tracks;#it{p}_{T,jet} (GeV/#it{c});counts";
3357 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", param.GetName(), jetDef.GetName());
3358 htitle = hname +
";no. of tracks;#it{p}_{T,D} (GeV/#it{c});counts";
3366 param.fOutputHandler = tree_handler;
3374 AliError(Form(
"Number of data output slots %d not sufficient. Tree of analysis engine %s will not be posted!",
fNOutputTrees, param.GetName()));
3381 param.fOutputHandler = thnsparse_handler;
3389 param.fOutputHandler = qa_handler;
3397 param.fOutputHandler = tree_handler;
3405 AliError(Form(
"Number of data output slots %d not sufficient. Tree of analysis engine %s will not be posted!",
fNOutputTrees, param.GetName()));
3432 AliError(Form(
"This task need an AOD event (Task '%s'). Expect troubles...", GetName()));
3450 params.fRandomGen = rnd;
3452 for (
auto &jetdef: params.fJetDefinitions) {
3453 if (!jetdef.fRhoName.IsNull()) {
3454 jetdef.fRho =
dynamic_cast<AliRhoParameter*
>(fInputEvent->FindListObject(jetdef.fRhoName));
3456 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3457 "%s: Could not find rho object '%s' for engine '%s'",
3458 GetName(), jetdef.fRhoName.Data(), params.GetName());
3463 if (!params.fRDHFCuts) {
3465 ::Warning(
"AliAnalysisTaskDmesonJets::ExecOnce",
3466 "%s: RDHF cuts not provided for engine '%s'.",
3467 GetName(), params.GetName());
3470 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3471 "%s: RDHF cuts not provided. Engine '%s' disabled.",
3472 GetName(), params.GetName());
3473 params.fInhibit = kTRUE;
3479 for (
auto cont_it : fParticleCollArray) {
3481 if (track_cont) params.fTrackContainers.push_back(track_cont);
3484 for (
auto cont_it :
fClusterCollArray) params.fClusterContainers.push_back(cont_it.second);
3489 params.fCandidateArray =
dynamic_cast<TClonesArray*
>(
fAodEvent->GetList()->FindObject(params.fBranchName.Data()));
3491 if (params.fCandidateArray) {
3494 className =
"AliAODRecoDecayHF2Prong";
3497 className =
"AliAODRecoCascadeHF";
3499 if (!params.fCandidateArray->GetClass()->InheritsFrom(className)) {
3500 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3501 "%s: Objects of type %s in %s are not inherited from %s! Task will be disabled!",
3502 GetName(), params.fCandidateArray->GetClass()->GetName(), params.fCandidateArray->GetName(), className.Data());
3503 params.fCandidateArray = 0;
3504 params.fInhibit = kTRUE;
3508 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3509 "Could not find candidate array '%s', skipping the event. Analysis engine '%s' will be disabled!",
3510 params.fBranchName.Data(), params.GetName());
3511 params.fInhibit = kTRUE;
3515 if (params.fMCMode !=
kNoMC) {
3516 if (!params.fMCContainer) {
3517 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3518 "No MC particle container was provided. Analysis engine '%s' will be disabled!",
3520 params.fInhibit = kTRUE;
3525 if (params.fTrackContainers.size() == 0 && params.fClusterContainers.size() == 0) {
3526 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3527 "No track container and no cluster container were provided. Analysis engine '%s' will be disabled!",
3529 params.fInhibit = kTRUE;
3547 if (eng.fInhibit)
continue;
3548 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3556 if (matchingAODdeltaAODlevel <= 0) {
3559 if (eng.fInhibit)
continue;
3560 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3568 eng.fDmesonJets.clear();
3569 if (eng.fInhibit)
continue;
3574 hname = TString::Format(
"%s/fHistNEvents", eng.GetName());
3576 Bool_t iseventselected = kTRUE;
3577 if (eng.fRDHFCuts) iseventselected = eng.fRDHFCuts->IsEventSelected(
fAodEvent);
3578 if (!iseventselected) {
3580 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3581 UInt_t bitmap = eng.fRDHFCuts->GetEventRejectionBitMap();
3585 if (label.IsNull())
break;
3595 AliDebug(2,
"Event selected");
3608 if (param.fInhibit)
continue;
3622 Int_t PdgHighParton = 0;
3623 for (
auto it = itcont.begin(); it != itcont.end(); it++) {
3625 if (part.first.Pt() == 0)
continue;
3627 Int_t PdgCode = part.second->GetPdgCode();
3630 if ((PdgCode < -9 || PdgCode > 9) && PdgCode != 21 && PdgCode != -21)
continue;
3632 AliDebugStream(5) <<
"Parton " << it.current_index() <<
3633 " with pdg=" << PdgCode <<
3634 ", px=" << part.first.Px() <<
3635 ", py=" << part.first.Py() <<
3636 ", pz=" << part.first.Pz() <<
3637 ", n daughters = " << part.second->GetNDaughters() <<
3642 if (part.second->GetNDaughters() == 0)
continue;
3645 if (highestPartonPt < part.first.Pt()) {
3646 highestPartonPt = part.first.Pt();
3647 PdgHighParton = PdgCode;
3651 if (PdgCode != 4 && PdgCode != 5 && PdgCode != -4 && PdgCode != -5)
continue;
3653 Bool_t lastInPartonShower = kTRUE;
3654 Bool_t hadronDaughter = kFALSE;
3655 for (
Int_t daughterIndex = part.second->GetFirstDaughter(); daughterIndex <= part.second->GetLastDaughter(); daughterIndex++){
3656 if (daughterIndex < 0) {
3657 AliDebugStream(5) <<
"Could not find daughter index!" << std::endl;
3662 AliDebugStream(5) <<
"Could not find particle with index " << daughterIndex <<
"!" << std::endl;
3665 Int_t daughterPdgCode = daughter->GetPdgCode();
3666 if (daughter->GetMother() != it.current_index()) {
3667 AliDebugStream(5) <<
"Particle " << daughterIndex <<
" with pdg=" << daughterPdgCode <<
3668 ", px=" << daughter->Px() <<
3669 ", py=" << daughter->Py() <<
3670 ", pz=" << daughter->Pz() <<
3671 ", is not a daughter of " << it.current_index() <<
3676 AliDebugStream(5) <<
"Found daughter " << daughterIndex <<
3677 " with pdg=" << daughterPdgCode <<
3678 ", px=" << daughter->Px() <<
3679 ", py=" << daughter->Py() <<
3680 ", pz=" << daughter->Pz() <<
3682 if (daughterPdgCode == PdgCode) lastInPartonShower = kFALSE;
3683 if (TMath::Abs(daughterPdgCode) >= 111) hadronDaughter = kTRUE;
3685 if (hadronDaughter) {
3686 AliDebugStream(5) <<
"This particle has at least a hadron among its daughters!" << std::endl;
3687 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;
3690 AliDebugStream(5) <<
"This particle does not have hadrons among its daughters!" << std::endl;
3691 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;
3695 if (PdgCode == 4 || PdgCode == -4) {
3700 else if (PdgCode == 5 || PdgCode == -5) {
3709 Int_t partonType = 0;
3710 Int_t absPdgHighParton = TMath::Abs(PdgHighParton);
3711 if (absPdgHighParton == 9 || absPdgHighParton == 21) {
3715 partonType = absPdgHighParton;
3729 TParticlePDG* part = TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg));
3734 if (nbins % 2 == 0) {
3735 minMass = mass - range / 2 - range / nbins / 2;
3736 maxMass = mass + range / 2 - range / nbins / 2;
3739 minMass = mass - range / 2;
3740 maxMass = mass + range / 2;
3755 label =
"NotSelTrigger";
3757 return label.Data();
3762 return label.Data();
3765 label =
"TooFewVtxContrib";
3767 return label.Data();
3770 label =
"ZVtxOutFid";
3772 return label.Data();
3777 return label.Data();
3780 label =
"OutsideCentrality";
3782 return label.Data();
3785 label =
"PhysicsSelection";
3787 return label.Data();
3790 label =
"BadSPDVertex";
3792 return label.Data();
3795 label =
"ZVtxSPDOutFid";
3797 return label.Data();
3800 label =
"CentralityFlattening";
3802 return label.Data();
3805 label =
"BadTrackV0Correl";
3807 return label.Data();
3810 return label.Data();
3842 ::Error(
"AddTaskDmesonJets",
"No analysis manager to connect to.");
3847 AliVEventHandler* handler = mgr->GetInputEventHandler();
3849 ::Error(
"AddTaskDmesonJets",
"This task requires an input event handler");
3855 if (handler->InheritsFrom(
"AliESDInputHandler")) {
3858 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
3863 if (ntracks ==
"usedefault") {
3864 if (dataType ==
kESD) {
3867 else if (dataType ==
kAOD) {
3875 if (nclusters ==
"usedefault") {
3876 if (dataType ==
kESD) {
3877 nclusters =
"CaloClusters";
3879 else if (dataType ==
kAOD) {
3880 nclusters =
"caloClusters";
3887 if (nMCpart ==
"usedefault") {
3888 nMCpart =
"mcparticles";
3891 TString name(
"AliAnalysisTaskDmesonJets");
3892 if (strcmp(suffix,
"") != 0) {
3893 name += TString::Format(
"_%s", suffix.Data());
3898 if (!ntracks.IsNull()) {
3900 jetTask->AdoptParticleContainer(trackCont);
3903 if (!nMCpart.IsNull()) {
3905 partCont->SetEtaLimits(-1.5, 1.5);
3906 partCont->SetPtLimits(0, 1000);
3907 jetTask->AdoptParticleContainer(partCont);
3910 jetTask->AddClusterContainer(nclusters.Data());
3913 mgr->AddTask(jetTask);
3916 AliAnalysisDataContainer* cinput1 = mgr->GetCommonInputContainer();
3918 contname1 +=
"_histos";
3919 AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(contname1.Data(),
3920 TList::Class(), AliAnalysisManager::kOutputContainer,
3921 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3923 mgr->ConnectInput(jetTask, 0, cinput1);
3924 mgr->ConnectOutput(jetTask, 1, coutput1);
3926 for (
Int_t i = 0; i < nMaxTrees; i++) {
3927 TString contname = TString::Format(
"%s_tree_%d", name.Data(), i);
3928 AliAnalysisDataContainer *coutput = mgr->CreateContainer(contname.Data(),
3929 TTree::Class(),AliAnalysisManager::kOutputContainer,
3930 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3931 mgr->ConnectOutput(jetTask, 2+i, coutput);
Int_t GetNConstituents() const
Bool_t IsAnyJetInAcceptance(const AliDmesonJetInfo &dMesonJet) const
AliD0ExtendedInfoSummary()
Double32_t fCorrZ
Z of the D meson after subtracting average background.
Lightweight class that encapsulates D meson jets.
void SetRejectionReasonLabels(TAxis *axis)
UChar_t fNDaughters
Number of daughters.
Double32_t fZ
Z of the D meson.
Double_t fMaxMass
! Max mass in histogram axis
void Print() const
Prints the content of this object in the standard output.
void UserCreateOutputObjects()
AliAODMCParticle * fParton
! pointer to the parton in the shower tree of the D meson (only for particle level D mesons) ...
std::list< AnalysisEngine > fAnalysisEngines
Array of analysis parameters.
std::string fClassName
Class name where the event was not found.
AliEMCALGeometry * fGeom
!emcal geometry
void SetDMesonCandidate(AliAODRecoDecay *c)
Analysis task for D meson jets.
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)
virtual void Set(const AliDmesonJetInfo &source)
Invariant mass of the D0 meson candidate in GeV/c2.
virtual void Reset()
Reset the object.
Bool_t fInhibit
!inhibit execution of the task
TList * fOutput
!output list
TTree * fTree
! Output tree
Double_t fPtHard
!event pt hard
Bool_t IsJetInAcceptance(const AliJetInfo &jet) const
Double_t fSoftPionPt
! Transverse momentum of the soft pion of the D* candidate
EDataType_t
Switch for the data type.
virtual AliAODMCParticle * GetMCParticle(Int_t i=-1) const
void SetJetPhiRange(Double_t min, Double_t max)
Int_t fDataSlotNumber
! Data slot where the tree output is posted
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
AliRDHFCuts * fRDHFCuts
D meson candidates cuts.
virtual void Set(const AliDmesonJetInfo &source)
THistManager * fHistManager
! Histograms
void RunAnalysis()
Run the analysis.
void AssignDataSlot(Int_t n)
TString fRhoName
Name of the object that holds the average background value.
Lightweight class that encapsulates D meson jets.
std::vector< AliTrackContainer * > fTrackContainers
! Track containers
AnalysisEngine * AddAnalysisEngine(ECandidateType_t type, TString cutfname, TString cuttype, EMCMode_t bkgMode, EJetType_t jettype, Double_t jetradius, TString rhoName="")
AliJetInfoSummary ** fCurrentJetInfo
! Current jet info
Double_t fTrackEfficiency
Artificial tracking inefficiency (0...1)
void SetJetEtaRange(Double_t min, Double_t max)
std::vector< AliClusterContainer * > fClusterContainers
! Cluster containers
Double32_t fPhi
Phi of the D meson.
EMCMode_t fMCMode
! MC mode: No MC (data and MC detector level), background-only (MC), signal-only (MC), MC truth (particle level)
Double_t fEPV0
!event plane V0
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
AliHFAODMCParticleContainer * fMCContainer
! MC particle container
ERecoScheme_t fRecoScheme
Jet recombination scheme (pt scheme, E scheme, ...)
const TObjArray & GetDaughterList() const
Double32_t fWeight
Centrality of the collision.
void SetRDHFCuts(AliRDHFCuts *cuts)
const char * what() const noexcept
void SetEnabledAxis(UInt_t axis)
Double_t fMaxNeutralPt
Transverse momentum of the leading neutral particle (or cluster)
Class that encapsulates event properties in a very compact structure (useful for pp simulation analys...
void RunDetectorLevelAnalysis()
Run a detector level analysis.
Container with name, TClonesArray and cuts for particles.
Double32_t fPartonPt
Transverse momentum of the parton.
friend bool operator<(const AnalysisEngine &lhs, const AnalysisEngine &rhs)
Double32_t fArea
Area of the jet.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
virtual void UserCreateOutputObjects()
Creates the output containers.
void FillPartonLevelHistograms()
Fill histograms with parton-level information.
static Int_t CheckMatchingAODdeltaAODevents()
Double32_t fInvMass
Invariant mass of the D0 meson candidate in GeV/c2.
Lightweight class that encapsulates D meson jets.
Double_t fMinMass
! Min mass in histogram axis
Output handler for D meson jet analysis.
Double_t fInvMass2Prong
! 2-prong mass of the D* candidate (w/o the soft pion)
friend bool operator==(const AnalysisEngine &lhs, const AnalysisEngine &rhs)
TString fName
! Name of this object
Double_t fMinChargedPt
Minimum pt of the leading charged particle (or track)
virtual Bool_t FillOutput(Bool_t applyKinCuts)
UInt_t fEnabledAxis
! Use bit defined in EAxis_t to enable axis in the THnSparse
static void CalculateMassLimits(Double_t range, Int_t pdg, Int_t nbins, Double_t &minMass, Double_t &maxMass)
AliAODEvent * fAodEvent
! AOD event
virtual void Reset()
Reset the object.
Bool_t FindJet(AliAODRecoDecayHF2Prong *Dcand, AliDmesonJetInfo &DmesonJet, AliHFJetDefinition &jetDef)
UInt_t fEnabledAxis
Use bit defined in EAxis_t to enable axis in the THnSparse.
Double32_t fPtK
Transverse momentum of the kaon.
TRandom * fRandomGen
! Random number generator
std::vector< AliAnalysisTaskDmesonJets::AliHFJetDefinition > & GetJetDefinitions()
Double32_t fCosPointing
Cosine of the pointing angle.
AliRhoParameter * fRho
Object that holds the average background value.
EMCMode_t fMCMode
MC mode: No MC (data and MC detector level), background-only (MC), signal-only (MC), MC truth (particle level)
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
Double_t fJetGhostArea
Area of the ghost particles.
Double_t InvMassD0() const
void SetRecombScheme(const fastjet::RecombinationScheme &scheme)
const char * GetName() const
virtual void Reset()
Reset the object.
AnalysisEngine()
This is the default constructor, used for ROOT I/O purposes.
Double_t Prodd0d0() const
Output handler for D meson jet analysis.
OutputHandlerTTree()
Constructor.
OutputHandlerTHnSparse()
Constructor.
Int_t PostDataFromAnalysisEngine(OutputHandler const *handler)
virtual void Reset()
Reset the current object.
THistManager * fHistManager
! Histograms
Output handler for D meson jet analysis.
EFindParticleOriginMode_t
Double32_t fPtPi
Transverse momentum of the pion.
void Init(const AliEMCALGeometry *const geom, Int_t runNumber)
Initialize the analysis engine.
Int_t fDataSlotNumber
! Data slot where the tree output is posted
std::vector< AliHFJetDefinition > * fJetDefinitions
! Jet definitions
Int_t fNMassBins
! Mass number of bins
static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco)
AliVParticle * fDmesonParticle
! pointer to the particle object
Double32_t fd0d0
D0K * D0Pi.
static TString GenerateJetName(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius, AliParticleContainer *partCont, AliClusterContainer *clusCont, TString tag)
Double_t fMinJetEta
Minimum jet eta.
static std::pair< AliAnalysisTaskDmesonJets::EMesonOrigin_t, AliAODMCParticle * > IsPromptCharm(const AliAODMCParticle *part, TClonesArray *mcArray)
std::vector< DMESONTYPE > fCurrentDmesonInfo
! Current D meson jet info
virtual void Set(const AliDmesonJetInfo &source)
AliAODEvent * fAodEvent
! AOD event
Double32_t fN
Number of jet constituents.
virtual Bool_t FillOutput(Bool_t applyKinCuts)
Select tracks based on specific prescriptions of HF analysis.
Double32_t fPt
Transverse momentum of the jet in GeV/c.
ECandidateType_t fCandidateType
Candidate type.
Double_t GetDistance(std::string n, Double_t &deta, Double_t &dphi) const
Int_t fMCLabel
! MC label, i.e. index of the generator level D meson (only for detector level D meson candidates) ...
EBeamType_t fForceBeamType
forced beam type
Double32_t fR
Distance between D meson and jet axis.
virtual void Reset()
Reset the object.
virtual void Set(const AliDmesonJetInfo &source)
void AddInputVectors(AliEmcalContainer *cont, Int_t offset, TH2 *rejectHist=0, Double_t eff=0.)
const std::vector< fastjet::PseudoJet > & GetInclusiveJets() const
virtual Bool_t FillOutput(Bool_t applyKinCuts)
EventInfo * fEventInfo
! Object conatining the event information (centrality, pt hard, weight, etc.)
EJetType_t fJetType
Jet type (charged, full, neutral)
Double32_t fEta
Eta of the D meson.
Double32_t fPt
Transverse momentum of the D meson in GeV/c.
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.
virtual void Set(const AliDmesonJetInfo &source)
AliTLorentzVector fD
! 4-momentum of the D meson candidate
Double_t GetDistance(const AliJetInfo &jet, Double_t &deta, Double_t &dphi) const
TObject * FindObject(const char *name) const
Find an object inside the container.
Lightweight class that encapsulates D0.
virtual void BuildOutputObject(const char *taskName)
OutputHandler()
Constructor.
OutputHandlerTTreeExtendedBase()
Constructor.
Double_t fMinJetPhi
Minimum jet phi.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t CosThetaStarD0bar() const
angle of K
UInt_t fCandidatePDG
Candidate PDG.
Float_t fMaxPt
! Histogram pt limit
AliAnalysisTaskDmesonJets()
This is the default constructor, used for ROOT I/O purposes.
virtual void Reset()
Reset the current object.
Output handler for D meson jet analysis.
AnalysisEngine & operator=(const AnalysisEngine &source)
Lightweight class that encapsulates D meson jets for PbPb analysis.
Double_t fMaxJetPt
Maximum jet pT.
Struct that encapsulates analysis parameters.
std::vector< AliHFJetDefinition >::iterator FindJetDefinition(const AliHFJetDefinition &eng)
Base task in the EMCAL framework (lighter version of AliAnalysisTaskEmcal)
Double_t Phi_0_2pi() const
static AliAODMCParticle * FindParticleOrigin(const AliAODMCParticle *part, TClonesArray *mcArray, EFindParticleOriginMode_t mode, const std::set< UInt_t > &pdgSet)
Double_t fMinNeutralPt
Minimum pt of the leading neutral particle (or cluster)
Double32_t fPhi
Phi of the jet.
void AssignDataSlot(Int_t n)
Bool_t fD0D0bar
! kTRUE if selected both as D0 and D0bar
TTree * fTree
! Output tree
Double_t fRadius
Jet radius.
Double_t fMinJetPt
Minimum jet pT.
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.
Bool_t IsD0Extended() const
TString fName
! Name of this object
Bool_t fD0Extended
! Store extended information in the tree (only for D0 mesons)
AliAODTrack * GetBachelor() const
Bool_t fD0Extended
Store extended information in the tree (only for D0 mesons)
AliRDHFCuts * LoadDMesonCutsFromFile(TString cutfname, TString cutsname)
AliDmesonJetInfo()
Default constructor.
std::list< AnalysisEngine >::iterator FindAnalysisEngine(const AnalysisEngine &eng)
std::vector< AliHFJetDefinition > fJetDefinitions
Jet definitions.
Double_t fMaxNeutralPt
Maximum pt of the leading neutral particle (or cluster)
Double_t fMaxJetPhi
Maximum jet phi.
Int_t fNMassBins
Mass number of bins.
Double_t fMaxMass
Max mass in histogram axis.
Double_t InvMassD0bar() const
EJetAlgo_t fJetAlgo
Jet algorithm (kt, anti-kt,...)
Double_t GetZ(std::string n) const
static const char * GetHFEventRejectionReasonLabel(UInt_t &bitmap)
Lightweight class that encapsulates D*.
virtual void Clear(const Option_t *="")
virtual void Reset()
Reset the object.
Bool_t fInhibit
Inhibit the task.
ECandidateType_t GetCandidateType() const
friend bool operator<(const AliHFJetDefinition &lhs, const AliHFJetDefinition &rhs)
OutputHandlerTTreeExtended()
Constructor.
void SetChargedPtRange(Double_t min, Double_t max)
virtual void BuildOutputObject(const char *taskName)
void SetRejectedOriginMap(UInt_t m)
Bool_t ExtractDstarAttributes(const AliAODRecoCascadeHF *DstarCand, AliDmesonJetInfo &DmesonJet, UInt_t i)
Int_t fJetAreaType
Jet area type.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
const AliJetInfo * GetJet(std::string n) const
Float_t fPtBinWidth
Histogram pt bin width.
Float_t fEventWeight
!event weight
Short_t fPartonType
! type of the parton in the shower tree (only for particle level D mesons)
TClonesArray * fCandidateArray
! D meson candidate array
void Reset()
Reset the object.
void SetAcceptedDecayMap(UInt_t m)
const AliMCParticleIterableMomentumContainer all_momentum() const
virtual ~AliAnalysisTaskDmesonJets()
This is the standard destructor.
Byte_t fSelectionType
! for D0: 0=not selected, 1=D0, 2=D0bar
void SetCandidateProperties(Double_t range)
Bool_t ExtractD0Attributes(const AliAODRecoDecayHF2Prong *Dcand, AliDmesonJetInfo &DmesonJet, UInt_t i)
Double_t Phi_0_2pi() const
Select MC particles based on specific prescriptions of HF analysis.
Double32_t fCosThetaStar
Cosine of theta star.
std::map< int, AliDmesonJetInfo > * fDmesonJets
! Array containing the D meson jets
static EMesonDecayChannel_t CheckDecayChannel(const AliAODMCParticle *part, TClonesArray *mcArray)
void SetGhostArea(Double_t gharea)
AliDmesonJetInfo & operator=(const AliDmesonJetInfo &source)
Double_t fMaxChargedPt
Transverse momentum of the leading charged particle (or track)
Double_t GetCorrZ(std::string n) const
Double32_t fCorrPt
Transverse momentum of the jet in GeV/c after subtracting average background.
std::vector< fastjet::PseudoJet > GetJetConstituents(UInt_t idx) const
EventInfo fEventInfo
! Event info (centrality, weight, pt hard etc.)
friend bool operator==(const AliHFJetDefinition &lhs, const AliHFJetDefinition &rhs)
EMCMode_t GetMCMode() const
virtual void BuildOutputObject(const char *taskName)
EVENTTYPE fCurrentEventInfo
! Current event info
static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo)
Double_t fMaxChargedPt
Maximum pt of the leading charged particle (or track)
void AdoptRDHFCuts(AliRDHFCuts *cuts)
Class that encapsulates jets.
ECandidateType_t fCandidateType
! Candidate type
std::map< std::string, AliJetInfo > fJets
! list of jets
Look for the very first particle in the fragmentation tree.
AliAODMCParticle * fAncestor
! pointer to the ancestor particle in the shower tree of the D meson (only for particle level D meson...
Double32_t fDeltaInvMass
< Difference between the Kpipi and the Kpi invariant masses in GeV/c2
OutputHandler * fOutputHandler
! Output handler
Bool_t IsSpecialPDGFound() const
Bool_t fRejectISR
! Reject initial state radiation
virtual ~AnalysisEngine()
void RunParticleLevelAnalysis()
Run a particle level analysis.
Bool_t FillHnSparse(THnSparse *h, const AliDmesonJetInfo &DmesonJet, std::string n)
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
std::map< int, AliDmesonJetInfo > fDmesonJets
! Array containing the D meson jets
std::string fWhat
Error message.
Double32_t f2ProngInvMass
Double_t fTrackEfficiency
! Artificial tracking inefficiency (0...1) -> set automatically at ExecOnce by AliAnalysisTaskDmesonJ...
void SetJetPtRange(Double_t min, Double_t max)
Bool_t fApplyKinematicCuts
Apply jet kinematic cuts.
Double32_t fSelectionType
Selection type: D0, D0bar, both.
Byte_t GetSelectionTypeSummary() const
void Set(EventInfo event)
Bool_t IsSelected(TObject *obj)
const char * GetName() const
Generate a name for this jet definition.
AliEventNotFound(const std::string &class_name, const std::string &method_name)
UInt_t fAcceptedDecay
Bit mask with D meson decays that are accepted (only used for particle-level analysis) ...
virtual void Set(const AliDmesonJetInfo &source, std::string n)
Bool_t fReconstructed
! Whether this D meson was reconstructed (only for particle level D mesons)
Bool_t ExtractRecoDecayAttributes(const AliAODRecoDecayHF2Prong *Dcand, AliDmesonJetInfo &DmesonJet, UInt_t i)
Double_t InvMassD0() const
Double32_t fEta
Eta of the jet.
Bool_t fRejectISR
Reject initial state radiation.
AliDmesonInfoSummary * fCurrentDmesonJetInfo
! Current D meson jet info
EOutputType_t fOutputType
Output type: none, TTree or THnSparse.
virtual void AddInputVector(Double_t px, Double_t py, Double_t pz, Double_t E, Int_t index=-99999)
std::map< std::string, std::vector< JETTYPE > > fCurrentJetInfo
! Current jet info
Double_t InvMassDstarKpipi() const
const AliVEvent * fEvent
! pointer to the ESD/AOD event
TArrayI fPDGdaughters
List of the PDG code of the daughters.
void SetNeutralPtRange(Double_t min, Double_t max)
Double32_t fMaxNormd0
max norm d0
TString fBranchName
AOD branch where the D meson candidate are found.
virtual Bool_t FillOutput(Bool_t applyKinCuts)
Float_t fMaxPt
Histogram pt limit.
Double_t CosPointingAngle() const
Int_t fNOutputTrees
Maximum number of output trees.
static OutputHandlerTTreeExtendedBase * GenerateOutputHandler(AnalysisEngine *eng)
virtual Bool_t FillHistograms()
AliHFJetDefinition()
This is the default constructor, used for ROOT I/O purposes.
Double_t CosThetaStarD0() const
void SetSpecialPDG(Int_t pdg)
AliHFJetDefinition & operator=(const AliHFJetDefinition &source)
Int_t GetNAcceptedParticles() const
Double_t fMaxJetEta
Maximum jet eta.
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.
Double_t fCorrPt
Transverse momentum of the jet after subtracting the average background.
AliHFAODMCParticleContainer * fMCContainer
! MC particle container
TString fCandidateName
Candidate name.
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
AliFJWrapper * fFastJetWrapper
! Fastjet wrapper
Float_t fPtBinWidth
! Histogram pt bin width
AliHFJetDefinition * AddJetDefinition(EJetType_t type, Double_t r, EJetAlgo_t algo, ERecoScheme_t reco)
Container for MC-true particles within the EMCAL framework.
Lightweight class that encapsulates D0.
void SetMakeGeneralHistograms(Bool_t g)
Double_t fCent
!event centrality
virtual Int_t GetDataSlotNumber() const
void SetCharge(EChargeCut_t c)
Container for jet within the EMCAL jet framework.
void SetRejectISR(Bool_t b)
Double32_t fPartonType
Parton type.
virtual void BuildOutputObject(const char *taskName)
AliFJWrapper * fFastJetWrapper
! Fastjet wrapper
THistManager fHistManager
Histogram manager.
void Reset()
Reset all fields to their default values.
Output handler for D meson jet analysis.
virtual TObject * GetOutputObject() const
static AliAnalysisTaskDmesonJets * AddTaskDmesonJets(TString ntracks="usedefault", TString nclusters="usedefault", TString nMCpart="", Int_t nMaxTrees=2, TString suffix="")
virtual void Set(const AliDmesonJetInfo &source, std::string n)
Double_t fMinMass
Min mass in histogram axis.
Double32_t fDCA
Distance of closest approach.