28 #include <TDatabasePDG.h>
29 #include <TParticle.h>
37 #include "AliAODMCHeader.h"
38 #include "AliAODHandler.h"
39 #include "AliAnalysisManager.h"
41 #include "AliAODVertex.h"
44 #include "AliESDtrack.h"
45 #include "AliAODMCParticle.h"
48 #include "AliAnalysisDataSlot.h"
49 #include "AliAnalysisDataContainer.h"
71 fCombineDmesons(kFALSE),
74 fRejectQuarkNotFound(kTRUE),
76 fKeepOnlyDfromB(kFALSE),
83 fCombinedDmesonsBkg(0),
84 fMCCombinedDmesons(0),
121 for (
Int_t i=4; i--;) fPDGdaughters[i] = 0;
122 for (
Int_t i=30; i--;) fSigmaD0[i] = 0.;
124 fNeedEmcalGeom = kFALSE;
132 fCandidateType(candtype),
140 fInhibitTask(kFALSE),
141 fCombineDmesons(kFALSE),
144 fRejectQuarkNotFound(kTRUE),
145 fRejectDfromB(kTRUE),
146 fKeepOnlyDfromB(kFALSE),
148 fArrayDStartoD0pi(0),
153 fCombinedDmesonsBkg(0),
154 fMCCombinedDmesons(0),
191 Info(
"AliAnalysisTaskSEDmesonsFilterCJ",
"Calling Constructor");
199 Float_t defaultSigmaD013[20]={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,0.040,0.040,0.040,0.040,0.040,0.040,0.040};
226 AliFatal(Form(
"Default sigma D0 not enough for %d pt bins, use SetSigmaD0ForDStar to set them",nptbins));
230 Warning(
"AliAnalysisTaskSEDmesonsFilterCJ",
"%d not accepted!!",
fCandidateType);
237 DefineOutput(1, TList::Class());
238 DefineOutput(2, AliRDHFCuts::Class());
239 DefineOutput(3, TClonesArray::Class());
240 DefineOutput(4, TClonesArray::Class());
241 DefineOutput(5, TClonesArray::Class());
242 DefineOutput(6, TClonesArray::Class());
243 DefineOutput(7, TClonesArray::Class());
253 Info(
"~AliAnalysisTaskSEDmesonsFilterCJ",
"Calling Destructor");
290 Info(
"AnalysisTaskSEDmesonsForJetCorrelations::Init()",
"Entering method");
296 copyfCutsDzero->SetName(
"AnalysisCutsDzero");
297 PostData(2, copyfCutsDzero);
302 copyfCutsDstar->SetName(
"AnalysisCutsDStar");
303 PostData(2, copyfCutsDstar);
319 Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s", GetName());
335 AliWarning(Form(
"Candidate type %d not recognized!",
fCandidateType));
360 fSideBandArray->SetName(GetOutputSlot(4)->GetContainer()->GetName());
378 Info(
"UserCreateOutputObjects",
"Data posted for task %s", GetName());
388 AliDebug(2,
"Entering ExecOnce()");
399 if (AODEvent() && IsStandardAOD()) {
407 AliAODHandler *aodHandler = (AliAODHandler*)((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
408 if(aodHandler->GetExtensions()) {
409 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
414 AliError(Form(
"This task need an AOD event! Task '%s' will be disabled!", GetName()));
424 if (!cls.InheritsFrom(
"AliAODRecoDecayHF2Prong")) {
425 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliAODRecoDecayHF2Prong! Task will be disabled!",
433 AliError(Form(
"Could not find array %s, skipping the event. Task '%s' will be disabled!",
fBranchName.Data(), GetName()));
439 fMCarray =
dynamic_cast<TClonesArray*
>(
fAodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
441 AliError(Form(
"MC particles not found! Task '%s' will be disabled!", GetName()));
466 if (matchingAODdeltaAODlevel<=0) {
471 AliDebug(2,
"Entering Run()");
478 AliDebug(2,
"TClonesArray cleared");
484 if (!
fAodEvent->GetPrimaryVertex() || TMath::Abs(
fAodEvent->GetMagneticField()) < 0.001)
return kFALSE;
488 if (!iseventselected)
return kFALSE;
491 AliDebug(2,
"Event selected");
494 AliDebug(2, Form(
"Found %d vertices", nD));
497 Int_t pdgMeson = 413;
506 for (
Int_t icharm = 0; icharm < nD; icharm++) {
507 Int_t isSelected = 0;
510 if (!charmCand)
continue;
513 Int_t nprongs = charmCand->GetNProngs();
514 AliDebug(2, Form(
"Candidate is %d, and nprongs = %d",
fCandidateType, nprongs));
521 Error(
"AliAnalysisTaskSEDmesonsFilterCJ::UserExec",
"Candidate type is D* but object type is wrong (should be AliAODRecoCascadeHF)");
536 if (!isSelected)
continue;
548 AliDebug(2,
"Loop done");
578 AliDebug(2,
"Exiting method");
589 AliAODMCParticle* charmPart = 0;
594 charmPart =
static_cast<AliAODMCParticle*
>(
fMCarray->At(mcLabel));
601 if (origin < 0)
return;
633 fHistImpParB->Fill(charmCand->Getd0Prong(0), charmCand->PtProng(0));
634 fHistImpParB->Fill(charmCand->Getd0Prong(1), charmCand->PtProng(1));
653 if(charmPart)
new ((*fMCCombinedDmesons)[0]) AliAODMCParticle(*charmPart);
657 fHistImpParS->Fill(charmCand->Getd0Prong(0), charmCand->PtProng(0));
658 fHistImpParS->Fill(charmCand->Getd0Prong(1), charmCand->PtProng(1));
664 if(!
fMultCand)
new ((*fCandidateArray)[
fNCand]) AliAODMCParticle(*charmPart);
665 else if(
fNCand==
fAnalyseCand)
new ((*fCandidateArray)[0]) AliAODMCParticle(*charmPart);
680 Int_t pdgCode = charmPart->GetPdgCode();
682 if (pdgCode == 421) {
685 else if (pdgCode == -421) {
689 AliDebug(2,
"Not a D0/D0bar meson!");
703 AliDebug(2,
"Entering method");
706 AliAODMCParticle* charmPart = 0;
709 Int_t pdgDgDStartoD0pi[2] = { 421, 211 };
710 Int_t pdgDgD0toKpi[2] = { 321, 211 };
715 charmPart =
static_cast<AliAODMCParticle*
>(
fMCarray->At(mcLabel));
722 if (origin < 0)
return;
757 fHistImpParB->Fill(dstar->Getd0Prong(0), dstar->PtProng(0));
758 fHistImpParB->Fill(D0fromDstar->Getd0Prong(0), D0fromDstar->PtProng(0));
759 fHistImpParB->Fill(D0fromDstar->Getd0Prong(1), D0fromDstar->PtProng(1));
776 if(charmPart)
new ((*fMCCombinedDmesons)[0]) AliAODMCParticle(*charmPart);
782 if(!
fMultCand)
new ((*fCandidateArray)[
fNCand]) AliAODMCParticle(*charmPart);
783 else if(
fNCand==
fAnalyseCand)
new ((*fCandidateArray)[0]) AliAODMCParticle(*charmPart);
788 fHistImpParS->Fill(dstar->Getd0Prong(0), dstar->PtProng(0));
789 fHistImpParS->Fill(D0fromDstar->Getd0Prong(0), D0fromDstar->PtProng(0));
790 fHistImpParS->Fill(D0fromDstar->Getd0Prong(1), D0fromDstar->PtProng(1));
802 Double_t mPDGD0 = TDatabasePDG::Instance()->GetParticle(421)->Mass();
803 Double_t mPDGDstar = TDatabasePDG::Instance()->GetParticle(413)->Mass();
804 Double_t invMassPDG = mPDGDstar - mPDGD0;
809 AliError(Form(
"Pt %.3f out of bounds", ptD));
813 AliDebug(1, Form(
"Pt bin %d and sigma D0 %.4f", ptDbin,
fSigmaD0[ptDbin]));
816 AliDebug(2,
"D0 mass within 3 sigma");
819 AliDebug(2,
"Filling invariant mass vs pt histogram");
824 if (TMath::Abs(invmassDelta - invMassPDG) < 0.0021) {
825 AliDebug(2,
"Filling pion pt histogram");
827 AliAODTrack *softPionTrack =
static_cast<AliAODTrack*
>(dstar->
GetBachelor());
828 if (softPionTrack)
fHistPtPion->Fill(softPionTrack->Pt());
833 Int_t isDstar = charmPart == NULL ? 0 : 1;
837 AliDebug(2,
"Exiting method");
847 Double_t adaugh[2] = {charmCand->PhiProng(0), charmCand->PhiProng(1)};
848 AliAODTrack* p0 =
static_cast<AliAODTrack*
>(charmCand->GetDaughter(0));
849 AliAODTrack* p1 =
static_cast<AliAODTrack*
>(charmCand->GetDaughter(1));
854 if (isSelected == 1 || isSelected == 3) {
861 if (isSelected >= 2) {
869 else if (isD0 == 1) {
876 if (isSelected == 3) {
884 else if (isD0 == -1) {
891 if (isSelected == 3) {
906 AliAODTrack *softPionTrack =
static_cast<AliAODTrack*
>(dstar->
GetBachelor());
909 Double_t apis= softPionTrack->Phi();
913 Int_t isD0 = D0fromDstar->Charge()>0 ? kTRUE : kFALSE;
914 Double_t aK = isD0 ? D0fromDstar->PhiProng(0) : D0fromDstar->PhiProng(1);
915 Double_t api = isD0 ? D0fromDstar->PhiProng(1) : D0fromDstar->PhiProng(0);
918 Double_t dRDpi =
DeltaR(dstar, isD0 ? static_cast<AliVParticle*>(D0fromDstar->GetDaughter(1)) : static_cast<AliVParticle*>(D0fromDstar->GetDaughter(0)));
919 Double_t dRDK =
DeltaR(dstar, isD0 ? static_cast<AliVParticle*>(D0fromDstar->GetDaughter(0)) : static_cast<AliVParticle*>(D0fromDstar->GetDaughter(1)));
952 if (!isSelected)
return;
957 AliError(Form(
"Pt %.3f out of bounds", dstar->Pt()));
961 const Double_t mPDGD0 = TDatabasePDG::Instance()->GetParticle(421)->Mass();
978 Float_t mass = TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg))->Mass();
988 AliError(Form(
"Wrong mass limits! Task '%s' will be disabled!", GetName()));
998 if (uplimit>lowlimit) {
1003 printf(
"Error! Lower limit larger than upper limit!\n");
1015 AliWarning(
"Maximum number of bins allowed is 30!");
1019 if (!width)
return kFALSE;
1031 fHistStat =
new TH1I(
"fHistStat",
"Statistics", 9, -0.5, 8.5);
1032 fHistStat->GetXaxis()->SetBinLabel(1,
"N ev anal");
1033 fHistStat->GetXaxis()->SetBinLabel(2,
"N ev sel");
1036 fHistStat->GetXaxis()->SetBinLabel(3,
"N D");
1039 fHistStat->GetXaxis()->SetBinLabel(3,
"N Gen D");
1043 fHistStat->GetXaxis()->SetBinLabel(3,
"N Cand");
1045 fHistStat->GetXaxis()->SetBinLabel(4,
"N cand sel cuts");
1047 fHistStat->GetXaxis()->SetBinLabel(5,
"N side band cand");
1050 fHistStat->GetXaxis()->SetBinLabel(6,
"N Background");
1051 fHistStat->GetXaxis()->SetBinLabel(7,
"N rej no quark");
1052 fHistStat->GetXaxis()->SetBinLabel(8,
"N rej from B");
1053 fHistStat->GetXaxis()->SetBinLabel(9,
"N rej from D");
1059 fHistNCandEv =
new TH1F(
"fHistNCandEv",
"Number of candidates per event (after cuts);# cand/ev", 100, 0., 100.);
1063 fHistNSBCandEv =
new TH1F(
"hnSBCandEv",
"Number of side bands candidates per event (after cuts);# cand/ev", 100, 0.,100.);
1068 fHistPtPion =
new TH1F(
"fHistPtPion",
"Primary pions candidates pt", 500, 0., 10.);
1070 fHistPtPion->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1076 const Int_t nbinsmass = 200;
1077 const Int_t ptbinsD = 100;
1086 fHistImpParS =
new TH2F(
"fHistImpParS",
"Impact parameter of daughter tracks; Getd0Prong();#it{p}^{daugh}_{T} (GeV/c)",200, -0.1,0.1,ptbinsD, ptmin, ptmax);
1095 const Int_t nbinsalpha = 200;
1096 Float_t minalpha = -TMath::Pi();
1097 Float_t maxalpha = TMath::Pi();
1098 const Int_t nbinsdeltaR = 200;
1103 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);
1114 fHistAlphaDDS =
new TH2F(
"fHistAlphaDDS",
"Angle D^{*}-D^{0} (Signal);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1115 fHistAlphaDpisS =
new TH2F(
"fHistAlphaDpisS",
"Angle D^{*}-#pi_{soft} (Signal);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1116 fHistAlphaDpiS =
new TH2F(
"fHistAlphaDpiS",
"Angle D^{*}-#pi (Signal);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1117 fHistAlphaDKS =
new TH2F(
"fHistAlphaDKS",
"Angle D^{*}-K (Signal);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1119 fHistAlphaDDB =
new TH2F(
"fHistAlphaDDB",
"Angle D^{*}-D^{0} (Background);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1120 fHistAlphaDpisB =
new TH2F(
"fHistAlphaDpisB",
"Angle D^{*}-#pi_{soft} (Background);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1121 fHistAlphaDpiB =
new TH2F(
"fHistAlphaDpiB",
"Angle D^{*}-#pi (Background);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1122 fHistAlphaDKB =
new TH2F(
"fHistAlphaDKB",
"Angle D^{*}-K (Background);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1124 fHistDeltaRDDS =
new TH2F(
"fHistDeltaRDDS",
"Angle D^{*}-D^{0} (Signal);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1125 fHistDeltaRDpisS =
new TH2F(
"fHistDeltaRDpisS",
"Angle D^{*}-#pi_{soft} (Signal);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1126 fHistDeltaRDpiS =
new TH2F(
"fHistDeltaRDpiS",
"Angle D^{*}-#pi (Signal);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1127 fHistDeltaRDKS =
new TH2F(
"fHistDeltaRDKS",
"Angle D^{*}-K (Signal);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1129 fHistDeltaRDDB =
new TH2F(
"fHistDeltaRDDB",
"Angle D^{*}-D^{0} (Background);#varphi (D^{*}) - #varphi (D0);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1130 fHistDeltaRDpisB =
new TH2F(
"fHistDeltaRDpisB",
"Angle D^{*}-#pi_{soft} (Background);#varphi (D^{*}) - #varphi (#pi_{soft});p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1131 fHistDeltaRDpiB =
new TH2F(
"fHistDeltaRDpiB",
"Angle D^{*}-#pi (Background);#varphi (D^{*}) - #varphi (#pi);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1132 fHistDeltaRDKB =
new TH2F(
"fHistDeltaRDKB",
"Angle D^{*}-K (Background);#varphi (D^{*}) - #varphi (K);p_{T}^{D*}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1154 fHistAlphaDpiS =
new TH2F(
"fHistAlphaDpiS",
"Angle D^{0}-#pi (Signal);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1155 fHistAlphaDKS =
new TH2F(
"fHistAlphaDKS",
"Angle D^{0}-K (Signal);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1156 fHistAlphaDpiR =
new TH2F(
"fHistAlphaDpiR",
"Angle D^{0}-#pi (Reflections);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1157 fHistAlphaDKR =
new TH2F(
"fHistAlphaDKR",
"Angle D^{0}-K (Reflections);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1159 fHistAlphaDpiB =
new TH2F(
"fHistAlphaDpiB",
"Angle D^{0}-#pi (Background);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1160 fHistAlphaDKB =
new TH2F(
"fHistAlphaDKB",
"Angle D^{0}-K (Background);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsalpha, minalpha, maxalpha, ptbinsD, ptmin, ptmax);
1162 fHistDeltaRDpiS =
new TH2F(
"fHistDeltaRDpiS",
"Angle D^{0}-#pi (Signal);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1163 fHistDeltaRDKS =
new TH2F(
"fHistDeltaRDKS",
"Angle D^{0}-K (Signal);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1164 fHistDeltaRDpiR =
new TH2F(
"fHistDeltaRDpiR",
"Angle D^{0}-#pi (Reflections);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1165 fHistDeltaRDKR =
new TH2F(
"fHistDeltaRDKR",
"Angle D^{0}-K (Reflections);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1167 fHistDeltaRDpiB =
new TH2F(
"fHistDeltaRDpiB",
"Angle D^{0}-#pi (Background);#varphi (D^{0}) - #varphi (#pi);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1168 fHistDeltaRDKB =
new TH2F(
"fHistDeltaRDKB",
"Angle D^{0}-K (Background);#varphi (D^{0}) - #varphi (K);p_{T}^{D0}",nbinsdeltaR, mindeltaR, maxdeltaR, ptbinsD, ptmin, ptmax);
1194 if (!p1 || !p2)
return -1;
1202 if(dPhi < -(TMath::Pi())/2) dPhi = dPhi + TMath::TwoPi();
1203 if(dPhi > (3*(TMath::Pi()))/2) dPhi = dPhi - TMath::TwoPi();
1207 Double_t deltaR = TMath::Sqrt(dEta*dEta + dPhi*dPhi);
1219 if (!tracks)
return;
1222 allDaughters.SetOwner(kFALSE);
1226 while ((emcpart = static_cast<AliEmcalParticle*>(next()))) {
1227 AliAODRecoDecay* reco =
dynamic_cast<AliAODRecoDecay*
>(emcpart->
GetTrack());
1228 AliDebug(2, Form(
"Found a D meson candidtate with pT = %.3f, eta = %.3f, phi = %.3f", reco->Pt(), reco->Eta(), reco->Phi()));
1232 tracks->ResetCurrentID();
1233 AliVTrack* track = 0;
1234 Int_t n = coll->GetEntriesFast();
1236 if (allDaughters.Remove(track) == 0) {
1239 AliDebug(2, Form(
"Track %d (pT = %.3f, eta = %.3f, phi = %.3f) is included", tracks->GetCurrentID(), track->Pt(), track->Eta(), track->Phi()));
1242 AliDebug(2, Form(
"Track %d (pT = %.3f, eta = %.3f, phi = %.3f) is excluded", tracks->GetCurrentID(), track->Pt(), track->Eta(), track->Phi()));
1252 Int_t n = cand->GetNDaughters();
1258 for (
Int_t i = 0; i < n; i++) {
1259 AliVTrack* track =
dynamic_cast<AliVTrack*
>(cand->GetDaughter(i));
1260 if (!track)
continue;
1262 AliAODRecoDecay* cand2 =
dynamic_cast<AliAODRecoDecay*
>(track);
1269 if (!track->InheritsFrom(
"AliAODTrack")) {
1270 Printf(
"Warning: One of the daughters is not of type 'AliAODTrack' nor 'AliAODRecoDecay'.");
1274 daughters.AddLast(track);
1291 if (!mctracks)
return;
1294 allMCDaughters.SetOwner(kFALSE);
1296 AliAODMCParticle* mcD = (AliAODMCParticle*)coll->At(0);
1300 mctracks->ResetCurrentID();
1301 AliAODMCParticle* mcpart = 0;
1302 Int_t n = coll->GetEntriesFast();
1304 if(TMath::Abs(mcpart->Charge())==0)
continue;
1305 if (allMCDaughters.Remove(mcpart) == 0) {
1306 new ((*coll)[n]) AliAODMCParticle(*mcpart);
1308 AliDebug(2, Form(
"Track %d (pT = %.3f, eta = %.3f, phi = %.3f) is included", mctracks->GetCurrentID(), mcpart->Pt(), mcpart->Eta(), mcpart->Phi()));
1311 AliDebug(2, Form(
"Track %d (pT = %.3f, eta = %.3f, phi = %.3f) is excluded", mctracks->GetCurrentID(), mcpart->Pt(), mcpart->Eta(), mcpart->Phi()));
1321 Int_t n = mcDmeson->GetNDaughters();
1326 for (
Int_t i = 0; i < n; i++) {
1327 AliAODMCParticle* DDaughter =
static_cast<AliAODMCParticle*
>(mcArray->At(mcDmeson->GetDaughter(i)));
1328 if (!DDaughter)
continue;
1330 if (DDaughter->GetNDaughters()>0) {
1336 mcdaughters.AddLast(DDaughter);
1337 pt += DDaughter->Pt();
1350 if (!mcArray)
return -1;
1352 Int_t labDau0 =
static_cast<AliVTrack*
>(cand->GetDaughter(0))->GetLabel();
1353 if (labDau0 < 0)
return -1;
1355 AliAODMCParticle* part =
static_cast<AliAODMCParticle*
>(mcArray->At(labDau0));
1364 if (!stack)
return -1;
1366 Int_t labDau0 =
static_cast<AliVTrack*
>(cand->GetDaughter(0))->GetLabel();
1367 if (labDau0 < 0)
return -1;
1377 if (!part)
return -1;
1378 if (!mcArray)
return -1;
1380 Int_t pdgGranma = 0;
1381 Int_t mother = part->GetMother();
1383 Int_t abspdgGranma = 0;
1385 Bool_t isQuarkFound = kFALSE;
1387 while (mother >= 0) {
1389 AliAODMCParticle* mcGranma =
static_cast<AliAODMCParticle*
>(mcArray->At(mother));
1390 if (mcGranma >= 0) {
1391 pdgGranma = mcGranma->GetPdgCode();
1392 abspdgGranma = TMath::Abs(pdgGranma);
1393 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)) {
1397 if (abspdgGranma == 4 || abspdgGranma == 5) isQuarkFound = kTRUE;
1398 mother = mcGranma->GetMother();
1401 ::Error(
"AliAnalysisTaskSEDmesonsFilterCJ::CheckOrigin",
"Could not retrieve mother particle %d!", mother);
1424 if (!stack)
return -1;
1426 TParticle* part = stack->Particle(ipart);
1427 if (!part)
return -1;
1429 Int_t pdgGranma = 0;
1430 Int_t mother = part->GetFirstMother();
1432 Int_t abspdgGranma = 0;
1434 Bool_t isQuarkFound = kFALSE;
1436 while (mother >= 0) {
1438 TParticle* mcGranma = stack->Particle(mother);
1439 if (mcGranma >= 0) {
1440 pdgGranma = mcGranma->GetPdgCode();
1441 abspdgGranma = TMath::Abs(pdgGranma);
1442 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)) {
1446 if (abspdgGranma == 4 || abspdgGranma == 5) isQuarkFound = kTRUE;
1447 mother = mcGranma->GetFirstMother();
1450 ::Error(
"AliAnalysisTaskSEDmesonsFilterCJ::CheckOrigin",
"Could not retrieve mother particle %d!", mother);
1473 if (!part)
return -1;
1474 if (!mcArray)
return -1;
1478 Int_t absPdgPart = TMath::Abs(part->GetPdgCode());
1480 if (part->GetNDaughters() == 2) {
1482 AliAODMCParticle* d1 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(0)));
1483 AliAODMCParticle* d2 =
static_cast<AliAODMCParticle*
>(mcArray->At(part->GetDaughter(1)));
1489 Int_t absPdg1 = TMath::Abs(d1->GetPdgCode());
1490 Int_t absPdg2 = TMath::Abs(d2->GetPdgCode());
1492 if (absPdgPart == 421) {
1494 if ((absPdg1 == 211 && absPdg2 == 321) ||
1495 (absPdg1 == 321 && absPdg2 == 211)) {
1500 if (absPdgPart == 413) {
1502 if (absPdg1 == 421 && absPdg2 == 211) {
1509 if (absPdg1 == 211 && absPdg2 == 421) {
1526 if (!stack)
return -1;
1528 TParticle* part = stack->Particle(ipart);
1530 if (!part)
return -1;
1534 if (part->GetNDaughters() == 2) {
1536 Int_t id1 = part->GetDaughter(0);
1537 Int_t id2 = part->GetDaughter(1);
1539 TParticle* d1 = stack->Particle(id1);
1540 TParticle* d2 = stack->Particle(id2);
1546 Int_t absPdg1 = TMath::Abs(d1->GetPdgCode());
1547 Int_t absPdg2 = TMath::Abs(d2->GetPdgCode());
1550 if (part->GetPdgCode() == 421) {
1552 if ((absPdg1 == 211 && absPdg2 == 321) ||
1553 (absPdg1 == 321 && absPdg2 == 211)) {
1558 if (part->GetPdgCode() == 413) {
1560 if (absPdg1 == 421 && absPdg2 == 211) {
1567 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
static Int_t CheckMatchingAODdeltaAODevents()
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)
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
Double_t InvMassD0() const
AliVTrack * GetTrack() const
AliAnalysisTaskSEDmesonsFilterCJ()
static Double_t AddMCDaughters(AliAODMCParticle *mcDmeson, TObjArray &mcdaughters, TClonesArray *mcArray)
Container for particles within the EMCAL framework.
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
Int_t fNCand
contains MC D0 and MC event particles
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
TClonesArray * fMCCombinedDmesons
contains bkg candidates selected by AliRDHFCuts and the rest of the event tracks
Double_t InvMassD0bar() const
Bool_t SetD0WidthForDStar(Int_t nptbins, Float_t *width)
virtual ~AliAnalysisTaskSEDmesonsFilterCJ()
void ExecOnce()
Perform steps needed to initialize the analysis.
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)
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
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)
Add object to event.
void UserCreateOutputObjects()
Main initialization function on the worker.
AliAODRecoDecayHF2Prong * Get2Prong() const
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
Int_t PtBin(Double_t pt) const
void AddMCEventTracks(TClonesArray *coll, AliParticleContainer *mctracks)
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
TClonesArray * fCombinedDmesons
contains candidates selected by AliRDHFCuts::IsSelected(kTracks), to be used for side bands (DStar ca...