17 #include <TClonesArray.h>
18 #include <TDatabasePDG.h>
19 #include <TParticlePDG.h>
21 #include <THnSparse.h>
22 #include <TParticle.h>
24 #include <THashList.h>
30 #include "AliEMCALGeometry.h"
31 #include "AliAnalysisManager.h"
32 #include "AliVEventHandler.h"
68 dphi = TVector2::Phi_mpi_pi(
fMomentum.Phi() - jet.
Phi());;
70 return TMath::Sqrt(dphi*dphi + deta*deta);
81 return GetDistance(jet, deta, dphi);
98 fReconstructed(kFALSE),
110 fDmesonParticle(source.fDmesonParticle),
112 fSoftPionPt(source.fSoftPionPt),
113 fInvMass2Prong(source.fInvMass2Prong),
115 fMCLabel(source.fMCLabel),
116 fReconstructed(source.fReconstructed),
117 fParton(source.fParton),
118 fPartonType(source.fPartonType),
119 fAncestor(source.fAncestor),
120 fSelectionType(source.fSelectionType)
136 fD.SetPtEtaPhiE(0,0,0,0);
141 fReconstructed = kFALSE;
145 for (
auto &jet : fJets) {
146 jet.second.fMomentum.SetPtEtaPhiE(0,0,0,0);
147 jet.second.fNConstituents = 0;
149 jet.second.fMaxChargedPt = 0;
150 jet.second.fMaxNeutralPt = 0;
157 Printf(
"Printing D Meson Jet object.");
158 Printf(
"D Meson: pT = %.3f, eta = %.3f, phi = %.3f, inv. mass = %.3f", fD.Pt(), fD.Eta(), fD.Phi_0_2pi(), fD.M());
159 Printf(
"Soft pion pT: %.3f. 2-Prong Invariant mass = %.3f", fSoftPionPt, fInvMass2Prong);
160 for (
auto &jet : fJets) {
161 Printf(
"Jet %s: pT = %.3f, eta = %.3f, phi = %.3f", jet.first.c_str(), jet.second.Pt(), jet.second.Eta(), jet.second.Phi_0_2pi());
162 Printf(
"Jet N Consituents = %d", jet.second.fNConstituents);
171 std::map<std::string, AliJetInfo>::const_iterator it = fJets.find(n);
172 if (it == fJets.end())
return 0;
176 if ((*it).second.Pt() > 0) {
177 TVector3 dvect = fD.Vect();
178 TVector3 jvect = (*it).second.fMomentum.Vect();
183 ::Error(
"AliAnalysisTaskDmesonJets::AliDmesonJetInfo::GetZ",
"Zero jet momentum!");
187 z = (dvect * jvect) / jetMom;
190 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
201 std::map<std::string, AliJetInfo>::const_iterator it = fJets.find(n);
202 if (it == fJets.end())
return 0;
206 if ((*it).second.Pt() > 0) {
207 TVector3 dvect = fD.Vect();
208 TVector3 jvect = (*it).second.fMomentum.Vect();
210 Double_t corrpt = (*it).second.fCorrPt > 0 ? (*it).second.fCorrPt : 0.;
211 jvect.SetPerp(corrpt);
219 z = (dvect * jvect) / jetMom;
234 std::map<std::string, AliJetInfo>::const_iterator it = fJets.find(n);
235 if (it == fJets.end())
return 0;
237 return GetDistance((*it).second, deta, dphi);
248 return GetDistance(n, deta, dphi);
259 dphi = TVector2::Phi_mpi_pi(fD.Phi() - jet.
Phi());;
260 deta = fD.Eta() - jet.
Eta();
261 return TMath::Sqrt(dphi*dphi + deta*deta);
272 return GetDistance(jet, deta, dphi);
281 std::map<std::string, AliJetInfo>::const_iterator it = fJets.find(n);
282 if (it == fJets.end()) {
283 ::Error(
"AliAnalysisTaskDmesonJets::AliDmesonJetInfo::GetJet",
"Could not find jet info for the jet definition '%s'!",
287 return &((*it).second);
296 std::map<std::string, AliJetInfo>::iterator it = fJets.find(n);
297 if (it == fJets.end()) {
298 ::Error(
"AliAnalysisTaskDmesonJets::AliDmesonJetInfo::GetJet",
"Could not find jet info for the jet definition '%s'!",
302 return &((*it).second);
343 std::map<std::string, AliJetInfo>::const_iterator it = source.
fJets.find(n);
344 if (it == source.
fJets.end())
return;
399 fArea = source.
fArea;
435 fPt = source.
fD.Pt();
436 fEta = source.
fD.Eta();
476 fPartonPt = source.
fParton->Pt();
507 fInvMass(source.fD.M()),
517 fInvMass = source.
fD.M();
541 f2ProngInvMass(source.fInvMass2Prong),
542 fDeltaInvMass(source.fD.M() - source.fInvMass2Prong)
652 fJetType(source.fJetType),
653 fRadius(source.fRadius),
654 fJetAlgo(source.fJetAlgo),
655 fRecoScheme(source.fRecoScheme),
656 fMinJetPt(source.fMinJetPt),
657 fMaxJetPt(source.fMaxJetPt),
658 fMinJetPhi(source.fMinJetPhi),
659 fMaxJetPhi(source.fMaxJetPhi),
660 fMinJetEta(source.fMinJetEta),
661 fMaxJetEta(source.fMaxJetEta),
662 fMinChargedPt(source.fMinChargedPt),
663 fMaxChargedPt(source.fMaxChargedPt),
664 fMinNeutralPt(source.fMinNeutralPt),
665 fMaxNeutralPt(source.fMaxNeutralPt),
666 fRhoName(source.fRhoName),
696 if (fMinJetEta < fMaxJetEta && (jet.
Eta() < fMinJetEta || jet.
Eta() > fMaxJetEta))
return kFALSE;
697 if (fMinJetPhi < fMaxJetPhi && (jet.
Phi() < fMinJetPhi || jet.
Phi() > fMaxJetPhi))
return kFALSE;
698 if (fMinJetPt < fMaxJetPt && (jet.
Pt() > fMaxJetPt || jet.
Pt() < fMinJetPt))
return kFALSE;
712 if (!jet)
return kFALSE;
713 return IsJetInAcceptance((*jet));
785 fCurrentDmesonJetInfo(0),
790 fClusterContainers(),
808 fCandidateType(type),
815 fNMassBins(nMassBins),
829 fCurrentDmesonJetInfo(0),
834 fClusterContainers(),
848 fPartons(source.fPartons),
849 fCandidateType(source.fCandidateType),
850 fCandidateName(source.fCandidateName),
851 fCandidatePDG(source.fCandidatePDG),
852 fNDaughters(source.fNDaughters),
853 fPDGdaughters(source.fPDGdaughters),
854 fBranchName(source.fBranchName),
855 fMCMode(source.fMCMode),
856 fNMassBins(source.fNMassBins),
857 fMinMass(source.fMinMass),
858 fMaxMass(source.fMaxMass),
860 fRejectedOrigin(source.fRejectedOrigin),
861 fAcceptedDecay(source.fAcceptedDecay),
862 fInhibit(source.fInhibit),
863 fJetDefinitions(source.fJetDefinitions),
864 fPtBinWidth(source.fPtBinWidth),
865 fMaxPt(source.fMaxPt),
866 fRandomGen(source.fRandomGen),
870 fCurrentDmesonJetInfo(0),
872 fCandidateArray(source.fCandidateArray),
874 fTrackContainers(source.fTrackContainers),
875 fClusterContainers(source.fClusterContainers),
904 for (
UInt_t i = 0; i < fJetDefinitions.size(); i++) {
905 if (fJetDefinitions[i].IsJetInAcceptance(dMesonJet, fJetDefinitions[i].GetName()))
return kTRUE;
921 switch (fCandidateType) {
924 fCandidateName =
"D0";
926 fPDGdaughters.Set(fNDaughters);
927 fPDGdaughters.Reset();
928 fPDGdaughters[0] = 211;
929 fPDGdaughters[1] = 321;
930 fBranchName =
"D0toKpi";
935 fCandidateName =
"2ProngLikeSign";
937 fPDGdaughters.Set(fNDaughters);
938 fPDGdaughters.Reset();
939 fPDGdaughters[0] = 211;
940 fPDGdaughters[1] = 321;
941 fBranchName =
"LikeSign2Prong";
945 fCandidateName =
"DStar";
947 fPDGdaughters.Set(fNDaughters);
948 fPDGdaughters.Reset();
949 fPDGdaughters[0] = 211;
950 fPDGdaughters[1] = 211;
951 fPDGdaughters[2] = 321;
952 fBranchName =
"Dstar";
956 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisEngine::SetCandidateProperties",
"Candidate %d unknown!", fCandidateType);
967 if (fRDHFCuts)
delete fRDHFCuts;
977 if (fRDHFCuts)
delete fRDHFCuts;
978 fRDHFCuts =
static_cast<AliRDHFCuts*
>(cuts->Clone());
988 name = TString::Format(
"%s_%s", GetName(), jetDef.
GetName());
998 fName = fCandidateName;
1001 fName +=
"_kBackgroundOnly";
1004 fName +=
"_kSignalOnly";
1007 fName +=
"_MCTruth";
1010 fName +=
"_WrongPID";
1016 if (fRDHFCuts) fName += TString::Format(
"_%s", fRDHFCuts->GetName());
1018 return fName.Data();
1029 std::vector<AliHFJetDefinition>::iterator it = FindJetDefinition(def);
1031 if (it == fJetDefinitions.end() || *it != def) {
1032 fJetDefinitions.push_back(def);
1033 ::Info(
"AliAnalysisTaskDmesonJets::AnalysisEngine::AddJetDefinition",
"Jet definition '%s' has been added to analysis engine '%s'."
1034 "Total number of jet definitions is now %lu.",
1035 def.
GetName(), GetName(), fJetDefinitions.size());
1037 if (fMCMode !=
kMCTruth) fJetDefinitions[fJetDefinitions.size()-1].SetChargedPtRange(0., 100.);
1040 ::Warning(
"AliAnalysisTaskDmesonJets::AnalysisEngine::AddJetDefinition",
"The same jet definition '%s' was already added in analysis engine '%s'.", def.
GetName(), GetName());
1060 return AddJetDefinition(def);
1070 std::vector<AliHFJetDefinition>::iterator it = fJetDefinitions.begin();
1071 while (it != fJetDefinitions.end() && (*it) != def) it++;
1080 for (
auto &jetdef : fJetDefinitions) jetdef.SetJetPhiRange(min, max);
1088 for (
auto &jetdef : fJetDefinitions) jetdef.SetJetEtaRange(min, max);
1096 for (
auto &jetdef : fJetDefinitions) jetdef.SetJetPtRange(min, max);
1104 for (
auto &jetdef : fJetDefinitions) jetdef.SetChargedPtRange(min, max);
1112 for (
auto &jetdef : fJetDefinitions) jetdef.SetNeutralPtRange(min, max);
1170 return ExtractD0Attributes(Dcand, DmesonJet, i);
1173 return ExtractDstarAttributes(static_cast<const AliAODRecoCascadeHF*>(Dcand), DmesonJet, i);
1189 AliDebug(10,
"Checking if D0 meson is selected");
1191 if (isSelected == 0)
return kFALSE;
1193 Int_t MCtruthPdgCode = 0;
1200 Int_t mcLab = Dcand->MatchToMC(fCandidatePDG,
fMCContainer->GetArray(), fNDaughters, fPDGdaughters.GetArray());
1205 AliAODMCParticle* aodMcPart =
static_cast<AliAODMCParticle*
>(
fMCContainer->GetArray()->At(mcLab));
1209 if (fRejectedOrigin) {
1210 auto origin = IsPromptCharm(aodMcPart,
fMCContainer->GetArray());
1211 if ((origin.first & fRejectedOrigin) == origin.first)
return kFALSE;
1213 MCtruthPdgCode = aodMcPart->PdgCode();
1218 if (isSelected == 1) {
1219 if (i != 0)
return kFALSE;
1221 if (fMCMode ==
kNoMC ||
1222 (MCtruthPdgCode == fCandidatePDG && fMCMode ==
kSignalOnly) ||
1224 (MCtruthPdgCode == -fCandidatePDG && fMCMode ==
kWrongPID)) {
1226 AliDebug(10,
"Selected as D0");
1233 else if (isSelected == 2) {
1234 if (i != 1)
return kFALSE;
1236 if (fMCMode ==
kNoMC ||
1237 (MCtruthPdgCode == -fCandidatePDG && fMCMode ==
kSignalOnly) ||
1239 (MCtruthPdgCode == fCandidatePDG && fMCMode ==
kWrongPID)) {
1241 AliDebug(10,
"Selected as D0bar");
1248 else if (isSelected == 3) {
1249 AliDebug(10,
"Selected as either D0 or D0bar");
1252 if ((MCtruthPdgCode == fCandidatePDG && fMCMode ==
kSignalOnly) ||
1254 if (i != 0)
return kFALSE;
1255 AliDebug(10,
"MC truth is D0");
1258 else if ((MCtruthPdgCode == -fCandidatePDG && fMCMode ==
kSignalOnly) ||
1260 if (i != 1)
return kFALSE;
1261 AliDebug(10,
"MC truth is D0bar");
1270 AliDebug(10,
"Returning invariant mass with D0 hypothesis");
1274 AliDebug(10,
"Returning invariant mass with D0bar hypothesis");
1286 DmesonJet.
fD.SetPtEtaPhiM(Dcand->Pt(), Dcand->Eta(), Dcand->Phi(), invMassD);
1299 AliDebug(10,
"Checking if D* meson is selected");
1301 if (isSelected == 0)
return kFALSE;
1303 if ((i == 1 && DstarCand->Charge()>0) || (i == 0 && DstarCand->Charge()<0) || i > 1)
return kFALSE;
1305 Int_t MCtruthPdgCode = 0;
1310 Int_t pdgDgDStartoD0pi[2] = { 421, 211 };
1311 Int_t pdgDgD0toKpi[2] = { 321, 211 };
1314 AliDebug(10, Form(
"MC label is %d", mcLab));
1317 AliAODMCParticle* aodMcPart =
static_cast<AliAODMCParticle*
>(
fMCContainer->GetArray()->At(mcLab));
1320 if (fRejectedOrigin) {
1321 auto origin = IsPromptCharm(aodMcPart,
fMCContainer->GetArray());
1322 if ((origin.first & fRejectedOrigin) == origin.first)
return kFALSE;
1325 MCtruthPdgCode = aodMcPart->PdgCode();
1326 AliDebug(10, Form(
"MC truth pdg code is %d",MCtruthPdgCode));
1331 Int_t absMCtruthPdgCode = TMath::Abs(MCtruthPdgCode);
1332 if (fMCMode ==
kNoMC ||
1333 (absMCtruthPdgCode == 413 && fMCMode ==
kSignalOnly) ||
1339 DmesonJet.
fD.SetPtEtaPhiM(DstarCand->Pt(), DstarCand->Eta(), DstarCand->Phi(), invMassD);
1360 Int_t absPdgPart = TMath::Abs(part->GetPdgCode());
1362 if (part->GetNDaughters() == 2) {
1364 AliAODMCParticle* d1 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(0)));
1365 AliAODMCParticle* d2 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(1)));
1371 Int_t absPdg1 = TMath::Abs(d1->GetPdgCode());
1372 Int_t absPdg2 = TMath::Abs(d2->GetPdgCode());
1374 if (absPdgPart == 421) {
1375 if ((absPdg1 == 211 && absPdg2 == 321) ||
1376 (absPdg1 == 321 && absPdg2 == 211)) {
1381 if (absPdgPart == 413) {
1382 if (absPdg1 == 421 && absPdg2 == 211) {
1383 Int_t D0decay = CheckDecayChannel(d1, mcArray);
1388 else if (absPdg1 == 211 && absPdg2 == 421) {
1389 Int_t D0decay = CheckDecayChannel(d2, mcArray);
1408 std::pair<AliAnalysisTaskDmesonJets::EMesonOrigin_t, AliAODMCParticle*> result(
kUnknownQuark, 0);
1410 if (!part)
return result;
1411 if (!mcArray)
return result;
1413 static std::set<UInt_t> partons = { 4, 5 };
1415 AliAODMCParticle* parton = FindParticleOrigin(part, mcArray, kFindLast, partons);
1417 result.second = parton;
1418 UInt_t absPdgParton = TMath::Abs(parton->GetPdgCode());
1419 if (absPdgParton == 4) result.first =
kFromCharm;
1420 else if (absPdgParton == 5) result.first =
kFromBottom;
1436 static std::set<UInt_t> pdgSet;
1438 return FindParticleOrigin(part, mcArray, mode, pdgSet);
1452 AliAODMCParticle* result =
nullptr;
1454 Int_t mother = part->GetMother();
1455 while (mother >= 0) {
1456 AliAODMCParticle* mcGranma =
static_cast<AliAODMCParticle*
>(mcArray->At(mother));
1458 UInt_t abspdgGranma = TMath::Abs(mcGranma->GetPdgCode());
1461 if (pdgSet.empty() || pdgSet.count(abspdgGranma) > 0) {
1464 if (mode == kFindLast)
break;
1466 mother = mcGranma->GetMother();
1469 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisParams::FindParticleOrigin",
"Could not retrieve mother particle %d!", mother);
1480 for (
auto& jetDef : fJetDefinitions) {
1481 jetDef.fJets.clear();
1485 RunParticleLevelAnalysis();
1488 RunDetectorLevelAnalysis();
1500 const Int_t nD = fCandidateArray->GetEntriesFast();
1504 std::map<AliHFJetDefinition*,Double_t> maxJetPt;
1505 for (
auto& def : fJetDefinitions) maxJetPt[&def] = 0;
1508 Int_t nAccCharm[3] = {0};
1509 for (
Int_t icharm = 0; icharm < nD; icharm++) {
1511 if (!charmCand)
continue;
1515 if (!fRDHFCuts->IsInFiducialAcceptance(charmCand->Pt(), charmCand->Y(fCandidatePDG)))
continue;
1516 Int_t nMassHypo = 0;
1517 if (charmCand->Pt() > maxDPt) maxDPt = charmCand->Pt();
1518 for (
Int_t im = 0; im < 2; im++) {
1522 if (ExtractRecoDecayAttributes(charmCand, DmesonJet, im)) {
1523 for (
auto& def : fJetDefinitions) {
1524 if (FindJet(charmCand, DmesonJet, def)) {
1525 Double_t jetPt = DmesonJet.
fJets[def.GetName()].fMomentum.Pt();
1526 if (jetPt > maxJetPt[&def]) maxJetPt[&def] = jetPt;
1529 AliWarning(Form(
"Could not find jet '%s' for D meson '%s': pT = %.3f, eta = %.3f, phi = %.3f",
1530 def.GetName(), GetName(), DmesonJet.
fD.Pt(), DmesonJet.
fD.Eta(), DmesonJet.
fD.
Phi_0_2pi()));
1533 fDmesonJets[(icharm+1)*(1-(im*2))] = DmesonJet;
1538 if (nMassHypo == 2) {
1543 if (nMassHypo == 2) {
1544 fDmesonJets[(icharm+1)].fSelectionType = 3;
1545 fDmesonJets[-(icharm+1)].fSelectionType = 3;
1553 for (
auto track_cont : fTrackContainers) {
1556 ntracks += track_cont->GetNAcceptEntries();
1559 for (
auto& def : fJetDefinitions) {
1560 if (!def.fRho)
continue;
1561 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", GetName(), def.GetName());
1564 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", GetName(), def.GetName());
1567 hname = TString::Format(
"%s/%s/fHistRhoVsCent", GetName(), def.GetName());
1570 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", GetName(), def.GetName());
1573 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", GetName(), def.GetName());
1576 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", GetName(), def.GetName());
1579 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", GetName(), def.GetName());
1582 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", GetName(), def.GetName());
1586 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", GetName());
1591 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", GetName());
1594 hname = TString::Format(
"%s/fHistNDmesons", GetName());
1612 if (jetDef.
fRho) rho = jetDef.
fRho->GetVal();
1622 for (
auto track_cont : fTrackContainers) {
1625 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason", GetName(), jetDef.
GetName());
1629 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet", GetName(), jetDef.
GetName());
1632 for (
Int_t i = 0; i < daughters.GetEntriesFast(); i++) {
1633 AliVParticle* daughter =
static_cast<AliVParticle*
>(daughters.At(i));
1634 if (!hftrack_cont->GetArray()->FindObject(daughter)) histDaughterNotInJet->Fill(daughter->Pt());
1641 for (
auto clus_cont : fClusterContainers) {
1642 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason", GetName(), jetDef.
GetName());
1652 for (
UInt_t ijet = 0; ijet < jets_incl.size(); ++ijet) {
1655 Bool_t isDmesonJet = kFALSE;
1662 for (
UInt_t ic = 0; ic < constituents.size(); ++ic) {
1663 if (constituents[ic].user_index() == 0) {
1664 isDmesonJet = kTRUE;
1666 else if (constituents[ic].user_index() >= 100) {
1667 if (constituents[ic].pt() > maxChPt) maxChPt = constituents[ic].pt();
1670 else if (constituents[ic].user_index() <= -100) {
1671 totalNeutralPt += constituents[ic].pt();
1672 if (constituents[ic].pt() > maxNePt) maxChPt = constituents[ic].pt();
1678 DmesonJet.
fJets[jetDef.
GetName()].fMomentum.SetPxPyPzE(jets_incl[ijet].px(), jets_incl[ijet].py(), jets_incl[ijet].pz(), jets_incl[ijet].E());
1679 DmesonJet.
fJets[jetDef.
GetName()].fNConstituents = nConst;
1680 DmesonJet.
fJets[jetDef.
GetName()].fMaxChargedPt = maxChPt;
1681 DmesonJet.
fJets[jetDef.
GetName()].fMaxNeutralPt = maxNePt;
1682 DmesonJet.
fJets[jetDef.
GetName()].fNEF = totalNeutralPt / jets_incl[ijet].pt();
1683 DmesonJet.
fJets[jetDef.
GetName()].fArea = jets_incl[ijet].area();
1684 DmesonJet.
fJets[jetDef.
GetName()].fCorrPt = DmesonJet.
fJets[jetDef.
GetName()].fMomentum.Pt() - jets_incl[ijet].area() * rho;
1698 auto itcont = cont->all_momentum();
1699 for (AliEmcalIterableMomentumContainer::iterator it = itcont.begin(); it != itcont.end(); it++) {
1700 UInt_t rejectionReason = 0;
1701 if (!cont->AcceptObject(it.current_index(), rejectionReason)) {
1702 if (rejectHist) rejectHist->Fill(AliEmcalContainer::GetRejectionReasonBitPosition(rejectionReason), it->first.Pt());
1705 if (fRandomGen && eff > 0 && eff < 1) {
1708 if (rejectHist) rejectHist->Fill(6, it->first.Pt());
1712 Int_t uid = offset >= 0 ? it.current_index() + offset: -it.current_index() - offset;
1729 Int_t nAccCharm[3] = {0};
1731 std::map<AliHFJetDefinition*, Double_t> maxJetPt;
1734 for (
auto &jetDef : fJetDefinitions) {
1735 maxJetPt[&jetDef] = 0;
1737 if (jetDef.fRho) rho = jetDef.fRho->GetVal();
1738 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents", GetName(), jetDef.GetName());
1741 switch (jetDef.fJetType) {
1758 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason", GetName(), jetDef.GetName());
1765 for (
auto jet : jets_incl) {
1766 Int_t nDmesonsInJet = 0;
1768 for (
auto constituent : jet.constituents()) {
1769 Int_t iPart = constituent.user_index() - 100;
1770 if (constituent.perp() < 1e-6)
continue;
1773 ::Error(
"AliAnalysisTaskDmesonJets::AnalysisEngine::RunParticleLevelAnalysis",
"Could not find jet constituent %d!", iPart);
1776 if (TMath::Abs(part->PdgCode()) == fCandidatePDG) {
1778 std::map<int, AliDmesonJetInfo>::iterator dMesonJetIt = fDmesonJets.find(iPart);
1779 if (dMesonJetIt == fDmesonJets.end()) {
1780 if (part->Pt() > maxDPt) maxDPt = part->Pt();
1781 std::pair<int, AliDmesonJetInfo> element;
1782 element.first = iPart;
1783 dMesonJetIt = fDmesonJets.insert(element).first;
1784 (*dMesonJetIt).second.fD.SetPxPyPzE(part->Px(), part->Py(), part->Pz(), part->E());
1785 (*dMesonJetIt).second.fDmesonParticle = part;
1786 (*dMesonJetIt).second.fSelectionType = part->PdgCode() > 0 ? 1 : 2;
1791 auto origin = IsPromptCharm(part,
fMCContainer->GetArray());
1794 while (rs >>= 1) { p++; }
1795 (*dMesonJetIt).second.fPartonType = p;
1796 (*dMesonJetIt).second.fParton = origin.second;
1798 (*dMesonJetIt).second.fAncestor = FindParticleOrigin(part,
fMCContainer->GetArray(), kFindFirst);
1800 if (part->PdgCode() > 0) {
1808 (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.SetPxPyPzE(jet.px(), jet.py(), jet.pz(), jet.E());
1809 (*dMesonJetIt).second.fJets[jetDef.GetName()].fNConstituents = jet.constituents().size();
1810 (*dMesonJetIt).second.fJets[jetDef.GetName()].fArea = jet.area();
1811 (*dMesonJetIt).second.fJets[jetDef.GetName()].fCorrPt = (*dMesonJetIt).second.fJets[jetDef.GetName()].fMomentum.Pt() - jet.area() * rho;
1812 if (jet.perp() > maxJetPt[&jetDef]) maxJetPt[&jetDef] = jet.perp();
1815 if (nDmesonsInJet > 0) histNDmesonsVsNconstituents->Fill(jet.constituents().size(), nDmesonsInJet);
1821 for (
auto& def : fJetDefinitions) {
1822 if (!def.fRho)
continue;
1823 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", GetName(), def.GetName());
1826 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", GetName(), def.GetName());
1829 hname = TString::Format(
"%s/%s/fHistRhoVsCent", GetName(), def.GetName());
1832 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", GetName(), def.GetName());
1835 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", GetName(), def.GetName());
1838 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", GetName(), def.GetName());
1841 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", GetName(), def.GetName());
1844 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", GetName(), def.GetName());
1848 if (fDmesonJets.size() != nAccCharm[0]+nAccCharm[1]) AliError(Form(
"I found %lu mesons (%d)?", fDmesonJets.size(), nAccCharm[0]+nAccCharm[1]));
1849 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", GetName());
1854 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", GetName());
1857 hname = TString::Format(
"%s/fHistNDmesons", GetName());
1868 classname =
"AliAnalysisTaskDmesonJets::AliDmesonMCInfoSummary";
1872 switch (fCandidateType) {
1875 classname =
"AliAnalysisTaskDmesonJets::AliD0InfoSummary";
1879 classname =
"AliAnalysisTaskDmesonJets::AliDStarInfoSummary";
1884 TString treeName = TString::Format(
"%s_%s", taskName, GetName());
1885 fTree =
new TTree(treeName, treeName);
1886 fTree->Branch(
"DmesonJet", classname, &fCurrentDmesonJetInfo);
1888 for (
Int_t i = 0; i < fJetDefinitions.size(); i++) {
1889 if (fJetDefinitions[i].fRhoName.IsNull()) {
1891 fTree->Branch(fJetDefinitions[i].GetName(),
"AliAnalysisTaskDmesonJets::AliJetInfoSummary", &fCurrentJetInfo[i]);
1895 fTree->Branch(fJetDefinitions[i].GetName(),
"AliAnalysisTaskDmesonJets::AliJetInfoPbPbSummary", &fCurrentJetInfo[i]);
1911 for (
auto &jetDef : fJetDefinitions) {
1913 AliDebug(2,Form(
"Now working on '%s'", jetDef.GetName()));
1923 title[dim] =
"#it{p}_{T,D} (GeV/#it{c})";
1930 title[dim] =
"#eta_{D}";
1936 title[dim] =
"#phi_{D} (rad)";
1939 max[dim] = TMath::TwoPi();
1944 title[dim] =
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})";
1945 nbins[dim] = fNMassBins;
1946 min[dim] = fMinMass;
1947 max[dim] = fMaxMass;
1952 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
1953 nbins[dim] = fNMassBins;
1954 min[dim] = fMinMass;
1955 max[dim] = fMaxMass;
1960 title[dim] =
"#it{M}_{K#pi} (GeV/#it{c}^{2})";
1961 nbins[dim] = fNMassBins;
1967 title[dim] =
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})";
1968 nbins[dim] = fNMassBins*6;
1972 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
1980 title[dim] =
"#it{p}_{T,#pi} (GeV/#it{c})";
1987 title[dim] =
"#it{z}_{D}";
1993 if ((enabledAxis &
kDeltaR) != 0) {
1994 title[dim] =
"#Delta R_{D-jet}";
1997 max[dim] = radius * 1.5;
2002 title[dim] =
"#eta_{D} - #eta_{jet}";
2004 min[dim] = -radius * 1.2;
2005 max[dim] = radius * 1.2;
2010 title[dim] =
"#phi_{D} - #phi_{jet} (rad)";
2012 min[dim] = -radius * 1.2;
2013 max[dim] = radius * 1.2;
2017 title[dim] =
"#it{p}_{T,jet} (GeV/#it{c})";
2024 title[dim] =
"#eta_{jet}";
2030 title[dim] =
"#phi_{jet} (rad)";
2033 max[dim] = TMath::TwoPi();
2038 title[dim] =
"No. of constituents";
2045 hname = TString::Format(
"%s/%s/fDmesonJets", GetName(), jetDef.GetName());
2047 for (
Int_t j = 0; j < dim; j++) {
2048 h->GetAxis(j)->SetTitle(title[j]);
2061 TH1* histAncestor =
nullptr;
2062 TH1* histPrompt =
nullptr;
2065 hname = TString::Format(
"%s/fHistPrompt", GetName());
2068 hname = TString::Format(
"%s/fHistAncestor", GetName());
2072 for (
auto& dmeson_pair : fDmesonJets) {
2073 fCurrentDmesonJetInfo->Set(dmeson_pair.second);
2075 for (
UInt_t ij = 0; ij < fJetDefinitions.size(); ij++) {
2076 fCurrentJetInfo[ij]->Reset();
2077 AliJetInfo* jet = dmeson_pair.second.GetJet(fJetDefinitions[ij].GetName());
2079 if (applyKinCuts && !fJetDefinitions[ij].IsJetInAcceptance(*jet)) {
2080 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", GetName(), fJetDefinitions[ij].GetName());
2082 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", GetName(), fJetDefinitions[ij].GetName());
2084 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", GetName(), fJetDefinitions[ij].GetName());
2088 fCurrentJetInfo[ij]->Set(dmeson_pair.second, fJetDefinitions[ij].GetName());
2093 if (dmeson_pair.second.fParton) {
2094 fPartons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
2095 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
2096 if (absPdgParton == 4) {
2097 histPrompt->Fill(
"Prompt", 1);
2099 else if (absPdgParton == 5) {
2100 histPrompt->Fill(
"Non-Prompt", 1);
2103 histPrompt->Fill(
"Unknown", 1);
2107 histPrompt->Fill(
"Unknown", 1);
2112 if (dmeson_pair.second.fAncestor) {
2113 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
2114 if (absPdgAncestor == 4) {
2115 histAncestor->Fill(
"Charm", 1);
2117 else if (absPdgAncestor == 5) {
2118 histAncestor->Fill(
"Bottom", 1);
2120 else if (absPdgAncestor == 2212) {
2121 histAncestor->Fill(
"Proton", 1);
2124 histAncestor->Fill(
"Unknown", 1);
2128 histAncestor->Fill(
"Unknown", 1);
2135 hname = TString::Format(
"%s/fHistRejectedDMesonPt", GetName());
2137 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", GetName());
2139 hname = TString::Format(
"%s/fHistRejectedDMesonEta", GetName());
2143 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", GetName());
2147 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", GetName());
2150 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", GetName());
2151 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
2158 hname = TString::Format(
"%s/fHistPartonPt", GetName());
2160 hname = TString::Format(
"%s/fHistPartonEta", GetName());
2162 hname = TString::Format(
"%s/fHistPartonPhi", GetName());
2164 hname = TString::Format(
"%s/fHistPartonType", GetName());
2167 for (
auto parton : fPartons) {
2168 if (!parton.first)
continue;
2169 histPartonPt->Fill(parton.first->Pt());
2170 histPartonEta->Fill(parton.first->Eta());
2171 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
2172 histPartonType->Fill(parton.second);
2187 TH1* histAncestor =
nullptr;
2188 TH1* histPrompt =
nullptr;
2191 hname = TString::Format(
"%s/fHistPrompt", GetName());
2194 hname = TString::Format(
"%s/fHistAncestor", GetName());
2199 for (
auto& dmeson_pair : fDmesonJets) {
2201 for (
UInt_t ij = 0; ij < fJetDefinitions.size(); ij++) {
2202 AliJetInfo* jet = dmeson_pair.second.GetJet(fJetDefinitions[ij].GetName());
2204 if (applyKinCuts && !fJetDefinitions[ij].IsJetInAcceptance(*jet)) {
2205 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", GetName(), fJetDefinitions[ij].GetName());
2207 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", GetName(), fJetDefinitions[ij].GetName());
2209 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", GetName(), fJetDefinitions[ij].GetName());
2217 if (dmeson_pair.second.fParton) {
2218 fPartons[dmeson_pair.second.fParton] = dmeson_pair.second.fPartonType;
2219 UInt_t absPdgParton = TMath::Abs(dmeson_pair.second.fParton->GetPdgCode());
2220 if (absPdgParton == 4) {
2221 histPrompt->Fill(
"Prompt", 1);
2223 else if (absPdgParton == 5) {
2224 histPrompt->Fill(
"Non-Prompt", 1);
2227 histPrompt->Fill(
"Unknown", 1);
2231 histPrompt->Fill(
"Unknown", 1);
2236 if (dmeson_pair.second.fAncestor) {
2237 UInt_t absPdgAncestor = TMath::Abs(dmeson_pair.second.fAncestor->GetPdgCode());
2238 if (absPdgAncestor == 4) {
2239 histAncestor->Fill(
"Charm", 1);
2241 else if (absPdgAncestor == 5) {
2242 histAncestor->Fill(
"Bottom", 1);
2244 else if (absPdgAncestor == 2212) {
2245 histAncestor->Fill(
"Proton", 1);
2248 histAncestor->Fill(
"Unknown", 1);
2252 histAncestor->Fill(
"Unknown", 1);
2257 hname = TString::Format(
"%s/fHistRejectedDMesonPt", GetName());
2259 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", GetName());
2261 hname = TString::Format(
"%s/fHistRejectedDMesonEta", GetName());
2265 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", GetName());
2269 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", GetName());
2272 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", GetName());
2273 fHistManager->
FillTH1(hname, dmeson_pair.second.fD.M() - dmeson_pair.second.fInvMass2Prong);
2280 hname = TString::Format(
"%s/fHistPartonPt", GetName());
2282 hname = TString::Format(
"%s/fHistPartonEta", GetName());
2284 hname = TString::Format(
"%s/fHistPartonPhi", GetName());
2286 hname = TString::Format(
"%s/fHistPartonType", GetName());
2289 for (
auto parton : fPartons) {
2290 if (!parton.first)
continue;
2291 histPartonPt->Fill(parton.first->Pt());
2292 histPartonEta->Fill(parton.first->Eta());
2293 histPartonPhi->Fill(TVector2::Phi_0_2pi(parton.first->Phi()));
2294 histPartonType->Fill(parton.second);
2308 for (
auto& dmeson_pair : fDmesonJets) {
2309 if (!IsAnyJetInAcceptance(dmeson_pair.second)) {
2310 hname = TString::Format(
"%s/fHistRejectedDMesonPt", GetName());
2312 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", GetName());
2314 hname = TString::Format(
"%s/fHistRejectedDMesonEta", GetName());
2319 for (
auto &jetDef : fJetDefinitions) {
2321 hname = TString::Format(
"%s/%s/fDmesonJets", GetName(), jetDef.GetName());
2324 for (
auto& dmeson_pair : fDmesonJets) {
2325 const AliJetInfo* jet = dmeson_pair.second.GetJet(jetDef.GetName());
2327 if (!jetDef.IsJetInAcceptance(*jet)) {
2328 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", GetName(), jetDef.GetName());
2330 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", GetName(), jetDef.GetName());
2332 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", GetName(), jetDef.GetName());
2336 FillHnSparse(h, dmeson_pair.second, jetDef.GetName());
2359 std::map<std::string, AliJetInfo>::const_iterator it = DmesonJet.
fJets.find(n);
2360 if (it == DmesonJet.
fJets.end())
return kFALSE;
2362 for (
Int_t i = 0; i < h->GetNdimensions(); i++) {
2364 if (
title==
"#it{p}_{T,D} (GeV/#it{c})") contents[i] = DmesonJet.
fD.Pt();
2365 else if (
title==
"#eta_{D}") contents[i] = DmesonJet.
fD.Eta();
2368 else if (
title==
"#it{M}_{K#pi#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M();
2369 else if (
title==
"#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2})") contents[i] = DmesonJet.
fD.M() - DmesonJet.
fInvMass2Prong;
2370 else if (
title==
"#it{p}_{T,#pi} (GeV/#it{c})") contents[i] = DmesonJet.
fSoftPionPt;
2371 else if (
title==
"#it{z}_{D}") contents[i] = z;
2372 else if (
title==
"#Delta R_{D-jet}") contents[i] = deltaR;
2373 else if (
title==
"#eta_{D} - #eta_{jet}") contents[i] = deltaEta;
2374 else if (
title==
"#phi_{D} - #phi_{jet} (rad)") contents[i] = deltaPhi;
2375 else if (
title==
"#it{p}_{T,jet} (GeV/#it{c})") contents[i] = (*it).second.Pt();
2376 else if (
title==
"#eta_{jet}") contents[i] = (*it).second.Eta();
2377 else if (
title==
"#phi_{jet} (rad)") contents[i] = (*it).second.Phi_0_2pi();
2378 else if (
title==
"No. of constituents") contents[i] = (*it).second.fNConstituents;
2379 else AliWarning(Form(
"Unable to fill dimension '%s'!",
title.Data()));
2419 fEnabledAxis(k2ProngInvMass),
2420 fOutputType(kTreeOutput),
2422 fApplyKinematicCuts(kTRUE),
2423 fNOutputTrees(nOutputTrees),
2424 fTrackEfficiency(0),
2426 fJetAreaType(fastjet::active_area),
2427 fJetGhostArea(0.005),
2433 for (
Int_t i = 0; i < nOutputTrees; i++){
2434 DefineOutput(2+i, TTree::Class());
2453 TFile* filecuts = TFile::Open(cutfname);
2454 if (!filecuts || filecuts->IsZombie()) {
2455 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Input file not found: will use std cuts.");
2459 if (filecuts) analysiscuts =
dynamic_cast<AliRDHFCuts*
>(filecuts->Get(cutsname));
2461 if (!analysiscuts) {
2462 ::Error(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Could not find analysis cuts '%s' in '%s'.", cutsname.Data(), cutfname.Data());
2468 ::Info(
"AliAnalysisTaskDmesonJets::LoadDMesonCutsFromFile",
"Cuts '%s' loaded from file '%s'", cutsname.Data(), cutfname.Data());
2471 return analysiscuts;
2505 if (!cutfname.IsNull()) {
2511 cutsname =
"D0toKpiCuts";
2514 cutsname =
"DStartoKpipiCuts";
2520 if (!cuttype.IsNull()) {
2521 cutsname += TString::Format(
"_%s", cuttype.Data());
2535 ::Info(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"A new analysis engine '%s' has been added. The total number of analysis engines is %lu.", eng.
GetName(),
fAnalysisEngines.size());
2539 ::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());
2543 if (found_eng->
fRDHFCuts != 0) ::Warning(
"AliAnalysisTaskDmesonJets::AddAnalysisEngine",
"D meson cuts were already defined for this D meson type. They will be overwritten.");
2561 ::Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s", GetName());
2573 Int_t maxTracks = 6000;
2584 hname =
"fHistCharmPt";
2585 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
2588 hname =
"fHistCharmEta";
2589 htitle = hname +
";#eta_{charm};counts";
2592 hname =
"fHistCharmPhi";
2593 htitle = hname +
";#phi_{charm};counts";
2596 hname =
"fHistCharmPt_Eta05";
2597 htitle = hname +
";#it{p}_{T,charm} (GeV/#it{c});counts";
2600 hname =
"fHistBottomPt";
2601 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2604 hname =
"fHistBottomEta";
2605 htitle = hname +
";#eta_{bottom};counts";
2608 hname =
"fHistBottomPhi";
2609 htitle = hname +
";#phi_{bottom};counts";
2612 hname =
"fHistBottomPt_Eta05";
2613 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2616 hname =
"fHistHighestPartonPt";
2617 htitle = hname +
";#it{p}_{T,bottom} (GeV/#it{c});counts";
2620 hname =
"fHistHighestPartonType";
2621 htitle = hname +
";type;counts";
2624 hname =
"fHistNHeavyQuarks";
2625 htitle = hname +
";number of heavy-quarks;counts";
2628 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for task '%s' (%lu analysis engines)", GetName(),
fAnalysisEngines.size());
2630 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for analysis engine '%s' (%lu jet definitions)", param.GetName(), param.fJetDefinitions.size());
2634 hname = TString::Format(
"%s/fHistNAcceptedDmesonsVsNtracks", param.GetName());
2635 htitle = hname +
";#it{N}_{tracks};#it{N}_{D};events";
2638 hname = TString::Format(
"%s/fHistNTotAcceptedDmesons", param.GetName());
2639 htitle = hname +
";;#it{N}_{D}";
2642 hname = TString::Format(
"%s/fHistNDmesons", param.GetName());
2643 htitle = hname +
";#it{N}_{D};events";
2646 hname = TString::Format(
"%s/fHistNEvents", param.GetName());
2647 htitle = hname +
";Event status;counts";
2649 h->GetXaxis()->SetBinLabel(1,
"Accepted");
2650 h->GetXaxis()->SetBinLabel(2,
"Rejected");
2652 hname = TString::Format(
"%s/fHistEventRejectionReasons", param.GetName());
2653 htitle = hname +
";Rejection reason;counts";
2656 hname = TString::Format(
"%s/fHistRejectedDMesonPt", param.GetName());
2657 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});counts";
2660 hname = TString::Format(
"%s/fHistRejectedDMesonEta", param.GetName());
2661 htitle = hname +
";#it{#eta}_{D};counts";
2664 hname = TString::Format(
"%s/fHistRejectedDMesonPhi", param.GetName());
2665 htitle = hname +
";#it{#phi}_{D};counts";
2670 hname = TString::Format(
"%s/fHistRejectedDMesonInvMass", param.GetName());
2671 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2678 hname = TString::Format(
"%s/fHistRejectedDMeson2ProngInvMass", param.GetName());
2679 htitle = hname +
";#it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2683 Double_t D0mass = TDatabasePDG::Instance()->GetParticle(421)->Mass();
2684 hname = TString::Format(
"%s/fHistRejectedDMesonDeltaInvMass", param.GetName());
2685 htitle = hname +
";#it{M}_{K#pi#pi} - #it{M}_{K#pi} (GeV/#it{c}^{2});counts";
2692 hname = TString::Format(
"%s/fHistPartonPt", param.GetName());
2693 htitle = hname +
";#it{p}_{T,parton} (GeV/#it{c});counts";
2696 hname = TString::Format(
"%s/fHistPartonEta", param.GetName());
2697 htitle = hname +
";#eta_{parton};counts";
2700 hname = TString::Format(
"%s/fHistPartonPhi", param.GetName());
2701 htitle = hname +
";#phi_{parton};counts";
2704 hname = TString::Format(
"%s/fHistPartonType", param.GetName());
2705 htitle = hname +
";type;counts";
2708 hname = TString::Format(
"%s/fHistPrompt", param.GetName());
2709 htitle = hname +
";Type;counts";
2711 h->GetXaxis()->SetBinLabel(1,
"Unknown");
2712 h->GetXaxis()->SetBinLabel(2,
"Prompt");
2713 h->GetXaxis()->SetBinLabel(3,
"Non-Prompt");
2715 hname = TString::Format(
"%s/fHistAncestor", param.GetName());
2716 htitle = hname +
";Ancestor;counts";
2718 h->GetXaxis()->SetBinLabel(1,
"Unknown");
2719 h->GetXaxis()->SetBinLabel(2,
"Charm");
2720 h->GetXaxis()->SetBinLabel(3,
"Bottom");
2721 h->GetXaxis()->SetBinLabel(4,
"Proton");
2724 for (
auto& jetDef : param.fJetDefinitions) {
2725 ::Info(
"AliAnalysisTaskDmesonJets::UserCreateOutputObjects",
"Allocating histograms for jet definition '%s'", jetDef.GetName());
2728 hname = TString::Format(
"%s/%s/fHistNDmesonsVsNconstituents", param.GetName(), jetDef.GetName());
2729 htitle = hname +
";#it{N}_{constituents};#it{N}_{D};counts";
2733 hname = TString::Format(
"%s/%s/fHistMCParticleRejectionReason", param.GetName(), jetDef.GetName());
2734 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
2738 hname = TString::Format(
"%s/%s/fHistTrackRejectionReason", param.GetName(), jetDef.GetName());
2739 htitle = hname +
";Track rejection reason;#it{p}_{T,track} (GeV/#it{c});counts";
2743 hname = TString::Format(
"%s/%s/fHistClusterRejectionReason", param.GetName(), jetDef.GetName());
2744 htitle = hname +
";Cluster rejection reason;#it{p}_{T,cluster} (GeV/#it{c});counts";
2748 hname = TString::Format(
"%s/%s/fHistDMesonDaughterNotInJet", param.GetName(), jetDef.GetName());
2749 htitle = hname +
";#it{p}_{T,track} (GeV/#it{c});counts";
2752 hname = TString::Format(
"%s/%s/fHistRejectedJetPt", param.GetName(), jetDef.GetName());
2753 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});counts";
2756 hname = TString::Format(
"%s/%s/fHistRejectedJetEta", param.GetName(), jetDef.GetName());
2757 htitle = hname +
";#it{#eta}_{jet};counts";
2760 hname = TString::Format(
"%s/%s/fHistRejectedJetPhi", param.GetName(), jetDef.GetName());
2761 htitle = hname +
";#it{#phi}_{jet};counts";
2764 if (!jetDef.fRhoName.IsNull()) {
2765 hname = TString::Format(
"%s/%s/fHistRhoVsLeadJetPt", param.GetName(), jetDef.GetName());
2766 htitle = hname +
";#it{p}_{T,jet} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
2769 hname = TString::Format(
"%s/%s/fHistRhoVsLeadDPt", param.GetName(), jetDef.GetName());
2770 htitle = hname +
";#it{p}_{T,D} (GeV/#it{c});#rho (GeV/#it{c} #times rad^{-1});counts";
2773 hname = TString::Format(
"%s/%s/fHistRhoVsCent", param.GetName(), jetDef.GetName());
2774 htitle = hname +
";Centrality (%);#rho (GeV/#it{c} #times rad^{-1});counts";
2777 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsCent", param.GetName(), jetDef.GetName());
2778 htitle = hname +
";Centrality (%);#it{p}_{T,jet} (GeV/#it{c});counts";
2781 hname = TString::Format(
"%s/%s/fHistLeadDPtVsCent", param.GetName(), jetDef.GetName());
2782 htitle = hname +
";Centrality (%);#it{p}_{T,D} (GeV/#it{c});counts";
2785 hname = TString::Format(
"%s/%s/fHistRhoVsNTracks", param.GetName(), jetDef.GetName());
2786 htitle = hname +
";no. of tracks;#rho (GeV/#it{c} #times rad^{-1});counts";
2789 hname = TString::Format(
"%s/%s/fHistLeadJetPtVsNTracks", param.GetName(), jetDef.GetName());
2790 htitle = hname +
";no. of tracks;#it{p}_{T,jet} (GeV/#it{c});counts";
2793 hname = TString::Format(
"%s/%s/fHistLeadDPtVsNTracks", param.GetName(), jetDef.GetName());
2794 htitle = hname +
";no. of tracks;#it{p}_{T,D} (GeV/#it{c});counts";
2800 param.BuildTree(GetName());
2802 param.AssignDataSlot(treeSlot+2);
2807 AliError(Form(
"Number of data output slots %d not sufficient. Tree of analysis engine %s will not be posted!",
fNOutputTrees, param.GetName()));
2838 AliError(Form(
"This task need an AOD event (Task '%s'). Expect troubles...", GetName()));
2856 params.fRandomGen = rnd;
2858 for (
auto &jetdef: params.fJetDefinitions) {
2859 if (!jetdef.fRhoName.IsNull()) {
2860 jetdef.fRho =
dynamic_cast<AliRhoParameter*
>(fInputEvent->FindListObject(jetdef.fRhoName));
2862 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2863 "%s: Could not find rho object '%s' for engine '%s'",
2864 GetName(), jetdef.fRhoName.Data(), params.GetName());
2869 if (!params.fRDHFCuts) {
2871 ::Warning(
"AliAnalysisTaskDmesonJets::ExecOnce",
2872 "%s: RDHF cuts not provided for engine '%s'.",
2873 GetName(), params.GetName());
2876 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2877 "%s: RDHF cuts not provided. Engine '%s' disabled.",
2878 GetName(), params.GetName());
2879 params.fInhibit = kTRUE;
2885 for (
auto cont_it : fParticleCollArray) {
2887 if (track_cont) params.fTrackContainers.push_back(track_cont);
2890 for (
auto cont_it :
fClusterCollArray) params.fClusterContainers.push_back(cont_it.second);
2895 params.fCandidateArray =
dynamic_cast<TClonesArray*
>(
fAodEvent->GetList()->FindObject(params.fBranchName.Data()));
2897 if (params.fCandidateArray) {
2900 className =
"AliAODRecoDecayHF2Prong";
2903 className =
"AliAODRecoCascadeHF";
2905 if (!params.fCandidateArray->GetClass()->InheritsFrom(className)) {
2906 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2907 "%s: Objects of type %s in %s are not inherited from %s! Task will be disabled!",
2908 GetName(), params.fCandidateArray->GetClass()->GetName(), params.fCandidateArray->GetName(), className.Data());
2909 params.fCandidateArray = 0;
2910 params.fInhibit = kTRUE;
2914 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2915 "Could not find candidate array '%s', skipping the event. Analysis engine '%s' will be disabled!",
2916 params.fBranchName.Data(), params.GetName());
2917 params.fInhibit = kTRUE;
2921 if (params.fMCMode !=
kNoMC) {
2922 if (!params.fMCContainer) {
2923 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2924 "No MC particle container was provided. Analysis engine '%s' will be disabled!",
2926 params.fInhibit = kTRUE;
2931 if (params.fTrackContainers.size() == 0 && params.fClusterContainers.size() == 0) {
2932 ::Error(
"AliAnalysisTaskDmesonJets::ExecOnce",
2933 "No track container and no cluster container were provided. Analysis engine '%s' will be disabled!",
2935 params.fInhibit = kTRUE;
2953 if (eng.fInhibit)
continue;
2954 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
2962 if (matchingAODdeltaAODlevel <= 0) {
2965 if (eng.fInhibit)
continue;
2966 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
2974 eng.fDmesonJets.clear();
2975 if (eng.fInhibit)
continue;
2980 hname = TString::Format(
"%s/fHistNEvents", eng.GetName());
2982 Bool_t iseventselected = kTRUE;
2983 if (eng.fRDHFCuts) iseventselected = eng.fRDHFCuts->IsEventSelected(
fAodEvent);
2984 if (!iseventselected) {
2986 hname = TString::Format(
"%s/fHistEventRejectionReasons", eng.GetName());
2987 UInt_t bitmap = eng.fRDHFCuts->GetEventRejectionBitMap();
2991 if (label.IsNull())
break;
3001 AliDebug(2,
"Event selected");
3014 if (param.fInhibit)
continue;
3034 Int_t absPdgHighParton = 0;
3035 for (
auto part : itcont) {
3036 Int_t absPdgCode = TMath::Abs(part.second->GetPdgCode());
3039 if (absPdgCode > 9 && absPdgCode != 21)
continue;
3042 if (highestPartonPt < part.first.Pt()) {
3043 highestPartonPt = part.first.Pt();
3044 absPdgHighParton = absPdgCode;
3060 if (absPdgCode != 4 && absPdgCode != 5)
continue;
3061 Bool_t notLastInPartonShower = kFALSE;
3062 for (
Int_t idaugh = 0; idaugh < 2; idaugh++){
3063 Int_t daughterIndex = part.second->GetDaughter(idaugh);
3064 if (daughterIndex < 0) {
3065 AliDebug(10, Form(
"Could not find daughter of heavy quark (pdg=%d, pt=%.3f)!", absPdgCode, part.first.Pt()));
3070 AliDebug(10, Form(
"Could not find daughter %d of heavy quark (pdg=%d, pt=%.3f)!", daughterIndex, absPdgCode, part.first.Pt()));
3073 Int_t daughterAbsPdgCode = TMath::Abs(daughter->GetPdgCode());
3074 if (daughterAbsPdgCode <= 9 || daughterAbsPdgCode == 21) notLastInPartonShower = kTRUE;
3075 AliDebug(10, Form(
"Found daughter with PDG=%d, pt=%.3f", daughterAbsPdgCode, daughter->Pt()));
3077 if (notLastInPartonShower)
continue;
3079 if (absPdgCode == 4) {
3083 if (TMath::Abs(part.first.Eta()) < 0.5)
fHistManager.
FillTH1(
"fHistCharmPt_Eta05", part.first.Pt());
3085 else if (absPdgCode == 5) {
3089 if (TMath::Abs(part.first.Eta()) < 0.5)
fHistManager.
FillTH1(
"fHistBottomPt_Eta05", part.first.Pt());
3095 Int_t partonType = 0;
3096 if (absPdgHighParton == 9 || absPdgHighParton == 21) {
3100 partonType = absPdgHighParton;
3114 TParticlePDG* part = TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg));
3119 if (nbins % 2 == 0) {
3120 minMass = mass - range / 2 - range / nbins / 2;
3121 maxMass = mass + range / 2 - range / nbins / 2;
3124 minMass = mass - range / 2;
3125 maxMass = mass + range / 2;
3140 label =
"NotSelTrigger";
3142 return label.Data();
3147 return label.Data();
3150 label =
"TooFewVtxContrib";
3152 return label.Data();
3155 label =
"ZVtxOutFid";
3157 return label.Data();
3162 return label.Data();
3165 label =
"OutsideCentrality";
3167 return label.Data();
3170 label =
"PhysicsSelection";
3172 return label.Data();
3175 label =
"BadSPDVertex";
3177 return label.Data();
3180 label =
"ZVtxSPDOutFid";
3182 return label.Data();
3185 label =
"CentralityFlattening";
3187 return label.Data();
3190 label =
"BadTrackV0Correl";
3192 return label.Data();
3195 return label.Data();
3227 ::Error(
"AddTaskDmesonJets",
"No analysis manager to connect to.");
3232 AliVEventHandler* handler = mgr->GetInputEventHandler();
3234 ::Error(
"AddTaskEmcalJetSpectraQA",
"This task requires an input event handler");
3240 if (handler->InheritsFrom(
"AliESDInputHandler")) {
3243 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
3248 if (ntracks ==
"usedefault") {
3249 if (dataType ==
kESD) {
3252 else if (dataType ==
kAOD) {
3260 if (nclusters ==
"usedefault") {
3261 if (dataType ==
kESD) {
3262 nclusters =
"CaloClusters";
3264 else if (dataType ==
kAOD) {
3265 nclusters =
"caloClusters";
3272 if (nMCpart ==
"usedefault") {
3273 nMCpart =
"mcparticles";
3276 TString name(
"AliAnalysisTaskDmesonJets");
3277 if (strcmp(suffix,
"") != 0) {
3278 name += TString::Format(
"_%s", suffix.Data());
3283 if (!ntracks.IsNull()) {
3288 if (!nMCpart.IsNull()) {
3290 partCont->SetEtaLimits(-1.5, 1.5);
3291 partCont->SetPtLimits(0, 1000);
3298 mgr->AddTask(jetTask);
3301 AliAnalysisDataContainer* cinput1 = mgr->GetCommonInputContainer();
3303 contname1 +=
"_histos";
3304 AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(contname1.Data(),
3305 TList::Class(), AliAnalysisManager::kOutputContainer,
3306 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3308 mgr->ConnectInput(jetTask, 0, cinput1);
3309 mgr->ConnectOutput(jetTask, 1, coutput1);
3311 for (
Int_t i = 0; i < nMaxTrees; i++) {
3312 TString contname = TString::Format(
"%s_tree_%d", name.Data(), i);
3313 AliAnalysisDataContainer *coutput = mgr->CreateContainer(contname.Data(),
3314 TTree::Class(),AliAnalysisManager::kOutputContainer,
3315 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3316 mgr->ConnectOutput(jetTask, 2+i, coutput);
Int_t GetNConstituents() const
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.
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)
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)
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.
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)
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 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.
THashList * GetListOfHistograms() const
Get the list of histograms.
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, 3=both
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
void SetJetPtRange(Double_t min, Double_t max)
Bool_t fApplyKinematicCuts
Apply jet kinematic cuts.
const char * GetName() const
Generate a name for this jet definition.
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
void SetNeutralPtRange(Double_t min, Double_t max)
Int_t fNOutputTrees
Maximum number of output trees.
virtual Bool_t FillHistograms()
AliHFJetDefinition()
This is the default constructor, used for ROOT I/O purposes.
void SetSpecialPDG(Int_t pdg)
AliHFJetDefinition & operator=(const AliHFJetDefinition &source)
Int_t GetNAcceptedParticles() const
void SetAreaType(const fastjet::AreaType &atype)
AliTLorentzVector fMomentum
4-momentum of the jet
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)