]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.h
Added Eventplane Dependence in dPhi Correlations code
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / AliAnalysisTaskPhiCorrelations.h
CommitLineData
e0331fd9 1#ifndef AliAnalysisTaskPhiCorrelations_H
2#define AliAnalysisTaskPhiCorrelations_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7////////////////////////////////////////////////////////////////////////
8//
9// Analysis class for Underlying Event studies w.r.t. leading track
10//
11// Look for correlations on the tranverse regions w.r.t
12// the leading track in the event
13//
14// This class needs input AODs.
15// The output is a list of analysis-specific containers.
16//
17// The AOD can be either connected to the InputEventHandler
18// for a chain of AOD files
19// or
20// to the OutputEventHandler
21// for a chain of ESD files,
22// in this case the class should be in the train after the jet-finder
23//
24// Authors:
e0331fd9 25// Jan Fiete Grosse-Oetringhaus
e0331fd9 26//
27////////////////////////////////////////////////////////////////////////
28
29#include "AliAnalysisTask.h"
30#include "AliUEHist.h"
2a910c25 31#include "TString.h"
a1c31636 32#include "AliVParticle.h"
33#include "AliLog.h"
408d1ac9 34#include "THn.h" // in cxx file causes .../THn.h:257: error: conflicting declaration ‘typedef class THnT<float> THnF’
e0331fd9 35
36class AliAODEvent;
37class AliAnalyseLeadingTrackUE;
38class AliInputEventHandler;
39class AliMCEvent;
40class AliMCEventHandler;
41class AliUEHistograms;
42class AliVParticle;
24d8278b 43class TH1;
e0331fd9 44class TObjArray;
2a910c25 45class AliEventPoolManager;
85bfac17 46class AliESDEvent;
32e49607 47class AliHelperPID;
6e84bd0a 48class AliAnalysisUtils;
97270ee2 49class TFormula;
dc44bc1f 50class TMap;
3e09dd3e 51class AliGenEventHeader;
677dc831 52class AliVEvent;
e0331fd9 53
408d1ac9 54
e0331fd9 55class AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
56 {
57 public:
58 AliAnalysisTaskPhiCorrelations(const char* name="AliAnalysisTaskPhiCorrelations");
59 virtual ~AliAnalysisTaskPhiCorrelations();
60
61
62 // Implementation of interace methods
63 virtual void ConnectInputData(Option_t *);
64 virtual void CreateOutputObjects();
65 virtual void Exec(Option_t *option);
66
67 // Setters/Getters
68 // general configuration
69 virtual void SetDebugLevel( Int_t level ) { fDebug = level; }
70 virtual void SetMode(Int_t mode) { fMode = mode; }
71 virtual void SetReduceMemoryFootprint(Bool_t flag) { fReduceMemoryFootprint = flag; }
eed401dc 72 virtual void SetEventMixing(Bool_t flag) { fFillMixed = flag; }
ac647b0f 73 virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
1bba939a 74 virtual void SetTwoTrackEfficiencyStudy(Bool_t flag) { fTwoTrackEfficiencyStudy = flag; }
7e9608f2 75 virtual void SetTwoTrackEfficiencyCut(Float_t value = 0.02, Float_t min = 0.8) { fTwoTrackEfficiencyCut = value; fTwoTrackCutMinRadius = min; }
3bbad7c1 76 virtual void SetUseVtxAxis(Int_t flag) { fUseVtxAxis = flag; }
9894bedd 77 virtual void SetCourseCentralityBinning(Bool_t flag) { fCourseCentralityBinning = flag; }
04af8d15 78 virtual void SetSkipTrigger(Bool_t flag) { fSkipTrigger = flag; }
1ccd8a0a 79 virtual void SetInjectedSignals(Bool_t flag) { fInjectedSignals = flag; }
f89c31a7 80 void SetRandomizeReactionPlane(Bool_t flag) { fRandomizeReactionPlane = flag; }
e0331fd9 81
82 // histogram settings
418b56c5 83 void SetEfficiencyCorrectionTriggers(THnF* hist) { fEfficiencyCorrectionTriggers = hist; }
84 void SetEfficiencyCorrectionAssociated(THnF* hist) { fEfficiencyCorrectionAssociated = hist; }
24d8278b 85 void SetCentralityWeights(TH1* hist) { fCentralityWeights = hist; }
e0331fd9 86
87 // for event QA
e08dff58 88 void SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
89 void SetZVertex( Double_t val ) { fZVertex = val; }
90 void SetAcceptOnlyMuEvents( Bool_t val ) { fAcceptOnlyMuEvents = val; }
e0331fd9 91
92 // track cuts
e08dff58 93 void SetTrackEtaCut( Double_t val ) { fTrackEtaCut = val; }
94 void SetTrackEtaCutMin( Double_t val ) { fTrackEtaCutMin = val; }
418b56c5 95 void SetOnlyOneEtaSide(Int_t flag) { fOnlyOneEtaSide = flag; }
774ef124 96 void SetTrackPhiCutEvPlMin(Double_t val) { fTrackPhiCutEvPlMin = val; }
97 void SetTrackPhiCutEvPlMax(Double_t val) { fTrackPhiCutEvPlMax = val; }
e0331fd9 98 void SetPtMin(Double_t val) { fPtMin = val; }
99 void SetFilterBit( UInt_t val ) { fFilterBit = val; }
97270ee2 100 void SetDCAXYCut(TFormula* value) { fDCAXYCut = value; }
7d756130 101 void SetSharedClusterCut(Float_t value) { fSharedClusterCut = value; }
132b6963 102 void SetCrossedRowsCut(Int_t value) { fCrossedRowsCut = value; }
103 void SetFoundFractionCut(Double_t value) { fFoundFractionCut = value; }
418b56c5 104 void SetTrackStatus(UInt_t status) { fTrackStatus = status; }
9e35c487 105 void SetCheckMotherPDG(Bool_t checkpdg) { fCheckMotherPDG = checkpdg; }
f334f670 106
107 // track cuts
108 void SetTrackletDphiCut( Double_t val ) { fTrackletDphiCut = val; }
109
e0331fd9 110 void SetEventSelectionBit( UInt_t val ) { fSelectBit = val; }
111 void SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
5c9b9fa6 112 void SetSelectParticleSpecies( Int_t trigger, Int_t associated ) { fParticleSpeciesTrigger = trigger; fParticleSpeciesAssociated = associated; }
2a910c25 113 void SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
7a77d480 114 void SetSelectTriggerCharge(Int_t selectCharge) { fTriggerSelectCharge = selectCharge; }
15b0fdd0 115 void SetSelectAssociatedCharge(Int_t selectCharge) { fAssociatedSelectCharge = selectCharge; }
d38fa455 116 void SetTriggerRestrictEta(Float_t eta) { fTriggerRestrictEta = eta; }
00b6f3c6 117 void SetEtaOrdering(Bool_t flag) { fEtaOrdering = flag; }
b0d56b29 118 void SetPairCuts(Bool_t conversions, Bool_t resonances) { fCutConversions = conversions; fCutResonances = resonances; }
97270ee2 119 void SetRejectResonanceDaughters(Int_t value) { fRejectResonanceDaughters = value; }
2a910c25 120 void SetCentralityMethod(const char* method) { fCentralityMethod = method; }
c05ff6be 121 void SetFillpT(Bool_t flag) { fFillpT = flag; }
a26093ba 122 void SetStepsFillSkip(Bool_t step0, Bool_t step6) { fFillOnlyStep0 = step0; fSkipStep6 = step6; }
5e053cad 123 void SetRejectCentralityOutliers(Bool_t flag = kTRUE) { fRejectCentralityOutliers = flag; }
ff9f18e4 124 void SetRejectZeroTrackEvents(Bool_t flag) { fRejectZeroTrackEvents = flag; }
f613255f 125 void SetRemoveWeakDecays(Bool_t flag = kTRUE) { fRemoveWeakDecays = flag; }
d6a8903f 126 void SetRemoveDuplicates(Bool_t flag = kTRUE) { fRemoveDuplicates = flag; }
8a368fc2 127 void SetSkipFastCluster(Bool_t flag = kTRUE) { fSkipFastCluster = flag; }
128 void SetWeightPerEvent(Bool_t flag = kTRUE) { fWeightPerEvent = flag; }
3f3f12d9 129 void SetCustomBinning(const char* binningStr) { fCustomBinning = binningStr; }
640b9425 130 void SetPtOrder(Bool_t flag) { fPtOrder = flag; }
2b27d6f4 131 void SetTriggersFromDetector(Int_t flag) { fTriggersFromDetector = flag; }
677dc831 132 void SetAssociatedFromDetector(Int_t flag) { fAssociatedFromDetector = flag; }
2313a5d0 133 void SetMCUseUncheckedCentrality(Bool_t flag) { fMCUseUncheckedCentrality = flag; }
e0331fd9 134
32e49607 135 AliHelperPID* GetHelperPID() { return fHelperPID; }
136 void SetHelperPID(AliHelperPID* pid){ fHelperPID = pid; }
6e84bd0a 137
138 AliAnalysisUtils* GetAnalysisUtils() { return fAnalysisUtils; }
139 void SetAnalysisUtils(AliAnalysisUtils* utils){ fAnalysisUtils = utils; }
dc44bc1f 140
141 TMap* GetMap() { return fMap; }
142 void SetMap(TMap* map){ fMap = map; }
32e49607 143
e0331fd9 144 private:
145 AliAnalysisTaskPhiCorrelations(const AliAnalysisTaskPhiCorrelations &det);
146 AliAnalysisTaskPhiCorrelations& operator=(const AliAnalysisTaskPhiCorrelations &det);
147 void AddSettingsTree(); // add list of settings to output list
148 // Analysis methods
149 void AnalyseCorrectionMode(); // main algorithm to get correction maps
150 void AnalyseDataMode(); // main algorithm to get raw distributions
151 void Initialize(); // initialize some common pointer
7a028750 152 TObjArray* CloneAndReduceTrackList(TObjArray* tracks);
d6a8903f 153 void RemoveDuplicates(TObjArray* tracks);
3f3f12d9 154 void CleanUp(TObjArray* tracks, TObject* mcObj, Int_t maxLabel);
29cfdb5f 155 void SelectCharge(TObjArray* tracks);
3e09dd3e 156 AliGenEventHeader* GetFirstHeader();
24d8278b 157 Bool_t AcceptEventCentralityWeight(Double_t centrality);
f89c31a7 158 void ShiftTracks(TObjArray* tracks, Double_t angle);
677dc831 159 TObjArray* GetParticlesFromDetector(AliVEvent* inputEvent, Int_t idet);
576bfde8 160 Bool_t IsMuEvent();
e0331fd9 161
e0331fd9 162 // General configuration
163 Int_t fDebug; // Debug flag
164 Int_t fMode; // fMode = 0: data-like analysis
165 // fMode = 1: corrections analysis
f89c31a7 166 Bool_t fReduceMemoryFootprint; // reduce memory consumption by writing less debug histograms
eed401dc 167 Bool_t fFillMixed; // enable event mixing (default: ON)
ac647b0f 168 Int_t fMixingTracks; // size of track buffer for event mixing
1bba939a 169 Bool_t fTwoTrackEfficiencyStudy; // two-track efficiency study on
d4b3dbfc 170 Float_t fTwoTrackEfficiencyCut; // enable two-track efficiency cut
7e9608f2 171 Float_t fTwoTrackCutMinRadius; // minimum radius for two-track efficiency cut
3bbad7c1 172 Int_t fUseVtxAxis; // use z vtx as axis (needs 7-10 times more memory!)
9894bedd 173 Bool_t fCourseCentralityBinning; // less centrality bins
04af8d15 174 Bool_t fSkipTrigger; // skip trigger selection
1ccd8a0a 175 Bool_t fInjectedSignals; // check header to skip injected signals in MC
f89c31a7 176 Bool_t fRandomizeReactionPlane; // change the orientation of the RP by a random value by shifting all tracks
e0331fd9 177
e08dff58 178 AliHelperPID* fHelperPID; // points to class for PID
dc44bc1f 179 AliAnalysisUtils* fAnalysisUtils; // points to class with common analysis utilities
e08dff58 180 TMap* fMap; // points to TMap class containing scaling factors for VZERO A signal
dc44bc1f 181
182 // Pointers to external UE classes
e08dff58 183 AliAnalyseLeadingTrackUE* fAnalyseUE; //! points to class containing common analysis algorithms
184 AliUEHistograms* fHistos; //! points to class to handle histograms/containers
185 AliUEHistograms* fHistosMixed; //! points to class to handle mixed histograms/containers
e0331fd9 186
e08dff58 187 THnF* fEfficiencyCorrectionTriggers; // if non-0 this efficiency correction is applied on the fly to the filling for trigger particles. The factor is multiplicative, i.e. should contain 1/efficiency. Axes: eta, pT, centrality, z-vtx
188 THnF* fEfficiencyCorrectionAssociated; // if non-0 this efficiency correction is applied on the fly to the filling for associated particles. The factor is multiplicative, i.e. should contain 1/efficiency. Axes: eta, pT, centrality, z-vtx
189 TH1* fCentralityWeights; // for centrality flattening
418b56c5 190
e0331fd9 191 // Handlers and events
192 AliAODEvent* fAOD; //! AOD Event
85bfac17 193 AliESDEvent* fESD; //! ESD Event
e0331fd9 194 TClonesArray* fArrayMC; //! Array of MC particles
195 AliInputEventHandler* fInputHandler; //! Generic InputEventHandler
196 AliMCEvent* fMcEvent; //! MC event
d8ee8cd0 197 AliInputEventHandler* fMcHandler; //! MCEventHandler
2a910c25 198 AliEventPoolManager* fPoolMgr; //! event pool manager
e0331fd9 199
200 // Histogram settings
e08dff58 201 TList* fListOfHistos; // Output list of containers
e0331fd9 202
203 // Event QA cuts
e08dff58 204 Int_t fnTracksVertex; // QA tracks pointing to principal vertex
205 Double_t fZVertex; // Position of Vertex in Z direction
576bfde8 206 Bool_t fAcceptOnlyMuEvents; // Only Events with at least one muon are accepted
e08dff58 207 TString fCentralityMethod; // Method to determine centrality
e0331fd9 208
209 // Track cuts
97dc2b4e 210 Double_t fTrackEtaCut; // Maximum Eta cut on particles
e08dff58 211 Double_t fTrackEtaCutMin; // Minimum Eta cut on particles
774ef124 212 Double_t fTrackPhiCutEvPlMin; // Minimum Phi cut on particles with respect to the Event Plane (values between 0 and Pi/2)
213 Double_t fTrackPhiCutEvPlMax; // Maximum Phi cut on particles with respect to the Event Plane (values between 0 and Pi/2), if = 0, then no cut is performed
9da2f080 214 Int_t fOnlyOneEtaSide; // decides that only trigger particle from one eta side are considered (0 = all; -1 = negative, 1 = positive)
97270ee2 215 Double_t fPtMin; // Min pT to start correlations
216 TFormula* fDCAXYCut; // additional pt dependent cut on DCA XY (only for AOD)
e08dff58 217 Double_t fSharedClusterCut; // cut on shared clusters (only for AOD)
218 Int_t fCrossedRowsCut; // cut on crossed rows (only for AOD)
132b6963 219 Double_t fFoundFractionCut; // cut on crossed rows/findable clusters (only for AOD)
418b56c5 220 UInt_t fFilterBit; // Select tracks from an specific track cut
221 UInt_t fTrackStatus; // if non-0, the bits set in this variable are required for each track
e0331fd9 222 UInt_t fSelectBit; // Select events according to AliAnalysisTaskJetServices bit maps
223 Bool_t fUseChargeHadrons; // Only use charge hadrons
5c9b9fa6 224 Int_t fParticleSpeciesTrigger; // Select which particle to use for the trigger [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
225 Int_t fParticleSpeciesAssociated; // Select which particle to use for the associated [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
e08dff58 226 Bool_t fCheckMotherPDG; // Check the PDG code of mother for secondaries
39c2cb38 227
f334f670 228 // Tracklets cuts
229 Double_t fTrackletDphiCut; //maximum Dphi cut on tracklets
230
2a910c25 231 Int_t fSelectCharge; // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
15b0fdd0 232 Int_t fTriggerSelectCharge; // select charge of trigger particle: 1: positive; -1 negative
233 Int_t fAssociatedSelectCharge; // select charge of associated particle: 1: positive; -1 negative
d38fa455 234 Float_t fTriggerRestrictEta; // restrict eta range for trigger particle (default: -1 [off])
00b6f3c6 235 Bool_t fEtaOrdering; // eta ordering, see AliUEHistograms.h for documentation
b0d56b29 236 Bool_t fCutConversions; // cut on conversions (inv mass)
237 Bool_t fCutResonances; // cut on resonances (inv mass)
97270ee2 238 Int_t fRejectResonanceDaughters; // reject all daughters of all resonance candidates (1: test method (cut at m_inv=0.9); 2: k0; 3: lambda)
a26093ba 239 Bool_t fFillOnlyStep0; // fill only step 0
240 Bool_t fSkipStep6; // skip step 6 when filling
774ef124 241 Bool_t fRejectCentralityOutliers; // enable rejection of outliers in centrality vs no track correlation. Interferes with the event plane dependence code
ff9f18e4 242 Bool_t fRejectZeroTrackEvents; // reject events which have no tracks (using the eta, pT cuts defined)
f613255f 243 Bool_t fRemoveWeakDecays; // remove secondaries from weak decays from tracks and particles
d6a8903f 244 Bool_t fRemoveDuplicates; // remove particles with the same label (double reconstruction)
51d0a028 245 Bool_t fSkipFastCluster; // skip kFastOnly flagged events (only for data)
8a368fc2 246 Bool_t fWeightPerEvent; // weight with the number of trigger particles per event
3f3f12d9 247 TString fCustomBinning; // supersedes default binning if set, see AliUEHist::GetBinning or AliUEHistograms::AliUEHistograms for syntax and examples
640b9425 248 Bool_t fPtOrder; // apply pT,a < pt,t condition; default: kTRUE
1db82805 249 Int_t fTriggersFromDetector; // 0 = tracks (default); 1 = VZERO_A; 2 = VZERO_C; 3 = SPD tracklets; 4 = forward muons
250 Int_t fAssociatedFromDetector; // 0 = tracks (default); 1 = VZERO_A; 2 = VZERO_C; 3 = SPD tracklets; 4 = forward muons
2313a5d0 251 Bool_t fMCUseUncheckedCentrality; // use unchecked centrality (only applies to MC); default: kFALSE
d38fa455 252
c05ff6be 253 Bool_t fFillpT; // fill sum pT instead of number density
2a910c25 254
774ef124 255 ClassDef(AliAnalysisTaskPhiCorrelations, 47); // Analysis task for delta phi correlations
e0331fd9 256 };
257
a1c31636 258class AliDPhiBasicParticle : public AliVParticle
259{
260 public:
261 AliDPhiBasicParticle(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
262 : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge)
263 {
264 }
265 ~AliDPhiBasicParticle() {}
266
267 // kinematics
268 virtual Double_t Px() const { AliFatal("Not implemented"); return 0; }
269 virtual Double_t Py() const { AliFatal("Not implemented"); return 0; }
270 virtual Double_t Pz() const { AliFatal("Not implemented"); return 0; }
271 virtual Double_t Pt() const { return fpT; }
272 virtual Double_t P() const { AliFatal("Not implemented"); return 0; }
273 virtual Bool_t PxPyPz(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
274
275 virtual Double_t Xv() const { AliFatal("Not implemented"); return 0; }
276 virtual Double_t Yv() const { AliFatal("Not implemented"); return 0; }
277 virtual Double_t Zv() const { AliFatal("Not implemented"); return 0; }
278 virtual Bool_t XvYvZv(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
279
280 virtual Double_t OneOverPt() const { AliFatal("Not implemented"); return 0; }
281 virtual Double_t Phi() const { return fPhi; }
282 virtual Double_t Theta() const { AliFatal("Not implemented"); return 0; }
283
284
285 virtual Double_t E() const { AliFatal("Not implemented"); return 0; }
286 virtual Double_t M() const { AliFatal("Not implemented"); return 0; }
287
288 virtual Double_t Eta() const { return fEta; }
289 virtual Double_t Y() const { AliFatal("Not implemented"); return 0; }
290
291 virtual Short_t Charge() const { return fCharge; }
292 virtual Int_t GetLabel() const { AliFatal("Not implemented"); return 0; }
293 // PID
294 virtual Int_t PdgCode() const { AliFatal("Not implemented"); return 0; }
295 virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }
296
1d53fb34 297 virtual Bool_t IsEqual(const TObject* obj) const { return (obj->GetUniqueID() == GetUniqueID()); }
298
f89c31a7
JFGO
299 virtual void SetPhi(Double_t phi) { fPhi = phi; }
300
a1c31636 301 private:
302 Float_t fEta; // eta
303 Float_t fPhi; // phi
304 Float_t fpT; // pT
305 Short_t fCharge; // charge
306
307 ClassDef( AliDPhiBasicParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing
308};
309
e0331fd9 310#endif
311
312