]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0Flow.h
AliAnalysisTaskPi0Flow: Ecore calculation is corrected
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_PbPb / AliAnalysisTaskPi0Flow.h
1 #ifndef AliAnalysisTaskPi0Flow_cxx
2 #define AliAnalysisTaskPi0Flow_cxx
3
4 // Analysis task to fill histograms with PHOS ESD or AOD clusters and cells
5 // Authors : Dmitri Peressounko
6 // Date    : 28.05.2011
7 // Modified: 03.08.2012 Henrik Qvigstad
8 /* $Id$ */
9
10 class TObjArray;
11 class TH1F;
12 class TH2I;
13 class TH2F;
14 class TH3F;
15 class TF1 ;
16 class AliStack ;
17 class AliESDtrackCuts;
18 class AliPHOSGeometry;
19 class AliESDEvent ;
20 class AliPHOSCalibData;
21 class AliESDtrack ;
22 class AliESDCaloCluster ;
23
24 #include "TArrayD.h"
25
26 #include "AliAnalysisTaskSE.h"
27
28 class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {
29 public:
30     enum Period { kUndefinedPeriod, kLHC10h, kLHC11h };
31
32 public:
33     AliAnalysisTaskPi0Flow(const char *name = "AliAnalysisTaskPi0Flow", Period period = kUndefinedPeriod);
34     virtual ~AliAnalysisTaskPi0Flow();
35
36     virtual void   UserCreateOutputObjects();
37     virtual void   UserExec(Option_t *option);
38     /* virtual void   Terminate(Option_t *); */
39
40     void SetPeriod(Period period) { fPeriod = period;}
41     
42     void SetCentralityBinning(const TArrayD& edges);
43     void SetNMixedPerCentrality(const TArrayI& nMixed);
44     void SetEventMixingRPBinning(UInt_t nBins) { fNEMRPBins = nBins; }
45     
46     void SetPHOSBadMap(Int_t mod,TH2I * badMapHist);
47
48
49 private:
50     AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented
51     AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented
52
53     // Step 0:
54     AliVEvent* GetEvent();
55     AliStack* GetMCStack();
56
57     // Step 1:
58     void SetGeometry();
59     void SetMisalignment();
60     void SetV0Calibration(); //V0 calibration
61     void SetESDTrackCuts(); // AliESDtrack cuts ( for esd data )
62     void SetPHOSCalibData(); // phos re-calibration ( for esd data)
63
64     // Step 2:
65     void SetVertex();
66     Bool_t RejectEventVertex();
67
68     // Step 4:
69     void SetCentrality();
70     Bool_t RejectCentrality();
71
72     // Step 5:
73     void EvalReactionPlane();
74     void EvalV0ReactionPlane();
75
76     // Step 7: QA PHOS cells
77     void FillPHOSCellQAHists();
78
79     // Step 8: Event Photons (PHOS Clusters) selection
80     void SelectPhotonClusters();
81     void FillSelectedClusterHistograms();
82
83     // Step 9: Consider pi0 (photon/cluster) pairs.
84     void ConsiderPi0s();
85
86     // Step 10; Mixing
87     void ConsiderPi0sMix();
88
89     // Step 11: Update lists
90     void UpdateLists();
91
92     Bool_t AreNeibors(Int_t id1,Int_t id2) ;
93     Double_t ApplyFlattening(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
94     Double_t ApplyFlatteningV0A(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
95     Double_t ApplyFlatteningV0C(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
96     Int_t ConvertToInternalRunNumber(Int_t run) ;
97     Double_t CoreEnergy(AliVCluster * clu, AliVCaloCells * cells);
98
99
100
101
102     void FillHistogram(const char * key,Double_t x) const ; //Fill 1D histogram witn name key
103     void FillHistogram(const char * key,Double_t x, Double_t y) const ; //Fill 2D histogram witn name key
104     void FillHistogram(const char * key,Double_t x, Double_t y, Double_t z) const ; //Fill 3D histogram witn name key
105
106     TVector3 GetVertexVector(const AliVVertex* vertex);
107     Int_t GetCentralityBin(Float_t centralityV0M);
108     Int_t GetRPBin();
109
110     void LogProgress(int step, int internalRunNumber);
111
112     Bool_t IsGoodChannel(const char * det, Int_t mod,Int_t ix, Int_t iz); //Use addisional bad map for PHOS
113
114
115     void Reclusterize(AliVCluster * clu) ;
116     Double_t TestCPV(Double_t dx, Double_t dz, Double_t pt, Int_t charge);
117     Bool_t TestLambda(Double_t pt,Double_t l1,Double_t l2) ;  //Evaluate Dispersion cuts for photons
118     Bool_t TestLambda2(Double_t pt,Double_t l1,Double_t l2) ;  //Evaluate Dispersion cuts for photons
119     
120     UInt_t GetNumberOfCentralityBins() { return fCentEdges.GetSize()-1; }
121     TList* GetCaloPhotonsPHOSList(UInt_t vtxBin, UInt_t centBin, UInt_t rpBin);
122     
123
124
125
126 private:
127     // constants:
128     static const Double_t kLogWeight= 4.5 ; // log weight for recalibration.
129     static const Double_t kAlphaCut=0.7 ;
130     static const Bool_t doESDReCalibration = kTRUE;
131     static const Int_t kNCenBins = 9; // see EvalV0ReactionPlane()
132
133     // cluster cut variables:
134     static const Double_t kMinClusterEnergy = 0.3;
135     static const Int_t kMinNCells = 3;
136     static const Double_t kMinM02 = 0.2;
137
138     // Binning, [vtx, centrality, reaction-plane]
139     static const Int_t kNVtxZBins = 1;
140     static const Double_t kCentCutoff = 90.; // Ignore Centrality over 90%
141     TArrayD fCentEdges;  // Centrality Bin Lower edges
142     TArrayI fCentNMixed; // Number of mixed events for each centrality bin
143     UInt_t fNEMRPBins;
144     
145
146     Period fPeriod;
147
148     TList * fOutputContainer;        //final histogram container
149
150     TF1 *fNonLinCorr;          // Non-linearity correction
151 //TF1 * fRecent[5][12] ;//Recentering corrections
152     TH2I *fPHOSBadMap[6] ;    //Container for PHOS bad channels map
153
154     // Run variables
155
156     // Step 0: Event Objects
157     // fEvent, fMCStack
158     AliVEvent* fEvent; //! Current event
159     AliESDEvent* fEventESD; //! Current event, if ESD.
160     AliAODEvent* fEventAOD; //! Current event, if AOD.
161     AliStack * fMCStack ;
162
163     // Step 1: Run Number, Misalignment Matrix, and Calibration
164     Int_t fRunNumber; // run number
165     Int_t fInternalRunNumber ;    //Current internal run number
166     AliPHOSGeometry  *fPHOSGeo;  //! PHOS geometry
167     TProfile *fMultV0;                  // object containing VZERO calibration information
168     Float_t fV0Cpol,fV0Apol;            // loaded by OADB
169     Float_t fMeanQ[kNCenBins][2][2];    // and recentering
170     Float_t fWidthQ[kNCenBins][2][2];   // ...
171     AliESDtrackCuts *fESDtrackCuts; // Track cut
172     AliPHOSCalibData *fPHOSCalibData; // PHOS calibration object
173
174     // Step 2: Vertex
175     Double_t fVertex[3];
176     TVector3 fVertexVector;
177     Int_t fVtxBin;
178
179     // Step 4: Centrality
180     Float_t fCentralityV0M ; //!Centrality of the currecnt event
181     Int_t fCentBin ;       //! Current centrality bin
182
183     // Step 5: Reaction Plane
184     Bool_t fHaveTPCRP ; //! Is TPC RP defined?
185     Float_t fRP ;       //!Reaction plane calculated with full TPC
186     Float_t fRPV0A ;    //!Reaction plain calculated with A-side TPC: eta>0.15
187     Float_t fRPV0C ;    //!Reaction plain calculated with C-side TPC: eta<-0.15
188     Int_t fEMRPBin;       //! Event Mixing Reaction Plane Bin
189
190     // Step 8: Event Photons (PHOS Clusters) selection
191     TObjArray * fCaloPhotonsPHOS ;      //PHOS photons in current event
192
193     // Step 11: Update lists for mixing.
194     TObjArray* fCaloPhotonsPHOSLists; //! array of TList, Containers for events with PHOS photons
195
196
197     ClassDef(AliAnalysisTaskPi0Flow, 1); // PHOS analysis task
198 };
199
200 #endif