]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0Flow.h
Code reworking to analize ESD and AOD (H.Qvigstad)
[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
9 class TObjArray;
10 class TH1F;
11 class TH2I;
12 class TH2F;
13 class TH3F;
14 class TF1 ;
15 class AliStack ;
16 class AliESDtrackCuts;
17 class AliPHOSGeometry;
18 class AliESDEvent ;
19 class AliPHOSCalibData;
20 class AliESDtrack ;
21 class AliESDCaloCluster ;
22
23 #include "TArrayD.h"
24
25 #include "AliAnalysisTaskSE.h"
26
27 class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {
28 public:
29     enum Period { kUndefinedPeriod, kLHC10h, kLHC11h };
30
31 public:
32     AliAnalysisTaskPi0Flow(const char *name = "AliAnalysisTaskPi0Flow", Period period = kUndefinedPeriod);
33     virtual ~AliAnalysisTaskPi0Flow();
34
35     virtual void   UserCreateOutputObjects();
36     virtual void   UserExec(Option_t *option);
37     virtual void   Terminate(Option_t *);
38
39     void SetPeriod(Period period) { fPeriod = period;}
40     
41     void SetCentralityBinning(const TArrayD& edges);
42     void SetEventMixingRPBinning(UInt_t nBins) { fNEMRPBins = nBins; }
43     void SetMixingArraysLength(UInt_t length) { fMixingArraysLength = length; }
44     
45     void SetPHOSBadMap(Int_t mod,TH2I * badMapHist);
46
47
48 private:
49     AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented
50     AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented
51
52     // Step 0:
53     AliVEvent* GetEvent();
54     AliStack* GetMCStack();
55
56     // Step 1:
57     void SetGeometry();
58     void SetMisalignment();
59     void SetV0Calibration(); //V0 calibration
60     void SetESDTrackCuts(); // AliESDtrack cuts ( for esd data )
61     void SetPHOSCalibData(); // phos re-calibration ( for esd data)
62
63     // Step 2:
64     void SetVertex();
65     Bool_t RejectEventVertex();
66
67     // Step 4:
68     void SetCentrality();
69     Bool_t RejectCentrality();
70
71     // Step 5:
72     void EvalReactionPlane();
73     void EvalV0ReactionPlane();
74
75     // Step 7: QA PHOS cells
76     void FillPHOSCellQAHists();
77
78     // Step 8: Event Photons (PHOS Clusters) selection
79     void SelectPhotonClusters();
80     void FillSelectedClusterHistograms();
81
82     // Step 9: Consider pi0 (photon/cluster) pairs.
83     void ConsiderPi0s();
84
85     // Step 10; Mixing
86     void ConsiderPi0sMix();
87
88     // Step 11: Update lists
89     void UpdateLists();
90
91     Bool_t AreNeibors(Int_t id1,Int_t id2) ;
92     Double_t ApplyFlattening(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
93     Double_t ApplyFlatteningV0A(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
94     Double_t ApplyFlatteningV0C(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
95     Int_t ConvertToInternalRunNumber(Int_t run) ;
96     Double_t CoreEnergy(AliVCluster * clu);
97
98
99
100
101     void FillHistogram(const char * key,Double_t x) const ; //Fill 1D histogram witn name key
102     void FillHistogram(const char * key,Double_t x, Double_t y) const ; //Fill 2D histogram witn name key
103     void FillHistogram(const char * key,Double_t x, Double_t y, Double_t z) const ; //Fill 3D histogram witn name key
104
105     TVector3 GetVertexVector(const AliVVertex* vertex);
106     Int_t GetCentralityBin(Float_t centralityV0M);
107     Int_t GetRPBin();
108
109     void LogProgress(int step, int internalRunNumber);
110
111     Bool_t IsGoodChannel(const char * det, Int_t mod,Int_t ix, Int_t iz); //Use addisional bad map for PHOS
112
113
114     void Reclusterize(AliVCluster * clu) ;
115     Double_t TestCPV(Double_t dx, Double_t dz, Double_t pt, Int_t charge);
116     Bool_t TestLambda(Double_t pt,Double_t l1,Double_t l2) ;  //Evaluate Dispersion cuts for photons
117     Bool_t TestLambda2(Double_t pt,Double_t l1,Double_t l2) ;  //Evaluate Dispersion cuts for photons
118     
119     UInt_t GetNumberOfCentralityBins() { return fCentEdges.GetSize()-1; }
120     TList* GetCaloPhotonsPHOSList(UInt_t vtxBin, UInt_t centBin, UInt_t rpBin);
121     
122
123
124
125 private:
126     // constants:
127     static const Double_t kLogWeight= 4.5 ; // log weight for recalibration.
128     static const Double_t kAlphaCut=0.7 ;
129     static const Bool_t doESDReCalibration = kTRUE;
130     static const Int_t kNCenBins = 9; // see EvalV0ReactionPlane()
131
132     // cluster cut variables:
133     static const Double_t kMinClusterEnergy = 0.3;
134     static const Int_t kMinNCells = 3;
135     static const Double_t kMinM02 = 0.2;
136
137     // Binning, [vtx, centrality, reaction-plane]
138     static const Int_t kNVtxZBins = 1;
139     static const Double_t kCentCutoff = 90.; // Ignore Centrality over 90%
140     TArrayD fCentEdges; // Centrality Bin Lower edges,
141     UInt_t fNEMRPBins;
142     
143     UInt_t fMixingArraysLength;
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