1 #ifndef AliAnalysisTaskPi0Flow_cxx
2 #define AliAnalysisTaskPi0Flow_cxx
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 // Analysis task to fill histograms with PHOS ESD or AOD clusters and cells
8 // Authors : Dmitri Peressounko
10 // Modified: 03.08.2012 Henrik Qvigstad
20 class AliESDtrackCuts;
21 class AliPHOSGeometry;
23 class AliPHOSCalibData;
25 class AliESDCaloCluster ;
30 #include "AliAnalysisTaskSE.h"
32 class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {
34 enum Period { kUndefinedPeriod, kLHC10h, kLHC11h };
37 AliAnalysisTaskPi0Flow(const char *name = "AliAnalysisTaskPi0Flow", Period period = kUndefinedPeriod);
38 virtual ~AliAnalysisTaskPi0Flow();
40 virtual void UserCreateOutputObjects();
41 virtual void UserExec(Option_t *option);
42 /* virtual void Terminate(Option_t *); */
44 void SetPeriod(Period period) { fPeriod = period;}
46 void SetCentralityBinning(const TArrayD& edges, const TArrayI& nMixed);
47 void SetEventMixingRPBinning(UInt_t nBins) { fNEMRPBins = nBins; }
48 void SetMaxAbsVertexZ(Float_t z) { fMaxAbsVertexZ = z; }
49 void SetManualV0EPCalc(Bool_t manCalc = true) {fManualV0EPCalc = manCalc;}
50 void SetEnablePHOSModule(int module, Bool_t enable = true);
52 void SetPHOSBadMap(Int_t mod,TH2I * badMapHist);
53 //Where to read AODB object with EP calibration if not default
54 void SetEPcalibFileName(const TString filename) {fEPcalibFileName = filename; }
57 AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented
58 AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented
61 AliVEvent* GetEvent();
62 AliStack* GetMCStack();
66 void SetMisalignment();
67 void SetV0Calibration(); //V0 calibration
68 void SetESDTrackCuts(); // AliESDtrack cuts ( for esd data )
69 void SetPHOSCalibData(); // phos re-calibration ( for esd data)
70 void SetFlatteningData(); // phos flattening
74 Bool_t RejectEventVertex();
78 Bool_t RejectCentrality();
81 void EvalReactionPlane();
82 void EvalV0ReactionPlane();
84 // Step 7: QA PHOS cells
85 void FillPHOSCellQAHists();
87 // Step 8: Event Photons (PHOS Clusters) selection
88 void SelectPhotonClusters();
89 void FillSelectedClusterHistograms();
91 // Step 9: Consider pi0 (photon/cluster) pairs.
95 void ConsiderPi0sMix();
97 // Step 11: Update lists
100 Bool_t AreNeibors(Int_t id1,Int_t id2) ;
101 Double_t ApplyFlattening(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
102 Double_t ApplyFlatteningV0A(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
103 Double_t ApplyFlatteningV0C(Double_t phi, Double_t c) ; //Apply centrality-dependent flattening
104 Int_t ConvertToInternalRunNumber(Int_t run) ;
105 Double_t CoreEnergy(AliVCluster * clu, AliVCaloCells * cells);
106 void EvalCoreLambdas(AliVCluster * clu, AliVCaloCells * cells, Double_t &m02, Double_t &m20) ;
107 Bool_t TestCoreLambda(Double_t pt,Double_t l1,Double_t l2) ;
112 void FillHistogram(const char * key,Double_t x) const ; //Fill 1D histogram witn name key
113 void FillHistogram(const char * key,Double_t x, Double_t y) const ; //Fill 2D histogram witn name key
114 void FillHistogram(const char * key,Double_t x, Double_t y, Double_t z) const ; //Fill 3D histogram witn name key
116 TVector3 GetVertexVector(const AliVVertex* vertex);
117 Int_t GetCentralityBin(Float_t centralityV0M);
120 void LogProgress(int step);
121 void LogSelection(int step, int internalRunNumber);
123 Bool_t IsGoodChannel(const char * det, Int_t mod,Int_t ix, Int_t iz); //Use addisional bad map for PHOS
126 void Reclusterize(AliVCluster * clu) ;
127 Double_t TestCPV(Double_t dx, Double_t dz, Double_t pt, Int_t charge);
128 Bool_t TestLambda(Double_t pt,Double_t l1,Double_t l2) ; //Evaluate Dispersion cuts for photons
129 Bool_t TestLambda2(Double_t pt,Double_t l1,Double_t l2) ; //Evaluate Dispersion cuts for photons
131 UInt_t GetNumberOfCentralityBins() { return fCentEdges.GetSize()-1; }
132 TList* GetCaloPhotonsPHOSList(UInt_t vtxBin, UInt_t centBin, UInt_t rpBin);
138 // transiant constants
139 static const Int_t kNMod = 5;
142 static const Double_t kLogWeight= 4.5 ; // log weight for recalibration.
143 static const Double_t kAlphaCut=0.7 ;
144 static const Bool_t doESDReCalibration = kTRUE;
145 static const Int_t kNCenBins = 9; // see EvalV0ReactionPlane()
147 // cluster cut variables:
148 static const Double_t kMinClusterEnergy = 0.3;
149 static const Double_t kMinBCDistance = 2.5; //distance to nearest bad channel
150 static const Int_t kMinNCells = 3;
151 static const Double_t kMinM02 = 0.2;
153 // Binning, [vtx, centrality, reaction-plane]
154 static const Int_t kNVtxZBins = 1;
155 static const Double_t kCentCutoff = 90.; // Ignore Centrality over 90%
156 TArrayD fCentEdges; // Centrality Bin Lower edges
157 TArrayI fCentNMixed; // Number of mixed events for each centrality bin
163 Float_t fMaxAbsVertexZ; // in cm
164 Bool_t fManualV0EPCalc;
165 Bool_t fModuleEnabled[kNMod]; //[kNMod]
168 TList * fOutputContainer; //final histogram container
170 TF1 *fNonLinCorr; // Non-linearity correction
171 //TF1 * fRecent[5][12] ;//Recentering corrections
172 TH2I *fPHOSBadMap[6] ; //Container for PHOS bad channels map
176 // Step 0: Event Objects
178 AliVEvent* fEvent; //! Current event
179 AliESDEvent* fEventESD; //! Current event, if ESD.
180 AliAODEvent* fEventAOD; //! Current event, if AOD.
181 AliStack * fMCStack ;
183 // Step 1: Run Number, Misalignment Matrix, and Calibration
184 Int_t fRunNumber; // run number
185 Int_t fInternalRunNumber ; //Current internal run number
186 AliPHOSGeometry *fPHOSGeo; //! PHOS geometry
187 TProfile *fMultV0; // object containing VZERO calibration information
188 Float_t fV0Cpol,fV0Apol; // loaded by OADB
189 Float_t fMeanQ[kNCenBins][2][2]; // and recentering
190 Float_t fWidthQ[kNCenBins][2][2]; // ...
191 AliESDtrackCuts *fESDtrackCuts; // Track cut
192 AliPHOSCalibData *fPHOSCalibData; // PHOS calibration object
193 TString fEPcalibFileName;
194 AliEPFlattener * fTPCFlat ; //Object for flattening of TPC
195 AliEPFlattener * fV0AFlat ; //Object for flattening of V0A
196 AliEPFlattener * fV0CFlat ; //Object for flattening of V0C
201 TVector3 fVertexVector;
204 // Step 4: Centrality
205 Float_t fCentralityV0M ; //!Centrality of the currecnt event
206 Int_t fCentBin ; //! Current centrality bin
208 // Step 5: Reaction Plane
209 Bool_t fHaveTPCRP ; //! Is TPC RP defined?
210 Float_t fRP ; //!Reaction plane calculated with full TPC
211 Float_t fRPV0A ; //!Reaction plain calculated with A-side TPC: eta>0.15
212 Float_t fRPV0C ; //!Reaction plain calculated with C-side TPC: eta<-0.15
213 Int_t fEMRPBin; //! Event Mixing Reaction Plane Bin
215 // Step 8: Event Photons (PHOS Clusters) selection
216 TObjArray * fCaloPhotonsPHOS ; //PHOS photons in current event
218 // Step 11: Update lists for mixing.
219 TObjArray* fCaloPhotonsPHOSLists; //! array of TList, Containers for events with PHOS photons
222 ClassDef(AliAnalysisTaskPi0Flow, 1); // PHOS analysis task