24 #include <TClonesArray.h>
28 #include <TDatabasePDG.h>
32 #include <THnSparse.h>
34 #include "AliAnalysisManager.h"
39 #include "AliAODHandler.h"
40 #include "AliAODEvent.h"
41 #include "AliAODVertex.h"
42 #include "AliAODTrack.h"
46 #include "AliAnalysisTaskSE.h"
50 #include "AliAODVZERO.h"
51 #include "AliESDUtils.h"
64 fHistNtrCorrVsZvtx(0),
67 fHistGenPrimaryParticlesInelGt0(0),
70 fHistNtrCorrEvWithCand(0),
71 fHistNtrCorrEvWithD(0),
73 fSparseSpherocitywithNoPid(0),
78 fMCRecoBothPromptFD(0),
79 fMCAccGenPromptEvSel(0),
80 fMCAccGenFeeddownEvSel(0),
87 fCounterCandidates(0),
96 fSubtractTrackletsFromDau(kFALSE),
102 fMultiplicityEstimator(kNtrk10),
103 fMCPrimariesEstimator(kEta10),
104 fFillSoSparseChecks(0),
112 fphiStepSizeDeg(0.1),
116 fCalculateSphericity(kFALSE),
117 fDoVZER0ParamVertexCorr(1)
120 for(Int_t i=0; i<5; i++) fHistMassPtImpPar[i]=0;
121 for(Int_t i=0; i<4; i++) fMultEstimatorAvg[i]=0;
126 AliAnalysisTaskSE(name),
134 fHistNtrCorrVsZvtx(0),
137 fHistGenPrimaryParticlesInelGt0(0),
138 fHistNtrCorrPSSel(0),
139 fHistNtrCorrEvSel(0),
140 fHistNtrCorrEvWithCand(0),
141 fHistNtrCorrEvWithD(0),
142 fSparseSpherocity(0),
143 fSparseSpherocitywithNoPid(0),
145 fMCAccGenFeeddown(0),
148 fMCRecoBothPromptFD(0),
149 fMCAccGenPromptEvSel(0),
150 fMCAccGenFeeddownEvSel(0),
152 fLowmasslimit(1.765),
154 fRDCutsAnalysis(cuts),
157 fCounterCandidates(0),
160 fLowerImpPar(-2000.),
161 fHigherImpPar(2000.),
164 fisPPbData(switchPPb),
166 fSubtractTrackletsFromDau(kFALSE),
172 fMultiplicityEstimator(kNtrk10),
173 fMCPrimariesEstimator(kEta10),
174 fFillSoSparseChecks(0),
182 fphiStepSizeDeg(0.1),
186 fCalculateSphericity(kFALSE),
187 fDoVZER0ParamVertexCorr(1)
204 DefineOutput(1,TList::Class());
206 DefineOutput(2,TList::Class());
208 DefineOutput(3,TList::Class());
210 DefineOutput(4,TList::Class());
212 DefineOutput(5,TList::Class());
230 for(Int_t i=0; i<4; i++) {
234 for(Int_t i=0; i<5; i++){
244 if(uplimit>lowlimit){
248 AliError(
"Wrong mass limits: upper value should be larger than lower one");
254 Double_t
mass=TDatabasePDG::Instance()->GetParticle(TMath::Abs(pdg))->Mass();
262 printf(
"AnalysisTaskSEDvsMultiplicity_0::Init() \n");
267 if(
fisPPbData){ AliFatal(
"Nch weights can only be used with MC and data histogram in pPb");
return; }
278 copycut->SetName(
"AnalysisCutsDplus");
282 copycut->SetName(
"AnalysisCutsDzero");
286 copycut->SetName(
"AnalysisCutsDStar");
298 if (
fisPPbData) {period[0]=
"LHC13b"; period[1]=
"LHC13c"; nProfiles = 2;}
299 else {period[0]=
"LHC10b"; period[1]=
"LHC10c"; period[2]=
"LHC10d"; period[3]=
"LHC10e"; nProfiles = 4;}
301 for(Int_t i=0; i<nProfiles; i++){
304 hprof->SetName(Form(
"ProfileTrkVsZvtx%s\n",period[i].
Data()));
319 if(fDebug > 1) printf(
"AnalysisTaskSEDvsMultiplicity::UserCreateOutputObjects() \n");
324 fOutput->SetName(
"OutputHistos");
330 Int_t nMultBins = 200;
331 Float_t firstMultBin = -0.5;
332 Float_t lastMultBin = 199.5;
333 Int_t nMultBinsNtrk = nMultBins;
334 Float_t lastMultBinNtrk = lastMultBin;
335 Int_t nMultBinsV0 = 400;
336 Float_t lastMultBinV0 = 799.5;
337 const char *estimatorName=
"tracklets";
340 lastMultBinNtrk = 374.5;
341 nMultBins = nMultBinsNtrk;
342 lastMultBin = lastMultBinNtrk;
345 nMultBins = nMultBinsV0;
346 lastMultBin = lastMultBinV0;
347 estimatorName =
"vzero";
350 fHistNtrCorrPSSel =
new TH1F(
"hNtrCorrPSSel",Form(
"Corrected %s multiplicity for PS selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
351 fHistNtrCorrEvSel =
new TH1F(
"hNtrCorrEvSel",Form(
"Corrected %s multiplicity for selected events; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
352 fHistNtrCorrEvWithCand =
new TH1F(
"hNtrCorrEvWithCand", Form(
"%s multiplicity for events with D candidates; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
353 fHistNtrCorrEvWithD =
new TH1F(
"hNtrCorrEvWithD", Form(
"%s multiplicity for events with D in mass region ; %s ; Entries",estimatorName,estimatorName),nMultBins,firstMultBin,lastMultBin);
355 fHistNtrVsZvtx =
new TH2F(
"hNtrVsZvtx",Form(
"N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin);
356 fHistNtrCorrVsZvtx =
new TH2F(
"hNtrCorrVsZvtx",Form(
"N%s vs VtxZ; VtxZ;N_{%s};",estimatorName,estimatorName),300,-15,15,nMultBins,firstMultBin,lastMultBin);
358 TString histoNtrName;
359 TString histoNtrCorrName;
362 histoNtrName =
"hNtrVsSpheri";
363 histoNtrCorrName =
"hNtrCorrVsSpheri";
364 parNameNtr =
"Spheri";
367 histoNtrName =
"hNtrVsSphero";
368 histoNtrCorrName =
"hNtrCorrVsSphero";
369 parNameNtr =
"Sphero";
372 fHistNtrVsSo =
new TH2F(histoNtrName.Data(),Form(
"N_{%s} vs %s; %s; N_{%s};",estimatorName,parNameNtr.Data(),parNameNtr.Data(),estimatorName), 20, 0., 1., nMultBins,firstMultBin,lastMultBin);
373 fHistNtrCorrVsSo =
new TH2F(histoNtrCorrName.Data(),Form(
"N_{%s} vs %s; %s; N_{%s};",estimatorName,parNameNtr.Data(),parNameNtr.Data(),estimatorName), 20, 0., 1., nMultBins, firstMultBin,lastMultBin);
375 fHistGenPrimaryParticlesInelGt0 =
new TH1F(
"hGenPrimaryParticlesInelGt0",
"Multiplcity of generated charged particles ; Nparticles ; Entries",nMultBins,firstMultBin,lastMultBin);
395 fHistNEvents =
new TH1F(
"fHistNEvents",
"number of events ",11,-0.5,10.5);
396 fHistNEvents->GetXaxis()->SetBinLabel(1,
"nEvents total");
397 fHistNEvents->GetXaxis()->SetBinLabel(2,
"nEvents with Z vertex");
398 fHistNEvents->GetXaxis()->SetBinLabel(3,
"nEvents selected");
399 fHistNEvents->GetXaxis()->SetBinLabel(4,
"Rejected due to trigger");
400 fHistNEvents->GetXaxis()->SetBinLabel(5,
"Rejected due to phys sel");
401 fHistNEvents->GetXaxis()->SetBinLabel(6,
"Rejected due to vertex cuts");
402 fHistNEvents->GetXaxis()->SetBinLabel(7,
"Rejected due to pileup");
403 fHistNEvents->GetXaxis()->SetBinLabel(8,
"Total no. of candidate");
404 fHistNEvents->GetXaxis()->SetBinLabel(9,
"no. of cand wo bitmask");
405 fHistNEvents->GetXaxis()->SetBinLabel(10,
"D after cuts (No PID)");
406 fHistNEvents->GetXaxis()->SetBinLabel(11,
"D after cuts + PID)");
413 Int_t nbinsSo[4]={48,
fNMassBins, 20, nMultBins};
415 Double_t xmaxSo[4]={24.,
fUpmasslimit, 1., lastMultBin};
418 TString histoNameNoPid;
422 histoName =
"hSparseSphericity";
423 histoNameNoPid =
"hSparseSphericitywithNoPid";
424 parName =
"Sphericity";
427 histoName =
"hSparseSpherocity";
428 histoNameNoPid =
"hSparseSpherocitywithNoPid";
429 parName =
"Spherocity";
432 Int_t nbinsSowithMultUncorr[5]={48,
fNMassBins, 20, nMultBins, nMultBins};
433 Double_t xminSowithMultUncorr[5]={0.,
fLowmasslimit,0., firstMultBin, firstMultBin};
434 Double_t xmaxSowithMultUncorr[5]={24.,
fUpmasslimit, 1., lastMultBin, lastMultBin};
435 fSparseSpherocity =
new THnSparseD(histoName.Data(), Form(
"D candidates:; p_{T} [GeV/c]; InvMass [GeV/c^{2}]; %s; Multipicity; MultipicityUncorr;", parName.Data()), 5 , nbinsSowithMultUncorr, xminSowithMultUncorr, xmaxSowithMultUncorr);
438 fSparseSpherocity =
new THnSparseD(histoName.Data(), Form(
"D candidates:; p_{T} [GeV/c]; InvMass [GeV/c^{2}]; %s; Multipicity;", parName.Data()), 4 , nbinsSo, xminSo, xmaxSo);
446 Int_t nbinsPrompt[4]={48, nMultBins, 20, 100};
447 Int_t nbinsFeeddown[4]={48, nMultBins, 20, 100};
448 Double_t xminPrompt[4] = {0.,firstMultBin, 0., -1.};
449 Double_t xmaxPrompt[4] = {24.,lastMultBin, 1., 1.};
450 Double_t xminFeeddown[4] = {0.,firstMultBin, 0., -1.};
451 Double_t xmaxFeeddown[4] = {24.,lastMultBin, 1., 1.};
454 fMCAccGenPrompt =
new THnSparseD(
"hMCAccGenPrompt",
"kStepMCAcceptance pt vs. Multiplicity vs. Spherocity vs. y - promptD",4,nbinsPrompt,xminPrompt,xmaxPrompt);
460 fMCRecoPrompt =
new THnSparseD(
"hMCRecoPrompt",
"kStepRecoPID pt vs. Multiplicity vs. Spherocity vs. y - promptD",4,nbinsPrompt,xminPrompt,xmaxPrompt);
466 fMCAccGenPromptEvSel =
new THnSparseD(
"hMCAccGenPromptEvSel",
"kStepMCAcceptanceEvSel pt vs. Multiplicity vs. Spherocity vs. y - promptD",4,nbinsPrompt,xminPrompt,xmaxPrompt);
473 fMCAccGenFeeddown =
new THnSparseD(
"hMCAccGenBFeeddown",
"kStepMCAcceptance pt vs. Multiplicity vs. Spherocity vs. y - DfromB",4,nbinsFeeddown,xminFeeddown,xmaxFeeddown);
479 fMCRecoFeeddown =
new THnSparseD(
"hMCRecoFeeddown",
"kStepRecoPID pt vs. Multiplicity vs. Spherocity vs. y - DfromB",4,nbinsFeeddown,xminFeeddown,xmaxFeeddown);
485 fMCAccGenFeeddownEvSel =
new THnSparseD(
"hMCAccGenBFeeddownEvSel",
"kStepMCAcceptance pt vs. Multiplicity vs. Spherocity vs. y - DfromB",4,nbinsFeeddown,xminFeeddown,xmaxFeeddown);
492 fMCRecoBothPromptFD =
new THnSparseD(
"hMCRecoBothPromptFD",
"kStepRecoPID pt vs. Multiplicity vs. Spherocity vs. y - BothPromptFD",4,nbinsPrompt,xminPrompt,xmaxPrompt);
545 AliAODEvent *aod =
dynamic_cast<AliAODEvent*
> (InputEvent());
547 TClonesArray *arrayCand = 0;
548 TString arrayName=
"";
553 arrayName=
"Charm3Prong";
554 pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=211;
559 pdgDau[0]=211; pdgDau[1]=321; pdgDau[2]=0;
564 pdgDau[0]=321; pdgDau[1]=211; pdgDau[2]=0;
569 if(!aod && AODEvent() && IsStandardAOD()) {
572 aod =
dynamic_cast<AliAODEvent*
> (AODEvent());
575 AliAODHandler* aodHandler = (AliAODHandler*)
576 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
577 if(aodHandler->GetExtensions()) {
578 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
579 AliAODEvent *aodFromExt = ext->GetAOD();
580 arrayCand=(TClonesArray*)aodFromExt->GetList()->FindObject(arrayName.Data());
583 arrayCand=(TClonesArray*)aod->GetList()->FindObject(arrayName.Data());
586 if(!aod || !arrayCand) {
587 printf(
"AliAnalysisTaskSEDvsEventShapes::UserExec: Charm3Prong branch not found!\n");
592 Int_t runnumber = aod->GetRunNumber();
593 if(aod->GetTriggerMask()==0 &&
594 (runnumber>=195344 && runnumber<=195677)){
595 AliDebug(3,
"Event rejected because of null trigger mask");
602 if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001)
return;
604 Int_t countTreta1=0, countTreta03=0, countTreta05=0, countTreta16=0;
605 AliAODTracklets* tracklets=aod->GetTracklets();
606 Int_t nTr=tracklets->GetNumberOfTracklets();
607 for(Int_t iTr=0; iTr<nTr; iTr++){
608 Double_t theta=tracklets->GetTheta(iTr);
609 Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
610 if(eta>-0.3 && eta<0.3) countTreta03++;
611 if(eta>-0.5 && eta<0.5) countTreta05++;
612 if(eta>-1.0 && eta<1.0) countTreta1++;
613 if(eta>-1.6 && eta<1.6) countTreta16++;
616 Int_t vzeroMult=0, vzeroMultA=0, vzeroMultC=0;
617 Int_t vzeroMultEq=0, vzeroMultAEq=0, vzeroMultCEq=0;
618 AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
620 vzeroMultA =
static_cast<Int_t
>(vzeroAOD->GetMTotV0A());
621 vzeroMultC =
static_cast<Int_t
>(vzeroAOD->GetMTotV0C());
622 vzeroMult = vzeroMultA + vzeroMultC;
625 vzeroMultEq = vzeroMultAEq + vzeroMultCEq;
628 Int_t countMult = countTreta1;
649 Double_t countTreta1corr=countTreta1;
650 Double_t countCorr=countMult;
651 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
654 Bool_t isDataDrivenZvtxCorr=kTRUE;
655 Bool_t isVtxOk=kFALSE;
656 Int_t vzeroMultACorr=vzeroMultA, vzeroMultCCorr=vzeroMultC, vzeroMultCorr=vzeroMult;
657 Int_t vzeroMultAEqCorr=vzeroMultAEq, vzeroMultCEqCorr=vzeroMultCEq, vzeroMultEqCorr=vzeroMultEq;
659 if(vtx1->GetNContributors()>0){
669 isDataDrivenZvtxCorr=kFALSE;
672 Float_t zvtx = vtx1->GetZ();
673 isDataDrivenZvtxCorr=kFALSE;
674 vzeroMultACorr =
static_cast<Int_t
>(AliESDUtils::GetCorrV0A(vzeroMultA,zvtx));
675 vzeroMultCCorr =
static_cast<Int_t
>(AliESDUtils::GetCorrV0C(vzeroMultC,zvtx));
676 vzeroMultCorr = vzeroMultACorr + vzeroMultCCorr;
677 vzeroMultAEqCorr =
static_cast<Int_t
>(AliESDUtils::GetCorrV0A(vzeroMultAEq,zvtx));
678 vzeroMultCEqCorr =
static_cast<Int_t
>( AliESDUtils::GetCorrV0C(vzeroMultCEq,zvtx));
679 vzeroMultEqCorr = vzeroMultAEqCorr + vzeroMultCEqCorr;
688 if(isVtxOk && isDataDrivenZvtxCorr){
711 TClonesArray *arrayMC=0;
712 AliAODMCHeader *mcHeader=0;
717 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
719 printf(
"AliAnalysisTaskSEDvsEventShapes::UserExec: MC particles branch not found!\n");
723 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
725 printf(
"AliAnalysisTaskSEDvsEventShapes::UserExec: MC header branch not found!\n");
741 Double_t nchWeight=1.0;
744 Int_t nChargedMCEta10=0, nChargedMCEta03=0, nChargedMCEta05=0, nChargedMCEta16=0, nChargedMCEtam37tm17=0, nChargedMCEta28t51=0;
745 Int_t nChargedMCPrimaryEta10=0, nChargedMCPrimaryEta03=0, nChargedMCPrimaryEta05=0, nChargedMCPrimaryEta16=0, nChargedMCPrimaryEtam37tm17=0, nChargedMCPrimaryEta28t51=0;
746 Int_t nChargedMCPhysicalPrimaryEta10=0, nChargedMCPhysicalPrimaryEta03=0, nChargedMCPhysicalPrimaryEta05=0, nChargedMCPhysicalPrimaryEta16=0, nChargedMCPhysicalPrimaryEtam37tm17=0, nChargedMCPhysicalPrimaryEta28t51=0;
747 for(Int_t i=0; i<arrayMC->GetEntriesFast(); i++){
748 AliAODMCParticle *part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
749 Int_t
charge = part->Charge();
750 Double_t eta = part->Eta();
751 Bool_t isPrim = part->IsPrimary();
752 Bool_t isPhysPrim = part->IsPhysicalPrimary();
754 if(eta>-0.3 && eta< 0.3) {
756 if(isPrim) nChargedMCPrimaryEta03++;
757 if(isPhysPrim) nChargedMCPhysicalPrimaryEta03++;
759 if(eta>-0.5 && eta< 0.5) {
761 if(isPrim) nChargedMCPrimaryEta05++;
762 if(isPhysPrim) nChargedMCPhysicalPrimaryEta05++;
764 if(eta>-1.0 && eta< 1.0) {
766 if(isPrim) nChargedMCPrimaryEta10++;
767 if(isPhysPrim) nChargedMCPhysicalPrimaryEta10++;
769 if(eta>-1.6 && eta< 1.6) {
771 if(isPrim) nChargedMCPrimaryEta16++;
772 if(isPhysPrim) nChargedMCPhysicalPrimaryEta16++;
774 if(eta>-3.7 && eta<-1.7) {
775 nChargedMCEtam37tm17++;
776 if(isPrim) nChargedMCPrimaryEtam37tm17++;
777 if(isPhysPrim) nChargedMCPhysicalPrimaryEtam37tm17++;
779 if(eta> 2.8 && eta< 5.1) {
780 nChargedMCEta28t51++;
781 if(isPrim) nChargedMCPrimaryEta28t51++;
782 if(isPhysPrim) nChargedMCPhysicalPrimaryEta28t51++;
786 Int_t nChargedMC=nChargedMCEta10;
787 Int_t nChargedMCPrimary=nChargedMCPrimaryEta10;
788 Int_t nChargedMCPhysicalPrimary=nChargedMCPhysicalPrimaryEta10;
793 Double_t tmpweight = 1.0;
794 Double_t tmpXweight=nChargedMCPhysicalPrimary;
797 if(tmpXweight<=0) tmpweight = 0.0;
802 tmpweight = pMC>0 ? pMeas/pMC : 0.;
804 nchWeight *= tmpweight;
805 AliDebug(2,Form(
"Using Nch weights, Mult=%f Weight=%f\n",tmpXweight,nchWeight));
810 nChargedMC = nChargedMCEta16 - nChargedMCEta10;
811 nChargedMCPrimary = nChargedMCPrimaryEta16 - nChargedMCPrimaryEta10;
812 nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta16 - nChargedMCPhysicalPrimaryEta10;
814 nChargedMC = nChargedMCEta05;
815 nChargedMCPrimary = nChargedMCPrimaryEta05;
816 nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta05;
818 nChargedMC = nChargedMCEta03;
819 nChargedMCPrimary = nChargedMCPrimaryEta03;
820 nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta03;
822 nChargedMC = nChargedMCEtam37tm17 + nChargedMCEta28t51;
823 nChargedMCPrimary = nChargedMCPrimaryEtam37tm17 + nChargedMCPrimaryEta28t51;
824 nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEtam37tm17 + nChargedMCPhysicalPrimaryEta28t51;
826 nChargedMC = nChargedMCEta28t51;
827 nChargedMCPrimary = nChargedMCPrimaryEta28t51;
828 nChargedMCPhysicalPrimary = nChargedMCPhysicalPrimaryEta28t51;
831 if(nChargedMCPhysicalPrimary>0){
836 Int_t nCand = arrayCand->GetEntriesFast();
837 Int_t nSelectedNoPID=0,nSelectedPID=0,nSelectedInMassPeak=0;
838 Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
839 Double_t mDplusPDG = TDatabasePDG::Instance()->GetParticle(411)->Mass();
840 Double_t mDstarPDG = TDatabasePDG::Instance()->GetParticle(413)->Mass();
843 UInt_t pdgDgDStartoD0pi[2]={421,211};
846 Double_t nSelCand=0.;
847 for (Int_t iCand = 0; iCand < nCand; iCand++) {
858 Double_t ptCand = d->Pt();
861 if(!isFidAcc)
continue;
865 if(passTopolCuts==0)
continue;
872 Double_t multForCand = countCorr;
879 for(Int_t iDau=0; iDau<nDau; iDau++){
880 AliAODTrack *t = NULL;
881 if(
fPdgMeson==413){ t = (AliAODTrack*)d0fromDstar->GetDaughter(iDau); }
882 else{ t = (AliAODTrack*)d->GetDaughter(iDau); }
884 if(t->HasPointOnITSLayer(0) && t->HasPointOnITSLayer(1)){
885 if(multForCand>0) multForCand-=1;
889 Bool_t isPrimary=kTRUE;
890 Double_t trueImpParXY=9999.;
891 Double_t impparXY=d->
ImpParXY()*10000.;
895 mass[0]=d->InvMass(nDau,pdgDau);
897 if(TMath::Abs(mass[0]-mDplusPDG)<0.02) nSelectedInMassPeak++;
899 UInt_t pdgdaughtersD0[2]={211,321};
900 UInt_t pdgdaughtersD0bar[2]={321,211};
901 mass[0]=d->InvMass(2,pdgdaughtersD0);
902 mass[1]=d->InvMass(2,pdgdaughtersD0bar);
903 if(TMath::Abs(mass[0]-mD0PDG)<0.02 || TMath::Abs(mass[1]-mD0PDG)<0.02 ) nSelectedInMassPeak++;
908 if(TMath::Abs(mass[0]-(mDstarPDG-mD0PDG))<0.0015) nSelectedInMassPeak++;
913 for(Int_t iHyp=0; iHyp<2; iHyp++){
914 if(mass[iHyp]<0.)
continue;
915 Double_t invMass=mass[iHyp];
916 Double_t arrayForSparse[5]={invMass,ptCand,impparXY,dlen,multForCand};
920 labD = dCascade->
MatchToMC(
fPdgMeson,421,(Int_t*)pdgDgDStartoD0pi,(Int_t*)pdgDau,arrayMC);
922 labD = d->MatchToMC(
fPdgMeson,arrayMC,nDau,(Int_t*)pdgDau);
927 AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
928 Int_t code=partD->GetPdgCode();
930 if(Origin==5) isPrimary=kFALSE;
931 if(code<0 && iHyp==0) fillHisto=kFALSE;
932 if(code>0 && iHyp==1) fillHisto=kFALSE;
941 Double_t arrayForSparseTrue[5]={invMass,ptCand,trueImpParXY,dlen,multForCand};
942 if(fillHisto && passAllCuts){
956 if(iHyp==0 && !(passTopolCuts&1))
continue;
957 if(iHyp==1 && !(passTopolCuts&2))
continue;
961 Double_t arrayForSparseSoNoPid[4]={ptCand, invMass, spherocity, multForCand};
965 if(iHyp==0 && !(passAllCuts&1))
continue;
966 if(iHyp==1 && !(passAllCuts&2))
continue;
969 aveMult+=multForCand;
974 Double_t arrayForSparseSowithMultUnncorr[5]={ptCand, invMass, spherocity, multForCand, (Double_t)countTreta1};
979 Double_t arrayForSparseSo[4]={ptCand, invMass, spherocity, multForCand};
984 Bool_t keepCase=kTRUE;
986 AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
987 Int_t code=partD->GetPdgCode();
988 if(code<0 && iHyp==0) keepCase=kFALSE;
989 if(code>0 && iHyp==1) keepCase=kFALSE;
1029 "Mass vs. pt vs.imppar - All",
1032 "Mass vs. pt vs.imppar - promptD",
1035 "Mass vs. pt vs.imppar - DfromB",
1038 "Mass vs. pt vs.true imppar -DfromB",
1041 "Mass vs. pt vs.imppar - backgr.",
1043 for(Int_t i=0; i<5;i++){
1053 if(fDebug > 1) printf(
"AnalysisTaskSEDvsMultiplicity: Terminate() \n");
1055 fOutput =
dynamic_cast<TList*
> (GetOutputData(1));
1057 printf(
"ERROR: fOutput not available\n");
1063 printf(
"ERROR: fHistNEvents not available\n");
1066 printf(
"Number of Analyzed Events = %d\n",(Int_t)
fHistNEvents->GetBinContent(3));
1078 Int_t runNo =
event->GetRunNumber();
1082 if (runNo>195343 && runNo<195484) period = 0;
1083 if (runNo>195528 && runNo<195678) period = 1;
1084 if (period < 0 || period > 1)
return 0;
1087 if(runNo>114930 && runNo<117223) period = 0;
1088 if(runNo>119158 && runNo<120830) period = 1;
1089 if(runNo>122373 && runNo<126438) period = 2;
1090 if(runNo>127711 && runNo<130841) period = 3;
1091 if(period<0 || period>3)
return 0;
1105 Double_t nchbins[82]={0.50,1.50,2.50,3.50,4.50,5.50,6.50,7.50,8.50,9.50,
1106 10.50,11.50,12.50,13.50,14.50,15.50,16.50,17.50,18.50,19.50,
1107 20.50,21.50,22.50,23.50,24.50,25.50,26.50,27.50,28.50,29.50,
1108 30.50,31.50,32.50,33.50,34.50,35.50,36.50,37.50,38.50,39.50,
1109 40.50,41.50,42.50,43.50,44.50,45.50,46.50,47.50,48.50,49.50,
1110 50.50,51.50,52.50,53.50,54.50,55.50,56.50,57.50,58.50,59.50,
1111 60.50,62.50,64.50,66.50,68.50,70.50,72.50,74.50,76.50,78.50,
1112 80.50,82.50,84.50,86.50,88.50,90.50,92.50,94.50,96.50,98.50,
1114 Double_t pch[81]={0.062011,0.072943,0.070771,0.067245,0.062834,0.057383,0.051499,0.04591,0.041109,0.036954,
1115 0.03359,0.030729,0.028539,0.026575,0.024653,0.0229,0.021325,0.019768,0.018561,0.017187,
1116 0.01604,0.014836,0.013726,0.012576,0.011481,0.010393,0.009502,0.008776,0.008024,0.007452,
1117 0.006851,0.006428,0.00594,0.005515,0.005102,0.00469,0.004162,0.003811,0.003389,0.003071,
1118 0.002708,0.002422,0.002184,0.001968,0.00186,0.00165,0.001577,0.001387,0.001254,0.001118,
1119 0.001037,0.000942,0.000823,0.000736,0.000654,0.000579,0.000512,0.00049,0.00045,0.000355,
1120 0.000296,0.000265,0.000193,0.00016,0.000126,0.0000851, 0.0000676,0.0000537,0.0000426, 0.0000338,
1121 0.0000268,0.0000213,0.0000166,0.0000133,0.0000106,0.00000837,0.00000662, 0.00000524,0.00000414, 0.00000327,
1126 for(Int_t i=0; i<81; i++){
1137 AliAODMCParticle *partD = (AliAODMCParticle*)arrayMC->At(labD);
1139 Double_t
mass = partD->M();
1140 Double_t pt = partD->Pt();
1141 Double_t rapid = partD->Y();
1148 Double_t arrayMCRecoPrompt[4] = {pt, countMult, spherocity, rapid};
1154 Double_t arrayMCRecoFeeddown[4] = {pt, countMult, spherocity, rapid};
1158 Double_t arrayMCReco[4] = {pt, countMult, spherocity, rapid};
1169 Int_t totPart = arrayMC->GetEntriesFast();
1177 Double_t zMCVertex = mcHeader->GetVtxZ();
1179 for(Int_t iPart=0; iPart<totPart; iPart++){
1180 AliAODMCParticle* mcGenPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
1182 if (TMath::Abs(mcGenPart->GetPdgCode()) ==
fPdgMeson){
1186 Bool_t isGoodDecay=kFALSE;
1187 Int_t labDau[4]={-1,-1,-1,-1};
1188 Bool_t isInAcc = kFALSE;
1189 Bool_t isFidAcc = kFALSE;
1193 if(mcGenPart->GetNDaughters()!=2)
continue;
1194 if(deca==1) isGoodDecay=kTRUE;
1197 if(deca>0) isGoodDecay=kTRUE;
1200 if(deca==1) isGoodDecay=kTRUE;
1203 if(deca==1) isGoodDecay=kTRUE;
1210 Double_t pt = mcGenPart->Pt();
1211 Double_t rapid = mcGenPart->Y();
1220 Double_t arrayMCGenPrompt[4] = {pt, countMult, spherocity, rapid};
1227 Double_t arrayMCGenFeeddown[4] = {pt, countMult, spherocity, rapid};
1241 for (Int_t iProng = 0; iProng<nProng; iProng++){
1242 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
1243 if(!mcPartDaughter)
return kFALSE;
1244 Double_t eta = mcPartDaughter->Eta();
1245 Double_t pt = mcPartDaughter->Pt();
Double_t fetaMin
pt limits for acceptance step
Bool_t CheckGenAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
TH2F * fHistNtrCorrVsSo
hist of ntracklets vs So
static Int_t CheckDplusDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
Bool_t fCalculateSphericity
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
Double_t DeltaInvMass() const
Int_t fMultiplicityEstimator
AliNormalizationCounter * fCounterCandidates
Counter for normalization, uncorrected multiplicity.
Int_t GetIsSelectedCuts() const
Bool_t fSubtractTrackletsFromDau
static Int_t CheckDstarDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
Bool_t HasSelectionBit(Int_t i) const
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
void FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Bool_t isEvSel)
THnSparseD * fMCAccGenFeeddown
histo for StepMCGenAcc for D meson prompt
THnSparseD * fSparseSpherocity
hist. of ntracklets for evnts with a candidate in D mass peak
Double_t ImpParXY() const
THnSparseD * fMCRecoFeeddown
histo for StepMCReco for D meson feeddown
Int_t fFillSoSparseChecks
static Int_t CheckDsDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
Int_t fMCPrimariesEstimator
Int_t GetWhyRejection() const
virtual void UserCreateOutputObjects()
THnSparseD * fMCAccGenFeeddownEvSel
histo for StepMCGenAcc for D meson prompt with Vertex selection (IsEvSel = kTRUE) ...
TH1F * fHistNtrCorrPSSel
hist. of geenrated multiplcity
virtual void UserExec(Option_t *option)
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Double_t GetMaxVtxZ() const
void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity)
TH2F * fHistNtrCorrVsZvtx
hist of ntracklets vs Zvertex
THnSparseF * fHistMassPtImpPar[5]
histo for StepMCGenAcc for D meson feeddown with Vertex selection (IsEvSel = kTRUE) ...
TH2F * fHistNtrVsZvtx
hist. for No. of events
Bool_t fDoImpPar
Counter for normalization, corrected multiplicity for candidates.
TList * fListProfiles
list send on output slot 3
THnSparseD * fMCRecoPrompt
histo for StepMCGenAcc for D meson feeddown
static Double_t GetVZEROCEqualizedMultiplicity(AliAODEvent *ev)
virtual ~AliAnalysisTaskSEDvsEventShapes()
Class for cuts on AOD reconstructed D+->Kpipi.
void SetStudyMultiplicity(Bool_t flag, Float_t etaRange)
AliAnalysisTaskSEDvsEventShapes()
Int_t fDoVZER0ParamVertexCorr
THnSparseD * fSparseSpherocitywithNoPid
THnSparse histograms for Spherocity studies.
AliNormalizationCounter * fCounterU
Counter for normalization, corrected multiplicity.
static Int_t CheckD0Decay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
AliRDHFCuts * fRDCutsAnalysis
void SetStudySpherocity(Bool_t flag, Double_t nsteps=100.)
TH1F * fHistNtrCorrEvSel
hist. of ntracklets for physics selection only selected events
void SetMassLimits(Double_t lowlimit, Double_t uplimit)
void CreateImpactParameterHistos()
TH2F * fHistNtrVsSo
hist of ntracklets vs Zvertex
TProfile * fMultEstimatorAvg[4]
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
TH1F * fHistNtrCorrEvWithD
hist. of ntracklets for evnts with a candidate
Bool_t IsEventRejectedDuePhysicsSelection() const
TProfile * GetEstimatorHistogram(const AliVEvent *event)
TH1F * fHistNtrCorrEvWithCand
hist. of ntracklets for selected events
ClassImp(AliAnalysisTaskSEDvsEventShapes) AliAnalysisTaskSEDvsEventShapes
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
THnSparseD * fMCRecoBothPromptFD
histo for StepMCReco for D meson feeddown
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
Double_t fUpmasslimit
histograms for impact paramter studies
THnSparseD * fMCAccGenPromptEvSel
histo for StepMCReco for D meson Both Prompt Feeddown
Double_t fPtAccCut
eta limits for acceptance step
Bool_t IsSelected(TObject *obj)
TList * fListCuts
list send on output slot 1
TH1F * fHistGenPrimaryParticlesInelGt0
hist of ntracklets vs So
static Double_t GetVZEROAEqualizedMultiplicity(AliAODEvent *ev)
Utilities for V0 multiplicity checks.
static Double_t GetTrueImpactParameterDzero(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
Functions for computing true impact parameter of D meson.
AliNormalizationCounter * fCounterC
void CreateMeasuredNchHisto()
AliAODRecoDecayHF2Prong * Get2Prong() const
THnSparseD * fMCAccGenPrompt
THnSparse histograms for Spherocity studies.
static Double_t GetTrueImpactParameterDplus(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
Double_t fEtaAccCut
flag for quark/hadron level identification of prompt and feeddown
virtual Bool_t IsInFiducialAcceptance(Double_t, Double_t) const
virtual void Terminate(Option_t *option)
static Double_t GetSphericity(AliAODEvent *aod, Double_t etaMin=-0.8, Double_t etaMax=0.8, Double_t ptMin=0.15, Double_t ptMax=10., Int_t filtbit1=256, Int_t filtbit2=512, Int_t minMult=3)
TH1F * fHistNEvents
list send on output slot 5
static Double_t GetSpherocity(AliAODEvent *aod, Double_t etaMin=-0.8, Double_t etaMax=0.8, Double_t ptMin=0.15, Double_t ptMax=10., Int_t filtbit1=256, Int_t filtbit2=512, Int_t minMult=3, Double_t phiStepSizeDeg=0.1, Int_t nTrksToSkip=0, Int_t *idToSkip=0x0)
Functions for event shape variables.