AliPhysics  ced2227 (ced2227)
AliAnalysisTaskSEDvsEventShapes.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSEDVSEVENTSHAPES_H
2 #define ALIANALYSISTASKSEDVSEVENTSHAPES_H
3 
4 /* Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 /* $Id$ */
8 
9 //*************************************************************************
10 // Class AliAnalysisTaskSEDvsEventShapes
11 // AliAnalysisTaskSE for the D meson vs. Event shape analysis in different mutiplicity window
12 // Authors: Renu Bala, Manoj Bhanudas Jadhav
13 //*************************************************************************
14 
15 #include <TROOT.h>
16 #include <TSystem.h>
17 #include <TH1F.h>
18 #include <TH2F.h>
19 #include <TH3F.h>
20 #include <THnSparse.h>
21 #include <TArrayD.h>
22 #include <TFile.h>
23 #include <TRandom.h>
24 #include <TProfile.h>
26 #include "AliAnalysisTaskSE.h"
27 #include "AliAnalysisVertexingHF.h"
29 #include "AliAODMCHeader.h"
30 #include "AliAODEvent.h"
31 #include "AliAODMCParticle.h"
32 #include "AliVertexingHFUtils.h"
33 #include "AliVEvent.h"
34 
36 {
37 public:
38 
40  AliAnalysisTaskSEDvsEventShapes(const char *name, Int_t pdgMeson, AliRDHFCuts* cuts, Bool_t switchPPb);
42 
43  void SetMassLimits(Double_t lowlimit, Double_t uplimit);
44  void SetMassLimits(Int_t pdg, Double_t range);
48  Int_t GetNMassBins() const{return fNMassBins;}
52 
55  fLowerImpPar=dmin;
56  fHigherImpPar=dmax;
57  }
58  void SetReadMC(Bool_t readMC=kTRUE){fReadMC=readMC;}
59  void SetMCOption(Int_t option=0){ fMCOption = option; }
60  void SetIsPPbData(Bool_t flag=kTRUE){
61  fisPPbData=flag;
62  }
63  void SetUseBit(Bool_t use=kTRUE){fUseBit=use;}
65 
66  void SetMultiplVsZProfileLHC10b(TProfile* hprof){
67  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
68  fMultEstimatorAvg[0]=new TProfile(*hprof);
69  }
70  void SetMultiplVsZProfileLHC10c(TProfile* hprof){
71  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
72  fMultEstimatorAvg[1]=new TProfile(*hprof);
73  }
74  void SetMultiplVsZProfileLHC10d(TProfile* hprof){
75  if(fMultEstimatorAvg[2]) delete fMultEstimatorAvg[2];
76  fMultEstimatorAvg[2]=new TProfile(*hprof);
77  }
78  void SetMultiplVsZProfileLHC10e(TProfile* hprof){
79  if(fMultEstimatorAvg[3]) delete fMultEstimatorAvg[3];
80  fMultEstimatorAvg[3]=new TProfile(*hprof);
81  }
82 
83  void SetMultiplVsZProfileLHC13b(TProfile* hprof){
84  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
85  fMultEstimatorAvg[0]=new TProfile(*hprof);
86  }
87  void SetMultiplVsZProfileLHC13c(TProfile* hprof){
88  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
89  fMultEstimatorAvg[1]=new TProfile(*hprof);
90  }
91 
93 
94  // Nch Ntrk weights on MC
95  void UseMCNchWeight(Int_t flag) { fUseNchWeight = flag; }
96  void SetHistoNchWeight(TH1F *h){
97  if(fHistoMCNch) delete fHistoMCNch;
98  fHistoMCNch = new TH1F(*h);
99  }
100  void SetMeasuredNchHisto(TH1F* h){
101  if(fHistoMeasNch) delete fHistoMeasNch;
102  fHistoMeasNch = new TH1F(*h);
103  }
104 
105  // pT weights on MC
106  void UsePtWeight(Bool_t flag) { fUsePtWeight = flag; }
108  Double_t dNdptFit(Float_t pt, Double_t* par);
109 
111 
112  // Flag to use the zvtx correction from ( 0= none, 1= usual d2h, 2=AliESDUtils for VZERO multiplicity)
114  // Flag to fill THnSparse with MultUncorr and NoPid cases ( 0 = only Mult, 1 = Mult and multUncorr, 2 = NoPid and 3 is All)
116  void SetEventShapeParameters(Double_t ptMin, Double_t ptMax, Double_t etaMin, Double_t etaMax, Int_t minMult, Double_t phiStepSizeDeg, Int_t filtbit1, Int_t filtbit2) { fptMin=ptMin; fptMax=ptMax; fetaMin=etaMin; fetaMax=etaMax; fminMult=minMult; fphiStepSizeDeg=phiStepSizeDeg; ffiltbit1=filtbit1; ffiltbit2=filtbit2;}
117 
119  void SetRecomputeSpherocityWithoutDau(Bool_t RecomputeSphero){fRecomputeSpherocity=RecomputeSphero;}
120  void SetRemoveD0fromDstar(Bool_t RemoveD0fromDstar){fRemoveD0fromDstar=RemoveD0fromDstar;}
121 
123 
127  enum { kEta10=0, kEta10to16=1, kEtaVZERO=2, kEta03=3, kEta05=5, kEtaVZEROA=5 };
130 
132  void SetEtaAccCut(Double_t etacut){fEtaAccCut=etacut;}
133  void SetPtAccCut(Double_t ptcut){fPtAccCut=ptcut;}
134  Bool_t CheckGenAcc(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
136 
137  // Implementation of interface methods
138  virtual void UserCreateOutputObjects();
139  virtual void Init();
140  virtual void LocalInit() {Init();}
141  virtual void UserExec(Option_t *option);
142  virtual void Terminate(Option_t *option);
143 
144 private:
145 
148 
149  TProfile* GetEstimatorHistogram(const AliVEvent *event);
151  void CreateMeasuredNchHisto();
152  Bool_t FillTrackControlHisto(AliAODEvent* aod, Int_t nSelTrkCorr, Double_t spherocity, Double_t genspherocity, Int_t nSelectedEvwithCand);
153  void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity, Double_t sphericity, Double_t recSpherocity, Double_t nchWeight);
154  void FillMCGenAccHistos(AliAODEvent* aod, TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Double_t sphericity, Bool_t isEvSel, Double_t nchWeight);
155 
157  TList *fListCuts; // list of cuts
159  TList *fListProfiles; // list of profile histos for z-vtx correction
161 
162  TH1F *fHistNEvents;
163 
171 
180 
185 
188 
191 
194 
195  THnSparseD *fSparseEvtShape;
200  THnSparseD *fMCAccGenPrompt;
201  THnSparseD *fMCAccGenFeeddown;
202  THnSparseD *fMCRecoPrompt;
203  THnSparseD *fMCRecoFeeddown;
204  THnSparseD *fMCRecoBothPromptFD;
205  THnSparseD *fMCAccGenPromptSpheri;
207  THnSparseD *fMCRecoPromptSpheri;
208  THnSparseD *fMCRecoFeeddownSpheri;
210 
211  THnSparseD *fMCAccGenPromptEvSel;
213 
214  THnSparseF *fHistMassPtImpPar[5];
215 
216  Double_t fUpmasslimit; //upper inv mass limit for histos
217  Double_t fLowmasslimit; //lower inv mass limit for histos
218  Int_t fNMassBins; // nbins for invariant mass histos
219 
220  AliRDHFCuts *fRDCutsAnalysis; // Cuts for Analysis
224 
225  Bool_t fDoImpPar; //swicth for D impact parameter THnSparse
226  Int_t fNImpParBins; // nunber of bins in impact parameter histos
227  Double_t fLowerImpPar; // lower limit in impact parameter (um)
228  Double_t fHigherImpPar; // higher limit in impact parameter (um)
229 
230  Bool_t fReadMC; //flag for access to MC
231  Int_t fMCOption; // 0=keep all cand, 1=keep only signal, 2= keep only back
232  Bool_t fisPPbData; // flag to run on pPb data (differen histogram bining)
233  Bool_t fUseBit; // flag to use bitmask
234  Bool_t fSubtractTrackletsFromDau; // flag for subtracting D meson daughter contribution to N of tracklets
235  Bool_t fCalculateSphericity; // flag for computing Sphericity
236  Bool_t fRecomputeSpherocity; // flag for subtracting D meson daughter contribution to Spherocity calculation
237  Bool_t fRemoveD0fromDstar; // flag for removal of D0 from D* meson
238  Int_t fUseNchWeight; // weight on the MC on the generated multiplicity (0->no weights, 1->Nch weights, 2->Ntrk weights)
239  TH1F* fHistoMCNch; // weight histogram for the MC on the generated multiplicity
240  TH1F* fHistoMeasNch; // weight histogram on the true measured multiplicity
241  Bool_t fUsePtWeight; // weight on the MC on the generated pT
242  Double_t fWeight; // Total weight on the MC: nchWeight*ptWeight
243 
244  TProfile* fMultEstimatorAvg[4]; //TProfile with mult vs. Z per period
245  Double_t fRefMult; // refrence multiplcity (period b)
246  Int_t fPdgMeson; // pdg code of analyzed meson
247 
248  Int_t fMultiplicityEstimator; // Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2
249  Int_t fMCPrimariesEstimator; // Definition of the primaries estimator eta range: |eta|<1.0=0, -1.6<|eta|<1.0=1, VZEROrange=2
250 
251  Int_t fDoVZER0ParamVertexCorr; // Flag to use the zvtx correction from (0=none, 1=usual d2h, 2=AliESDUtils for VZERO multiplicity)
252 
253  Int_t fFillSoSparseChecks; // Flag to fill THnSparse with MultUncorr and NoPid cases ( 0 = only Mult, 1 = Mult and multUncorr, 2 = NoPid and 3 is All)
254 
259 
268 
269  ClassDef(AliAnalysisTaskSEDvsEventShapes,14); // D vs. mult task
270 };
271 
272 #endif
Double_t fetaMin
pt limits for acceptance step
Bool_t CheckGenAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
Int_t pdg
AliAnalysisTaskSEDvsEventShapes & operator=(const AliAnalysisTaskSEDvsEventShapes &source)
TH2F * fHistNtrCorrVsSo
hist of ntracklets vs So
THnSparseD * fMCRecoPromptSpheri
histo for StepMCGenAcc for D meson feeddown for Sphericity
double Double_t
Definition: External.C:58
Definition: External.C:260
Definition: External.C:236
TH3F * fHistSpheroAxisDeltaPhi
! hist. of Invariant mass, pt vs. deltaPhi of spherocity axis w.r.t. D-meson direction ...
TH2F * fHistNtrCorrVsSpheri
hist of ntracklets vs Spheri
AliNormalizationCounter * fCounterCandidates
Counter for normalization, uncorrected multiplicity.
void SetRemoveD0fromDstar(Bool_t RemoveD0fromDstar)
THnSparseD * fMCAccGenFeeddown
histo for StepMCGenAcc for D meson prompt
TH3F * fHistnTrackvsEtavsPhi
hist. of ntracklets for evnts with a candidate in D mass peak
THnSparseD * fMCRecoFeeddown
histo for StepMCReco for D meson feeddown
THnSparseD * fSparseEvtShapeFeeddown
THnSparse histograms for Prompt D0 vs. Spherocity.
TH2F * fHistNtrVsNchMCPhysicalPrimary
! hist of ntracklets vs Nch (Physical Primary)
TH2F * fHistNtrCorrVsNchMCPhysicalPrimary
! hist of ntracklets vs Nch (Physical Primary)
THnSparseD * fMCAccGenFeeddownEvSel
histo for StepMCGenAcc for D meson prompt with Vertex selection (IsEvSel = kTRUE) ...
TH2F * fHistNtrVsNchMC
hist of ntracklets vs Spheri
Double_t ptMin
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
void SetEventShapeParameters(Double_t ptMin, Double_t ptMax, Double_t etaMin, Double_t etaMax, Int_t minMult, Double_t phiStepSizeDeg, Int_t filtbit1, Int_t filtbit2)
THnSparseD * fMCRecoPrompt
histo for StepMCGenAcc for D meson feeddown
THnSparseD * fSparseEvtShapewithNoPid
THnSparse histograms for Spherocity.
TH2F * fHistNtrVsnTrackEvWithCand
hist of ntracklets vs Zvertex
void FillMCGenAccHistos(AliAODEvent *aod, TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Double_t sphericity, Bool_t isEvSel, Double_t nchWeight)
TH2F * fHistNtrCorrVsNchMC
! hist of ntracklets vs Nch (Generated)
int Int_t
Definition: External.C:63
THnSparseD * fMCRecoFeeddownSpheri
histo for StepMCReco for D meson feeddown for Sphericity
const Bool_t doImp
float Float_t
Definition: External.C:68
THnSparseD * fMCRecoBothPromptFDSpheri
histo for StepMCReco for D meson feeddown for Sphericity
TH3F * fHistTrueSovsMeasSo
! hist. of number of tracks passing track selection for spherocity calculation vs eta vs...
TH2F * fHistNtrVsNchMCPrimary
! hist of ntracklets vs Nch (Primary)
TH3F * fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary
! hist of Nch (generated) vs Nch (Primary) vs Nch (Physical Primary)
Bool_t fFillTrackHisto
flag for quark/hadron level identification of prompt and feeddown
void SetImpactParameterBinning(Int_t nbins, Double_t dmin, Double_t dmax)
AliNormalizationCounter * fCounterU
Counter for normalization, corrected multiplicity.
THnSparseD * fSparseEvtShapePrompt
THnSparse histograms for D0 vs. Spherocity.
void SetRecomputeSpherocityWithoutDau(Bool_t RecomputeSphero)
TH3F * fHistTrueSovsMeasSoEvWithCand
! hist. of number of tracks passing track selection for spherocity calculation vs eta vs...
TH1F * fHistNtrCorrEvSel
hist. of ntracklets for physics selection only selected events
void SetMassLimits(Double_t lowlimit, Double_t uplimit)
TH1F * fHistNtrCorrEvWithD
hist. of ntracklets for evnts with a candidate
TProfile * GetEstimatorHistogram(const AliVEvent *event)
TH1F * fHistNtrCorrEvWithCand
hist. of ntracklets for selected events
TH3F * fHistSpheroAxisDeltaGenPhi
! hist. of Invariant mass, pt vs. deltaPhi of generated spherocity axis w.r.t. D-meson direction ...
Bool_t FillTrackControlHisto(AliAODEvent *aod, Int_t nSelTrkCorr, Double_t spherocity, Double_t genspherocity, Int_t nSelectedEvwithCand)
THnSparseD * fMCAccGenFeeddownSpheri
histo for StepMCGenAcc for D meson prompt for Sphericity
THnSparseD * fMCRecoBothPromptFD
histo for StepMCReco for D meson feeddown
THnSparseD * fMCAccGenPromptSpheri
histo for StepMCReco for D meson Both Prompt Feeddown
Double_t fUpmasslimit
histograms for impact paramter studies
Double_t dNdptFit(Float_t pt, Double_t *par)
THnSparseD * fMCAccGenPromptEvSel
histo for StepMCReco for D meson Both Prompt Feeddown for Sphericity
void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity, Double_t sphericity, Double_t recSpherocity, Double_t nchWeight)
TH3F * fHistnTrackvsEtavsPhiEvWithCand
! hist. of number of tracks passing track selection for spherocity calculation vs eta vs...
Double_t fPtAccCut
eta limits for acceptance step
const char Option_t
Definition: External.C:48
TList * fListCuts
list send on output slot 1
THnSparseD * fSparseEvtShapeRecSphero
THnSparse histograms for feeddown D0 vs. Spherocity.
TH1F * fHistGenPrimaryParticlesInelGt0
!hist. of geenrated multiplcity
const Int_t nbins
bool Bool_t
Definition: External.C:53
TH2F * fHistNtrCorrVsNchMCPrimary
! hist of ntracklets vs Nch (Primary)
Double_t ptMax
THnSparseD * fMCAccGenPrompt
THnSparse histograms for Both Prompt and feeddown D0 vs. Spherocity.
Double_t fEtaAccCut
flag for filling track control histograms
TH2F * fHistNtrVsSpheri
hist of ntracklets vs So
TH1F * fHistNEvents
list send on output slot 5