27 #include <TDatabasePDG.h>
28 #include <TParticle.h>
36 #include "AliAODMCHeader.h"
37 #include "AliAODHandler.h"
38 #include "AliAnalysisManager.h"
40 #include "AliAODVertex.h"
43 #include "AliESDtrack.h"
44 #include "AliAODMCParticle.h"
47 #include "AliAnalysisDataSlot.h"
48 #include "AliAnalysisDataContainer.h"
69 fCombineDmesons(kFALSE),
72 fRejectQuarkNotFound(kTRUE),
74 fKeepOnlyDfromB(kFALSE),
81 fCombinedDmesonsBkg(0),
118 for (Int_t i=4; i--;) fPDGdaughters[i] = 0;
119 for (Int_t i=30; i--;) fSigmaD0[i] = 0.;
121 fNeedEmcalGeom = kFALSE;
129 fCandidateType(candtype),
137 fInhibitTask(kFALSE),
138 fCombineDmesons(kFALSE),
141 fRejectQuarkNotFound(kTRUE),
142 fRejectDfromB(kTRUE),
143 fKeepOnlyDfromB(kFALSE),
145 fArrayDStartoD0pi(0),
150 fCombinedDmesonsBkg(0),
187 Info(
"AliAnalysisTaskSEDmesonsFilterCJ",
"Calling Constructor");
189 fNeedEmcalGeom = kFALSE;
191 for (Int_t i=4; i--;) fPDGdaughters[i] = 0;
192 for (Int_t i=30; i--;) fSigmaD0[i] = 0.;
194 const Int_t
nptbins = fCuts->GetNPtBins();
195 Float_t defaultSigmaD013[13] = { 0.012, 0.012, 0.012, 0.015, 0.015, 0.018, 0.018, 0.020, 0.020, 0.030, 0.030, 0.037, 0.040 };
197 switch (fCandidateType) {
199 fCandidateName =
"D0";
202 fPDGdaughters[0] = 211;
203 fPDGdaughters[1] = 321;
204 fPDGdaughters[2] = 0;
205 fPDGdaughters[3] = 0;
206 fBranchName =
"D0toKpi";
209 fCandidateName =
"DStar";
212 fPDGdaughters[1] = 211;
213 fPDGdaughters[0] = 421;
214 fPDGdaughters[2] = 211;
215 fPDGdaughters[3] = 321;
216 fBranchName =
"Dstar";
219 for (Int_t ipt=0; ipt<
nptbins;ipt++) fSigmaD0[ipt] = defaultSigmaD013[ipt];
222 AliFatal(Form(
"Default sigma D0 not enough for %d pt bins, use SetSigmaD0ForDStar to set them",nptbins));
226 Warning(
"AliAnalysisTaskSEDmesonsFilterCJ",
"%d not accepted!!", fCandidateType);
230 if (fCandidateType ==
kD0toKpi) SetMassLimits(0.15, fPDGmother);
231 if (fCandidateType == kDstartoKpipi) SetMassLimits(0.015, fPDGmother);
233 DefineOutput(1, TList::Class());
234 DefineOutput(2, AliRDHFCuts::Class());
235 DefineOutput(3, TClonesArray::Class());
236 DefineOutput(4, TClonesArray::Class());
237 DefineOutput(5, TClonesArray::Class());
238 DefineOutput(6, TClonesArray::Class());
248 Info(
"~AliAnalysisTaskSEDmesonsFilterCJ",
"Calling Destructor");
283 Info(
"AnalysisTaskSEDmesonsForJetCorrelations::Init()",
"Entering method");
289 copyfCutsDzero->SetName(
"AnalysisCutsDzero");
290 PostData(2, copyfCutsDzero);
295 copyfCutsDstar->SetName(
"AnalysisCutsDStar");
296 PostData(2, copyfCutsDstar);
312 Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s", GetName());
328 AliWarning(Form(
"Candidate type %d not recognized!",
fCandidateType));
351 fSideBandArray->SetName(GetOutputSlot(4)->GetContainer()->GetName());
365 Info(
"UserCreateOutputObjects",
"Data posted for task %s", GetName());
375 AliDebug(2,
"Entering ExecOnce()");
380 fAodEvent =
dynamic_cast<AliAODEvent*
>(fInputEvent);
386 if (AODEvent() && IsStandardAOD()) {
390 fAodEvent =
dynamic_cast<AliAODEvent*
>(AODEvent());
394 AliAODHandler *aodHandler = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
395 if(aodHandler->GetExtensions()) {
396 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
397 AliAODEvent *aodFromExt = ext->GetAOD();
401 AliError(Form(
"This task need an AOD event! Task '%s' will be disabled!", GetName()));
411 if (!cls.InheritsFrom(
"AliAODRecoDecayHF2Prong")) {
412 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliAODRecoDecayHF2Prong! Task will be disabled!",
420 AliError(Form(
"Could not find array %s, skipping the event. Task '%s' will be disabled!",
fBranchName.Data(), GetName()));
426 fMCarray =
dynamic_cast<TClonesArray*
>(
fAodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
428 AliError(Form(
"MC particles not found! Task '%s' will be disabled!", GetName()));
451 AliDebug(2,
"Entering Run()");
458 AliDebug(2,
"TClonesArray cleared");
464 if (!
fAodEvent->GetPrimaryVertex() || TMath::Abs(
fAodEvent->GetMagneticField()) < 0.001)
return kFALSE;
468 if (!iseventselected)
return kFALSE;
471 AliDebug(2,
"Event selected");
474 AliDebug(2, Form(
"Found %d vertices", nD));
477 Int_t pdgMeson = 413;
483 for (Int_t icharm = 0; icharm < nD; icharm++) {
484 Int_t isSelected = 0;
487 if (!charmCand)
continue;
489 Int_t nprongs = charmCand->GetNProngs();
490 AliDebug(2, Form(
"Candidate is %d, and nprongs = %d",
fCandidateType, nprongs));
497 Error(
"AliAnalysisTaskSEDmesonsFilterCJ::UserExec",
"Candidate type is D* but object type is wrong (should be AliAODRecoCascadeHF)");
512 if (!isSelected)
continue;
522 AliDebug(2,
"Loop done");
547 AliDebug(2,
"Exiting method");
558 AliAODMCParticle* charmPart = 0;
563 charmPart =
static_cast<AliAODMCParticle*
>(
fMCarray->At(mcLabel));
570 if (origin < 0)
return;
602 fHistImpParB->Fill(charmCand->Getd0Prong(0), charmCand->PtProng(0));
603 fHistImpParB->Fill(charmCand->Getd0Prong(1), charmCand->PtProng(1));
622 fHistImpParS->Fill(charmCand->Getd0Prong(0), charmCand->PtProng(0));
623 fHistImpParS->Fill(charmCand->Getd0Prong(1), charmCand->PtProng(1));
629 if(!
fMultCand)
new ((*fCandidateArray)[
fNCand]) AliAODMCParticle(*charmPart);
630 else if(
fNCand==
fAnalyseCand)
new ((*fCandidateArray)[0]) AliAODMCParticle(*charmPart);
645 Int_t pdgCode = charmPart->GetPdgCode();
647 if (pdgCode == 421) {
650 else if (pdgCode == -421) {
654 AliDebug(2,
"Not a D0/D0bar meson!");
668 AliDebug(2,
"Entering method");
671 AliAODMCParticle* charmPart = 0;
674 Int_t pdgDgDStartoD0pi[2] = { 421, 211 };
675 Int_t pdgDgD0toKpi[2] = { 321, 211 };
677 Int_t mcLabel = dstar->
MatchToMC(413, 421, pdgDgDStartoD0pi, pdgDgD0toKpi,
fMCarray);
680 charmPart =
static_cast<AliAODMCParticle*
>(
fMCarray->At(mcLabel));
687 if (origin < 0)
return;
722 fHistImpParB->Fill(dstar->Getd0Prong(0), dstar->PtProng(0));
723 fHistImpParB->Fill(D0fromDstar->Getd0Prong(0), D0fromDstar->PtProng(0));
724 fHistImpParB->Fill(D0fromDstar->Getd0Prong(1), D0fromDstar->PtProng(1));
743 if(!
fMultCand)
new ((*fCandidateArray)[
fNCand]) AliAODMCParticle(*charmPart);
744 else if(
fNCand==
fAnalyseCand)
new ((*fCandidateArray)[0]) AliAODMCParticle(*charmPart);
749 fHistImpParS->Fill(dstar->Getd0Prong(0), dstar->PtProng(0));
750 fHistImpParS->Fill(D0fromDstar->Getd0Prong(0), D0fromDstar->PtProng(0));
751 fHistImpParS->Fill(D0fromDstar->Getd0Prong(1), D0fromDstar->PtProng(1));
763 Double_t mPDGD0 = TDatabasePDG::Instance()->GetParticle(421)->Mass();
764 Double_t mPDGDstar = TDatabasePDG::Instance()->GetParticle(413)->Mass();
765 Double_t invMassPDG = mPDGDstar - mPDGD0;
767 Double_t ptD = dstar->Pt();
770 AliError(Form(
"Pt %.3f out of bounds", ptD));
774 AliDebug(1, Form(
"Pt bin %d and sigma D0 %.4f", ptDbin,
fSigmaD0[ptDbin]));
777 AliDebug(2,
"D0 mass within 3 sigma");
780 AliDebug(2,
"Filling invariant mass vs pt histogram");
785 if (TMath::Abs(invmassDelta - invMassPDG) < 0.0021) {
786 AliDebug(2,
"Filling pion pt histogram");
788 AliAODTrack *softPionTrack =
static_cast<AliAODTrack*
>(dstar->
GetBachelor());
789 if (softPionTrack)
fHistPtPion->Fill(softPionTrack->Pt());
794 Int_t isDstar = charmPart == NULL ? 0 : 1;
798 AliDebug(2,
"Exiting method");
806 Double_t ptD = charmCand->Pt();
807 Double_t aD = charmCand->Phi();
808 Double_t adaugh[2] = {charmCand->PhiProng(0), charmCand->PhiProng(1)};
809 AliAODTrack* p0 =
static_cast<AliAODTrack*
>(charmCand->GetDaughter(0));
810 AliAODTrack* p1 =
static_cast<AliAODTrack*
>(charmCand->GetDaughter(1));
811 Float_t dR0 =
DeltaR(charmCand, p0);
812 Float_t dR1 =
DeltaR(charmCand, p1);
815 if (isSelected == 1 || isSelected == 3) {
822 if (isSelected >= 2) {
830 else if (isD0 == 1) {
837 if (isSelected == 3) {
845 else if (isD0 == -1) {
852 if (isSelected == 3) {
867 AliAODTrack *softPionTrack =
static_cast<AliAODTrack*
>(dstar->
GetBachelor());
868 Double_t ptD = dstar->Pt();
869 Double_t aD = dstar->Phi();
870 Double_t apis= softPionTrack->Phi();
873 Double_t aD0 = D0fromDstar->Phi();
874 Int_t isD0 = D0fromDstar->Charge()>0 ? kTRUE : kFALSE;
875 Double_t aK = isD0 ? D0fromDstar->PhiProng(0) : D0fromDstar->PhiProng(1);
876 Double_t api = isD0 ? D0fromDstar->PhiProng(1) : D0fromDstar->PhiProng(0);
877 Double_t dRDD0 =
DeltaR(dstar,D0fromDstar);
878 Double_t dRDpis =
DeltaR(dstar,softPionTrack);
879 Double_t dRDpi =
DeltaR(dstar, isD0 ? static_cast<AliVParticle*>(D0fromDstar->GetDaughter(1)) : static_cast<AliVParticle*>(D0fromDstar->GetDaughter(0)));
880 Double_t dRDK =
DeltaR(dstar, isD0 ? static_cast<AliVParticle*>(D0fromDstar->GetDaughter(0)) : static_cast<AliVParticle*>(D0fromDstar->GetDaughter(1)));
913 if (!isSelected)
return;
918 AliError(Form(
"Pt %.3f out of bounds", dstar->Pt()));
922 const Double_t mPDGD0 = TDatabasePDG::Instance()->GetParticle(421)->Mass();
939 Float_t
mass = TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg))->Mass();
949 AliError(Form(
"Wrong mass limits! Task '%s' will be disabled!", GetName()));
959 if (uplimit>lowlimit) {
964 printf(
"Error! Lower limit larger than upper limit!\n");
976 AliWarning(
"Maximum number of bins allowed is 30!");
980 if (!width)
return kFALSE;
992 fHistStat =
new TH1I(
"fHistStat",
"Statistics", 9, -0.5, 8.5);
993 fHistStat->GetXaxis()->SetBinLabel(1,
"N ev anal");
994 fHistStat->GetXaxis()->SetBinLabel(2,
"N ev sel");
997 fHistStat->GetXaxis()->SetBinLabel(3,
"N D");
1000 fHistStat->GetXaxis()->SetBinLabel(3,
"N Gen D");
1004 fHistStat->GetXaxis()->SetBinLabel(3,
"N Cand");
1006 fHistStat->GetXaxis()->SetBinLabel(4,
"N cand sel cuts");
1008 fHistStat->GetXaxis()->SetBinLabel(5,
"N side band cand");
1011 fHistStat->GetXaxis()->SetBinLabel(6,
"N Background");
1012 fHistStat->GetXaxis()->SetBinLabel(7,
"N rej no quark");
1013 fHistStat->GetXaxis()->SetBinLabel(8,
"N rej from B");
1014 fHistStat->GetXaxis()->SetBinLabel(9,
"N rej from D");
1020 fHistNCandEv =
new TH1F(
"fHistNCandEv",
"Number of candidates per event (after cuts);# cand/ev", 100, 0., 100.);
1024 fHistNSBCandEv =
new TH1F(
"hnSBCandEv",
"Number of side bands candidates per event (after cuts);# cand/ev", 100, 0.,100.);
1029 fHistPtPion =
new TH1F(
"fHistPtPion",
"Primary pions candidates pt", 500, 0., 10.);
1031 fHistPtPion->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1037 const Int_t nbinsmass = 200;
1038 const Int_t ptbinsD = 100;
1047 fHistImpParS =
new TH2F(
"fHistImpParS",
"Impact parameter of daughter tracks; Getd0Prong();#it{p}^{daugh}_{T} (GeV/c)",200, -0.1,0.1,ptbinsD, ptmin, ptmax);
1056 const Int_t nbinsalpha = 200;
1057 Float_t minalpha = -TMath::Pi();
1058 Float_t maxalpha = TMath::Pi();
1059 const Int_t nbinsdeltaR = 200;
1060 Float_t mindeltaR = 0.;
1061 Float_t maxdeltaR = 10.;
1064 fHistImpParB =
new TH2F(
"fHistImpParB",
"Impact parameter of daughter tracks (Background); Getd0Prong();#it{p}^{daugh}_{T} (GeV/c)",200, -0.1,0.1,ptbinsD, ptmin, ptmax);
1075 fHistAlphaDDS =
new TH2F(
"fHistAlphaDDS",
"Angle D^{*}-D^{0} (Signal);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1076 fHistAlphaDpisS =
new TH2F(
"fHistAlphaDpisS",
"Angle D^{*}-#pi_{soft} (Signal);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1077 fHistAlphaDpiS =
new TH2F(
"fHistAlphaDpiS",
"Angle D^{*}-#pi (Signal);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1078 fHistAlphaDKS =
new TH2F(
"fHistAlphaDKS",
"Angle D^{*}-K (Signal);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1080 fHistAlphaDDB =
new TH2F(
"fHistAlphaDDB",
"Angle D^{*}-D^{0} (Background);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1081 fHistAlphaDpisB =
new TH2F(
"fHistAlphaDpisB",
"Angle D^{*}-#pi_{soft} (Background);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1082 fHistAlphaDpiB =
new TH2F(
"fHistAlphaDpiB",
"Angle D^{*}-#pi (Background);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1083 fHistAlphaDKB =
new TH2F(
"fHistAlphaDKB",
"Angle D^{*}-K (Background);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1085 fHistDeltaRDDS =
new TH2F(
"fHistDeltaRDDS",
"Angle D^{*}-D^{0} (Signal);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1086 fHistDeltaRDpisS =
new TH2F(
"fHistDeltaRDpisS",
"Angle D^{*}-#pi_{soft} (Signal);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1087 fHistDeltaRDpiS =
new TH2F(
"fHistDeltaRDpiS",
"Angle D^{*}-#pi (Signal);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1088 fHistDeltaRDKS =
new TH2F(
"fHistDeltaRDKS",
"Angle D^{*}-K (Signal);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1090 fHistDeltaRDDB =
new TH2F(
"fHistDeltaRDDB",
"Angle D^{*}-D^{0} (Background);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1091 fHistDeltaRDpisB =
new TH2F(
"fHistDeltaRDpisB",
"Angle D^{*}-#pi_{soft} (Background);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1092 fHistDeltaRDpiB =
new TH2F(
"fHistDeltaRDpiB",
"Angle D^{*}-#pi (Background);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1093 fHistDeltaRDKB =
new TH2F(
"fHistDeltaRDKB",
"Angle D^{*}-K (Background);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1115 fHistAlphaDpiS =
new TH2F(
"fHistAlphaDpiS",
"Angle D^{0}-#pi (Signal);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1116 fHistAlphaDKS =
new TH2F(
"fHistAlphaDKS",
"Angle D^{0}-K (Signal);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1117 fHistAlphaDpiR =
new TH2F(
"fHistAlphaDpiR",
"Angle D^{0}-#pi (Reflections);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1118 fHistAlphaDKR =
new TH2F(
"fHistAlphaDKR",
"Angle D^{0}-K (Reflections);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1120 fHistAlphaDpiB =
new TH2F(
"fHistAlphaDpiB",
"Angle D^{0}-#pi (Background);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1121 fHistAlphaDKB =
new TH2F(
"fHistAlphaDKB",
"Angle D^{0}-K (Background);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1123 fHistDeltaRDpiS =
new TH2F(
"fHistDeltaRDpiS",
"Angle D^{0}-#pi (Signal);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1124 fHistDeltaRDKS =
new TH2F(
"fHistDeltaRDKS",
"Angle D^{0}-K (Signal);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1125 fHistDeltaRDpiR =
new TH2F(
"fHistDeltaRDpiR",
"Angle D^{0}-#pi (Reflections);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1126 fHistDeltaRDKR =
new TH2F(
"fHistDeltaRDKR",
"Angle D^{0}-K (Reflections);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1128 fHistDeltaRDpiB =
new TH2F(
"fHistDeltaRDpiB",
"Angle D^{0}-#pi (Background);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1129 fHistDeltaRDKB =
new TH2F(
"fHistDeltaRDKB",
"Angle D^{0}-K (Background);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1155 if (!p1 || !p2)
return -1;
1157 Double_t phi1 = p1->Phi();
1158 Double_t eta1 = p1->Eta();
1159 Double_t phi2 = p2->Phi();
1160 Double_t eta2 = p2->Eta();
1162 Double_t dPhi = phi1 - phi2;
1163 if(dPhi < -(TMath::Pi())/2) dPhi = dPhi + TMath::TwoPi();
1164 if(dPhi > (3*(TMath::Pi()))/2) dPhi = dPhi - TMath::TwoPi();
1166 Double_t dEta = eta1 - eta2;
1168 Double_t deltaR = TMath::Sqrt(dEta*dEta + dPhi*dPhi);
1180 if (!tracks)
return;
1182 TObjArray allDaughters(10);
1183 allDaughters.SetOwner(kFALSE);
1187 while ((emcpart = static_cast<AliEmcalParticle*>(next()))) {
1188 AliAODRecoDecay* reco =
dynamic_cast<AliAODRecoDecay*
>(emcpart->
GetTrack());
1189 AliDebug(2, Form(
"Found a D meson candidtate with pT = %.3f, eta = %.3f, phi = %.3f", reco->Pt(), reco->Eta(), reco->Phi()));
1193 tracks->ResetCurrentID();
1194 AliVTrack* track = 0;
1195 Int_t n = coll->GetEntriesFast();
1197 if (allDaughters.Remove(track) == 0) {
1200 AliDebug(2, Form(
"Track %d (pT = %.3f, eta = %.3f, phi = %.3f) is included", tracks->GetCurrentID(), track->Pt(), track->Eta(), track->Phi()));
1203 AliDebug(2, Form(
"Track %d (pT = %.3f, eta = %.3f, phi = %.3f) is excluded", tracks->GetCurrentID(), track->Pt(), track->Eta(), track->Phi()));
1213 Int_t n = cand->GetNDaughters();
1219 for (Int_t i = 0; i < n; i++) {
1220 AliVTrack* track =
dynamic_cast<AliVTrack*
>(cand->GetDaughter(i));
1221 if (!track)
continue;
1223 AliAODRecoDecay* cand2 =
dynamic_cast<AliAODRecoDecay*
>(track);
1230 if (!track->InheritsFrom(
"AliAODTrack")) {
1231 Printf(
"Warning: One of the daughters is not of type 'AliAODTrack' nor 'AliAODRecoDecay'.");
1235 daughters.AddLast(track);
1251 if (!mcArray)
return -1;
1253 Int_t labDau0 =
static_cast<AliVTrack*
>(cand->GetDaughter(0))->GetLabel();
1254 if (labDau0 < 0)
return -1;
1256 AliAODMCParticle* part =
static_cast<AliAODMCParticle*
>(mcArray->At(labDau0));
1265 if (!stack)
return -1;
1267 Int_t labDau0 =
static_cast<AliVTrack*
>(cand->GetDaughter(0))->GetLabel();
1268 if (labDau0 < 0)
return -1;
1278 if (!part)
return -1;
1279 if (!mcArray)
return -1;
1281 Int_t pdgGranma = 0;
1282 Int_t mother = part->GetMother();
1284 Int_t abspdgGranma = 0;
1285 Bool_t isFromB = kFALSE;
1286 Bool_t isQuarkFound = kFALSE;
1288 while (mother >= 0) {
1290 AliAODMCParticle* mcGranma =
static_cast<AliAODMCParticle*
>(mcArray->At(mother));
1291 if (mcGranma >= 0) {
1292 pdgGranma = mcGranma->GetPdgCode();
1293 abspdgGranma = TMath::Abs(pdgGranma);
1294 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)) {
1298 if (abspdgGranma == 4 || abspdgGranma == 5) isQuarkFound = kTRUE;
1299 mother = mcGranma->GetMother();
1302 ::Error(
"AliAnalysisTaskSEDmesonsFilterCJ::CheckOrigin",
"Could not retrieve mother particle %d!", mother);
1325 if (!stack)
return -1;
1327 TParticle* part = stack->Particle(ipart);
1328 if (!part)
return -1;
1330 Int_t pdgGranma = 0;
1331 Int_t mother = part->GetFirstMother();
1333 Int_t abspdgGranma = 0;
1334 Bool_t isFromB = kFALSE;
1335 Bool_t isQuarkFound = kFALSE;
1337 while (mother >= 0) {
1339 TParticle* mcGranma = stack->Particle(mother);
1340 if (mcGranma >= 0) {
1341 pdgGranma = mcGranma->GetPdgCode();
1342 abspdgGranma = TMath::Abs(pdgGranma);
1343 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)) {
1347 if (abspdgGranma == 4 || abspdgGranma == 5) isQuarkFound = kTRUE;
1348 mother = mcGranma->GetFirstMother();
1351 ::Error(
"AliAnalysisTaskSEDmesonsFilterCJ::CheckOrigin",
"Could not retrieve mother particle %d!", mother);
1374 if (!part)
return -1;
1375 if (!mcArray)
return -1;
1379 Int_t absPdgPart = TMath::Abs(part->GetPdgCode());
1381 if (part->GetNDaughters() == 2) {
1383 AliAODMCParticle* d1 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(0)));
1384 AliAODMCParticle* d2 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(1)));
1390 Int_t absPdg1 = TMath::Abs(d1->GetPdgCode());
1391 Int_t absPdg2 = TMath::Abs(d2->GetPdgCode());
1393 if (absPdgPart == 421) {
1395 if ((absPdg1 == 211 && absPdg2 == 321) ||
1396 (absPdg1 == 321 && absPdg2 == 211)) {
1401 if (absPdgPart == 413) {
1403 if (absPdg1 == 421 && absPdg2 == 211) {
1410 if (absPdg1 == 211 && absPdg2 == 421) {
1427 if (!stack)
return -1;
1429 TParticle* part = stack->Particle(ipart);
1431 if (!part)
return -1;
1435 if (part->GetNDaughters() == 2) {
1437 Int_t id1 = part->GetDaughter(0);
1438 Int_t id2 = part->GetDaughter(1);
1440 TParticle* d1 = stack->Particle(id1);
1441 TParticle* d2 = stack->Particle(id2);
1447 Int_t absPdg1 = TMath::Abs(d1->GetPdgCode());
1448 Int_t absPdg2 = TMath::Abs(d2->GetPdgCode());
1451 if (part->GetPdgCode() == 421) {
1453 if ((absPdg1 == 211 && absPdg2 == 321) ||
1454 (absPdg1 == 321 && absPdg2 == 211)) {
1459 if (part->GetPdgCode() == 413) {
1461 if (absPdg1 == 421 && absPdg2 == 211) {
1468 if (absPdg1 == 211 && absPdg2 == 421) {
void ProcessDstar(AliAODRecoCascadeHF *dstar, Int_t isSelected)
static Int_t CheckOrigin(AliAODRecoDecay *cand, TClonesArray *mcArray)
virtual AliVParticle * GetNextAcceptParticle()
TClonesArray * fCombinedDmesonsBkg
contains candidates selected by AliRDHFCuts and the rest of the event tracks
Double_t DeltaInvMass() const
void ProcessD0(AliAODRecoDecayHF2Prong *charmCand, Int_t isSelected)
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
Base task in the EMCAL framework.
TClonesArray * fArrayDStartoD0pi
void FillDStarMCTruthKinHistos(AliAODRecoCascadeHF *dstar, Int_t, Int_t isDstar)
void FillD0MCTruthKinHistos(AliAODRecoDecayHF2Prong *charmCand, Int_t isSelected, Int_t isD0)
static Double_t AddDaughters(AliAODRecoDecay *cand, TObjArray &daughters)
void AddEventTracks(TClonesArray *coll, AliParticleContainer *tracks)
Double_t InvMassD0() const
AliVTrack * GetTrack() const
AliAnalysisTaskSEDmesonsFilterCJ()
Container for particles within the EMCAL framework.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Int_t fNCand
contains bkg candidates selected by AliRDHFCuts and the rest of the event tracks
void FillDstarSideBands(AliAODRecoCascadeHF *dstar)
TClonesArray * fSideBandArray
contains candidates selected by AliRDHFCuts
TClonesArray * fCandidateArray
static Int_t CheckDecayChannel(AliAODMCParticle *part, TClonesArray *mcArray)
void SetMassLimits(Double_t range, Int_t pdg)
void UserCreateOutputObjects()
AliAODTrack * GetBachelor() const
Double_t InvMassD0bar() const
Bool_t SetD0WidthForDStar(Int_t nptbins, Float_t *width)
virtual ~AliAnalysisTaskSEDmesonsFilterCJ()
ClassImp(AliAnalysisTaskSEDmesonsFilterCJ) AliAnalysisTaskSEDmesonsFilterCJ
Bool_t IsEventSelected(AliVEvent *event)
AliEmcalList * fOutput
!output list
Bool_t fRejectQuarkNotFound
Int_t fNSBCand
number of selected D candidates already added to fCandidateArray
Bool_t DefineHistoForAnalysis()
Bool_t IsSelected(TObject *obj)
Double_t InvMassD0() const
TH1 * fHistStat
number of selected side-band D candidates already added to fSideBandArray
Float_t DeltaR(AliVParticle *p1, AliVParticle *p2) const
void AddObjectToEvent(TObject *obj, Bool_t attempt=kFALSE)
void UserCreateOutputObjects()
AliAODRecoDecayHF2Prong * Get2Prong() const
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
Int_t PtBin(Double_t pt) const
TClonesArray * fCombinedDmesons
contains candidates selected by AliRDHFCuts::IsSelected(kTracks), to be used for side bands (DStar ca...