AliPhysics  e59a9ba (e59a9ba)
 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 
52  void SetImpactParameterBinning(Int_t nbins, Double_t dmin, Double_t dmax){
54  fLowerImpPar=dmin;
55  fHigherImpPar=dmax;
56  }
57  void SetReadMC(Bool_t readMC=kTRUE){fReadMC=readMC;}
58  void SetMCOption(Int_t option=0){ fMCOption = option; }
59  void SetIsPPbData(Bool_t flag=kTRUE){
60  fisPPbData=flag;
61  }
62  void SetUseBit(Bool_t use=kTRUE){fUseBit=use;}
64 
65  void SetMultiplVsZProfileLHC10b(TProfile* hprof){
66  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
67  fMultEstimatorAvg[0]=new TProfile(*hprof);
68  }
69  void SetMultiplVsZProfileLHC10c(TProfile* hprof){
70  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
71  fMultEstimatorAvg[1]=new TProfile(*hprof);
72  }
73  void SetMultiplVsZProfileLHC10d(TProfile* hprof){
74  if(fMultEstimatorAvg[2]) delete fMultEstimatorAvg[2];
75  fMultEstimatorAvg[2]=new TProfile(*hprof);
76  }
77  void SetMultiplVsZProfileLHC10e(TProfile* hprof){
78  if(fMultEstimatorAvg[3]) delete fMultEstimatorAvg[3];
79  fMultEstimatorAvg[3]=new TProfile(*hprof);
80  }
81 
82  void SetMultiplVsZProfileLHC13b(TProfile* hprof){
83  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
84  fMultEstimatorAvg[0]=new TProfile(*hprof);
85  }
86  void SetMultiplVsZProfileLHC13c(TProfile* hprof){
87  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
88  fMultEstimatorAvg[1]=new TProfile(*hprof);
89  }
90 
91  void SetReferenceMultiplcity(Double_t rmu){fRefMult=rmu;}
92 
93  // Nch Ntrk weights on MC
94  void UseMCNchWeight(Int_t flag) { fUseNchWeight = flag; }
95  void SetHistoNchWeight(TH1F *h){
96  if(fHistoMCNch) delete fHistoMCNch;
97  fHistoMCNch = new TH1F(*h);
98  }
99  void SetMeasuredNchHisto(TH1F* h){
100  if(fHistoMeasNch) delete fHistoMeasNch;
101  fHistoMeasNch = new TH1F(*h);
102  }
104 
105  // Flag to use the zvtx correction from ( 0= none, 1= usual d2h, 2=AliESDUtils for VZERO multiplicity)
107  // Flag to fill THnSparse with MultUncorr and NoPid cases ( 0 = only Mult, 1 = Mult and multUncorr, 2 = NoPid and 3 is All)
109  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;}
110 
111  void SetCalculationsForSphericity(Bool_t CalSpheri){fCalculateSphericity=CalSpheri;}
112  void SetRecomputeSpherocityWithoutDau(Bool_t RecomputeSphero){fRecomputeSpherocity=RecomputeSphero;}
113 
115 
119  enum { kEta10=0, kEta10to16=1, kEtaVZERO=2, kEta03=3, kEta05=5, kEtaVZEROA=5 };
120  void SetMCPrimariesEstimator(Int_t value){ fMCPrimariesEstimator=value; }
122 
123  void SetUseQuarkLevel(Bool_t opt){fUseQuarkTag=opt;}
124  void SetEtaAccCut(Double_t etacut){fEtaAccCut=etacut;}
125  void SetPtAccCut(Double_t ptcut){fPtAccCut=ptcut;}
126  Bool_t CheckGenAcc(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
127 
128  // Implementation of interface methods
129  virtual void UserCreateOutputObjects();
130  virtual void Init();
131  virtual void LocalInit() {Init();}
132  virtual void UserExec(Option_t *option);
133  virtual void Terminate(Option_t *option);
134 
135 private:
136 
139 
140  TProfile* GetEstimatorHistogram(const AliVEvent *event);
142  void CreateMeasuredNchHisto();
143  void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity);
144  void FillMCGenAccHistos(AliAODEvent* aod, TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Bool_t isEvSel);
145 
146  TList *fOutput;
147  TList *fListCuts; // list of cuts
149  TList *fListProfiles; // list of profile histos for z-vtx correction
150  TList *fOutputEffCorr;
151 
152  TH1F *fHistNEvents;
153 
156  TH2F* fHistNtrVsSo;
160 
166 
167  THnSparseD *fSparseEvtShape;
169  THnSparseD *fMCAccGenPrompt;
170  THnSparseD *fMCAccGenFeeddown;
171  THnSparseD *fMCRecoPrompt;
172  THnSparseD *fMCRecoFeeddown;
173  THnSparseD *fMCRecoBothPromptFD;
174  THnSparseD *fMCAccGenPromptEvSel;
176 
177  THnSparseF *fHistMassPtImpPar[5];
178 
179  Double_t fUpmasslimit; //upper inv mass limit for histos
180  Double_t fLowmasslimit; //lower inv mass limit for histos
181  Int_t fNMassBins; // nbins for invariant mass histos
182 
183  AliRDHFCuts *fRDCutsAnalysis; // Cuts for Analysis
187 
188  Bool_t fDoImpPar; //swicth for D impact parameter THnSparse
189  Int_t fNImpParBins; // nunber of bins in impact parameter histos
190  Double_t fLowerImpPar; // lower limit in impact parameter (um)
191  Double_t fHigherImpPar; // higher limit in impact parameter (um)
192 
193  Bool_t fReadMC; //flag for access to MC
194  Int_t fMCOption; // 0=keep all cand, 1=keep only signal, 2= keep only back
195  Bool_t fisPPbData; // flag to run on pPb data (differen histogram bining)
196  Bool_t fUseBit; // flag to use bitmask
197  Bool_t fSubtractTrackletsFromDau; // flag for subtracting D meson daughter contribution to N of tracklets
198  Bool_t fCalculateSphericity; // flag for computing Sphericity
199  Bool_t fRecomputeSpherocity; // flag for subtracting D meson daughter contribution to Spherocity calculation
200  Int_t fUseNchWeight; // weight on the MC on the generated multiplicity (0->no weights, 1->Nch weights, 2->Ntrk weights)
201  TH1F* fHistoMCNch; // weight histogram for the MC on the generated multiplicity
202  TH1F* fHistoMeasNch; // weight histogram on the true measured multiplicity
203 
204  TProfile* fMultEstimatorAvg[4]; //TProfile with mult vs. Z per period
205  Double_t fRefMult; // refrence multiplcity (period b)
206  Int_t fPdgMeson; // pdg code of analyzed meson
207 
208  Int_t fMultiplicityEstimator; // Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2
209  Int_t fMCPrimariesEstimator; // Definition of the primaries estimator eta range: |eta|<1.0=0, -1.6<|eta|<1.0=1, VZEROrange=2
210 
211  Int_t fDoVZER0ParamVertexCorr; // Flag to use the zvtx correction from (0=none, 1=usual d2h, 2=AliESDUtils for VZERO multiplicity)
212 
213  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)
214 
215  Bool_t fUseQuarkTag;
216  Double_t fEtaAccCut;
217  Double_t fPtAccCut;
218 
219  Double_t fetaMin;
220  Double_t fetaMax;
221  Double_t fptMin;
222  Double_t fptMax;
223  Int_t fminMult;
224  Int_t ffiltbit1;
225  Int_t ffiltbit2;
226  Double_t fphiStepSizeDeg;
227 
228  ClassDef(AliAnalysisTaskSEDvsEventShapes,4); // D vs. mult task
229 };
230 
231 #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
TH2F * fHistNtrCorrVsSpheri
hist of ntracklets vs Spheri
AliNormalizationCounter * fCounterCandidates
Counter for normalization, uncorrected multiplicity.
ClassDef(AliAnalysisTaskSEDvsEventShapes, 4)
THnSparseD * fMCAccGenFeeddown
histo for StepMCGenAcc for D meson prompt
THnSparseD * fMCRecoFeeddown
histo for StepMCReco for D meson feeddown
THnSparseD * fMCAccGenFeeddownEvSel
histo for StepMCGenAcc for D meson prompt with Vertex selection (IsEvSel = kTRUE) ...
Double_t ptMin
TH1F * fHistNtrCorrPSSel
hist. of geenrated multiplcity
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
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 studies.
void SetImpactParameterBinning(Int_t nbins, Double_t dmin, Double_t dmax)
AliNormalizationCounter * fCounterU
Counter for normalization, corrected multiplicity.
const Bool_t doImp
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 Spherocity studies.
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