20 #include <TClonesArray.h> 21 #include <TDatabasePDG.h> 22 #include <TParticlePDG.h> 24 #include <THnSparse.h> 25 #include <TParticle.h> 27 #include <THashList.h> 33 #include "AliEMCALGeometry.h" 34 #include "AliAnalysisManager.h" 35 #include "AliVEventHandler.h" 59 fClassName(class_name),
60 fAccessMethodName(method_name)
62 std::stringstream what_str;
63 what_str <<
"ALICE event not found in class '" <<
fClassName <<
"' using method '" << method_name <<
"'.";
64 fWhat = what_str.str();
67 #if !(defined(__CINT__) || defined(__MAKECINT__)) 88 dphi = TVector2::Phi_mpi_pi(fMomentum.Phi() - jet.
Phi());;
89 deta = fMomentum.Eta() - jet.
Eta();
90 return TMath::Sqrt(dphi*dphi + deta*deta);
101 return GetDistance(jet, deta, dphi);
118 fReconstructed(kFALSE),
160 fD.SetPtEtaPhiE(0,0,0,0);
170 for (
auto &jet :
fJets) {
171 jet.second.fMomentum.SetPtEtaPhiE(0,0,0,0);
172 jet.second.fNConstituents = 0;
174 jet.second.fMaxChargedPt = 0;
175 jet.second.fMaxNeutralPt = 0;
182 Printf(
"Printing D Meson Jet object.");
183 Printf(
"D Meson: pT = %.3f, eta = %.3f, phi = %.3f, inv. mass = %.3f",
fD.Pt(),
fD.Eta(),
fD.
Phi_0_2pi(),
fD.M());
185 for (
auto &jet :
fJets) {
186 Printf(
"Jet %s: pT = %.3f, eta = %.3f, phi = %.3f", jet.first.c_str(), jet.second.Pt(), jet.second.Eta(), jet.second.Phi_0_2pi());
187 Printf(
"Jet N Consituents = %d", jet.second.fNConstituents);
196 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
197 if (it ==
fJets.end())
return 0;
201 if ((*it).second.Pt() > 0) {
202 TVector3 dvect =
fD.Vect();
203 TVector3 jvect = (*it).second.fMomentum.Vect();
208 ::Error(
"AliAnalysisTaskDmesonJets::AliDmesonJetInfo::GetZ",
"Zero jet momentum!");
212 z = (dvect * jvect) / jetMom;
215 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
226 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
227 if (it ==
fJets.end())
return 0;
231 if ((*it).second.Pt() > 0) {
232 TVector3 dvect =
fD.Vect();
233 TVector3 jvect = (*it).second.fMomentum.Vect();
235 Double_t corrpt = (*it).second.fCorrPt > 0 ? (*it).second.fCorrPt : 0.;
236 jvect.SetPerp(corrpt);
244 z = (dvect * jvect) / jetMom;
259 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
260 if (it ==
fJets.end())
return 0;
284 dphi = TVector2::Phi_mpi_pi(
fD.Phi() - jet.
Phi());;
285 deta =
fD.Eta() - jet.
Eta();
286 return TMath::Sqrt(dphi*dphi + deta*deta);
306 std::map<std::string, AliJetInfo>::const_iterator it =
fJets.find(n);
307 if (it ==
fJets.end()) {
308 ::Error(
"AliAnalysisTaskDmesonJets::AliDmesonJetInfo::GetJet",
"Could not find jet info for the jet definition '%s'!",
312 return &((*it).second);
321 std::map<std::string, AliJetInfo>::iterator it =
fJets.find(n);
322 if (it ==
fJets.end()) {
323 ::Error(
"AliAnalysisTaskDmesonJets::AliDmesonJetInfo::GetJet",
"Could not find jet info for the jet definition '%s'!",
327 return &((*it).second);
368 std::map<std::string, AliJetInfo>::const_iterator it = source.
fJets.find(n);
369 if (it == source.
fJets.end())
return;
460 fPt = source.
fD.Pt();
532 fInvMass(source.fD.M()),
586 fDCA = recoDecay->GetDCA();
589 fPtK = recoDecay->PtProng(0);
590 fPtPi = recoDecay->PtProng(1);
591 fd0K = recoDecay->Getd0Prong(0);
592 fd0Pi = recoDecay->Getd0Prong(1);
596 fPtK = recoDecay->PtProng(1);
597 fPtPi = recoDecay->PtProng(0);
598 fd0K = recoDecay->Getd0Prong(1);
599 fd0Pi = recoDecay->Getd0Prong(0);
606 for (
Int_t ipr=0; ipr < 2; ipr++) {
607 Double_t diffIP = 0., errdiffIP = 0.;
610 if (errdiffIP > 0.) {
611 normdd0 = diffIP / errdiffIP;
618 normdd0 = diffIP > 0 ? 9999. : -9999.;
621 if (TMath::Abs(normdd0) > TMath::Abs(
fMaxNormd0)) {
659 f2ProngInvMass(source.fInvMass2Prong),
660 fDeltaInvMass(source.fD.M() - source.fInvMass2Prong)
830 if (!jet)
return kFALSE;
904 fCurrentDmesonJetInfo(0),
909 fClusterContainers(),
1077 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisEngine::SetCandidateProperties",
"Candidate %d unknown!",
fCandidateType);
1122 fName +=
"_BackgroundOnly";
1125 fName +=
"_SignalOnly";
1128 fName +=
"_MCTruth";
1131 fName +=
"_D0Reflection";
1139 return fName.Data();
1154 ::Info(
"AliAnalysisTaskDmesonJets::AnalysisEngine::AddJetDefinition",
"Jet definition '%s' has been added to analysis engine '%s'." 1155 "Total number of jet definitions is now %lu.",
1161 ::Warning(
"AliAnalysisTaskDmesonJets::AnalysisEngine::AddJetDefinition",
"The same jet definition '%s' was already added in analysis engine '%s'.", def.
GetName(),
GetName());
1191 std::vector<AliHFJetDefinition>::iterator it =
fJetDefinitions.begin();
1225 for (
auto &jetdef :
fJetDefinitions) jetdef.SetChargedPtRange(min, max);
1233 for (
auto &jetdef :
fJetDefinitions) jetdef.SetNeutralPtRange(min, max);
1310 AliDebug(10,
"Checking if D0 meson is selected");
1312 if (isSelected == 0)
return kFALSE;
1314 Int_t MCtruthPdgCode = 0;
1326 AliAODMCParticle* aodMcPart =
static_cast<AliAODMCParticle*
>(
fMCContainer->GetArray()->At(mcLab));
1334 MCtruthPdgCode = aodMcPart->PdgCode();
1339 if (isSelected == 1) {
1340 if (i != 0)
return kFALSE;
1347 AliDebug(10,
"Selected as D0");
1354 else if (isSelected == 2) {
1355 if (i != 1)
return kFALSE;
1362 AliDebug(10,
"Selected as D0bar");
1369 else if (isSelected == 3) {
1370 AliDebug(10,
"Selected as either D0 or D0bar");
1375 if (i != 0)
return kFALSE;
1376 AliDebug(10,
"MC truth is D0");
1381 if (i != 1)
return kFALSE;
1382 AliDebug(10,
"MC truth is D0bar");
1391 AliDebug(10,
"Returning invariant mass with D0 hypothesis");
1395 AliDebug(10,
"Returning invariant mass with D0bar hypothesis");
1407 DmesonJet.
fD.SetPtEtaPhiM(Dcand->Pt(), Dcand->Eta(), Dcand->Phi(), invMassD);
1420 AliDebug(10,
"Checking if D* meson is selected");
1422 if (isSelected == 0)
return kFALSE;
1424 if ((i == 1 && DstarCand->Charge()>0) || (i == 0 && DstarCand->Charge()<0) || i > 1)
return kFALSE;
1426 Int_t MCtruthPdgCode = 0;
1431 Int_t pdgDgDStartoD0pi[2] = { 421, 211 };
1432 Int_t pdgDgD0toKpi[2] = { 321, 211 };
1435 AliDebug(10, Form(
"MC label is %d", mcLab));
1438 AliAODMCParticle* aodMcPart =
static_cast<AliAODMCParticle*
>(
fMCContainer->GetArray()->At(mcLab));
1446 MCtruthPdgCode = aodMcPart->PdgCode();
1447 AliDebug(10, Form(
"MC truth pdg code is %d",MCtruthPdgCode));
1452 Int_t absMCtruthPdgCode = TMath::Abs(MCtruthPdgCode);
1460 DmesonJet.
fD.SetPtEtaPhiM(DstarCand->Pt(), DstarCand->Eta(), DstarCand->Phi(), invMassD);
1481 Int_t absPdgPart = TMath::Abs(part->GetPdgCode());
1483 if (part->GetNDaughters() == 2) {
1485 AliAODMCParticle* d1 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(0)));
1486 AliAODMCParticle* d2 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(1)));
1492 Int_t absPdg1 = TMath::Abs(d1->GetPdgCode());
1493 Int_t absPdg2 = TMath::Abs(d2->GetPdgCode());
1495 if (absPdgPart == 421) {
1496 if ((absPdg1 == 211 && absPdg2 == 321) ||
1497 (absPdg1 == 321 && absPdg2 == 211)) {
1502 if (absPdgPart == 413) {
1503 if (absPdg1 == 421 && absPdg2 == 211) {
1509 else if (absPdg1 == 211 && absPdg2 == 421) {
1529 std::pair<AliAnalysisTaskDmesonJets::EMesonOrigin_t, AliAODMCParticle*> result(
kUnknownQuark, 0);
1531 if (!part)
return result;
1532 if (!mcArray)
return result;
1534 static std::set<UInt_t> partons = { 4, 5 };
1538 result.second = parton;
1539 UInt_t absPdgParton = TMath::Abs(parton->GetPdgCode());
1540 if (absPdgParton == 4) result.first =
kFromCharm;
1541 else if (absPdgParton == 5) result.first =
kFromBottom;
1557 static std::set<UInt_t> pdgSet;
1573 AliAODMCParticle* result =
nullptr;
1575 Int_t mother = part->GetMother();
1576 while (mother >= 0) {
1577 AliAODMCParticle* mcGranma =
static_cast<AliAODMCParticle*
>(mcArray->At(mother));
1579 UInt_t abspdgGranma = TMath::Abs(mcGranma->GetPdgCode());
1582 if (pdgSet.empty() || pdgSet.count(abspdgGranma) > 0) {
1587 if (mother == mcGranma->GetMother()) {
1588 AliWarningClassStream() <<
"Particle " << mother <<
" (PDG=" << mcGranma->PdgCode() <<
") is the mother of itself!?" << std::endl;
1591 mother = mcGranma->GetMother();
1594 AliErrorClassStream() <<
"Could not retrieve mother particle " << mother <<
"!" << std::endl;
1606 jetDef.fJets.clear();
1630 std::map<AliHFJetDefinition*,Double_t> maxJetPt;
1634 Int_t nAccCharm[3] = {0};
1635 for (
Int_t icharm = 0; icharm < nD; icharm++) {
1637 if (!charmCand)
continue;
1642 Int_t nMassHypo = 0;
1643 if (charmCand->Pt() > maxDPt) maxDPt = charmCand->Pt();
1644 for (
Int_t im = 0; im < 2; im++) {
1649 for (
auto& def : fJetDefinitions) {
1650 if (
FindJet(charmCand, DmesonJet, def)) {
1651 Double_t jetPt = DmesonJet.
fJets[def.GetName()].fMomentum.Pt();
1652 if (jetPt > maxJetPt[&def]) maxJetPt[&def] = jetPt;
1655 AliWarning(Form(
"Could not find jet '%s' for D meson '%s': pT = %.3f, eta = %.3f, phi = %.3f",
1664 if (nMassHypo == 2) {
1669 if (nMassHypo == 2) {
1682 ntracks += track_cont->GetNAcceptEntries();
1685 for (
auto& def : fJetDefinitions) {
1686 if (!def.fRho)
continue;
1687 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt",
GetName(), def.GetName());
1690 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt",
GetName(), def.GetName());
1693 hname = TString::Format(
"%s/%s/fHistRhoVsCent",
GetName(), def.GetName());
1696 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent",
GetName(), def.GetName());
1699 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent",
GetName(), def.GetName());
1702 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks",
GetName(), def.GetName());
1705 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks",
GetName(), def.GetName());
1708 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks",
GetName(), def.GetName());
1712 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons",
GetName());
1717 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks",
GetName());
1720 hname = TString::Format(
"%s/fHistNDmesons",
GetName());
1738 if (jetDef.
fRho) rho = jetDef.
fRho->GetVal();
1751 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason",
GetName(), jetDef.
GetName());
1755 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet",
GetName(), jetDef.
GetName());
1758 for (
Int_t i = 0; i < daughters.GetEntriesFast(); i++) {
1759 AliVParticle* daughter =
static_cast<AliVParticle*
>(daughters.At(i));
1760 if (!hftrack_cont->GetArray()->FindObject(daughter)) histDaughterNotInJet->Fill(daughter->Pt());
1768 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason",
GetName(), jetDef.
GetName());
1778 for (
UInt_t ijet = 0; ijet < jets_incl.size(); ++ijet) {
1781 Bool_t isDmesonJet = kFALSE;
1788 for (
UInt_t ic = 0; ic < constituents.size(); ++ic) {
1789 if (constituents[ic].user_index() == 0) {
1790 isDmesonJet = kTRUE;
1792 else if (constituents[ic].user_index() >= 100) {
1793 if (constituents[ic].pt() > maxChPt) maxChPt = constituents[ic].pt();
1796 else if (constituents[ic].user_index() <= -100) {
1797 totalNeutralPt += constituents[ic].pt();
1798 if (constituents[ic].pt() > maxNePt) maxChPt = constituents[ic].pt();
1804 DmesonJet.
fJets[jetDef.
GetName()].fMomentum.SetPxPyPzE(jets_incl[ijet].px(), jets_incl[ijet].py(), jets_incl[ijet].pz(), jets_incl[ijet].E());
1805 DmesonJet.
fJets[jetDef.
GetName()].fNConstituents = nConst;
1806 DmesonJet.
fJets[jetDef.
GetName()].fMaxChargedPt = maxChPt;
1807 DmesonJet.
fJets[jetDef.
GetName()].fMaxNeutralPt = maxNePt;
1808 DmesonJet.
fJets[jetDef.
GetName()].fNEF = totalNeutralPt / jets_incl[ijet].pt();
1809 DmesonJet.
fJets[jetDef.
GetName()].fArea = jets_incl[ijet].area();
1810 DmesonJet.
fJets[jetDef.
GetName()].fCorrPt = DmesonJet.
fJets[jetDef.
GetName()].fMomentum.Pt() - jets_incl[ijet].area() * rho;
1824 auto itcont = cont->all_momentum();
1825 for (AliEmcalIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
1826 UInt_t rejectionReason = 0;
1827 if (!cont->AcceptObject(it.current_index(), rejectionReason)) {
1828 if (rejectHist) rejectHist->Fill(AliEmcalContainer::GetRejectionReasonBitPosition(rejectionReason), it->first.Pt());
1834 if (rejectHist) rejectHist->Fill(6, it->first.Pt());
1838 Int_t uid = offset >= 0 ? it.current_index() + offset: -it.current_index() - offset;
1855 Int_t nAccCharm[3] = {0};
1857 std::map<AliHFJetDefinition*, Double_t> maxJetPt;
1861 maxJetPt[&jetDef] = 0;
1863 if (jetDef.fRho) rho = jetDef.fRho->GetVal();
1864 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents",
GetName(), jetDef.GetName());
1867 switch (jetDef.fJetType) {
1884 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason",
GetName(), jetDef.GetName());
1891 for (
auto jet : jets_incl) {
1892 Int_t nDmesonsInJet = 0;
1894 for (
auto constituent : jet.constituents()) {
1895 Int_t iPart = constituent.user_index() - 100;
1896 if (constituent.perp() < 1e-6)
continue;
1899 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisEngine::RunParticleLevelAnalysis",
"Could not find jet constituent %d!", iPart);
1904 std::map<int, AliDmesonJetInfo>::iterator dMesonJetIt =
fDmesonJets.find(iPart);
1906 if (part->Pt() > maxDPt) maxDPt = part->Pt();
1907 std::pair<int, AliDmesonJetInfo> element;
1908 element.first = iPart;
1910 (*dMesonJetIt).second.fD.SetPxPyPzE(part->Px(), part->Py(), part->Pz(), part->E());
1911 (*dMesonJetIt).second.fDmesonParticle =
part;
1912 (*dMesonJetIt).second.fSelectionType = part->PdgCode() > 0 ? 1 : 2;
1920 while (rs >>= 1) { p++; }
1921 (*dMesonJetIt).second.fPartonType = p;
1922 (*dMesonJetIt).second.fParton = origin.second;
1926 if (part->PdgCode() > 0) {
1934 (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.SetPxPyPzE(jet.px(), jet.py(), jet.pz(), jet.E());
1935 (*dMesonJetIt).second.fJets[jetDef.GetName()].fNConstituents = jet.constituents().size();
1936 (*dMesonJetIt).second.fJets[jetDef.GetName()].fArea = jet.area();
1937 (*dMesonJetIt).second.fJets[jetDef.GetName()].fCorrPt = (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.Pt() - jet.area() * rho;
1938 if (jet.perp() > maxJetPt[&jetDef]) maxJetPt[&jetDef] = jet.perp();
1941 if (nDmesonsInJet > 0) histNDmesonsVsNconstituents->Fill(jet.constituents().size(), nDmesonsInJet);
1947 for (
auto& def : fJetDefinitions) {
1948 if (!def.fRho)
continue;
1949 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt",
GetName(), def.GetName());
1952 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt",
GetName(), def.GetName());
1955 hname = TString::Format(
"%s/%s/fHistRhoVsCent",
GetName(), def.GetName());
1958 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent",
GetName(), def.GetName());
1961 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent",
GetName(), def.GetName());
1964 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks",
GetName(), def.GetName());
1967 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks",
GetName(), def.GetName());
1970 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks",
GetName(), def.GetName());
1974 if (
fDmesonJets.size() != nAccCharm[0]+nAccCharm[1]) AliError(Form(
"I found %lu mesons (%d)?",
fDmesonJets.size(), nAccCharm[0]+nAccCharm[1]));
1975 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons",
GetName());
1980 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks",
GetName());
1983 hname = TString::Format(
"%s/fHistNDmesons",
GetName());
1994 classname =
"AliAnalysisTaskDmesonJets::AliDmesonMCInfoSummary";
2002 classname =
"AliAnalysisTaskDmesonJets::AliD0ExtendedInfoSummary";
2006 classname =
"AliAnalysisTaskDmesonJets::AliD0InfoSummary";
2011 classname =
"AliAnalysisTaskDmesonJets::AliDStarInfoSummary";
2016 TString treeName = TString::Format(
"%s_%s", taskName,
GetName());
2045 AliDebug(2,Form(
"Now working on '%s'", jetDef.GetName()));
2055 title[dim] =
"#it{p}_{T,D} (GeV/#it{c})";
2062 title[dim] =
"#eta_{D}";
2068 title[dim] =
"#phi_{D} (rad)";
2071 max[dim] = TMath::TwoPi();
2076 title[dim] =
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})";
2084 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
2092 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
2099 title[dim] =
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})";
2104 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
2112 title[dim] =
"#it{p}_{T,#pi} (GeV/#it{c})";
2119 title[dim] =
"#it{z}_{D}";
2125 if ((enabledAxis &
kDeltaR) != 0) {
2126 title[dim] =
"#Delta R_{D-jet}";
2129 max[dim] = radius * 1.5;
2134 title[dim] =
"#eta_{D} - #eta_{jet}";
2136 min[dim] = -radius * 1.2;
2137 max[dim] = radius * 1.2;
2142 title[dim] =
"#phi_{D} - #phi_{jet} (rad)";
2144 min[dim] = -radius * 1.2;
2145 max[dim] = radius * 1.2;
2149 title[dim] =
"#it{p}_{T,jet} (GeV/#it{c})";
2156 title[dim] =
"#eta_{jet}";
2162 title[dim] =
"#phi_{jet} (rad)";
2165 max[dim] = TMath::TwoPi();
2170 title[dim] =
"No. of constituents";
2177 hname = TString::Format(
"%s/%s/fDmesonJets",
GetName(), jetDef.GetName());
2179 for (
Int_t j = 0; j < dim; j++) {
2180 h->GetAxis(j)->SetTitle(title[j]);
2193 TH1* histAncestor =
nullptr;
2194 TH1* histPrompt =
nullptr;
2197 hname = TString::Format(
"%s/fHistPrompt",
GetName());
2200 hname = TString::Format(
"%s/fHistAncestor",
GetName());
2225 if (dmeson_pair.second.fParton) {
2226 fPartons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
2227 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
2228 if (absPdgParton == 4) {
2229 histPrompt->Fill(
"Prompt", 1);
2231 else if (absPdgParton == 5) {
2232 histPrompt->Fill(
"Non-Prompt", 1);
2235 histPrompt->Fill(
"Unknown", 1);
2239 histPrompt->Fill(
"Unknown", 1);
2244 if (dmeson_pair.second.fAncestor) {
2245 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
2246 if (absPdgAncestor == 4) {
2247 histAncestor->Fill(
"Charm", 1);
2249 else if (absPdgAncestor == 5) {
2250 histAncestor->Fill(
"Bottom", 1);
2252 else if (absPdgAncestor == 2212) {
2253 histAncestor->Fill(
"Proton", 1);
2256 histAncestor->Fill(
"Unknown", 1);
2260 histAncestor->Fill(
"Unknown", 1);
2267 hname = TString::Format(
"%s/fHistRejectedDMesonPt",
GetName());
2269 hname = TString::Format(
"%s/fHistRejectedDMesonPhi",
GetName());
2271 hname = TString::Format(
"%s/fHistRejectedDMesonEta",
GetName());
2275 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass",
GetName());
2279 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass",
GetName());
2282 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass",
GetName());
2283 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
2290 hname = TString::Format(
"%s/fHistPartonPt",
GetName());
2292 hname = TString::Format(
"%s/fHistPartonEta",
GetName());
2294 hname = TString::Format(
"%s/fHistPartonPhi",
GetName());
2296 hname = TString::Format(
"%s/fHistPartonType",
GetName());
2300 if (!parton.first)
continue;
2301 histPartonPt->Fill(parton.first->Pt());
2302 histPartonEta->Fill(parton.first->Eta());
2303 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
2304 histPartonType->Fill(parton.second);
2319 TH1* histAncestor =
nullptr;
2320 TH1* histPrompt =
nullptr;
2323 hname = TString::Format(
"%s/fHistPrompt",
GetName());
2326 hname = TString::Format(
"%s/fHistAncestor",
GetName());
2349 if (dmeson_pair.second.fParton) {
2350 fPartons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
2351 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
2352 if (absPdgParton == 4) {
2353 histPrompt->Fill(
"Prompt", 1);
2355 else if (absPdgParton == 5) {
2356 histPrompt->Fill(
"Non-Prompt", 1);
2359 histPrompt->Fill(
"Unknown", 1);
2363 histPrompt->Fill(
"Unknown", 1);
2368 if (dmeson_pair.second.fAncestor) {
2369 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
2370 if (absPdgAncestor == 4) {
2371 histAncestor->Fill(
"Charm", 1);
2373 else if (absPdgAncestor == 5) {
2374 histAncestor->Fill(
"Bottom", 1);
2376 else if (absPdgAncestor == 2212) {
2377 histAncestor->Fill(
"Proton", 1);
2380 histAncestor->Fill(
"Unknown", 1);
2384 histAncestor->Fill(
"Unknown", 1);
2389 hname = TString::Format(
"%s/fHistRejectedDMesonPt",
GetName());
2391 hname = TString::Format(
"%s/fHistRejectedDMesonPhi",
GetName());
2393 hname = TString::Format(
"%s/fHistRejectedDMesonEta",
GetName());
2397 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass",
GetName());
2401 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass",
GetName());
2404 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass",
GetName());
2405 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
2412 hname = TString::Format(
"%s/fHistPartonPt",
GetName());
2414 hname = TString::Format(
"%s/fHistPartonEta",
GetName());
2416 hname = TString::Format(
"%s/fHistPartonPhi",
GetName());
2418 hname = TString::Format(
"%s/fHistPartonType",
GetName());
2422 if (!parton.first)
continue;
2423 histPartonPt->Fill(parton.first->Pt());
2424 histPartonEta->Fill(parton.first->Eta());
2425 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
2426 histPartonType->Fill(parton.second);
2442 hname = TString::Format(
"%s/fHistRejectedDMesonPt",
GetName());
2444 hname = TString::Format(
"%s/fHistRejectedDMesonPhi",
GetName());
2446 hname = TString::Format(
"%s/fHistRejectedDMesonEta",
GetName());
2453 hname = TString::Format(
"%s/%s/fDmesonJets",
GetName(), jetDef.GetName());
2456 for (
auto& dmeson_pair : fDmesonJets) {
2457 const AliJetInfo* jet = dmeson_pair.second.GetJet(jetDef.GetName());
2459 if (!jetDef.IsJetInAcceptance(*jet)) {
2460 hname = TString::Format(
"%s/%s/fHistRejectedJetPt",
GetName(), jetDef.GetName());
2462 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi",
GetName(), jetDef.GetName());
2464 hname = TString::Format(
"%s/%s/fHistRejectedJetEta",
GetName(), jetDef.GetName());
2491 std::map<std::string, AliJetInfo>::const_iterator it = DmesonJet.
fJets.find(n);
2492 if (it == DmesonJet.
fJets.end())
return kFALSE;
2494 for (
Int_t i = 0; i < h->GetNdimensions(); i++) {
2496 if (
title==
"#it{p}_{T,D} (GeV/#it{c})") contents[i] = DmesonJet.
fD.Pt();
2497 else if (
title==
"#eta_{D}") contents[i] = DmesonJet.
fD.Eta();
2500 else if (
title==
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M();
2501 else if (
title==
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M() - DmesonJet.
fInvMass2Prong;
2502 else if (
title==
"#it{p}_{T,#pi} (GeV/#it{c})") contents[i] = DmesonJet.
fSoftPionPt;
2503 else if (
title==
"#it{z}_{D}") contents[i] = z;
2504 else if (
title==
"#Delta R_{D-jet}") contents[i] = deltaR;
2505 else if (
title==
"#eta_{D} - #eta_{jet}") contents[i] = deltaEta;
2506 else if (
title==
"#phi_{D} - #phi_{jet} (rad)") contents[i] = deltaPhi;
2507 else if (
title==
"#it{p}_{T,jet} (GeV/#it{c})") contents[i] = (*it).second.Pt();
2508 else if (
title==
"#eta_{jet}") contents[i] = (*it).second.Eta();
2509 else if (
title==
"#phi_{jet} (rad)") contents[i] = (*it).second.Phi_0_2pi();
2510 else if (
title==
"No. of constituents") contents[i] = (*it).second.fNConstituents;
2511 else AliWarning(Form(
"Unable to fill dimension '%s'!",
title.Data()));
2565 for (
Int_t i = 0; i < nOutputTrees; i++){
2566 DefineOutput(2+i, TTree::Class());
2585 TFile* filecuts = TFile::Open(cutfname);
2586 if (!filecuts || filecuts->IsZombie()) {
2587 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Input file not found: will use std cuts.");
2591 if (filecuts) analysiscuts =
dynamic_cast<AliRDHFCuts*
>(filecuts->Get(cutsname));
2593 if (!analysiscuts) {
2594 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Could not find analysis cuts '%s' in '%s'.", cutsname.Data(), cutfname.Data());
2600 ::Info(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Cuts '%s' loaded from file '%s'", cutsname.Data(), cutfname.Data());
2603 return analysiscuts;
2637 if (!cutfname.IsNull()) {
2643 cutsname =
"D0toKpiCuts";
2646 cutsname =
"DStartoKpipiCuts";
2652 if (!cuttype.IsNull()) {
2653 cutsname += TString::Format(
"_%s", cuttype.Data());
2657 if (cuts) cuts->PrintAll();
2667 ::Info(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"A new analysis engine '%s' has been added. The total number of analysis engines is %lu.", eng.
GetName(),
fAnalysisEngines.size());
2671 ::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());
2675 if (found_eng->
fRDHFCuts != 0) ::Warning(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"D meson cuts were already defined for this D meson type. They will be overwritten.");
2693 ::Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s", GetName());
2705 Int_t maxTracks = 6000;
2716 hname =
"fHistCharmPt";
2717 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
2720 hname =
"fHistCharmEta";
2721 htitle = hname +
";#eta_{charm};counts";
2724 hname =
"fHistCharmPhi";
2725 htitle = hname +
";#phi_{charm};counts";
2728 hname =
"fHistCharmPt_Eta05";
2729 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
2732 hname =
"fHistBottomPt";
2733 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2736 hname =
"fHistBottomEta";
2737 htitle = hname +
";#eta_{bottom};counts";
2740 hname =
"fHistBottomPhi";
2741 htitle = hname +
";#phi_{bottom};counts";
2744 hname =
"fHistBottomPt_Eta05";
2745 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2748 hname =
"fHistHighestPartonPt";
2749 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2752 hname =
"fHistHighestPartonType";
2753 htitle = hname +
";type;counts";
2756 hname =
"fHistNHeavyQuarks";
2757 htitle = hname +
";number of heavy-quarks;counts";
2760 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for task '%s' (%lu analysis engines)", GetName(),
fAnalysisEngines.size());
2762 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for analysis engine '%s' (%lu jet definitions)", param.GetName(), param.fJetDefinitions.size());
2766 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", param.GetName());
2767 htitle = hname +
";#it{N}_{tracks};#it{N}_{D};events";
2770 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", param.GetName());
2771 htitle = hname +
";;#it{N}_{D}";
2774 hname = TString::Format(
"%s/fHistNDmesons", param.GetName());
2775 htitle = hname +
";#it{N}_{D};events";
2778 hname = TString::Format(
"%s/fHistNEvents", param.GetName());
2779 htitle = hname +
";Event status;counts";
2781 h->GetXaxis()->SetBinLabel(1,
"Accepted");
2782 h->GetXaxis()->SetBinLabel(2,
"Rejected");
2784 hname = TString::Format(
"%s/fHistEventRejectionReasons", param.GetName());
2785 htitle = hname +
";Rejection reason;counts";
2788 hname = TString::Format(
"%s/fHistRejectedDMesonPt", param.GetName());
2789 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});counts";
2792 hname = TString::Format(
"%s/fHistRejectedDMesonEta", param.GetName());
2793 htitle = hname +
";#it{#eta}_{D};counts";
2796 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", param.GetName());
2797 htitle = hname +
";#it{#phi}_{D};counts";
2802 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", param.GetName());
2803 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2810 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", param.GetName());
2811 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2815 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
2816 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", param.GetName());
2817 htitle = hname +
";#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2824 hname = TString::Format(
"%s/fHistPartonPt", param.GetName());
2825 htitle = hname +
";#it{p}_{T,parton} (GeV/#it{c});counts";
2828 hname = TString::Format(
"%s/fHistPartonEta", param.GetName());
2829 htitle = hname +
";#eta_{parton};counts";
2832 hname = TString::Format(
"%s/fHistPartonPhi", param.GetName());
2833 htitle = hname +
";#phi_{parton};counts";
2836 hname = TString::Format(
"%s/fHistPartonType", param.GetName());
2837 htitle = hname +
";type;counts";
2840 hname = TString::Format(
"%s/fHistPrompt", param.GetName());
2841 htitle = hname +
";Type;counts";
2843 h->GetXaxis()->SetBinLabel(1,
"Unknown");
2844 h->GetXaxis()->SetBinLabel(2,
"Prompt");
2845 h->GetXaxis()->SetBinLabel(3,
"Non-Prompt");
2847 hname = TString::Format(
"%s/fHistAncestor", param.GetName());
2848 htitle = hname +
";Ancestor;counts";
2850 h->GetXaxis()->SetBinLabel(1,
"Unknown");
2851 h->GetXaxis()->SetBinLabel(2,
"Charm");
2852 h->GetXaxis()->SetBinLabel(3,
"Bottom");
2853 h->GetXaxis()->SetBinLabel(4,
"Proton");
2856 for (
auto& jetDef : param.fJetDefinitions) {
2857 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for jet definition '%s'", jetDef.GetName());
2860 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents", param.GetName(), jetDef.GetName());
2861 htitle = hname +
";#it{N}_{constituents};#it{N}_{D};counts";
2865 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason", param.GetName(), jetDef.GetName());
2866 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
2870 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason", param.GetName(), jetDef.GetName());
2871 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
2875 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason", param.GetName(), jetDef.GetName());
2876 htitle = hname +
";Cluster rejection reason;#it{p}_{T,cluster} (GeV/#it{c});counts";
2880 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet", param.GetName(), jetDef.GetName());
2881 htitle = hname +
";#it{p}_{T,track} (GeV/#it{c});counts";
2884 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", param.GetName(), jetDef.GetName());
2885 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});counts";
2888 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", param.GetName(), jetDef.GetName());
2889 htitle = hname +
";#it{#eta}_{jet};counts";
2892 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", param.GetName(), jetDef.GetName());
2893 htitle = hname +
";#it{#phi}_{jet};counts";
2896 if (!jetDef.fRhoName.IsNull()) {
2897 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", param.GetName(), jetDef.GetName());
2898 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
2901 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", param.GetName(), jetDef.GetName());
2902 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
2905 hname = TString::Format(
"%s/%s/fHistRhoVsCent", param.GetName(), jetDef.GetName());
2906 htitle = hname +
";Centrality (%);#rho (GeV/#it{c} #times rad^{-1});counts";
2909 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", param.GetName(), jetDef.GetName());
2910 htitle = hname +
";Centrality (%);#it{p}_{T,jet} (GeV/#it{c});counts";
2913 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", param.GetName(), jetDef.GetName());
2914 htitle = hname +
";Centrality (%);#it{p}_{T,D} (GeV/#it{c});counts";
2917 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", param.GetName(), jetDef.GetName());
2918 htitle = hname +
";no. of tracks;#rho (GeV/#it{c} #times rad^{-1});counts";
2921 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", param.GetName(), jetDef.GetName());
2922 htitle = hname +
";no. of tracks;#it{p}_{T,jet} (GeV/#it{c});counts";
2925 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", param.GetName(), jetDef.GetName());
2926 htitle = hname +
";no. of tracks;#it{p}_{T,D} (GeV/#it{c});counts";
2932 param.BuildTree(GetName());
2934 param.AssignDataSlot(treeSlot+2);
2939 AliError(Form(
"Number of data output slots %d not sufficient. Tree of analysis engine %s will not be posted!",
fNOutputTrees, param.GetName()));
2970 AliError(Form(
"This task need an AOD event (Task '%s'). Expect troubles...", GetName()));
2988 params.fRandomGen = rnd;
2990 for (
auto &jetdef: params.fJetDefinitions) {
2991 if (!jetdef.fRhoName.IsNull()) {
2992 jetdef.fRho =
dynamic_cast<AliRhoParameter*
>(fInputEvent->FindListObject(jetdef.fRhoName));
2994 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2995 "%s: Could not find rho object '%s' for engine '%s'",
2996 GetName(), jetdef.fRhoName.Data(), params.GetName());
3001 if (!params.fRDHFCuts) {
3003 ::Warning(
"AliAnalysisTaskDmesonJets::ExecOnce",
3004 "%s: RDHF cuts not provided for engine '%s'.",
3005 GetName(), params.GetName());
3008 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3009 "%s: RDHF cuts not provided. Engine '%s' disabled.",
3010 GetName(), params.GetName());
3011 params.fInhibit = kTRUE;
3017 for (
auto cont_it : fParticleCollArray) {
3019 if (track_cont) params.fTrackContainers.push_back(track_cont);
3022 for (
auto cont_it :
fClusterCollArray) params.fClusterContainers.push_back(cont_it.second);
3027 params.fCandidateArray =
dynamic_cast<TClonesArray*
>(
fAodEvent->GetList()->FindObject(params.fBranchName.Data()));
3029 if (params.fCandidateArray) {
3032 className =
"AliAODRecoDecayHF2Prong";
3035 className =
"AliAODRecoCascadeHF";
3037 if (!params.fCandidateArray->GetClass()->InheritsFrom(className)) {
3038 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3039 "%s: Objects of type %s in %s are not inherited from %s! Task will be disabled!",
3040 GetName(), params.fCandidateArray->GetClass()->GetName(), params.fCandidateArray->GetName(), className.Data());
3041 params.fCandidateArray = 0;
3042 params.fInhibit = kTRUE;
3046 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3047 "Could not find candidate array '%s', skipping the event. Analysis engine '%s' will be disabled!",
3048 params.fBranchName.Data(), params.GetName());
3049 params.fInhibit = kTRUE;
3053 if (params.fMCMode !=
kNoMC) {
3054 if (!params.fMCContainer) {
3055 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3056 "No MC particle container was provided. Analysis engine '%s' will be disabled!",
3058 params.fInhibit = kTRUE;
3063 if (params.fTrackContainers.size() == 0 && params.fClusterContainers.size() == 0) {
3064 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3065 "No track container and no cluster container were provided. Analysis engine '%s' will be disabled!",
3067 params.fInhibit = kTRUE;
3085 if (eng.fInhibit)
continue;
3086 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3094 if (matchingAODdeltaAODlevel <= 0) {
3097 if (eng.fInhibit)
continue;
3098 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3106 eng.fDmesonJets.clear();
3107 if (eng.fInhibit)
continue;
3112 hname = TString::Format(
"%s/fHistNEvents", eng.GetName());
3114 Bool_t iseventselected = kTRUE;
3115 if (eng.fRDHFCuts) iseventselected = eng.fRDHFCuts->IsEventSelected(
fAodEvent);
3116 if (!iseventselected) {
3118 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3119 UInt_t bitmap = eng.fRDHFCuts->GetEventRejectionBitMap();
3123 if (label.IsNull())
break;
3133 AliDebug(2,
"Event selected");
3146 if (param.fInhibit)
continue;
3166 Int_t absPdgHighParton = 0;
3167 for (
auto part : itcont) {
3168 Int_t absPdgCode = TMath::Abs(
part.second->GetPdgCode());
3171 if (absPdgCode > 9 && absPdgCode != 21)
continue;
3174 if (highestPartonPt <
part.first.Pt()) {
3175 highestPartonPt =
part.first.Pt();
3176 absPdgHighParton = absPdgCode;
3192 if (absPdgCode != 4 && absPdgCode != 5)
continue;
3193 Bool_t notLastInPartonShower = kFALSE;
3194 for (
Int_t idaugh = 0; idaugh < 2; idaugh++){
3195 Int_t daughterIndex =
part.second->GetDaughter(idaugh);
3196 if (daughterIndex < 0) {
3197 AliDebug(10, Form(
"Could not find daughter of heavy quark (pdg=%d, pt=%.3f)!", absPdgCode,
part.first.Pt()));
3202 AliDebug(10, Form(
"Could not find daughter %d of heavy quark (pdg=%d, pt=%.3f)!", daughterIndex, absPdgCode,
part.first.Pt()));
3205 Int_t daughterAbsPdgCode = TMath::Abs(daughter->GetPdgCode());
3206 if (daughterAbsPdgCode <= 9 || daughterAbsPdgCode == 21) notLastInPartonShower = kTRUE;
3207 AliDebug(10, Form(
"Found daughter with PDG=%d, pt=%.3f", daughterAbsPdgCode, daughter->Pt()));
3209 if (notLastInPartonShower)
continue;
3211 if (absPdgCode == 4) {
3217 else if (absPdgCode == 5) {
3227 Int_t partonType = 0;
3228 if (absPdgHighParton == 9 || absPdgHighParton == 21) {
3232 partonType = absPdgHighParton;
3246 TParticlePDG*
part = TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg));
3251 if (nbins % 2 == 0) {
3252 minMass = mass - range / 2 - range / nbins / 2;
3253 maxMass = mass + range / 2 - range / nbins / 2;
3256 minMass = mass - range / 2;
3257 maxMass = mass + range / 2;
3272 label =
"NotSelTrigger";
3274 return label.Data();
3279 return label.Data();
3282 label =
"TooFewVtxContrib";
3284 return label.Data();
3287 label =
"ZVtxOutFid";
3289 return label.Data();
3294 return label.Data();
3297 label =
"OutsideCentrality";
3299 return label.Data();
3302 label =
"PhysicsSelection";
3304 return label.Data();
3307 label =
"BadSPDVertex";
3309 return label.Data();
3312 label =
"ZVtxSPDOutFid";
3314 return label.Data();
3317 label =
"CentralityFlattening";
3319 return label.Data();
3322 label =
"BadTrackV0Correl";
3324 return label.Data();
3327 return label.Data();
3359 ::Error(
"AddTaskDmesonJets",
"No analysis manager to connect to.");
3364 AliVEventHandler* handler = mgr->GetInputEventHandler();
3366 ::Error(
"AddTaskEmcalJetSpectraQA",
"This task requires an input event handler");
3372 if (handler->InheritsFrom(
"AliESDInputHandler")) {
3375 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
3380 if (ntracks ==
"usedefault") {
3381 if (dataType ==
kESD) {
3384 else if (dataType ==
kAOD) {
3392 if (nclusters ==
"usedefault") {
3393 if (dataType ==
kESD) {
3394 nclusters =
"CaloClusters";
3396 else if (dataType ==
kAOD) {
3397 nclusters =
"caloClusters";
3404 if (nMCpart ==
"usedefault") {
3405 nMCpart =
"mcparticles";
3408 TString name(
"AliAnalysisTaskDmesonJets");
3409 if (strcmp(suffix,
"") != 0) {
3410 name += TString::Format(
"_%s", suffix.Data());
3415 if (!ntracks.IsNull()) {
3417 jetTask->AdoptParticleContainer(trackCont);
3420 if (!nMCpart.IsNull()) {
3422 partCont->SetEtaLimits(-1.5, 1.5);
3423 partCont->SetPtLimits(0, 1000);
3424 jetTask->AdoptParticleContainer(partCont);
3427 jetTask->AddClusterContainer(nclusters.Data());
3430 mgr->AddTask(jetTask);
3433 AliAnalysisDataContainer* cinput1 = mgr->GetCommonInputContainer();
3435 contname1 +=
"_histos";
3436 AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(contname1.Data(),
3437 TList::Class(), AliAnalysisManager::kOutputContainer,
3438 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3440 mgr->ConnectInput(jetTask, 0, cinput1);
3441 mgr->ConnectOutput(jetTask, 1, coutput1);
3443 for (
Int_t i = 0; i < nMaxTrees; i++) {
3444 TString contname = TString::Format(
"%s_tree_%d", name.Data(), i);
3445 AliAnalysisDataContainer *coutput = mgr->CreateContainer(contname.Data(),
3446 TTree::Class(),AliAnalysisManager::kOutputContainer,
3447 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3448 mgr->ConnectOutput(jetTask, 2+i, coutput);
Int_t GetNConstituents() 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.
void Print() const
Prints the content of this object in the standard output.
void UserCreateOutputObjects()
AliDmesonInfoSummary * fCurrentDmesonJetInfo
! Current D meson jet info
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.
Bool_t FillTree(Bool_t applyKinCuts)
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.
TList * fOutput
!output list
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)
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.
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="")
Double_t fTrackEfficiency
Artificial tracking inefficiency (0...1)
void SetJetEtaRange(Double_t min, Double_t max)
Bool_t FillHnSparse(Bool_t applyKinCuts)
std::vector< AliClusterContainer * > fClusterContainers
! Cluster containers
Double32_t fPhi
Phi of the D meson.
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
void SetRDHFCuts(AliRDHFCuts *cuts)
const char * what() const noexcept
Double_t fMaxNeutralPt
Transverse momentum of the leading neutral particle (or cluster)
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 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)
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
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 BuildHnSparse(UInt_t enabledAxis)
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
Int_t fDataSlotNumber
! Data slot where the tree output is posted
virtual void Reset()
Reset the current object.
EFindParticleOriginMode_t
Double32_t fPtPi
Transverse momentum of the pion.
void Init(const AliEMCALGeometry *const geom, Int_t runNumber)
Initialize the analysis engine.
static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco)
AliVParticle * fDmesonParticle
! pointer to the particle object
Double32_t fd0d0
D0K * D0Pi.
TString part
use mixed event to constrain combinatorial background
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)
virtual void Set(const AliDmesonJetInfo &source)
AliAODEvent * fAodEvent
! AOD event
Double32_t fN
Number of jet constituents.
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
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.
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.
AliAnalysisTaskDmesonJets()
This is the default constructor, used for ROOT I/O purposes.
virtual void Reset()
Reset the current object.
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.
Bool_t fD0D0bar
! kTRUE if selected both as D0 and D0bar
Int_t GetDataSlotNumber() const
Double_t fRadius
Jet radius.
Double_t fMinJetPt
Minimum jet pT.
TTree * fTree
! Output tree
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.
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.
friend bool operator<(const AliHFJetDefinition &lhs, const AliHFJetDefinition &rhs)
void SetChargedPtRange(Double_t min, Double_t max)
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.
Short_t fPartonType
! type of the parton in the shower tree (only for particle level D mesons)
TClonesArray * fCandidateArray
! D meson candidate array
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.
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
friend bool operator==(const AliHFJetDefinition &lhs, const AliHFJetDefinition &rhs)
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.
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
Bool_t IsSpecialPDGFound() const
std::map< AliAODMCParticle *, Short_t > fPartons
! set of the partons in the shower that produced each D meson
Bool_t fRejectISR
! Reject initial state radiation
virtual ~AnalysisEngine()
void RunParticleLevelAnalysis()
Run a particle level analysis.
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
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.
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)
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.
Float_t fMaxPt
Histogram pt limit.
Double_t CosPointingAngle() const
Int_t fNOutputTrees
Maximum number of output trees.
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.
AliJetInfoSummary ** fCurrentJetInfo
! Current jet info
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
AliFJWrapper * fFastJetWrapper
! Fastjet wrapper
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)
Bool_t IsAnyJetInAcceptance(const AliDmesonJetInfo &dMesonJet) const
Double_t fCent
! Event centrality
Double_t fCent
!event centrality
void SetCharge(EChargeCut_t c)
Container for jet within the EMCAL jet framework.
void SetRejectISR(Bool_t b)
Double32_t fPartonType
Parton type.
Int_t PostDataFromAnalysisEngine(const AnalysisEngine &eng)
AliFJWrapper * fFastJetWrapper
! Fastjet wrapper
THistManager fHistManager
Histogram manager.
void Reset()
Reset all fields to their default values.
static AliAnalysisTaskDmesonJets * AddTaskDmesonJets(TString ntracks="usedefault", TString nclusters="usedefault", TString nMCpart="", Int_t nMaxTrees=2, TString suffix="")
TTree * BuildTree(const char *taskName)
virtual void Set(const AliDmesonJetInfo &source, std::string n)
Bool_t FillQA(Bool_t applyKinCuts)
Double_t fMinMass
Min mass in histogram axis.
Double32_t fDCA
Distance of closest approach.