AliPhysics  2aaea23 (2aaea23)
AliAnalysisTaskPi0v2.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskPi0v2_cxx
2 #define AliAnalysisTaskPi0v2_cxx
3 
4 #include "AliAnalysisTaskSE.h"
5 #include "TH1.h"
6 #include "TH2.h"
7 #include "TH3.h"
8 #include "THnSparse.h"
9 #include "AliLog.h"
10 #include "AliConversionSelection.h"
11 #include "AliConvEventCuts.h"
12 #include "AliConversionMesonCuts.h"
13 #include "AliV0ReaderV1.h"
14 #include "AliEventplane.h"
15 #include "TVector2.h"
16 
17 #include "TProfile.h"
18 using namespace std;
19 
21 
22  public:
23 
25  kTPC=0,
26  kTPCEtaGap=1,
27  kV0A=2,
28  kV0C=3,
29  knEPMethod=4
30  };
31 
33  kEPTPC=0,
38  knEP
39  };
40 
41  enum EPDGCode{
42  kPi0=111,
43  kEta=221
44  };
45 
46  static const Int_t knBinsPhi=6;
47  static const Int_t knCentMax=10;
48  static const Int_t knFlatPeriod=2;
49 
50  AliAnalysisTaskPi0v2(const char *name="pi0v2",Int_t harmonic=2);
51  virtual ~AliAnalysisTaskPi0v2();
52 
53  virtual void UserCreateOutputObjects();
54  virtual void UserExec(Option_t *option);
55  virtual void Terminate(Option_t *);
56 
57  void SetCentralityBins(Double_t *bins,Int_t nbins);
58  void SetMeson(EPDGCode meson){fMesonPDGCode=meson;}
59 
60  void SetNBinsPhi(Int_t nbins){fNBinsPhi=nbins;}
61  void SetV0Reader(AliV0ReaderV1 *v0Reader){fV0Reader=v0Reader;}
62  void SetInvMassRange(Double_t range[2]){fInvMassRange[0]=range[0];fInvMassRange[1]=range[1];};
63  void SetEtaGap(Double_t gapsize){fEtaGap=gapsize;};
64 
65  void SetCuts(AliConversionSelection **conversionselection,Int_t numberOfCuts);
66  void SetFillQA(Bool_t fill){fFillQA=fill;}
67 
68  void SetEPSelectionMask(Int_t mask[knEPMethod]){for(Int_t ii=0;ii<knEPMethod;ii++)fEPSelectionMask[ii]=mask[ii];};
69 
70  void SetFlatteningCoeff(EEventPlane ep,Int_t period,Int_t nCent,Double_t *cc2,Double_t *cs2,Double_t *cc4,Double_t *cs4);
71 
72  Int_t GetPeriodIndex(TString period);
73  Int_t GetHarmonic(){return fHarmonic;};
74 
75  private:
76 
77  AliAnalysisTaskPi0v2(const AliAnalysisTaskPi0v2&);// private::prevent use of copy constructor
78  AliAnalysisTaskPi0v2& operator=(const AliAnalysisTaskPi0v2&); // private::prevent use of assignment operator
79 
80  Bool_t InitEvent();
81 
82  void ProcessGammas(Int_t iCut,EEventPlaneMethod iEP);
83  void ProcessPi0s(Int_t iCut,EEventPlaneMethod iEP);
84  void ProcessQA();
85 
86  Double_t GetPhiwrtRP(Double_t dPhi);
87  Double_t GetPhotonPhiwrtRP(AliAODConversionPhoton *gamma,EEventPlaneMethod iEP,Bool_t bDoFlattening=kTRUE);
88  Double_t GetPi0PhiwrtRP(AliAODConversionMother *pi0,EEventPlaneMethod iEP,Bool_t bDoFlattening=kTRUE);
89  Double_t GetChargedPhiwrtRP(AliVTrack *charged,EEventPlaneMethod iEP,Bool_t bDoFlattening=kTRUE);
90  void GetPhotondNdPhi(Int_t *dNdPhi,Int_t iEP,Int_t iCut=0);
91  void GetChargeddNdPhi(Int_t *dNdPhi,Int_t &ntot,Int_t iEP);
92  Int_t GetPhiBin(Double_t phiwrt);
93  Int_t GetPhotonPhiBin(AliAODConversionPhoton *gamma,Int_t iEP);
94  Double_t GetMCPhotonPhiwrtRP(TParticle *gamma,EEventPlaneMethod iEP,Bool_t bDoFlattening=kTRUE);
95  TVector2 GetEPContribution(AliAODConversionPhoton *gamma);
96  Double_t GetEventPlaneAngle(EEventPlaneMethod EPmethod,Double_t eta=0,AliAODConversionPhoton *gamma0=NULL,AliAODConversionPhoton *gamma1=NULL,Bool_t bDoFlattening=kTRUE);
97  Double_t GetTPCSubEPEta(EEventPlane ep);
98  Double_t GetCorrectedTPCEPAngle(AliAODConversionPhoton *gamma0=NULL,AliAODConversionPhoton *gamma1=NULL,Bool_t bDoFlattening=kTRUE);
99  Bool_t SetCentrality();
100  void ProcessEventPlane();
101  Int_t GetRadialBin(Double_t radius);
102  Int_t GetRunIndex(Int_t run);
103  Double_t ApplyFlattening(Double_t phi,EEventPlane ep);
104  Bool_t GetTPCEventPlane();
105 
106  void GetV0EP(AliVEvent * event,Double_t &rpv0a,Double_t &rpv0c);
107  void LoadVZEROCalibration(Int_t run);
108  void LoadTPCCalibration(Int_t run);
109 
110  Double_t GetWeight(TObject* track1);
111  Double_t GetPhiWeight(TObject* track1);
112  TH1F* SelectPhiDist(AliVTrack *track);
113 
114  Double_t GetPsiInRange(Double_t phi);
115 
116  TObjArray* GetEventPlaneTracks(Int_t &maxID);
117  TVector2 GetContributionEP(AliVTrack *track);
118  Int_t GetAODEPTrackFilterBit();
119 
120  // Constants
122  kGammaPt=0,
126  knbinsGamma
127  };
128 
129  enum Ebinspi0{
130  kPi0Pt=0,
135  knbinsPi0
136  };
137 
139  kEventIn=1,
145  kEventSelected
146  };
147 
148 
149  static const Int_t knbinsGammaMult=3;
150  static const Int_t kGCnYBinsSpectra = 80;
153 
154  // Class variables and pointer
155  AliV0ReaderV1 *fV0Reader; // V0Reader
156  Int_t fNCuts; // Number of Photon Cuts for v2 analysis
157  AliConversionSelection **fConversionSelection; //[fNCuts] Selection of Particles for given Cut
158  TClonesArray *fConversionGammas;
159  Int_t fNCentralityBins; // Number of Centrality Bins
160  Double_t fCentralityBins[knCentMax]; // CentralityBins for Analysis
163  Int_t fNBinsPhi; // Number of Phi wrt RP bins
164  AliEventplane *fEP;
165  Bool_t fUseTPCOnlyTracks; // Use TPC Only Tracks for EP
166  Double_t fEtaMax; // Eta Max for analysis;
167  Double_t fEtaGap; // Eta Gap
180  TRandom3 *fRandomizer;
182  EPDGCode fMesonPDGCode; // PDG Code of the processed Meson (for MC truth)
183  Double_t fInvMassRange[2]; // Inv Mass Range
187  Int_t fNEPMethods; // number of EP methods
188  Bool_t fFillQA; // Fill QA Histograms
189  Int_t fHarmonic; // Harmonic to be analyzed (v2,v3,..)
190  Double_t fPsiMax; // Range for Psi
193  TH1F *fPhiDist[4];
194  THnSparse *fSparseDist;
195  TH1F *fHruns;
196  Bool_t fDoEPFlattening; // Do flattening
197  Int_t fEPSelectionMask[knEPMethod]; // Which EP methods shall be applied
198  Double_t fFlatc2[knFlatPeriod][knEP][knCentMax];
199  Double_t fFlats2[knFlatPeriod][knEP][knCentMax];
200  Double_t fFlatc4[knFlatPeriod][knEP][knCentMax];
201  Double_t fFlats4[knFlatPeriod][knEP][knCentMax];
203 
204  // Histograms
205  TH1F *hNEvents;
207 
208  // RP
230 
231  // Gamma
237 
238  THnSparseF *hGammadNdPhi;
239  THnSparseF *hGammaMultdPhiTRUE;
241  THnSparseF *hGammaMultTRUE;
242  THnSparseF *hGammaMultRECOTRUE;
243  THnSparseF **hGammaMultdPhi;
244  THnSparseF **hGammaMult;
245 
246  THnSparseF **hGamma;
247  THnSparseF *hGammaFull;
248  THnSparseF *hCharged;
249 
250  // Pi0
251  THnSparseF **hPi0;
252  THnSparseF **hPi0BG;
253 
254  //V0 Calibration
255 
256  static const Int_t nCentrBinV0 = 9; // # cenrality bins
257  TProfile *fMultV0;
258  Float_t fV0Cpol,fV0Apol;
259  Float_t fMeanQ[nCentrBinV0][2][2];
260  Float_t fWidthQ[nCentrBinV0][2][2];
261 
262  //Event Plane
263  //THnSparse *hEPVertex;
264  THnSparse *hEPQA;
265 
266  ClassDef(AliAnalysisTaskPi0v2, 7); // example of analysis
267 };
268 
269 #endif
270 
void SetV0Reader(AliV0ReaderV1 *v0Reader)
THnSparseF * hGammaMultdPhiRECOTRUE
double Double_t
Definition: External.C:58
Definition: External.C:236
void SetInvMassRange(Double_t range[2])
Double_t fRPTPCEtaCBF
TPCEtaA event plane before flattening.
Int_t fCentralityBin
Event Centrality.
Int_t fNEPMethods
current internal run index
void SetEtaGap(Double_t gapsize)
EPDGCode fMesonPDGCode
List for Output (Histograms etc.)
Int_t fNBinsPhi
Event Centrality Bin.
AliConvEventCuts * fEventCuts
TPC event plane before flattening.
THnSparse * fSparseDist
array of Phi distributions used to calculate phi weights
TList * fOutputList
Randomizer for Event Plane Randomisation.
TClonesArray * fConversionGammas
Float_t fV0Cpol
object containing VZERO calibration information
Int_t fNCentralityBins
Reconstructed Photons;.
static const Double_t kGCfirstYBinSpectra
Double_t fRPTPCEtaABF
TPC event plane.
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Double_t fRPV0ABF
TPCEtaC event plane before flattening.
Double_t fRPTPC
V0C event plane.
void SetEPSelectionMask(Int_t mask[knEPMethod])
AliConversionSelection ** fConversionSelection
void SetMeson(EPDGCode meson)
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Int_t fRunNumber
Difference between subEventPlane angles.
AliConversionPhotonCuts * fConversionCuts
Cuts used by the V0Reader.
Double_t GetWeight(Int_t averageoption, Double_t pt, TH1D *hRaa, Double_t raaSystLow, Double_t raaSystHigh, Double_t ppSystRawYield, Double_t ppSystRawYieldCutVar, Double_t ppSystRawYieldCutVarPid, Double_t ABSystRawYield, Double_t ABSystRawYieldCutVar, Double_t ABSystRawYieldCutVarPid)
static const Double_t kGClastYBinSpectra
Int_t fRunIndex
current run number
Double_t fRPV0CBF
V0A event plane before flattening.
Double_t fRPV0C
V0A event plane.
Double_t fRPV0A
TPCEtaC event plane.
void SetNBinsPhi(Int_t nbins)
Bool_t fIsAOD
"LHC11h","LHC10h"
Bool_t fDoEPFlattening
information about runwise statistics of phi-weights
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Double_t fRPTPCBF
V0C event plane before flattening.
const char Option_t
Definition: External.C:48
const Int_t nbins
bool Bool_t
Definition: External.C:53
TH1F * fHruns
THn for eta-charge phi-weighting.
void SetFillQA(Bool_t fill)
Bool_t fUseTPCOnlyTracks
Event Plane Pointer.
TRandom3 * fRandomizer
Cuts used by the V0Reader.
TString meson
Double_t fRPTPCEtaC
TPCEtaA event plane.