AliPhysics  b095172 (b095172)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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);
135 
136  // Implementation of interface methods
137  virtual void UserCreateOutputObjects();
138  virtual void Init();
139  virtual void LocalInit() {Init();}
140  virtual void UserExec(Option_t *option);
141  virtual void Terminate(Option_t *option);
142 
143 private:
144 
147 
148  TProfile* GetEstimatorHistogram(const AliVEvent *event);
150  void CreateMeasuredNchHisto();
151  void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity, Double_t sphericity, Double_t recSpherocity, Double_t nchWeight);
152  void FillMCGenAccHistos(AliAODEvent* aod, TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Double_t sphericity, Bool_t isEvSel, Double_t nchWeight);
153 
155  TList *fListCuts; // list of cuts
157  TList *fListProfiles; // list of profile histos for z-vtx correction
159 
160  TH1F *fHistNEvents;
161 
168 
177 
182 
183  THnSparseD *fSparseEvtShape;
188  THnSparseD *fMCAccGenPrompt;
189  THnSparseD *fMCAccGenFeeddown;
190  THnSparseD *fMCRecoPrompt;
191  THnSparseD *fMCRecoFeeddown;
192  THnSparseD *fMCRecoBothPromptFD;
193  THnSparseD *fMCAccGenPromptSpheri;
195  THnSparseD *fMCRecoPromptSpheri;
196  THnSparseD *fMCRecoFeeddownSpheri;
198 
199  THnSparseD *fMCAccGenPromptEvSel;
201 
202  THnSparseF *fHistMassPtImpPar[5];
203 
204  Double_t fUpmasslimit; //upper inv mass limit for histos
205  Double_t fLowmasslimit; //lower inv mass limit for histos
206  Int_t fNMassBins; // nbins for invariant mass histos
207 
208  AliRDHFCuts *fRDCutsAnalysis; // Cuts for Analysis
212 
213  Bool_t fDoImpPar; //swicth for D impact parameter THnSparse
214  Int_t fNImpParBins; // nunber of bins in impact parameter histos
215  Double_t fLowerImpPar; // lower limit in impact parameter (um)
216  Double_t fHigherImpPar; // higher limit in impact parameter (um)
217 
218  Bool_t fReadMC; //flag for access to MC
219  Int_t fMCOption; // 0=keep all cand, 1=keep only signal, 2= keep only back
220  Bool_t fisPPbData; // flag to run on pPb data (differen histogram bining)
221  Bool_t fUseBit; // flag to use bitmask
222  Bool_t fSubtractTrackletsFromDau; // flag for subtracting D meson daughter contribution to N of tracklets
223  Bool_t fCalculateSphericity; // flag for computing Sphericity
224  Bool_t fRecomputeSpherocity; // flag for subtracting D meson daughter contribution to Spherocity calculation
225  Bool_t fRemoveD0fromDstar; // flag for removal of D0 from D* meson
226  Int_t fUseNchWeight; // weight on the MC on the generated multiplicity (0->no weights, 1->Nch weights, 2->Ntrk weights)
227  TH1F* fHistoMCNch; // weight histogram for the MC on the generated multiplicity
228  TH1F* fHistoMeasNch; // weight histogram on the true measured multiplicity
229  Bool_t fUsePtWeight; // weight on the MC on the generated pT
230  Double_t fWeight; // Total weight on the MC: nchWeight*ptWeight
231 
232  TProfile* fMultEstimatorAvg[4]; //TProfile with mult vs. Z per period
233  Double_t fRefMult; // refrence multiplcity (period b)
234  Int_t fPdgMeson; // pdg code of analyzed meson
235 
236  Int_t fMultiplicityEstimator; // Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2
237  Int_t fMCPrimariesEstimator; // Definition of the primaries estimator eta range: |eta|<1.0=0, -1.6<|eta|<1.0=1, VZEROrange=2
238 
239  Int_t fDoVZER0ParamVertexCorr; // Flag to use the zvtx correction from (0=none, 1=usual d2h, 2=AliESDUtils for VZERO multiplicity)
240 
241  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)
242 
246 
255 
256  ClassDef(AliAnalysisTaskSEDvsEventShapes,9); // D vs. mult task
257 };
258 
259 #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
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
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
THnSparseD * fSparseEvtShape
hist. of ntracklets for evnts with a candidate in D mass peak
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.
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
float Float_t
Definition: External.C:68
THnSparseD * fMCRecoBothPromptFDSpheri
histo for StepMCReco for D meson feeddown for Sphericity
TH2F * fHistNtrVsNchMCPrimary
! hist of ntracklets vs Nch (Primary)
TH3F * fHistNchMCVsNchMCPrimaryVsNchMCPhysicalPrimary
! hist of Nch (generated) vs Nch (Primary) vs Nch (Physical Primary)
void SetImpactParameterBinning(Int_t nbins, Double_t dmin, Double_t dmax)
AliNormalizationCounter * fCounterU
Counter for normalization, corrected multiplicity.
const Bool_t doImp
THnSparseD * fSparseEvtShapePrompt
THnSparse histograms for D0 vs. Spherocity.
void SetRecomputeSpherocityWithoutDau(Bool_t RecomputeSphero)
TH1F * fHistNtrCorrEvSel
hist. of ntracklets for physics selection only selected events
void SetMassLimits(Double_t lowlimit, Double_t uplimit)
TH2F * fHistNtrVsSo
hist of ntracklets vs Zvertex
TH1F * fHistNtrCorrEvWithD
hist. of ntracklets for evnts with a candidate
TProfile * GetEstimatorHistogram(const AliVEvent *event)
TH1F * fHistNtrCorrEvWithCand
hist. of ntracklets for selected events
THnSparseD * fMCAccGenFeeddownSpheri
histo for StepMCGenAcc for D meson prompt for Sphericity
ClassDef(AliAnalysisTaskSEDvsEventShapes, 9)
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)
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 quark/hadron level identification of prompt and feeddown
TH2F * fHistNtrVsSpheri
hist of ntracklets vs So
TH1F * fHistNEvents
list send on output slot 5