]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/PHOSTasks/PHOS_Correlation/AliPHOSCorrelations.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_Correlation / AliPHOSCorrelations.h
CommitLineData
67ef08bd 1#ifndef AliPHOSCorrelations_cxx
2#define AliPHOSCorrelations_cxx
3
4/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
42800acf 7// Analysis task for identifion PHOS cluster from Pi0 and extracting pi0-hadron correlation.
ce12219e 8// Author: Daniil Ponomarenko <Daniil.Ponomarenko@cern.ch>
42800acf 9// 20-Sept-2014
67ef08bd 10
11class TClonesArray;
12class AliStack ;
13class AliESDtrackCuts;
14class AliPHOSGeometry;
15class AliTriggerAnalysis;
16class AliESDEvent ;
17class AliPIDResponse;
18class AliPHOSCalibData ;
19class AliESDCaloCluster ;
20class AliESDEvent ;
21class AliESDtrack ;
22class AliAODTrack ;
23class AliVCluster ;
24class AliAnalysisUtils;
25class AliEPFlattener;
7deabbe7 26class AliAODInputHandler;
27class AliESDInputHandler;
08a327bf 28class AliVTrack;
67ef08bd 29
30
31#include "TArrayD.h"
32#include "AliAnalysisTaskSE.h"
33
34class AliPHOSCorrelations : public AliAnalysisTaskSE
35{
36public:
42800acf 37 enum EventSelection { kTotal, kEvent, kEventHandler,
38 kTriggerMaskSelection, kHasVertex, kHasCentrality,
39 kHasPHOSClusters, kHasTPCTracks, kPHOSEvent,
40 kMBEvent, kTotalSelected, kHasAbsVertex } ;
42800acf 41 enum PID { kPidAll, kPidCPV, kPidDisp, kPidBoth} ;
67ef08bd 42
43
44public:
42800acf 45 AliPHOSCorrelations() ;
46 AliPHOSCorrelations(const char *name) ;
42800acf 47 virtual ~AliPHOSCorrelations() ;
48
49 virtual void UserCreateOutputObjects() ;
50 virtual void UserExec(Option_t *option) ;
51
631912e0 52 void SetPeriodName(const TString str) { fPeriod = str ; }
ce12219e 53 TString GetPeriod() const { return fPeriod ; }
631912e0 54
08a327bf 55 void SetCentralityEstimator(const char * centr) { fCentralityEstimator = centr ; }
56 void SetEventMixingRPBinning(const UInt_t nBins) { fNEMRPBins = nBins ; }
57 void SetMaxAbsVertexZ(const Float_t z) { fMaxAbsVertexZ = z ; }
58
59 void SwitchOnPionEfficiency() { fUseEfficiency = kTRUE ; }
60 void SwitchOffPionEfficiency() { fUseEfficiency = kFALSE ; }
61
62 void EnableTOFCut(const Bool_t enable, const Double_t TOFCut) { fTOFCutEnabled=enable; fTOFCut=TOFCut; }
b28a73e8 63
08a327bf 64 void SetSigmaWidth(const Double_t sigmaWidth) { fNSigmaWidth = sigmaWidth ; }
65 void SetMassMeanParametrs(const Double_t par[2]) ;
66 void SetMassSigmaParametrs(const Double_t par[4]) ;
b28a73e8 67 void SetMassWindow(const Double_t min, const Double_t max) { fMassInvMeanMin = min; fMassInvMeanMax = max ; }
68 void SetPtAssocBins(TArrayD * arr) { fAssocBins.Set(arr->GetSize(), arr->GetArray()) ; }
42800acf 69 void SetCentralityBinning(const TArrayD& edges, const TArrayI& nMixed) ;
08a327bf 70 void SetCentralityBorders(const Double_t& downLimit , const Double_t& upLimit) ;
08a327bf 71 void SwitchOnMassParametrisation() { fUseMassWindowParametrisation = true ; }
72 void SwitchOffMassParametrisation() { fUseMassWindowParametrisation = false; }
73
74 ULong_t GetTrackStatus() const { return fTrackStatus ; }
75 void SetTrackStatus(ULong_t bit) { fTrackStatus = bit ; }
76
77 ULong_t GetTrackFilterMask() const { return fTrackFilterMask ; }
78 void SetTrackFilterMask(ULong_t bit) { fTrackFilterMask = bit ; }
79
80 void SwitchOnTrackHitSPDSelection() { fSelectSPDHitTracks = kTRUE ; }
81 void SwitchOffTrackHitSPDSelection() { fSelectSPDHitTracks = kFALSE ; }
82
83 void SwitchOnAODTrackSharedClusterSelection() { fSelectFractionTPCSharedClusters = kTRUE ; }
84 void SwitchOffAODTrackSharedClusterSelection() { fSelectFractionTPCSharedClusters = kFALSE ; }
85
86 Float_t GetTPCSharedClusterFraction() const { return fCutTPCSharedClustersFraction ; }
87 void SetTPCSharedClusterFraction(Float_t fr) { fCutTPCSharedClustersFraction = fr ; }
88
89 void SwitchOnAODHybridTrackSelection() { fSelectHybridTracks = kTRUE ; }
90 void SwitchOffAODHybridTrackSelection() { fSelectHybridTracks = kFALSE ; }
67ef08bd 91
42800acf 92
67ef08bd 93protected:
42800acf 94 AliPHOSCorrelations ( const AliPHOSCorrelations& ) ; // not implemented
95 AliPHOSCorrelations& operator=( const AliPHOSCorrelations& ) ; // not implemented
67ef08bd 96
42800acf 97 // Filling hists.
98 void FillHistogram( const char * key,Double_t x ) const ; // Fill 1D histogram witn name key
99 void FillHistogram( const char * key,Double_t x, Double_t y ) const ; // Fill 2D histogram witn name key
100 void FillHistogram( const char * key,Double_t x, Double_t y, Double_t z ) const ; // Fill 3D histogram witn name key
101 void FillHistogram( const char * key,Double_t x, Double_t y, Double_t z, Double_t w ) const ; // Fill 3D histogram witn name key
67ef08bd 102
42800acf 103 // Setup hists.
08a327bf 104 void SetHistPtNumTrigger( const Int_t& ptMult, const Double_t& ptMin, const Double_t& ptMax ) const ; // Set trigger's number of histograms (1-5).
105 void SetHistPtAssoc ( const Int_t& ptMult, const Double_t& ptMin, const Double_t& ptMax ) const ; // Set pt associated of histograms (1-5).
106 void SetHistMass ( const Int_t& ptMult, const Double_t& ptMin, const Double_t& ptMax ) const ; // Set mass histograms.
107 void SetHistEtaPhi ( const Int_t& ptMult, const Double_t& ptMin, const Double_t& ptMax ) const ; // Set hists with track's (pt depend.) and cluster's angle distributions.
108 void SetHistPHOSClusterMap() ; // XZE distribution in PHOS.
9aed5fcd 109
42800acf 110 // Logical and debug.
111 void LogProgress ( int step ) ;
08a327bf 112 void LogSelection ( const int& step , const int& internalRunNumber ) const ;
67ef08bd 113
42800acf 114 // Step 1(done once):
08a327bf 115 Int_t ConvertToInternalRunNumber(const Int_t& run) const ; // Convert run number to local number.
116 void SetESDTrackCuts() ; // AliESDtrack cuts ( for esd data )
67ef08bd 117
42800acf 118 // Step 2: Preparation variables for new event
119 void ZeroingVariables() ;
120 void SetGeometry(); // Initialize the PHOS geometry
67ef08bd 121
42800acf 122 // Step 3: Event trigger selection
123 Bool_t RejectTriggerMaskSelection() ; // Select event trigger and reject.
67ef08bd 124
42800acf 125 // Step 4: Vertex
126 void SetVertex() ; // Find vertex of event.
08a327bf 127 Bool_t RejectEventVertex() const ;
128
129 void SetVertexBinning() ; // Define vertex bins by their edges
130 Int_t GetVertexBin(const TVector3& vertexVector) ; // Find vertex bin
131 UInt_t GetNumberOfVertexBins() const { return fNVtxZBins ; } // Get number of vertex bins.
67ef08bd 132
42800acf 133 // Step 5: Centrality
134 void SetCentrality() ; // Find centrality of event.
08a327bf 135 Bool_t RejectEventCentrality() const;
67ef08bd 136
08a327bf 137 Int_t GetCentralityBin(const Float_t& centralityV0M) ; // Find centrality bin.
42800acf 138 UInt_t GetNumberOfCentralityBins() const { return fCentEdges.GetSize()-1 ; } // Get number of centrality bins.
67ef08bd 139
42800acf 140 // Step 6: Reaction Plane
08a327bf 141 void EvalReactionPlane() ; // Find RP of event.
142 Int_t GetRPBin() ; // Return RP (rad).
143 UInt_t GetNumberOfRPBins() const { return fNEMRPBins ; } // Get number of RP bins.
7deabbe7 144
42800acf 145 // Step 7: Event Photons (PHOS Clusters) selection
08a327bf 146 void SelectPhotonClusters() ;
7deabbe7 147
42800acf 148 // Step 8: Event Associated particles (TPC Tracks) selection
149 void SelectAccosiatedTracks() ;
7deabbe7 150
08a327bf 151 // Step 9: Fill TPC's track mask and control bining hists.
152 void FillTrackEtaPhi() const; // Distribution by track's angles.
153 void FillEventBiningProperties() const ; // Fill fCentBin, fEMRPBin, fVtxBin.
7deabbe7 154
42800acf 155 // Step 10: Extract one most energetic pi0 candidate in this event.
156 void SelectTriggerPi0ME() ; // Select most energetic Pi0 in event.
9aed5fcd 157
08a327bf 158 void TestPi0ME(const Int_t& ipid, const TLorentzVector& p12, const Int_t& modCase) ; // Compare Pi0 particles and remember most energetic in current event.
42800acf 159
160 void SetMEExists(const Int_t pid) { fMEExists[pid] = true ; }
161 void SetMEPhi(const Int_t pid, const Double_t phi) { fMEPhi[pid] = phi ; }
162 void SetMEEta(const Int_t pid, const Double_t eta) { fMEEta[pid] = eta ; }
08a327bf 163 void SetMEPt( const Int_t pid, const Double_t pT) { fMEPt[pid] = pT ; }
42800acf 164 void SetMEModCase(const Int_t pid, const Int_t modcase) { fMEModCase[pid] = modcase ; }
165
08a327bf 166 Bool_t GetMEExists(const Int_t pid) const { return fMEExists[pid] ; }
167 Double_t GetMEPhi(const Int_t pid) const { return fMEPhi[pid] ; }
168 Double_t GetMEEta(const Int_t pid) const { return fMEEta[pid] ; }
169 Double_t GetMEPt(const Int_t pid) const { return fMEPt[pid] ; }
170 Int_t GetMEModCase(const Int_t pid) const { return fMEModCase[pid] ; }
42800acf 171
172 // Step 11: Start correlation analysis.
173 void ConsiderPi0s() ; // Consider the most energetic Pi0 in this event with all tracks of this event.
174 void ConsiderPi0s_MBSelection() ; // Consider the most energetic Pi0 in this event with all tracks of this event using MB events.
175
176 void ConsiderPi0sMix() ; // Use MIX for catch mass peck.
177 void ConsiderTracksMix() ; // Consider the most energetic Pi0 in this event with all tracks from MIXing pull.
67ef08bd 178
42800acf 179 void UpdatePhotonLists() ; // Fill photons in MIXing pull.
180 void UpdateTrackLists() ; // Fill Tracks in MIXing pull.
67ef08bd 181
182
08a327bf 183 Bool_t TestMass(const Double_t& m, const Double_t& pt) const ; // Check if mair in pi0 peak window.
67ef08bd 184
08a327bf 185 Double_t MassMeanFunction(const Double_t &pt) const ; // Parametrization mean of mass window.
186 Double_t MassSigmaFunction(const Double_t &pt) const ; // Parametrization sigma of mass window.
187 Double_t GetAssocBin(const Double_t& pt) const ; // Calculates bin for current associated particle pT.
188 Double_t GetEfficiency(const Double_t& pt) const ; // Return Pi0 efficiency for current pT (PID: both2core only).
189 Int_t GetModCase(const Int_t &mod1, const Int_t &mod2) const ; // Produce part of module neme for pTetaPhi histogram.
7deabbe7 190
08a327bf 191 TList* GetCaloPhotonsPHOSList(const UInt_t vtxBin, const UInt_t centBin, const UInt_t rpBin) ; // Return photons from PHOS list from previous events.
192 TList* GetTracksTPCList(const UInt_t vtxBin, const UInt_t centBin, const UInt_t rpBin) ; // Return tracks from TPC list from previous events.
7deabbe7 193
08a327bf 194 Bool_t SelectESDTrack(const AliESDtrack * t) const ; // Estimate if this track can be used for the RP calculation.
195 Bool_t SelectAODTrack(const AliAODTrack * t) const ; // Estimate if this track can be used for the RP calculation.
42800acf 196
197 AliAnalysisUtils* GetAnalysisUtils() ;
7deabbe7 198
199
67ef08bd 200private:
42800acf 201 //General Data members
202 AliPHOSGeometry * fPHOSGeo ; //! Geometry
203 TList * fOutputContainer ; //! Output histograms container
204
205 AliVEvent * fEvent; //! Current event
206 AliESDEvent * fEventESD; //! Current event, if ESD.
207 AliAODEvent * fEventAOD; //! Current event, if AOD.
208 AliInputEventHandler * fEventHandler; //! Event trigger bit.
209
210 TClonesArray * fCaloPhotonsPHOS ; //! PHOS photons in current event
211 TClonesArray * fTracksTPC ; //! TPC tracks in current event
212 TObjArray * fCaloPhotonsPHOSLists; //! array of TList, Containers for events with PHOS photons
213 TObjArray * fTracksTPCLists; //! array of TList, Containers for events with TPC tracks
214
215 Int_t fRunNumber; //! Run number
216 Int_t fInternalRunNumber ; //! Current internal run number
631912e0 217 TString fPeriod;
42800acf 218
219 Bool_t fPHOSEvent; //! PHOS event trigger.
220 Bool_t fMBEvent; //! MB event trigger.
221
222 // Binning [vtx, centrality, reaction-plane]
223 Int_t fNVtxZBins; // Number of Z vertex bins
08a327bf 224 TArrayD fVtxEdges; //! Vertex bin Lower edges
42800acf 225 TArrayD fCentEdges; //! Centrality Bin Lower edges
226 TArrayI fCentNMixed; // Number of mixed events for each centrality bin
227 UInt_t fNEMRPBins; // Binning of Reaction plane
228 TArrayD fAssocBins; //! Assoc Pt Bin Lower edges
229
230 Double_t fVertex[3]; //! Event vertex
231 TVector3 fVertexVector; //! The same
232 Int_t fVtxBin; //! Vertex bin
233
234 TString fCentralityEstimator; //! Centrality estimator ("V0M", "ZNA")
235 Float_t fCentrality ; //! Centrality of the current event
236 Int_t fCentBin ; //! Current centrality bin
237
238 Bool_t fHaveTPCRP ; //! Is TPC RP defined?
239 Float_t fRP ; //! Reaction plane calculated with full TPC
240 Int_t fEMRPBin; //! Event Mixing Reaction Plane Bin
67ef08bd 241
242 // Behavior / cuts
42800acf 243 Float_t fMaxAbsVertexZ; // Maximum distence Z component of vertix in cm
244 Double_t fCentralityLowLimit; // Ignore Centrality less %
245 Double_t fCentralityHightLimit; // Ignore Centrality over %
246
42800acf 247 Double_t fMinClusterEnergy; // Min energy PHOS's cluster
248 Double_t fMinBCDistance; // Min distance to nearest bad channel
249 Int_t fMinNCells; // Min count of Cells in cluster
250 Double_t fMinM02; // Min size of M02 in claster
251 Bool_t fTOFCutEnabled; // Use time of flight or not?
252 Double_t fTOFCut; // Max time of flight
253
08a327bf 254 Bool_t fUseMassWindowParametrisation; // Use parametrization? (Else use fixed mass borders)
255 Double_t fMassInvMeanMin ; // Mass Pi0 minimum window value
256 Double_t fMassInvMeanMax ; // Mass Pi0 maximum window value
257 Double_t fNSigmaWidth; // Width in sigma (*N). If fNSigmaWidth = 0 code will use window fMassInvMeanMin fMassInvMeanMax
42800acf 258
259 // Funktion of mass window parametrs: [mass, pt]
260 Double_t fMassMean[2]; // Mass mean parametrisation
08a327bf 261 Double_t fMassSigma[3]; // Mass sigma parametrisation
42800acf 262
263 // ME Pi0 selection veriables ([n] = pid).
264 Bool_t fMEExists[4]; // Does trigger Pi0 candidate exists?
265 Double_t fMEPhi[4]; // Phi of ME Pi0 candidate
266 Double_t fMEEta[4]; // Eta of ME Pi0 candidate
267 Double_t fMEPt[4]; // pT of ME Pi0 candidate
268 Int_t fMEModCase[4]; // Pair of modules where photons are observed
269
270 Bool_t fUseEfficiency ; // Use efficiensy correction during analysis
271
08a327bf 272 AliESDtrackCuts * fESDtrackCuts ; // Track cut
273
274 Bool_t fSelectHybridTracks ; // Select CTS tracks of type hybrid (only for AODs)
275
276 ULong_t fTrackStatus ; // the statusflag contains a set of flags which show which parts of the tracking algorithm were successful.
277 ULong_t fTrackFilterMask ; // The filterbits encode combinations of cuts on the AOD, such as the hybrid track selection.
278 Bool_t fSelectSPDHitTracks ; // Ensure that track hits SPD layers
279 Bool_t fSelectFractionTPCSharedClusters ; // Accept only TPC tracks with over a given fraction of shared clusters
280 Float_t fCutTPCSharedClustersFraction ; // Fraction of TPC shared clusters to be accepted.
281
282
42800acf 283 ClassDef(AliPHOSCorrelations, 2); // PHOS analysis task
67ef08bd 284};
285
d2c19ce3 286#endif
08a327bf 287