AliPhysics  9fe175b (9fe175b)
 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 
35 class AliAnalysisTaskSEDvsEventShapes : public AliAnalysisTaskSE
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);
45  Double_t GetUpperMassLimit() const {return fUpmasslimit;}
46  Double_t GetLowerMassLimit() const {return fLowmasslimit;}
48  Int_t GetNMassBins() const{return fNMassBins;}
51  Bool_t GetRemoveD0fromDstar() const {return fRemoveD0fromDstar;}
52 
53  void SetImpactParameterBinning(Int_t nbins, Double_t dmin, Double_t dmax){
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 
92  void SetReferenceMultiplcity(Double_t rmu){fRefMult=rmu;}
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  }
105 
106  // Flag to use the zvtx correction from ( 0= none, 1= usual d2h, 2=AliESDUtils for VZERO multiplicity)
108  // Flag to fill THnSparse with MultUncorr and NoPid cases ( 0 = only Mult, 1 = Mult and multUncorr, 2 = NoPid and 3 is All)
110  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;}
111 
112  void SetCalculationsForSphericity(Bool_t CalSpheri){fCalculateSphericity=CalSpheri;}
113  void SetRecomputeSpherocityWithoutDau(Bool_t RecomputeSphero){fRecomputeSpherocity=RecomputeSphero;}
114  void SetRemoveD0fromDstar(Bool_t RemoveD0fromDstar){fRemoveD0fromDstar=RemoveD0fromDstar;}
115 
117 
121  enum { kEta10=0, kEta10to16=1, kEtaVZERO=2, kEta03=3, kEta05=5, kEtaVZEROA=5 };
122  void SetMCPrimariesEstimator(Int_t value){ fMCPrimariesEstimator=value; }
124 
125  void SetUseQuarkLevel(Bool_t opt){fUseQuarkTag=opt;}
126  void SetEtaAccCut(Double_t etacut){fEtaAccCut=etacut;}
127  void SetPtAccCut(Double_t ptcut){fPtAccCut=ptcut;}
128  Bool_t CheckGenAcc(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
129 
130  // Implementation of interface methods
131  virtual void UserCreateOutputObjects();
132  virtual void Init();
133  virtual void LocalInit() {Init();}
134  virtual void UserExec(Option_t *option);
135  virtual void Terminate(Option_t *option);
136 
137 private:
138 
141 
142  TProfile* GetEstimatorHistogram(const AliVEvent *event);
144  void CreateMeasuredNchHisto();
145  void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity, Double_t recSpherocity);
146  void FillMCGenAccHistos(AliAODEvent* aod, TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Bool_t isEvSel);
147 
148  TList *fOutput;
149  TList *fListCuts; // list of cuts
151  TList *fListProfiles; // list of profile histos for z-vtx correction
152  TList *fOutputEffCorr;
153 
154  TH1F *fHistNEvents;
155 
158  TH2F* fHistNtrVsSo;
162 
168 
169  THnSparseD *fSparseEvtShape;
174  THnSparseD *fMCAccGenPrompt;
175  THnSparseD *fMCAccGenFeeddown;
176  THnSparseD *fMCRecoPrompt;
177  THnSparseD *fMCRecoFeeddown;
178  THnSparseD *fMCRecoBothPromptFD;
179  THnSparseD *fMCAccGenPromptEvSel;
181 
182  THnSparseF *fHistMassPtImpPar[5];
183 
184  Double_t fUpmasslimit; //upper inv mass limit for histos
185  Double_t fLowmasslimit; //lower inv mass limit for histos
186  Int_t fNMassBins; // nbins for invariant mass histos
187 
188  AliRDHFCuts *fRDCutsAnalysis; // Cuts for Analysis
192 
193  Bool_t fDoImpPar; //swicth for D impact parameter THnSparse
194  Int_t fNImpParBins; // nunber of bins in impact parameter histos
195  Double_t fLowerImpPar; // lower limit in impact parameter (um)
196  Double_t fHigherImpPar; // higher limit in impact parameter (um)
197 
198  Bool_t fReadMC; //flag for access to MC
199  Int_t fMCOption; // 0=keep all cand, 1=keep only signal, 2= keep only back
200  Bool_t fisPPbData; // flag to run on pPb data (differen histogram bining)
201  Bool_t fUseBit; // flag to use bitmask
202  Bool_t fSubtractTrackletsFromDau; // flag for subtracting D meson daughter contribution to N of tracklets
203  Bool_t fCalculateSphericity; // flag for computing Sphericity
204  Bool_t fRecomputeSpherocity; // flag for subtracting D meson daughter contribution to Spherocity calculation
205  Bool_t fRemoveD0fromDstar; // flag for removal of D0 from D* meson
206  Int_t fUseNchWeight; // weight on the MC on the generated multiplicity (0->no weights, 1->Nch weights, 2->Ntrk weights)
207  TH1F* fHistoMCNch; // weight histogram for the MC on the generated multiplicity
208  TH1F* fHistoMeasNch; // weight histogram on the true measured multiplicity
209 
210  TProfile* fMultEstimatorAvg[4]; //TProfile with mult vs. Z per period
211  Double_t fRefMult; // refrence multiplcity (period b)
212  Int_t fPdgMeson; // pdg code of analyzed meson
213 
214  Int_t fMultiplicityEstimator; // Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2
215  Int_t fMCPrimariesEstimator; // Definition of the primaries estimator eta range: |eta|<1.0=0, -1.6<|eta|<1.0=1, VZEROrange=2
216 
217  Int_t fDoVZER0ParamVertexCorr; // Flag to use the zvtx correction from (0=none, 1=usual d2h, 2=AliESDUtils for VZERO multiplicity)
218 
219  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)
220 
221  Bool_t fUseQuarkTag;
222  Double_t fEtaAccCut;
223  Double_t fPtAccCut;
224 
225  Double_t fetaMin;
226  Double_t fetaMax;
227  Double_t fptMin;
228  Double_t fptMax;
229  Int_t fminMult;
230  Int_t ffiltbit1;
231  Int_t ffiltbit2;
232  Double_t fphiStepSizeDeg;
233 
234  ClassDef(AliAnalysisTaskSEDvsEventShapes,6); // D vs. mult task
235 };
236 
237 #endif
Double_t fetaMin
pt limits for acceptance step
Bool_t CheckGenAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
Int_t pdg
THnSparseD * fSparseEvtShapePromptFD
THnSparse histograms for feeddown D0 vs. Spherocity.
AliAnalysisTaskSEDvsEventShapes & operator=(const AliAnalysisTaskSEDvsEventShapes &source)
TH2F * fHistNtrCorrVsSo
hist of ntracklets vs So
void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity, Double_t recSpherocity)
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.
THnSparseD * fMCAccGenFeeddownEvSel
histo for StepMCGenAcc for D meson prompt with Vertex selection (IsEvSel = kTRUE) ...
Double_t ptMin
TH1F * fHistNtrCorrPSSel
hist. of geenrated multiplcity
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.
ClassDef(AliAnalysisTaskSEDvsEventShapes, 6)
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 * fMCRecoBothPromptFD
histo for StepMCReco for D meson feeddown
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
TList * fListCuts
list send on output slot 1
TH1F * fHistGenPrimaryParticlesInelGt0
hist of ntracklets vs Spheri
const Int_t nbins
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
void FillMCGenAccHistos(AliAODEvent *aod, TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Bool_t isEvSel)
TH2F * fHistNtrVsSpheri
hist of ntracklets vs So
TH1F * fHistNEvents
list send on output slot 5