]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.h
Add possibility to work with AOD
[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;
43class TH1D;
44class TObjArray;
2a910c25 45class AliEventPoolManager;
85bfac17 46class AliESDEvent;
e0331fd9 47
408d1ac9 48
e0331fd9 49class AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
50 {
51 public:
52 AliAnalysisTaskPhiCorrelations(const char* name="AliAnalysisTaskPhiCorrelations");
53 virtual ~AliAnalysisTaskPhiCorrelations();
54
55
56 // Implementation of interace methods
57 virtual void ConnectInputData(Option_t *);
58 virtual void CreateOutputObjects();
59 virtual void Exec(Option_t *option);
60
61 // Setters/Getters
62 // general configuration
63 virtual void SetDebugLevel( Int_t level ) { fDebug = level; }
64 virtual void SetMode(Int_t mode) { fMode = mode; }
65 virtual void SetReduceMemoryFootprint(Bool_t flag) { fReduceMemoryFootprint = flag; }
eed401dc 66 virtual void SetEventMixing(Bool_t flag) { fFillMixed = flag; }
ac647b0f 67 virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
c3294f09 68 virtual void SetCompareCentralities(Bool_t flag) { fCompareCentralities = flag; }
1bba939a 69 virtual void SetTwoTrackEfficiencyStudy(Bool_t flag) { fTwoTrackEfficiencyStudy = flag; }
d4b3dbfc 70 virtual void SetTwoTrackEfficiencyCut(Float_t value = 0.02) { fTwoTrackEfficiencyCut = value; }
3bbad7c1 71 virtual void SetUseVtxAxis(Int_t flag) { fUseVtxAxis = flag; }
9894bedd 72 virtual void SetCourseCentralityBinning(Bool_t flag) { fCourseCentralityBinning = flag; }
04af8d15 73 virtual void SetSkipTrigger(Bool_t flag) { fSkipTrigger = flag; }
1ccd8a0a 74 virtual void SetInjectedSignals(Bool_t flag) { fInjectedSignals = flag; }
e0331fd9 75
76 // histogram settings
d787bf34 77 void SetEfficiencyCorrection(THnF* hist, Bool_t correctTriggers) { fEfficiencyCorrection = hist; fCorrectTriggers = correctTriggers; }
e0331fd9 78
79 // for event QA
80 void SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
81 void SetZVertex( Double_t val ) { fZVertex = val; }
82
83 // track cuts
84 void SetTrackEtaCut( Double_t val ) { fTrackEtaCut = val; }
9da2f080 85 void SetOnlyOneEtaSide(Int_t flag) { fOnlyOneEtaSide = flag; }
e0331fd9 86 void SetPtMin(Double_t val) { fPtMin = val; }
87 void SetFilterBit( UInt_t val ) { fFilterBit = val; }
2a910c25 88
e0331fd9 89 void SetEventSelectionBit( UInt_t val ) { fSelectBit = val; }
90 void SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
2a910c25 91 void SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
7a77d480 92 void SetSelectTriggerCharge(Int_t selectCharge) { fTriggerSelectCharge = selectCharge; }
d38fa455 93 void SetTriggerRestrictEta(Float_t eta) { fTriggerRestrictEta = eta; }
00b6f3c6 94 void SetEtaOrdering(Bool_t flag) { fEtaOrdering = flag; }
b0d56b29 95 void SetPairCuts(Bool_t conversions, Bool_t resonances) { fCutConversions = conversions; fCutResonances = resonances; }
2a910c25 96 void SetCentralityMethod(const char* method) { fCentralityMethod = method; }
c05ff6be 97 void SetFillpT(Bool_t flag) { fFillpT = flag; }
a26093ba 98 void SetStepsFillSkip(Bool_t step0, Bool_t step6) { fFillOnlyStep0 = step0; fSkipStep6 = step6; }
5e053cad 99 void SetRejectCentralityOutliers(Bool_t flag = kTRUE) { fRejectCentralityOutliers = flag; }
f613255f 100 void SetRemoveWeakDecays(Bool_t flag = kTRUE) { fRemoveWeakDecays = flag; }
d6a8903f 101 void SetRemoveDuplicates(Bool_t flag = kTRUE) { fRemoveDuplicates = flag; }
8a368fc2 102 void SetSkipFastCluster(Bool_t flag = kTRUE) { fSkipFastCluster = flag; }
103 void SetWeightPerEvent(Bool_t flag = kTRUE) { fWeightPerEvent = flag; }
e0331fd9 104
105 private:
106 AliAnalysisTaskPhiCorrelations(const AliAnalysisTaskPhiCorrelations &det);
107 AliAnalysisTaskPhiCorrelations& operator=(const AliAnalysisTaskPhiCorrelations &det);
108 void AddSettingsTree(); // add list of settings to output list
109 // Analysis methods
110 void AnalyseCorrectionMode(); // main algorithm to get correction maps
111 void AnalyseDataMode(); // main algorithm to get raw distributions
112 void Initialize(); // initialize some common pointer
7a028750 113 TObjArray* CloneAndReduceTrackList(TObjArray* tracks);
d6a8903f 114 void RemoveDuplicates(TObjArray* tracks);
e0331fd9 115
e0331fd9 116 // General configuration
117 Int_t fDebug; // Debug flag
118 Int_t fMode; // fMode = 0: data-like analysis
119 // fMode = 1: corrections analysis
120 Bool_t fReduceMemoryFootprint; // reduce memory consumption by writing less debug histograms
eed401dc 121 Bool_t fFillMixed; // enable event mixing (default: ON)
ac647b0f 122 Int_t fMixingTracks; // size of track buffer for event mixing
c3294f09 123 Bool_t fCompareCentralities; // use the z vtx axis for a centrality comparison
1bba939a 124 Bool_t fTwoTrackEfficiencyStudy; // two-track efficiency study on
d4b3dbfc 125 Float_t fTwoTrackEfficiencyCut; // enable two-track efficiency cut
3bbad7c1 126 Int_t fUseVtxAxis; // use z vtx as axis (needs 7-10 times more memory!)
9894bedd 127 Bool_t fCourseCentralityBinning; // less centrality bins
04af8d15 128 Bool_t fSkipTrigger; // skip trigger selection
1ccd8a0a 129 Bool_t fInjectedSignals; // check header to skip injected signals in MC
e0331fd9 130
131 // Pointers to external UE classes
132 AliAnalyseLeadingTrackUE* fAnalyseUE; //! points to class containing common analysis algorithms
133 AliUEHistograms* fHistos; //! points to class to handle histograms/containers
134 AliUEHistograms* fHistosMixed; //! points to class to handle mixed histograms/containers
135
408d1ac9 136 THnF* fEfficiencyCorrection; // 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
d787bf34 137 Bool_t fCorrectTriggers; // if true correct also trigger particles
e0331fd9 138
139 // Handlers and events
140 AliAODEvent* fAOD; //! AOD Event
85bfac17 141 AliESDEvent* fESD; //! ESD Event
e0331fd9 142 TClonesArray* fArrayMC; //! Array of MC particles
143 AliInputEventHandler* fInputHandler; //! Generic InputEventHandler
144 AliMCEvent* fMcEvent; //! MC event
145 AliMCEventHandler* fMcHandler; //! MCEventHandler
2a910c25 146 AliEventPoolManager* fPoolMgr; //! event pool manager
e0331fd9 147
148 // Histogram settings
149 TList* fListOfHistos; // Output list of containers
150
151 // Event QA cuts
c05ff6be 152 Int_t fnTracksVertex; // QA tracks pointing to principal vertex
e0331fd9 153 Double_t fZVertex; // Position of Vertex in Z direction
2a910c25 154 TString fCentralityMethod; // Method to determine centrality
e0331fd9 155
156 // Track cuts
157 Double_t fTrackEtaCut; // Eta cut on particles
9da2f080 158 Int_t fOnlyOneEtaSide; // decides that only trigger particle from one eta side are considered (0 = all; -1 = negative, 1 = positive)
e0331fd9 159 Double_t fPtMin; // Min pT to start correlations
160 UInt_t fFilterBit; // Select tracks from an specific track cut (default 0xFF all track selected)
161 UInt_t fSelectBit; // Select events according to AliAnalysisTaskJetServices bit maps
162 Bool_t fUseChargeHadrons; // Only use charge hadrons
163
2a910c25 164 Int_t fSelectCharge; // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
7a77d480 165 Int_t fTriggerSelectCharge; // select charge of trigger particle
d38fa455 166 Float_t fTriggerRestrictEta; // restrict eta range for trigger particle (default: -1 [off])
00b6f3c6 167 Bool_t fEtaOrdering; // eta ordering, see AliUEHistograms.h for documentation
b0d56b29 168 Bool_t fCutConversions; // cut on conversions (inv mass)
169 Bool_t fCutResonances; // cut on resonances (inv mass)
a26093ba 170 Bool_t fFillOnlyStep0; // fill only step 0
171 Bool_t fSkipStep6; // skip step 6 when filling
5e053cad 172 Bool_t fRejectCentralityOutliers; // enable rejection of outliers in centrality vs no track correlation
f613255f 173 Bool_t fRemoveWeakDecays; // remove secondaries from weak decays from tracks and particles
d6a8903f 174 Bool_t fRemoveDuplicates; // remove particles with the same label (double reconstruction)
51d0a028 175 Bool_t fSkipFastCluster; // skip kFastOnly flagged events (only for data)
8a368fc2 176 Bool_t fWeightPerEvent; // weight with the number of trigger particles per event
d38fa455 177
c05ff6be 178 Bool_t fFillpT; // fill sum pT instead of number density
2a910c25 179
8a368fc2 180 ClassDef( AliAnalysisTaskPhiCorrelations, 22); // Analysis task for delta phi correlations
e0331fd9 181 };
182
a1c31636 183class AliDPhiBasicParticle : public AliVParticle
184{
185 public:
186 AliDPhiBasicParticle(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
187 : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge)
188 {
189 }
190 ~AliDPhiBasicParticle() {}
191
192 // kinematics
193 virtual Double_t Px() const { AliFatal("Not implemented"); return 0; }
194 virtual Double_t Py() const { AliFatal("Not implemented"); return 0; }
195 virtual Double_t Pz() const { AliFatal("Not implemented"); return 0; }
196 virtual Double_t Pt() const { return fpT; }
197 virtual Double_t P() const { AliFatal("Not implemented"); return 0; }
198 virtual Bool_t PxPyPz(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
199
200 virtual Double_t Xv() const { AliFatal("Not implemented"); return 0; }
201 virtual Double_t Yv() const { AliFatal("Not implemented"); return 0; }
202 virtual Double_t Zv() const { AliFatal("Not implemented"); return 0; }
203 virtual Bool_t XvYvZv(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
204
205 virtual Double_t OneOverPt() const { AliFatal("Not implemented"); return 0; }
206 virtual Double_t Phi() const { return fPhi; }
207 virtual Double_t Theta() const { AliFatal("Not implemented"); return 0; }
208
209
210 virtual Double_t E() const { AliFatal("Not implemented"); return 0; }
211 virtual Double_t M() const { AliFatal("Not implemented"); return 0; }
212
213 virtual Double_t Eta() const { return fEta; }
214 virtual Double_t Y() const { AliFatal("Not implemented"); return 0; }
215
216 virtual Short_t Charge() const { return fCharge; }
217 virtual Int_t GetLabel() const { AliFatal("Not implemented"); return 0; }
218 // PID
219 virtual Int_t PdgCode() const { AliFatal("Not implemented"); return 0; }
220 virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }
221
222 private:
223 Float_t fEta; // eta
224 Float_t fPhi; // phi
225 Float_t fpT; // pT
226 Short_t fCharge; // charge
227
228 ClassDef( AliDPhiBasicParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing
229};
230
e0331fd9 231#endif
232
233