1 #ifndef AliAnalysisTaskPi0Flow_cxx
2 #define AliAnalysisTaskPi0Flow_cxx
4 // Analysis task to fill histograms with PHOS ESD or AOD clusters and cells
5 // Authors : Dmitri Peressounko
7 // Modified: 03.08.2012 Henrik Qvigstad
16 class AliESDtrackCuts;
17 class AliPHOSGeometry;
19 class AliPHOSCalibData;
21 class AliESDCaloCluster ;
25 #include "AliAnalysisTaskSE.h"
27 class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {
29 enum Period { kUndefinedPeriod, kLHC10h, kLHC11h };
32 AliAnalysisTaskPi0Flow(const char *name = "AliAnalysisTaskPi0Flow", Period period = kUndefinedPeriod);
33 virtual ~AliAnalysisTaskPi0Flow();
35 virtual void UserCreateOutputObjects();
36 virtual void UserExec(Option_t *option);
37 virtual void Terminate(Option_t *);
39 void SetPeriod(Period period) { fPeriod = period;}
41 void SetCentralityBinning(const TArrayD& edges);
42 void SetEventMixingRPBinning(UInt_t nBins) { fNEMRPBins = nBins; }
43 void SetMixingArraysLength(UInt_t length) { fMixingArraysLength = length; }
45 void SetPHOSBadMap(Int_t mod,TH2I * badMapHist);
49 AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented
50 AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented
53 AliVEvent* GetEvent();
54 AliStack* GetMCStack();
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)
65 Bool_t RejectEventVertex();
69 Bool_t RejectCentrality();
72 void EvalReactionPlane();
73 void EvalV0ReactionPlane();
75 // Step 7: QA PHOS cells
76 void FillPHOSCellQAHists();
78 // Step 8: Event Photons (PHOS Clusters) selection
79 void SelectPhotonClusters();
80 void FillSelectedClusterHistograms();
82 // Step 9: Consider pi0 (photon/cluster) pairs.
86 void ConsiderPi0sMix();
88 // Step 11: Update lists
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);
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
105 TVector3 GetVertexVector(const AliVVertex* vertex);
106 Int_t GetCentralityBin(Float_t centralityV0M);
109 void LogProgress(int step, int internalRunNumber);
111 Bool_t IsGoodChannel(const char * det, Int_t mod,Int_t ix, Int_t iz); //Use addisional bad map for PHOS
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
119 UInt_t GetNumberOfCentralityBins() { return fCentEdges.GetSize()-1; }
120 TList* GetCaloPhotonsPHOSList(UInt_t vtxBin, UInt_t centBin, UInt_t rpBin);
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()
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;
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,
143 UInt_t fMixingArraysLength;
148 TList * fOutputContainer; //final histogram container
150 TF1 *fNonLinCorr; // Non-linearity correction
151 //TF1 * fRecent[5][12] ;//Recentering corrections
152 TH2I *fPHOSBadMap[6] ; //Container for PHOS bad channels map
156 // Step 0: Event Objects
158 AliVEvent* fEvent; //! Current event
159 AliESDEvent* fEventESD; //! Current event, if ESD.
160 AliAODEvent* fEventAOD; //! Current event, if AOD.
161 AliStack * fMCStack ;
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
176 TVector3 fVertexVector;
179 // Step 4: Centrality
180 Float_t fCentralityV0M ; //!Centrality of the currecnt event
181 Int_t fCentBin ; //! Current centrality bin
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
190 // Step 8: Event Photons (PHOS Clusters) selection
191 TObjArray * fCaloPhotonsPHOS ; //PHOS photons in current event
193 // Step 11: Update lists for mixing.
194 TObjArray* fCaloPhotonsPHOSLists; //! array of TList, Containers for events with PHOS photons
197 ClassDef(AliAnalysisTaskPi0Flow, 1); // PHOS analysis task