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
17 class AliESDtrackCuts;
18 class AliPHOSGeometry;
20 class AliPHOSCalibData;
22 class AliESDCaloCluster ;
26 #include "AliAnalysisTaskSE.h"
28 class AliAnalysisTaskPi0Flow : public AliAnalysisTaskSE {
30 enum Period { kUndefinedPeriod, kLHC10h, kLHC11h };
33 AliAnalysisTaskPi0Flow(const char *name = "AliAnalysisTaskPi0Flow", Period period = kUndefinedPeriod);
34 virtual ~AliAnalysisTaskPi0Flow();
36 virtual void UserCreateOutputObjects();
37 virtual void UserExec(Option_t *option);
38 /* virtual void Terminate(Option_t *); */
40 void SetPeriod(Period period) { fPeriod = period;}
42 void SetCentralityBinning(const TArrayD& edges);
43 void SetNMixedPerCentrality(const TArrayI& nMixed);
44 void SetEventMixingRPBinning(UInt_t nBins) { fNEMRPBins = nBins; }
46 void SetPHOSBadMap(Int_t mod,TH2I * badMapHist);
50 AliAnalysisTaskPi0Flow(const AliAnalysisTaskPi0Flow&); // not implemented
51 AliAnalysisTaskPi0Flow& operator=(const AliAnalysisTaskPi0Flow&); // not implemented
54 AliVEvent* GetEvent();
55 AliStack* GetMCStack();
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)
66 Bool_t RejectEventVertex();
70 Bool_t RejectCentrality();
73 void EvalReactionPlane();
74 void EvalV0ReactionPlane();
76 // Step 7: QA PHOS cells
77 void FillPHOSCellQAHists();
79 // Step 8: Event Photons (PHOS Clusters) selection
80 void SelectPhotonClusters();
81 void FillSelectedClusterHistograms();
83 // Step 9: Consider pi0 (photon/cluster) pairs.
87 void ConsiderPi0sMix();
89 // Step 11: Update lists
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);
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
106 TVector3 GetVertexVector(const AliVVertex* vertex);
107 Int_t GetCentralityBin(Float_t centralityV0M);
110 void LogProgress(int step, int internalRunNumber);
112 Bool_t IsGoodChannel(const char * det, Int_t mod,Int_t ix, Int_t iz); //Use addisional bad map for PHOS
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
120 UInt_t GetNumberOfCentralityBins() { return fCentEdges.GetSize()-1; }
121 TList* GetCaloPhotonsPHOSList(UInt_t vtxBin, UInt_t centBin, UInt_t rpBin);
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()
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;
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
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