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),
132 fDmesonParticle(source.fDmesonParticle),
134 fSoftPionPt(source.fSoftPionPt),
135 fInvMass2Prong(source.fInvMass2Prong),
137 fMCLabel(source.fMCLabel),
138 fReconstructed(source.fReconstructed),
139 fParton(source.fParton),
140 fPartonType(source.fPartonType),
141 fAncestor(source.fAncestor),
142 fD0D0bar(source.fD0D0bar),
143 fSelectionType(source.fSelectionType),
144 fEvent(source.fEvent)
160 fD.SetPtEtaPhiE(0,0,0,0);
165 fReconstructed = kFALSE;
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());
184 Printf(
"Soft pion pT: %.3f. 2-Prong Invariant mass = %.3f", fSoftPionPt, fInvMass2Prong);
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;
262 return GetDistance((*it).second, deta, dphi);
273 return GetDistance(n, deta, dphi);
284 dphi = TVector2::Phi_mpi_pi(fD.Phi() - jet.
Phi());;
285 deta = fD.Eta() - jet.
Eta();
286 return TMath::Sqrt(dphi*dphi + deta*deta);
297 return GetDistance(jet, deta, dphi);
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;
424 fArea = source.
fArea;
460 fPt = source.
fD.Pt();
461 fEta = source.
fD.Eta();
501 fPartonPt = source.
fParton->Pt();
532 fInvMass(source.fD.M()),
542 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)) {
622 fMaxNormd0 = normdd0;
659 f2ProngInvMass(source.fInvMass2Prong),
660 fDeltaInvMass(source.fD.M() - source.fInvMass2Prong)
770 fJetType(source.fJetType),
771 fRadius(source.fRadius),
772 fJetAlgo(source.fJetAlgo),
773 fRecoScheme(source.fRecoScheme),
774 fMinJetPt(source.fMinJetPt),
775 fMaxJetPt(source.fMaxJetPt),
776 fMinJetPhi(source.fMinJetPhi),
777 fMaxJetPhi(source.fMaxJetPhi),
778 fMinJetEta(source.fMinJetEta),
779 fMaxJetEta(source.fMaxJetEta),
780 fMinChargedPt(source.fMinChargedPt),
781 fMaxChargedPt(source.fMaxChargedPt),
782 fMinNeutralPt(source.fMinNeutralPt),
783 fMaxNeutralPt(source.fMaxNeutralPt),
784 fRhoName(source.fRhoName),
814 if (fMinJetEta < fMaxJetEta && (jet.
Eta() < fMinJetEta || jet.
Eta() > fMaxJetEta))
return kFALSE;
815 if (fMinJetPhi < fMaxJetPhi && (jet.
Phi() < fMinJetPhi || jet.
Phi() > fMaxJetPhi))
return kFALSE;
816 if (fMinJetPt < fMaxJetPt && (jet.
Pt() > fMaxJetPt || jet.
Pt() < fMinJetPt))
return kFALSE;
830 if (!jet)
return kFALSE;
831 return IsJetInAcceptance((*jet));
904 fCurrentDmesonJetInfo(0),
909 fClusterContainers(),
927 fCandidateType(type),
934 fNMassBins(nMassBins),
949 fCurrentDmesonJetInfo(0),
954 fClusterContainers(),
968 fPartons(source.fPartons),
969 fCandidateType(source.fCandidateType),
970 fCandidateName(source.fCandidateName),
971 fCandidatePDG(source.fCandidatePDG),
972 fNDaughters(source.fNDaughters),
973 fPDGdaughters(source.fPDGdaughters),
974 fBranchName(source.fBranchName),
975 fMCMode(source.fMCMode),
976 fNMassBins(source.fNMassBins),
977 fMinMass(source.fMinMass),
978 fMaxMass(source.fMaxMass),
980 fRejectedOrigin(source.fRejectedOrigin),
981 fAcceptedDecay(source.fAcceptedDecay),
982 fInhibit(source.fInhibit),
983 fJetDefinitions(source.fJetDefinitions),
984 fPtBinWidth(source.fPtBinWidth),
985 fMaxPt(source.fMaxPt),
986 fD0Extended(source.fD0Extended),
987 fRandomGen(source.fRandomGen),
991 fCurrentDmesonJetInfo(0),
993 fCandidateArray(source.fCandidateArray),
995 fTrackContainers(source.fTrackContainers),
996 fClusterContainers(source.fClusterContainers),
1025 for (
UInt_t i = 0; i < fJetDefinitions.size(); i++) {
1026 if (fJetDefinitions[i].IsJetInAcceptance(dMesonJet, fJetDefinitions[i].GetName()))
return kTRUE;
1042 switch (fCandidateType) {
1044 fCandidatePDG = 421;
1045 fCandidateName =
"D0";
1047 fPDGdaughters.Set(fNDaughters);
1048 fPDGdaughters.Reset();
1049 fPDGdaughters[0] = 211;
1050 fPDGdaughters[1] = 321;
1051 fBranchName =
"D0toKpi";
1055 fCandidatePDG = 421;
1056 fCandidateName =
"2ProngLikeSign";
1058 fPDGdaughters.Set(fNDaughters);
1059 fPDGdaughters.Reset();
1060 fPDGdaughters[0] = 211;
1061 fPDGdaughters[1] = 321;
1062 fBranchName =
"LikeSign2Prong";
1065 fCandidatePDG = 413;
1066 fCandidateName =
"DStar";
1068 fPDGdaughters.Set(fNDaughters);
1069 fPDGdaughters.Reset();
1070 fPDGdaughters[0] = 211;
1071 fPDGdaughters[1] = 211;
1072 fPDGdaughters[2] = 321;
1073 fBranchName =
"Dstar";
1077 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisEngine::SetCandidateProperties",
"Candidate %d unknown!", fCandidateType);
1088 if (fRDHFCuts)
delete fRDHFCuts;
1098 if (fRDHFCuts)
delete fRDHFCuts;
1099 fRDHFCuts =
static_cast<AliRDHFCuts*
>(cuts->Clone());
1109 name = TString::Format(
"%s_%s", GetName(), jetDef.
GetName());
1119 fName = fCandidateName;
1122 fName +=
"_kBackgroundOnly";
1125 fName +=
"_kSignalOnly";
1128 fName +=
"_MCTruth";
1131 fName +=
"_WrongPID";
1137 if (fRDHFCuts) fName += TString::Format(
"_%s", fRDHFCuts->GetName());
1139 return fName.Data();
1150 std::vector<AliHFJetDefinition>::iterator it = FindJetDefinition(def);
1152 if (it == fJetDefinitions.end() || *it != def) {
1153 fJetDefinitions.push_back(def);
1154 ::Info(
"AliAnalysisTaskDmesonJets::AnalysisEngine::AddJetDefinition",
"Jet definition '%s' has been added to analysis engine '%s'."
1155 "Total number of jet definitions is now %lu.",
1156 def.
GetName(), GetName(), fJetDefinitions.size());
1158 if (fMCMode !=
kMCTruth) fJetDefinitions[fJetDefinitions.size()-1].SetChargedPtRange(0., 100.);
1161 ::Warning(
"AliAnalysisTaskDmesonJets::AnalysisEngine::AddJetDefinition",
"The same jet definition '%s' was already added in analysis engine '%s'.", def.
GetName(), GetName());
1181 return AddJetDefinition(def);
1191 std::vector<AliHFJetDefinition>::iterator it = fJetDefinitions.begin();
1192 while (it != fJetDefinitions.end() && (*it) != def) it++;
1201 for (
auto &jetdef : fJetDefinitions) jetdef.SetJetPhiRange(min, max);
1209 for (
auto &jetdef : fJetDefinitions) jetdef.SetJetEtaRange(min, max);
1217 for (
auto &jetdef : fJetDefinitions) jetdef.SetJetPtRange(min, max);
1225 for (
auto &jetdef : fJetDefinitions) jetdef.SetChargedPtRange(min, max);
1233 for (
auto &jetdef : fJetDefinitions) jetdef.SetNeutralPtRange(min, max);
1291 return ExtractD0Attributes(Dcand, DmesonJet, i);
1294 return ExtractDstarAttributes(static_cast<const AliAODRecoCascadeHF*>(Dcand), DmesonJet, i);
1310 AliDebug(10,
"Checking if D0 meson is selected");
1312 if (isSelected == 0)
return kFALSE;
1314 Int_t MCtruthPdgCode = 0;
1321 Int_t mcLab = Dcand->MatchToMC(fCandidatePDG,
fMCContainer->GetArray(), fNDaughters, fPDGdaughters.GetArray());
1326 AliAODMCParticle* aodMcPart =
static_cast<AliAODMCParticle*
>(
fMCContainer->GetArray()->At(mcLab));
1330 if (fRejectedOrigin) {
1331 auto origin = IsPromptCharm(aodMcPart,
fMCContainer->GetArray());
1332 if ((origin.first & fRejectedOrigin) == origin.first)
return kFALSE;
1334 MCtruthPdgCode = aodMcPart->PdgCode();
1339 if (isSelected == 1) {
1340 if (i != 0)
return kFALSE;
1342 if (fMCMode ==
kNoMC ||
1343 (MCtruthPdgCode == fCandidatePDG && fMCMode ==
kSignalOnly) ||
1345 (MCtruthPdgCode == -fCandidatePDG && fMCMode ==
kWrongPID)) {
1347 AliDebug(10,
"Selected as D0");
1354 else if (isSelected == 2) {
1355 if (i != 1)
return kFALSE;
1357 if (fMCMode ==
kNoMC ||
1358 (MCtruthPdgCode == -fCandidatePDG && fMCMode ==
kSignalOnly) ||
1360 (MCtruthPdgCode == fCandidatePDG && fMCMode ==
kWrongPID)) {
1362 AliDebug(10,
"Selected as D0bar");
1369 else if (isSelected == 3) {
1370 AliDebug(10,
"Selected as either D0 or D0bar");
1373 if ((MCtruthPdgCode == fCandidatePDG && fMCMode ==
kSignalOnly) ||
1375 if (i != 0)
return kFALSE;
1376 AliDebug(10,
"MC truth is D0");
1379 else if ((MCtruthPdgCode == -fCandidatePDG && fMCMode ==
kSignalOnly) ||
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));
1441 if (fRejectedOrigin) {
1442 auto origin = IsPromptCharm(aodMcPart,
fMCContainer->GetArray());
1443 if ((origin.first & fRejectedOrigin) == origin.first)
return kFALSE;
1446 MCtruthPdgCode = aodMcPart->PdgCode();
1447 AliDebug(10, Form(
"MC truth pdg code is %d",MCtruthPdgCode));
1452 Int_t absMCtruthPdgCode = TMath::Abs(MCtruthPdgCode);
1453 if (fMCMode ==
kNoMC ||
1454 (absMCtruthPdgCode == 413 && fMCMode ==
kSignalOnly) ||
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) {
1504 Int_t D0decay = CheckDecayChannel(d1, mcArray);
1509 else if (absPdg1 == 211 && absPdg2 == 421) {
1510 Int_t D0decay = CheckDecayChannel(d2, mcArray);
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 };
1536 AliAODMCParticle* parton = FindParticleOrigin(part, mcArray, kFindLast, partons);
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;
1559 return FindParticleOrigin(part, mcArray, mode, 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) {
1585 if (mode == kFindLast)
break;
1587 mother = mcGranma->GetMother();
1590 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisParams::FindParticleOrigin",
"Could not retrieve mother particle %d!", mother);
1601 for (
auto& jetDef : fJetDefinitions) {
1602 jetDef.fJets.clear();
1606 RunParticleLevelAnalysis();
1609 RunDetectorLevelAnalysis();
1621 const Int_t nD = fCandidateArray->GetEntriesFast();
1626 std::map<AliHFJetDefinition*,Double_t> maxJetPt;
1627 for (
auto& def : fJetDefinitions) maxJetPt[&def] = 0;
1630 Int_t nAccCharm[3] = {0};
1631 for (
Int_t icharm = 0; icharm < nD; icharm++) {
1633 if (!charmCand)
continue;
1637 if (!fRDHFCuts->IsInFiducialAcceptance(charmCand->Pt(), charmCand->Y(fCandidatePDG)))
continue;
1638 Int_t nMassHypo = 0;
1639 if (charmCand->Pt() > maxDPt) maxDPt = charmCand->Pt();
1640 for (
Int_t im = 0; im < 2; im++) {
1644 if (ExtractRecoDecayAttributes(charmCand, DmesonJet, im)) {
1645 for (
auto& def : fJetDefinitions) {
1646 if (FindJet(charmCand, DmesonJet, def)) {
1647 Double_t jetPt = DmesonJet.
fJets[def.GetName()].fMomentum.Pt();
1648 if (jetPt > maxJetPt[&def]) maxJetPt[&def] = jetPt;
1651 AliWarning(Form(
"Could not find jet '%s' for D meson '%s': pT = %.3f, eta = %.3f, phi = %.3f",
1652 def.GetName(), GetName(), DmesonJet.
fD.Pt(), DmesonJet.
fD.Eta(), DmesonJet.
fD.
Phi_0_2pi()));
1655 fDmesonJets[(icharm+1)*(1-(im*2))] = DmesonJet;
1660 if (nMassHypo == 2) {
1665 if (nMassHypo == 2) {
1666 fDmesonJets[(icharm+1)].fD0D0bar = kTRUE;
1667 fDmesonJets[-(icharm+1)].fD0D0bar = kTRUE;
1675 for (
auto track_cont : fTrackContainers) {
1678 ntracks += track_cont->GetNAcceptEntries();
1681 for (
auto& def : fJetDefinitions) {
1682 if (!def.fRho)
continue;
1683 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", GetName(), def.GetName());
1686 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", GetName(), def.GetName());
1689 hname = TString::Format(
"%s/%s/fHistRhoVsCent", GetName(), def.GetName());
1692 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", GetName(), def.GetName());
1695 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", GetName(), def.GetName());
1698 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", GetName(), def.GetName());
1701 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", GetName(), def.GetName());
1704 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", GetName(), def.GetName());
1708 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", GetName());
1713 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", GetName());
1716 hname = TString::Format(
"%s/fHistNDmesons", GetName());
1734 if (jetDef.
fRho) rho = jetDef.
fRho->GetVal();
1744 for (
auto track_cont : fTrackContainers) {
1747 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason", GetName(), jetDef.
GetName());
1751 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet", GetName(), jetDef.
GetName());
1754 for (
Int_t i = 0; i < daughters.GetEntriesFast(); i++) {
1755 AliVParticle* daughter =
static_cast<AliVParticle*
>(daughters.At(i));
1756 if (!hftrack_cont->GetArray()->FindObject(daughter)) histDaughterNotInJet->Fill(daughter->Pt());
1763 for (
auto clus_cont : fClusterContainers) {
1764 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason", GetName(), jetDef.
GetName());
1774 for (
UInt_t ijet = 0; ijet < jets_incl.size(); ++ijet) {
1777 Bool_t isDmesonJet = kFALSE;
1784 for (
UInt_t ic = 0; ic < constituents.size(); ++ic) {
1785 if (constituents[ic].user_index() == 0) {
1786 isDmesonJet = kTRUE;
1788 else if (constituents[ic].user_index() >= 100) {
1789 if (constituents[ic].pt() > maxChPt) maxChPt = constituents[ic].pt();
1792 else if (constituents[ic].user_index() <= -100) {
1793 totalNeutralPt += constituents[ic].pt();
1794 if (constituents[ic].pt() > maxNePt) maxChPt = constituents[ic].pt();
1800 DmesonJet.
fJets[jetDef.
GetName()].fMomentum.SetPxPyPzE(jets_incl[ijet].px(), jets_incl[ijet].py(), jets_incl[ijet].pz(), jets_incl[ijet].E());
1801 DmesonJet.
fJets[jetDef.
GetName()].fNConstituents = nConst;
1802 DmesonJet.
fJets[jetDef.
GetName()].fMaxChargedPt = maxChPt;
1803 DmesonJet.
fJets[jetDef.
GetName()].fMaxNeutralPt = maxNePt;
1804 DmesonJet.
fJets[jetDef.
GetName()].fNEF = totalNeutralPt / jets_incl[ijet].pt();
1805 DmesonJet.
fJets[jetDef.
GetName()].fArea = jets_incl[ijet].area();
1806 DmesonJet.
fJets[jetDef.
GetName()].fCorrPt = DmesonJet.
fJets[jetDef.
GetName()].fMomentum.Pt() - jets_incl[ijet].area() * rho;
1820 auto itcont = cont->all_momentum();
1821 for (AliEmcalIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
1822 UInt_t rejectionReason = 0;
1823 if (!cont->AcceptObject(it.current_index(), rejectionReason)) {
1824 if (rejectHist) rejectHist->Fill(AliEmcalContainer::GetRejectionReasonBitPosition(rejectionReason), it->first.Pt());
1827 if (fRandomGen && eff > 0 && eff < 1) {
1830 if (rejectHist) rejectHist->Fill(6, it->first.Pt());
1834 Int_t uid = offset >= 0 ? it.current_index() + offset: -it.current_index() - offset;
1851 Int_t nAccCharm[3] = {0};
1853 std::map<AliHFJetDefinition*, Double_t> maxJetPt;
1856 for (
auto &jetDef : fJetDefinitions) {
1857 maxJetPt[&jetDef] = 0;
1859 if (jetDef.fRho) rho = jetDef.fRho->GetVal();
1860 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents", GetName(), jetDef.GetName());
1863 switch (jetDef.fJetType) {
1880 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason", GetName(), jetDef.GetName());
1887 for (
auto jet : jets_incl) {
1888 Int_t nDmesonsInJet = 0;
1890 for (
auto constituent : jet.constituents()) {
1891 Int_t iPart = constituent.user_index() - 100;
1892 if (constituent.perp() < 1e-6)
continue;
1895 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisEngine::RunParticleLevelAnalysis",
"Could not find jet constituent %d!", iPart);
1898 if (TMath::Abs(part->PdgCode()) == fCandidatePDG) {
1900 std::map<int, AliDmesonJetInfo>::iterator dMesonJetIt = fDmesonJets.find(iPart);
1901 if (dMesonJetIt == fDmesonJets.end()) {
1902 if (part->Pt() > maxDPt) maxDPt = part->Pt();
1903 std::pair<int, AliDmesonJetInfo> element;
1904 element.first = iPart;
1905 dMesonJetIt = fDmesonJets.insert(element).first;
1906 (*dMesonJetIt).second.fD.SetPxPyPzE(part->Px(), part->Py(), part->Pz(), part->E());
1907 (*dMesonJetIt).second.fDmesonParticle = part;
1908 (*dMesonJetIt).second.fSelectionType = part->PdgCode() > 0 ? 1 : 2;
1913 auto origin = IsPromptCharm(part,
fMCContainer->GetArray());
1916 while (rs >>= 1) { p++; }
1917 (*dMesonJetIt).second.fPartonType = p;
1918 (*dMesonJetIt).second.fParton = origin.second;
1920 (*dMesonJetIt).second.fAncestor = FindParticleOrigin(part,
fMCContainer->GetArray(), kFindFirst);
1922 if (part->PdgCode() > 0) {
1930 (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.SetPxPyPzE(jet.px(), jet.py(), jet.pz(), jet.E());
1931 (*dMesonJetIt).second.fJets[jetDef.GetName()].fNConstituents = jet.constituents().size();
1932 (*dMesonJetIt).second.fJets[jetDef.GetName()].fArea = jet.area();
1933 (*dMesonJetIt).second.fJets[jetDef.GetName()].fCorrPt = (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.Pt() - jet.area() * rho;
1934 if (jet.perp() > maxJetPt[&jetDef]) maxJetPt[&jetDef] = jet.perp();
1937 if (nDmesonsInJet > 0) histNDmesonsVsNconstituents->Fill(jet.constituents().size(), nDmesonsInJet);
1943 for (
auto& def : fJetDefinitions) {
1944 if (!def.fRho)
continue;
1945 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", GetName(), def.GetName());
1948 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", GetName(), def.GetName());
1951 hname = TString::Format(
"%s/%s/fHistRhoVsCent", GetName(), def.GetName());
1954 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", GetName(), def.GetName());
1957 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", GetName(), def.GetName());
1960 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", GetName(), def.GetName());
1963 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", GetName(), def.GetName());
1966 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", GetName(), def.GetName());
1970 if (fDmesonJets.size() != nAccCharm[0]+nAccCharm[1]) AliError(Form(
"I found %lu mesons (%d)?", fDmesonJets.size(), nAccCharm[0]+nAccCharm[1]));
1971 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", GetName());
1976 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", GetName());
1979 hname = TString::Format(
"%s/fHistNDmesons", GetName());
1990 classname =
"AliAnalysisTaskDmesonJets::AliDmesonMCInfoSummary";
1994 switch (fCandidateType) {
1998 classname =
"AliAnalysisTaskDmesonJets::AliD0ExtendedInfoSummary";
2002 classname =
"AliAnalysisTaskDmesonJets::AliD0InfoSummary";
2007 classname =
"AliAnalysisTaskDmesonJets::AliDStarInfoSummary";
2012 TString treeName = TString::Format(
"%s_%s", taskName, GetName());
2013 fTree =
new TTree(treeName, treeName);
2014 fTree->Branch(
"DmesonJet", classname, &fCurrentDmesonJetInfo);
2016 for (
Int_t i = 0; i < fJetDefinitions.size(); i++) {
2017 if (fJetDefinitions[i].fRhoName.IsNull()) {
2019 fTree->Branch(fJetDefinitions[i].GetName(),
"AliAnalysisTaskDmesonJets::AliJetInfoSummary", &fCurrentJetInfo[i]);
2023 fTree->Branch(fJetDefinitions[i].GetName(),
"AliAnalysisTaskDmesonJets::AliJetInfoPbPbSummary", &fCurrentJetInfo[i]);
2039 for (
auto &jetDef : fJetDefinitions) {
2041 AliDebug(2,Form(
"Now working on '%s'", jetDef.GetName()));
2051 title[dim] =
"#it{p}_{T,D} (GeV/#it{c})";
2058 title[dim] =
"#eta_{D}";
2064 title[dim] =
"#phi_{D} (rad)";
2067 max[dim] = TMath::TwoPi();
2072 title[dim] =
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})";
2073 nbins[dim] = fNMassBins;
2074 min[dim] = fMinMass;
2075 max[dim] = fMaxMass;
2080 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
2081 nbins[dim] = fNMassBins;
2082 min[dim] = fMinMass;
2083 max[dim] = fMaxMass;
2088 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
2089 nbins[dim] = fNMassBins;
2095 title[dim] =
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})";
2096 nbins[dim] = fNMassBins*6;
2100 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
2108 title[dim] =
"#it{p}_{T,#pi} (GeV/#it{c})";
2115 title[dim] =
"#it{z}_{D}";
2121 if ((enabledAxis &
kDeltaR) != 0) {
2122 title[dim] =
"#Delta R_{D-jet}";
2125 max[dim] = radius * 1.5;
2130 title[dim] =
"#eta_{D} - #eta_{jet}";
2132 min[dim] = -radius * 1.2;
2133 max[dim] = radius * 1.2;
2138 title[dim] =
"#phi_{D} - #phi_{jet} (rad)";
2140 min[dim] = -radius * 1.2;
2141 max[dim] = radius * 1.2;
2145 title[dim] =
"#it{p}_{T,jet} (GeV/#it{c})";
2152 title[dim] =
"#eta_{jet}";
2158 title[dim] =
"#phi_{jet} (rad)";
2161 max[dim] = TMath::TwoPi();
2166 title[dim] =
"No. of constituents";
2173 hname = TString::Format(
"%s/%s/fDmesonJets", GetName(), jetDef.GetName());
2175 for (
Int_t j = 0; j < dim; j++) {
2176 h->GetAxis(j)->SetTitle(title[j]);
2189 TH1* histAncestor =
nullptr;
2190 TH1* histPrompt =
nullptr;
2193 hname = TString::Format(
"%s/fHistPrompt", GetName());
2196 hname = TString::Format(
"%s/fHistAncestor", GetName());
2200 for (
auto& dmeson_pair : fDmesonJets) {
2201 fCurrentDmesonJetInfo->Set(dmeson_pair.second);
2203 for (
UInt_t ij = 0; ij < fJetDefinitions.size(); ij++) {
2204 fCurrentJetInfo[ij]->Reset();
2205 AliJetInfo* jet = dmeson_pair.second.GetJet(fJetDefinitions[ij].GetName());
2207 if (applyKinCuts && !fJetDefinitions[ij].IsJetInAcceptance(*jet)) {
2208 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", GetName(), fJetDefinitions[ij].GetName());
2210 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", GetName(), fJetDefinitions[ij].GetName());
2212 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", GetName(), fJetDefinitions[ij].GetName());
2216 fCurrentJetInfo[ij]->Set(dmeson_pair.second, fJetDefinitions[ij].GetName());
2221 if (dmeson_pair.second.fParton) {
2222 fPartons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
2223 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
2224 if (absPdgParton == 4) {
2225 histPrompt->Fill(
"Prompt", 1);
2227 else if (absPdgParton == 5) {
2228 histPrompt->Fill(
"Non-Prompt", 1);
2231 histPrompt->Fill(
"Unknown", 1);
2235 histPrompt->Fill(
"Unknown", 1);
2240 if (dmeson_pair.second.fAncestor) {
2241 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
2242 if (absPdgAncestor == 4) {
2243 histAncestor->Fill(
"Charm", 1);
2245 else if (absPdgAncestor == 5) {
2246 histAncestor->Fill(
"Bottom", 1);
2248 else if (absPdgAncestor == 2212) {
2249 histAncestor->Fill(
"Proton", 1);
2252 histAncestor->Fill(
"Unknown", 1);
2256 histAncestor->Fill(
"Unknown", 1);
2263 hname = TString::Format(
"%s/fHistRejectedDMesonPt", GetName());
2265 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", GetName());
2267 hname = TString::Format(
"%s/fHistRejectedDMesonEta", GetName());
2271 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", GetName());
2275 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", GetName());
2278 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", GetName());
2279 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
2286 hname = TString::Format(
"%s/fHistPartonPt", GetName());
2288 hname = TString::Format(
"%s/fHistPartonEta", GetName());
2290 hname = TString::Format(
"%s/fHistPartonPhi", GetName());
2292 hname = TString::Format(
"%s/fHistPartonType", GetName());
2295 for (
auto parton : fPartons) {
2296 if (!parton.first)
continue;
2297 histPartonPt->Fill(parton.first->Pt());
2298 histPartonEta->Fill(parton.first->Eta());
2299 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
2300 histPartonType->Fill(parton.second);
2315 TH1* histAncestor =
nullptr;
2316 TH1* histPrompt =
nullptr;
2319 hname = TString::Format(
"%s/fHistPrompt", GetName());
2322 hname = TString::Format(
"%s/fHistAncestor", GetName());
2327 for (
auto& dmeson_pair : fDmesonJets) {
2329 for (
UInt_t ij = 0; ij < fJetDefinitions.size(); ij++) {
2330 AliJetInfo* jet = dmeson_pair.second.GetJet(fJetDefinitions[ij].GetName());
2332 if (applyKinCuts && !fJetDefinitions[ij].IsJetInAcceptance(*jet)) {
2333 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", GetName(), fJetDefinitions[ij].GetName());
2335 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", GetName(), fJetDefinitions[ij].GetName());
2337 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", GetName(), fJetDefinitions[ij].GetName());
2345 if (dmeson_pair.second.fParton) {
2346 fPartons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
2347 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
2348 if (absPdgParton == 4) {
2349 histPrompt->Fill(
"Prompt", 1);
2351 else if (absPdgParton == 5) {
2352 histPrompt->Fill(
"Non-Prompt", 1);
2355 histPrompt->Fill(
"Unknown", 1);
2359 histPrompt->Fill(
"Unknown", 1);
2364 if (dmeson_pair.second.fAncestor) {
2365 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
2366 if (absPdgAncestor == 4) {
2367 histAncestor->Fill(
"Charm", 1);
2369 else if (absPdgAncestor == 5) {
2370 histAncestor->Fill(
"Bottom", 1);
2372 else if (absPdgAncestor == 2212) {
2373 histAncestor->Fill(
"Proton", 1);
2376 histAncestor->Fill(
"Unknown", 1);
2380 histAncestor->Fill(
"Unknown", 1);
2385 hname = TString::Format(
"%s/fHistRejectedDMesonPt", GetName());
2387 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", GetName());
2389 hname = TString::Format(
"%s/fHistRejectedDMesonEta", GetName());
2393 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", GetName());
2397 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", GetName());
2400 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", GetName());
2401 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
2408 hname = TString::Format(
"%s/fHistPartonPt", GetName());
2410 hname = TString::Format(
"%s/fHistPartonEta", GetName());
2412 hname = TString::Format(
"%s/fHistPartonPhi", GetName());
2414 hname = TString::Format(
"%s/fHistPartonType", GetName());
2417 for (
auto parton : fPartons) {
2418 if (!parton.first)
continue;
2419 histPartonPt->Fill(parton.first->Pt());
2420 histPartonEta->Fill(parton.first->Eta());
2421 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
2422 histPartonType->Fill(parton.second);
2436 for (
auto& dmeson_pair : fDmesonJets) {
2437 if (!IsAnyJetInAcceptance(dmeson_pair.second)) {
2438 hname = TString::Format(
"%s/fHistRejectedDMesonPt", GetName());
2440 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", GetName());
2442 hname = TString::Format(
"%s/fHistRejectedDMesonEta", GetName());
2447 for (
auto &jetDef : fJetDefinitions) {
2449 hname = TString::Format(
"%s/%s/fDmesonJets", GetName(), jetDef.GetName());
2452 for (
auto& dmeson_pair : fDmesonJets) {
2453 const AliJetInfo* jet = dmeson_pair.second.GetJet(jetDef.GetName());
2455 if (!jetDef.IsJetInAcceptance(*jet)) {
2456 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", GetName(), jetDef.GetName());
2458 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", GetName(), jetDef.GetName());
2460 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", GetName(), jetDef.GetName());
2464 FillHnSparse(h, dmeson_pair.second, jetDef.GetName());
2487 std::map<std::string, AliJetInfo>::const_iterator it = DmesonJet.
fJets.find(n);
2488 if (it == DmesonJet.
fJets.end())
return kFALSE;
2490 for (
Int_t i = 0; i < h->GetNdimensions(); i++) {
2492 if (
title==
"#it{p}_{T,D} (GeV/#it{c})") contents[i] = DmesonJet.
fD.Pt();
2493 else if (
title==
"#eta_{D}") contents[i] = DmesonJet.
fD.Eta();
2496 else if (
title==
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M();
2497 else if (
title==
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M() - DmesonJet.
fInvMass2Prong;
2498 else if (
title==
"#it{p}_{T,#pi} (GeV/#it{c})") contents[i] = DmesonJet.
fSoftPionPt;
2499 else if (
title==
"#it{z}_{D}") contents[i] = z;
2500 else if (
title==
"#Delta R_{D-jet}") contents[i] = deltaR;
2501 else if (
title==
"#eta_{D} - #eta_{jet}") contents[i] = deltaEta;
2502 else if (
title==
"#phi_{D} - #phi_{jet} (rad)") contents[i] = deltaPhi;
2503 else if (
title==
"#it{p}_{T,jet} (GeV/#it{c})") contents[i] = (*it).second.Pt();
2504 else if (
title==
"#eta_{jet}") contents[i] = (*it).second.Eta();
2505 else if (
title==
"#phi_{jet} (rad)") contents[i] = (*it).second.Phi_0_2pi();
2506 else if (
title==
"No. of constituents") contents[i] = (*it).second.fNConstituents;
2507 else AliWarning(Form(
"Unable to fill dimension '%s'!",
title.Data()));
2547 fEnabledAxis(k2ProngInvMass),
2548 fOutputType(kTreeOutput),
2550 fApplyKinematicCuts(kTRUE),
2551 fNOutputTrees(nOutputTrees),
2552 fTrackEfficiency(0),
2554 fJetAreaType(fastjet::active_area),
2555 fJetGhostArea(0.005),
2561 for (
Int_t i = 0; i < nOutputTrees; i++){
2562 DefineOutput(2+i, TTree::Class());
2581 TFile* filecuts = TFile::Open(cutfname);
2582 if (!filecuts || filecuts->IsZombie()) {
2583 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Input file not found: will use std cuts.");
2587 if (filecuts) analysiscuts =
dynamic_cast<AliRDHFCuts*
>(filecuts->Get(cutsname));
2589 if (!analysiscuts) {
2590 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Could not find analysis cuts '%s' in '%s'.", cutsname.Data(), cutfname.Data());
2596 ::Info(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Cuts '%s' loaded from file '%s'", cutsname.Data(), cutfname.Data());
2599 return analysiscuts;
2633 if (!cutfname.IsNull()) {
2639 cutsname =
"D0toKpiCuts";
2642 cutsname =
"DStartoKpipiCuts";
2648 if (!cuttype.IsNull()) {
2649 cutsname += TString::Format(
"_%s", cuttype.Data());
2663 ::Info(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"A new analysis engine '%s' has been added. The total number of analysis engines is %lu.", eng.
GetName(),
fAnalysisEngines.size());
2667 ::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());
2671 if (found_eng->
fRDHFCuts != 0) ::Warning(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"D meson cuts were already defined for this D meson type. They will be overwritten.");
2689 ::Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s", GetName());
2701 Int_t maxTracks = 6000;
2712 hname =
"fHistCharmPt";
2713 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
2716 hname =
"fHistCharmEta";
2717 htitle = hname +
";#eta_{charm};counts";
2720 hname =
"fHistCharmPhi";
2721 htitle = hname +
";#phi_{charm};counts";
2724 hname =
"fHistCharmPt_Eta05";
2725 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
2728 hname =
"fHistBottomPt";
2729 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2732 hname =
"fHistBottomEta";
2733 htitle = hname +
";#eta_{bottom};counts";
2736 hname =
"fHistBottomPhi";
2737 htitle = hname +
";#phi_{bottom};counts";
2740 hname =
"fHistBottomPt_Eta05";
2741 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2744 hname =
"fHistHighestPartonPt";
2745 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2748 hname =
"fHistHighestPartonType";
2749 htitle = hname +
";type;counts";
2752 hname =
"fHistNHeavyQuarks";
2753 htitle = hname +
";number of heavy-quarks;counts";
2756 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for task '%s' (%lu analysis engines)", GetName(),
fAnalysisEngines.size());
2758 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for analysis engine '%s' (%lu jet definitions)", param.GetName(), param.fJetDefinitions.size());
2762 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", param.GetName());
2763 htitle = hname +
";#it{N}_{tracks};#it{N}_{D};events";
2766 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", param.GetName());
2767 htitle = hname +
";;#it{N}_{D}";
2770 hname = TString::Format(
"%s/fHistNDmesons", param.GetName());
2771 htitle = hname +
";#it{N}_{D};events";
2774 hname = TString::Format(
"%s/fHistNEvents", param.GetName());
2775 htitle = hname +
";Event status;counts";
2777 h->GetXaxis()->SetBinLabel(1,
"Accepted");
2778 h->GetXaxis()->SetBinLabel(2,
"Rejected");
2780 hname = TString::Format(
"%s/fHistEventRejectionReasons", param.GetName());
2781 htitle = hname +
";Rejection reason;counts";
2784 hname = TString::Format(
"%s/fHistRejectedDMesonPt", param.GetName());
2785 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});counts";
2788 hname = TString::Format(
"%s/fHistRejectedDMesonEta", param.GetName());
2789 htitle = hname +
";#it{#eta}_{D};counts";
2792 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", param.GetName());
2793 htitle = hname +
";#it{#phi}_{D};counts";
2798 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", param.GetName());
2799 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2806 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", param.GetName());
2807 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2811 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
2812 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", param.GetName());
2813 htitle = hname +
";#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2820 hname = TString::Format(
"%s/fHistPartonPt", param.GetName());
2821 htitle = hname +
";#it{p}_{T,parton} (GeV/#it{c});counts";
2824 hname = TString::Format(
"%s/fHistPartonEta", param.GetName());
2825 htitle = hname +
";#eta_{parton};counts";
2828 hname = TString::Format(
"%s/fHistPartonPhi", param.GetName());
2829 htitle = hname +
";#phi_{parton};counts";
2832 hname = TString::Format(
"%s/fHistPartonType", param.GetName());
2833 htitle = hname +
";type;counts";
2836 hname = TString::Format(
"%s/fHistPrompt", param.GetName());
2837 htitle = hname +
";Type;counts";
2839 h->GetXaxis()->SetBinLabel(1,
"Unknown");
2840 h->GetXaxis()->SetBinLabel(2,
"Prompt");
2841 h->GetXaxis()->SetBinLabel(3,
"Non-Prompt");
2843 hname = TString::Format(
"%s/fHistAncestor", param.GetName());
2844 htitle = hname +
";Ancestor;counts";
2846 h->GetXaxis()->SetBinLabel(1,
"Unknown");
2847 h->GetXaxis()->SetBinLabel(2,
"Charm");
2848 h->GetXaxis()->SetBinLabel(3,
"Bottom");
2849 h->GetXaxis()->SetBinLabel(4,
"Proton");
2852 for (
auto& jetDef : param.fJetDefinitions) {
2853 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for jet definition '%s'", jetDef.GetName());
2856 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents", param.GetName(), jetDef.GetName());
2857 htitle = hname +
";#it{N}_{constituents};#it{N}_{D};counts";
2861 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason", param.GetName(), jetDef.GetName());
2862 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
2866 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason", param.GetName(), jetDef.GetName());
2867 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
2871 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason", param.GetName(), jetDef.GetName());
2872 htitle = hname +
";Cluster rejection reason;#it{p}_{T,cluster} (GeV/#it{c});counts";
2876 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet", param.GetName(), jetDef.GetName());
2877 htitle = hname +
";#it{p}_{T,track} (GeV/#it{c});counts";
2880 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", param.GetName(), jetDef.GetName());
2881 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});counts";
2884 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", param.GetName(), jetDef.GetName());
2885 htitle = hname +
";#it{#eta}_{jet};counts";
2888 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", param.GetName(), jetDef.GetName());
2889 htitle = hname +
";#it{#phi}_{jet};counts";
2892 if (!jetDef.fRhoName.IsNull()) {
2893 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", param.GetName(), jetDef.GetName());
2894 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
2897 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", param.GetName(), jetDef.GetName());
2898 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
2901 hname = TString::Format(
"%s/%s/fHistRhoVsCent", param.GetName(), jetDef.GetName());
2902 htitle = hname +
";Centrality (%);#rho (GeV/#it{c} #times rad^{-1});counts";
2905 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", param.GetName(), jetDef.GetName());
2906 htitle = hname +
";Centrality (%);#it{p}_{T,jet} (GeV/#it{c});counts";
2909 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", param.GetName(), jetDef.GetName());
2910 htitle = hname +
";Centrality (%);#it{p}_{T,D} (GeV/#it{c});counts";
2913 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", param.GetName(), jetDef.GetName());
2914 htitle = hname +
";no. of tracks;#rho (GeV/#it{c} #times rad^{-1});counts";
2917 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", param.GetName(), jetDef.GetName());
2918 htitle = hname +
";no. of tracks;#it{p}_{T,jet} (GeV/#it{c});counts";
2921 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", param.GetName(), jetDef.GetName());
2922 htitle = hname +
";no. of tracks;#it{p}_{T,D} (GeV/#it{c});counts";
2928 param.BuildTree(GetName());
2930 param.AssignDataSlot(treeSlot+2);
2935 AliError(Form(
"Number of data output slots %d not sufficient. Tree of analysis engine %s will not be posted!",
fNOutputTrees, param.GetName()));
2966 AliError(Form(
"This task need an AOD event (Task '%s'). Expect troubles...", GetName()));
2984 params.fRandomGen = rnd;
2986 for (
auto &jetdef: params.fJetDefinitions) {
2987 if (!jetdef.fRhoName.IsNull()) {
2988 jetdef.fRho =
dynamic_cast<AliRhoParameter*
>(fInputEvent->FindListObject(jetdef.fRhoName));
2990 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2991 "%s: Could not find rho object '%s' for engine '%s'",
2992 GetName(), jetdef.fRhoName.Data(), params.GetName());
2997 if (!params.fRDHFCuts) {
2999 ::Warning(
"AliAnalysisTaskDmesonJets::ExecOnce",
3000 "%s: RDHF cuts not provided for engine '%s'.",
3001 GetName(), params.GetName());
3004 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3005 "%s: RDHF cuts not provided. Engine '%s' disabled.",
3006 GetName(), params.GetName());
3007 params.fInhibit = kTRUE;
3013 for (
auto cont_it : fParticleCollArray) {
3015 if (track_cont) params.fTrackContainers.push_back(track_cont);
3018 for (
auto cont_it :
fClusterCollArray) params.fClusterContainers.push_back(cont_it.second);
3023 params.fCandidateArray =
dynamic_cast<TClonesArray*
>(
fAodEvent->GetList()->FindObject(params.fBranchName.Data()));
3025 if (params.fCandidateArray) {
3028 className =
"AliAODRecoDecayHF2Prong";
3031 className =
"AliAODRecoCascadeHF";
3033 if (!params.fCandidateArray->GetClass()->InheritsFrom(className)) {
3034 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3035 "%s: Objects of type %s in %s are not inherited from %s! Task will be disabled!",
3036 GetName(), params.fCandidateArray->GetClass()->GetName(), params.fCandidateArray->GetName(), className.Data());
3037 params.fCandidateArray = 0;
3038 params.fInhibit = kTRUE;
3042 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3043 "Could not find candidate array '%s', skipping the event. Analysis engine '%s' will be disabled!",
3044 params.fBranchName.Data(), params.GetName());
3045 params.fInhibit = kTRUE;
3049 if (params.fMCMode !=
kNoMC) {
3050 if (!params.fMCContainer) {
3051 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3052 "No MC particle container was provided. Analysis engine '%s' will be disabled!",
3054 params.fInhibit = kTRUE;
3059 if (params.fTrackContainers.size() == 0 && params.fClusterContainers.size() == 0) {
3060 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
3061 "No track container and no cluster container were provided. Analysis engine '%s' will be disabled!",
3063 params.fInhibit = kTRUE;
3081 if (eng.fInhibit)
continue;
3082 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3090 if (matchingAODdeltaAODlevel <= 0) {
3093 if (eng.fInhibit)
continue;
3094 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3102 eng.fDmesonJets.clear();
3103 if (eng.fInhibit)
continue;
3108 hname = TString::Format(
"%s/fHistNEvents", eng.GetName());
3110 Bool_t iseventselected = kTRUE;
3111 if (eng.fRDHFCuts) iseventselected = eng.fRDHFCuts->IsEventSelected(
fAodEvent);
3112 if (!iseventselected) {
3114 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
3115 UInt_t bitmap = eng.fRDHFCuts->GetEventRejectionBitMap();
3119 if (label.IsNull())
break;
3129 AliDebug(2,
"Event selected");
3142 if (param.fInhibit)
continue;
3162 Int_t absPdgHighParton = 0;
3163 for (
auto part : itcont) {
3164 Int_t absPdgCode = TMath::Abs(part.second->GetPdgCode());
3167 if (absPdgCode > 9 && absPdgCode != 21)
continue;
3170 if (highestPartonPt < part.first.Pt()) {
3171 highestPartonPt = part.first.Pt();
3172 absPdgHighParton = absPdgCode;
3188 if (absPdgCode != 4 && absPdgCode != 5)
continue;
3189 Bool_t notLastInPartonShower = kFALSE;
3190 for (
Int_t idaugh = 0; idaugh < 2; idaugh++){
3191 Int_t daughterIndex = part.second->GetDaughter(idaugh);
3192 if (daughterIndex < 0) {
3193 AliDebug(10, Form(
"Could not find daughter of heavy quark (pdg=%d, pt=%.3f)!", absPdgCode, part.first.Pt()));
3198 AliDebug(10, Form(
"Could not find daughter %d of heavy quark (pdg=%d, pt=%.3f)!", daughterIndex, absPdgCode, part.first.Pt()));
3201 Int_t daughterAbsPdgCode = TMath::Abs(daughter->GetPdgCode());
3202 if (daughterAbsPdgCode <= 9 || daughterAbsPdgCode == 21) notLastInPartonShower = kTRUE;
3203 AliDebug(10, Form(
"Found daughter with PDG=%d, pt=%.3f", daughterAbsPdgCode, daughter->Pt()));
3205 if (notLastInPartonShower)
continue;
3207 if (absPdgCode == 4) {
3211 if (TMath::Abs(part.first.Eta()) < 0.5)
fHistManager.
FillTH1(
"fHistCharmPt_Eta05", part.first.Pt());
3213 else if (absPdgCode == 5) {
3217 if (TMath::Abs(part.first.Eta()) < 0.5)
fHistManager.
FillTH1(
"fHistBottomPt_Eta05", part.first.Pt());
3223 Int_t partonType = 0;
3224 if (absPdgHighParton == 9 || absPdgHighParton == 21) {
3228 partonType = absPdgHighParton;
3242 TParticlePDG* part = TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg));
3247 if (nbins % 2 == 0) {
3248 minMass = mass - range / 2 - range / nbins / 2;
3249 maxMass = mass + range / 2 - range / nbins / 2;
3252 minMass = mass - range / 2;
3253 maxMass = mass + range / 2;
3268 label =
"NotSelTrigger";
3270 return label.Data();
3275 return label.Data();
3278 label =
"TooFewVtxContrib";
3280 return label.Data();
3283 label =
"ZVtxOutFid";
3285 return label.Data();
3290 return label.Data();
3293 label =
"OutsideCentrality";
3295 return label.Data();
3298 label =
"PhysicsSelection";
3300 return label.Data();
3303 label =
"BadSPDVertex";
3305 return label.Data();
3308 label =
"ZVtxSPDOutFid";
3310 return label.Data();
3313 label =
"CentralityFlattening";
3315 return label.Data();
3318 label =
"BadTrackV0Correl";
3320 return label.Data();
3323 return label.Data();
3355 ::Error(
"AddTaskDmesonJets",
"No analysis manager to connect to.");
3360 AliVEventHandler* handler = mgr->GetInputEventHandler();
3362 ::Error(
"AddTaskEmcalJetSpectraQA",
"This task requires an input event handler");
3368 if (handler->InheritsFrom(
"AliESDInputHandler")) {
3371 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
3376 if (ntracks ==
"usedefault") {
3377 if (dataType ==
kESD) {
3380 else if (dataType ==
kAOD) {
3388 if (nclusters ==
"usedefault") {
3389 if (dataType ==
kESD) {
3390 nclusters =
"CaloClusters";
3392 else if (dataType ==
kAOD) {
3393 nclusters =
"caloClusters";
3400 if (nMCpart ==
"usedefault") {
3401 nMCpart =
"mcparticles";
3404 TString name(
"AliAnalysisTaskDmesonJets");
3405 if (strcmp(suffix,
"") != 0) {
3406 name += TString::Format(
"_%s", suffix.Data());
3411 if (!ntracks.IsNull()) {
3416 if (!nMCpart.IsNull()) {
3418 partCont->SetEtaLimits(-1.5, 1.5);
3419 partCont->SetPtLimits(0, 1000);
3426 mgr->AddTask(jetTask);
3429 AliAnalysisDataContainer* cinput1 = mgr->GetCommonInputContainer();
3431 contname1 +=
"_histos";
3432 AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(contname1.Data(),
3433 TList::Class(), AliAnalysisManager::kOutputContainer,
3434 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3436 mgr->ConnectInput(jetTask, 0, cinput1);
3437 mgr->ConnectOutput(jetTask, 1, coutput1);
3439 for (
Int_t i = 0; i < nMaxTrees; i++) {
3440 TString contname = TString::Format(
"%s_tree_%d", name.Data(), i);
3441 AliAnalysisDataContainer *coutput = mgr->CreateContainer(contname.Data(),
3442 TTree::Class(),AliAnalysisManager::kOutputContainer,
3443 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3444 mgr->ConnectOutput(jetTask, 2+i, coutput);
Int_t GetNConstituents() const
AliD0ExtendedInfoSummary()
Lightweight class that encapsulates D meson jets.
void SetRejectionReasonLabels(TAxis *axis)
AliClusterContainer * AddClusterContainer(std::string branchName, std::string contName="")
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.
Bool_t FillTree(Bool_t applyKinCuts)
AliEMCALGeometry * fGeom
!emcal geometry
void SetDMesonCandidate(AliAODRecoDecay *c)
Analysis task for D meson jets.
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)
void RunAnalysis()
Run the analysis.
Lightweight class that encapsulates D meson jets.
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)
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.
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()
Lightweight class that encapsulates D meson jets.
Double_t fInvMass2Prong
! 2-prong mass of the D* candidate (w/o the soft pion)
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.
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
virtual void Reset()
Reset the current object.
EFindParticleOriginMode_t
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
static TString GenerateJetName(EJetType_t jetType, EJetAlgo_t jetAlgo, ERecoScheme_t recoScheme, Double_t radius, AliParticleContainer *partCont, AliClusterContainer *clusCont, TString tag)
static std::pair< AliAnalysisTaskDmesonJets::EMesonOrigin_t, AliAODMCParticle * > IsPromptCharm(const AliAODMCParticle *part, TClonesArray *mcArray)
virtual void Set(const AliDmesonJetInfo &source)
Select tracks based on specific prescriptions of HF analysis.
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
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)
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.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t CosThetaStarD0bar() const
angle of K
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.
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)
Int_t GetDataSlotNumber() const
Double_t fRadius
Jet radius.
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
AliRDHFCuts * LoadDMesonCutsFromFile(TString cutfname, TString cutsname)
AliDmesonJetInfo()
Default constructor.
bool operator<(const AliAnalysisTaskDmesonJets::AliHFJetDefinition &lhs, const AliAnalysisTaskDmesonJets::AliHFJetDefinition &rhs)
std::list< AnalysisEngine >::iterator FindAnalysisEngine(const AnalysisEngine &eng)
std::vector< AliHFJetDefinition > fJetDefinitions
Jet definitions.
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.
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
Short_t fPartonType
! type of the parton in the shower tree (only for particle level D mesons)
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.
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
std::vector< fastjet::PseudoJet > GetJetConstituents(UInt_t idx) const
static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo)
void AdoptRDHFCuts(AliRDHFCuts *cuts)
Class that encapsulates jets.
std::map< std::string, AliJetInfo > fJets
! list of jets
AliAODMCParticle * fAncestor
! pointer to the ancestor particle in the shower tree of the D meson (only for particle level D meson...
Bool_t IsSpecialPDGFound() const
virtual void PrintAll() const
virtual ~AnalysisEngine()
void RunParticleLevelAnalysis()
Run a particle level analysis.
std::map< std::string, AliParticleContainer * > fParticleCollArray
particle/track collection array
std::string fWhat
Error message.
void SetJetPtRange(Double_t min, Double_t max)
Bool_t fApplyKinematicCuts
Apply jet kinematic cuts.
Byte_t GetSelectionTypeSummary() const
const char * GetName() const
Generate a name for this jet definition.
AliEventNotFound(const std::string &class_name, const std::string &method_name)
virtual void Set(const AliDmesonJetInfo &source, std::string n)
Bool_t ExtractRecoDecayAttributes(const AliAODRecoDecayHF2Prong *Dcand, AliDmesonJetInfo &DmesonJet, UInt_t i)
Double_t InvMassD0() const
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)
bool operator==(const AliAnalysisTaskDmesonJets::AliHFJetDefinition &lhs, const AliAnalysisTaskDmesonJets::AliHFJetDefinition &rhs)
Double_t InvMassDstarKpipi() const
const AliVEvent * fEvent
! pointer to the ESD/AOD event
void SetNeutralPtRange(Double_t min, Double_t max)
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
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.
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
void AdoptParticleContainer(AliParticleContainer *cont)
Double_t fCent
!event centrality
void SetCharge(EChargeCut_t c)
Container for jet within the EMCAL jet framework.
void SetRejectISR(Bool_t b)
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)