AliPhysics  a9863a5 (a9863a5)
 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 "AliAODMCParticle.h"
31 #include "AliVertexingHFUtils.h"
32 #include "AliVEvent.h"
33 
34 class AliAnalysisTaskSEDvsEventShapes : public AliAnalysisTaskSE
35 {
36 public:
37 
39  AliAnalysisTaskSEDvsEventShapes(const char *name, Int_t pdgMeson, AliRDHFCuts* cuts, Bool_t switchPPb);
41 
42  void SetMassLimits(Double_t lowlimit, Double_t uplimit);
43  void SetMassLimits(Int_t pdg, Double_t range);
44  Double_t GetUpperMassLimit() const {return fUpmasslimit;}
45  Double_t GetLowerMassLimit() const {return fLowmasslimit;}
47  Int_t GetNMassBins() const{return fNMassBins;}
49 
50  void SetImpactParameterBinning(Int_t nbins, Double_t dmin, Double_t dmax){
52  fLowerImpPar=dmin;
53  fHigherImpPar=dmax;
54  }
55  void SetReadMC(Bool_t readMC=kTRUE){fReadMC=readMC;}
56  void SetMCOption(Int_t option=0){ fMCOption = option; }
57  void SetIsPPbData(Bool_t flag=kTRUE){
58  fisPPbData=flag;
59  }
60  void SetUseBit(Bool_t use=kTRUE){fUseBit=use;}
62 
63  void SetMultiplVsZProfileLHC10b(TProfile* hprof){
64  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
65  fMultEstimatorAvg[0]=new TProfile(*hprof);
66  }
67  void SetMultiplVsZProfileLHC10c(TProfile* hprof){
68  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
69  fMultEstimatorAvg[1]=new TProfile(*hprof);
70  }
71  void SetMultiplVsZProfileLHC10d(TProfile* hprof){
72  if(fMultEstimatorAvg[2]) delete fMultEstimatorAvg[2];
73  fMultEstimatorAvg[2]=new TProfile(*hprof);
74  }
75  void SetMultiplVsZProfileLHC10e(TProfile* hprof){
76  if(fMultEstimatorAvg[3]) delete fMultEstimatorAvg[3];
77  fMultEstimatorAvg[3]=new TProfile(*hprof);
78  }
79 
80  void SetMultiplVsZProfileLHC13b(TProfile* hprof){
81  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
82  fMultEstimatorAvg[0]=new TProfile(*hprof);
83  }
84  void SetMultiplVsZProfileLHC13c(TProfile* hprof){
85  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
86  fMultEstimatorAvg[1]=new TProfile(*hprof);
87  }
88 
89  void SetReferenceMultiplcity(Double_t rmu){fRefMult=rmu;}
90 
91  // Nch Ntrk weights on MC
92  void UseMCNchWeight(Int_t flag) { fUseNchWeight = flag; }
93  void SetHistoNchWeight(TH1F *h){
94  if(fHistoMCNch) delete fHistoMCNch;
95  fHistoMCNch = new TH1F(*h);
96  }
97  void SetMeasuredNchHisto(TH1F* h){
98  if(fHistoMeasNch) delete fHistoMeasNch;
99  fHistoMeasNch = new TH1F(*h);
100  }
102 
103  // Flag to use the zvtx correction from ( 0= none, 1= usual d2h, 2=AliESDUtils for VZERO multiplicity)
105  // Flag to fill THnSparse with MultUncorr and NoPid cases ( 0 = only Mult, 1 = Mult and multUncorr, 2 = NoPid and 3 is All)
107  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;}
108  void SetCalculationsForSphericity(Bool_t CalSpheri){fCalculateSphericity=CalSpheri;}
109 
111 
115  enum { kEta10=0, kEta10to16=1, kEtaVZERO=2, kEta03=3, kEta05=5, kEtaVZEROA=5 };
116  void SetMCPrimariesEstimator(Int_t value){ fMCPrimariesEstimator=value; }
118 
119  void SetUseQuarkLevel(Bool_t opt){fUseQuarkTag=opt;}
120  void SetEtaAccCut(Double_t etacut){fEtaAccCut=etacut;}
121  void SetPtAccCut(Double_t ptcut){fPtAccCut=ptcut;}
122  Bool_t CheckGenAcc(TClonesArray* arrayMC, Int_t nProng, Int_t *labDau);
123 
124  // Implementation of interface methods
125  virtual void UserCreateOutputObjects();
126  virtual void Init();
127  virtual void LocalInit() {Init();}
128  virtual void UserExec(Option_t *option);
129  virtual void Terminate(Option_t *option);
130 
131 private:
132 
135 
136  TProfile* GetEstimatorHistogram(const AliVEvent *event);
138  void CreateMeasuredNchHisto();
139  void FillMCMassHistos(TClonesArray *arrayMC, Int_t labD, Double_t countMult, Double_t spherocity);
140  void FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Double_t countMult, Double_t spherocity, Bool_t isEvSel);
141 
142  TList *fOutput;
143  TList *fListCuts; // list of cuts
145  TList *fListProfiles; // list of profile histos for z-vtx correction
146  TList *fOutputEffCorr;
147 
148  TH1F *fHistNEvents;
149 
152  TH2F* fHistNtrVsSo;
154 
160 
161  THnSparseD *fSparseSpherocity;
163  THnSparseD *fMCAccGenPrompt;
164  THnSparseD *fMCAccGenFeeddown;
165  THnSparseD *fMCRecoPrompt;
166  THnSparseD *fMCRecoFeeddown;
167  THnSparseD *fMCRecoBothPromptFD;
168  THnSparseD *fMCAccGenPromptEvSel;
170 
171  THnSparseF *fHistMassPtImpPar[5];
172 
173  Double_t fUpmasslimit; //upper inv mass limit for histos
174  Double_t fLowmasslimit; //lower inv mass limit for histos
175  Int_t fNMassBins; // nbins for invariant mass histos
176 
177  AliRDHFCuts *fRDCutsAnalysis; // Cuts for Analysis
181 
182  Bool_t fDoImpPar; //swicth for D impact parameter THnSparse
183  Int_t fNImpParBins; // nunber of bins in impact parameter histos
184  Double_t fLowerImpPar; // lower limit in impact parameter (um)
185  Double_t fHigherImpPar; // higher limit in impact parameter (um)
186 
187  Bool_t fReadMC; //flag for access to MC
188  Int_t fMCOption; // 0=keep all cand, 1=keep only signal, 2= keep only back
189  Bool_t fisPPbData; // flag to run on pPb data (differen histogram bining)
190  Bool_t fUseBit; // flag to use bitmask
191  Bool_t fSubtractTrackletsFromDau; // flag for subtracting D meson daughter contribution to N of tracklets
193  Int_t fUseNchWeight; // weight on the MC on the generated multiplicity (0->no weights, 1->Nch weights, 2->Ntrk weights)
194  TH1F* fHistoMCNch; // weight histogram for the MC on the generated multiplicity
195  TH1F* fHistoMeasNch; // weight histogram on the true measured multiplicity
196 
197  TProfile* fMultEstimatorAvg[4]; //TProfile with mult vs. Z per period
198  Double_t fRefMult; // refrence multiplcity (period b)
199  Int_t fPdgMeson; // pdg code of analyzed meson
200 
201  Int_t fMultiplicityEstimator; // Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2
202  Int_t fMCPrimariesEstimator; // Definition of the primaries estimator eta range: |eta|<1.0=0, -1.6<|eta|<1.0=1, VZEROrange=2
203 
204  Int_t fDoVZER0ParamVertexCorr; // Flag to use the zvtx correction from (0=none, 1=usual d2h, 2=AliESDUtils for VZERO multiplicity)
205 
206  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)
207 
208  Bool_t fUseQuarkTag;
209  Double_t fEtaAccCut;
210  Double_t fPtAccCut;
211 
212  Double_t fetaMin;
213  Double_t fetaMax;
214  Double_t fptMin;
215  Double_t fptMax;
216  Int_t fminMult;
217  Int_t ffiltbit1;
218  Int_t ffiltbit2;
219  Double_t fphiStepSizeDeg;
220 
221  ClassDef(AliAnalysisTaskSEDvsEventShapes,3); // D vs. mult task
222 };
223 
224 #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
AliNormalizationCounter * fCounterCandidates
Counter for normalization, uncorrected multiplicity.
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
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
ClassDef(AliAnalysisTaskSEDvsEventShapes, 3)
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
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 * fSparseSpherocitywithNoPid
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
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 So
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
TH1F * fHistNEvents
list send on output slot 5