]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.h
changes needed for MC generation on the fly
[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;
32e49607 47class AliHelperPID;
6e84bd0a 48class AliAnalysisUtils;
97270ee2 49class TFormula;
dc44bc1f 50class TMap;
3e09dd3e 51class AliGenEventHeader;
e0331fd9 52
408d1ac9 53
e0331fd9 54class AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
55 {
56 public:
57 AliAnalysisTaskPhiCorrelations(const char* name="AliAnalysisTaskPhiCorrelations");
58 virtual ~AliAnalysisTaskPhiCorrelations();
59
60
61 // Implementation of interace methods
62 virtual void ConnectInputData(Option_t *);
63 virtual void CreateOutputObjects();
64 virtual void Exec(Option_t *option);
65
66 // Setters/Getters
67 // general configuration
68 virtual void SetDebugLevel( Int_t level ) { fDebug = level; }
69 virtual void SetMode(Int_t mode) { fMode = mode; }
70 virtual void SetReduceMemoryFootprint(Bool_t flag) { fReduceMemoryFootprint = flag; }
eed401dc 71 virtual void SetEventMixing(Bool_t flag) { fFillMixed = flag; }
ac647b0f 72 virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
1bba939a 73 virtual void SetTwoTrackEfficiencyStudy(Bool_t flag) { fTwoTrackEfficiencyStudy = flag; }
7e9608f2 74 virtual void SetTwoTrackEfficiencyCut(Float_t value = 0.02, Float_t min = 0.8) { fTwoTrackEfficiencyCut = value; fTwoTrackCutMinRadius = min; }
3bbad7c1 75 virtual void SetUseVtxAxis(Int_t flag) { fUseVtxAxis = flag; }
9894bedd 76 virtual void SetCourseCentralityBinning(Bool_t flag) { fCourseCentralityBinning = flag; }
04af8d15 77 virtual void SetSkipTrigger(Bool_t flag) { fSkipTrigger = flag; }
1ccd8a0a 78 virtual void SetInjectedSignals(Bool_t flag) { fInjectedSignals = flag; }
e0331fd9 79
80 // histogram settings
418b56c5 81 void SetEfficiencyCorrectionTriggers(THnF* hist) { fEfficiencyCorrectionTriggers = hist; }
82 void SetEfficiencyCorrectionAssociated(THnF* hist) { fEfficiencyCorrectionAssociated = hist; }
e0331fd9 83
84 // for event QA
85 void SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
86 void SetZVertex( Double_t val ) { fZVertex = val; }
87
88 // track cuts
89 void SetTrackEtaCut( Double_t val ) { fTrackEtaCut = val; }
97dc2b4e 90 void SetTrackEtaCutMin( Double_t val ) { fTrackEtaCutMin = val; }
418b56c5 91 void SetOnlyOneEtaSide(Int_t flag) { fOnlyOneEtaSide = flag; }
e0331fd9 92 void SetPtMin(Double_t val) { fPtMin = val; }
93 void SetFilterBit( UInt_t val ) { fFilterBit = val; }
97270ee2 94 void SetDCAXYCut(TFormula* value) { fDCAXYCut = value; }
418b56c5 95 void SetTrackStatus(UInt_t status) { fTrackStatus = status; }
9e35c487 96 void SetCheckMotherPDG(Bool_t checkpdg) { fCheckMotherPDG = checkpdg; }
2a910c25 97
e0331fd9 98 void SetEventSelectionBit( UInt_t val ) { fSelectBit = val; }
99 void SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
5c9b9fa6 100 void SetSelectParticleSpecies( Int_t trigger, Int_t associated ) { fParticleSpeciesTrigger = trigger; fParticleSpeciesAssociated = associated; }
2a910c25 101 void SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
7a77d480 102 void SetSelectTriggerCharge(Int_t selectCharge) { fTriggerSelectCharge = selectCharge; }
15b0fdd0 103 void SetSelectAssociatedCharge(Int_t selectCharge) { fAssociatedSelectCharge = selectCharge; }
d38fa455 104 void SetTriggerRestrictEta(Float_t eta) { fTriggerRestrictEta = eta; }
00b6f3c6 105 void SetEtaOrdering(Bool_t flag) { fEtaOrdering = flag; }
b0d56b29 106 void SetPairCuts(Bool_t conversions, Bool_t resonances) { fCutConversions = conversions; fCutResonances = resonances; }
97270ee2 107 void SetRejectResonanceDaughters(Int_t value) { fRejectResonanceDaughters = value; }
2a910c25 108 void SetCentralityMethod(const char* method) { fCentralityMethod = method; }
c05ff6be 109 void SetFillpT(Bool_t flag) { fFillpT = flag; }
a26093ba 110 void SetStepsFillSkip(Bool_t step0, Bool_t step6) { fFillOnlyStep0 = step0; fSkipStep6 = step6; }
5e053cad 111 void SetRejectCentralityOutliers(Bool_t flag = kTRUE) { fRejectCentralityOutliers = flag; }
ff9f18e4 112 void SetRejectZeroTrackEvents(Bool_t flag) { fRejectZeroTrackEvents = flag; }
f613255f 113 void SetRemoveWeakDecays(Bool_t flag = kTRUE) { fRemoveWeakDecays = flag; }
d6a8903f 114 void SetRemoveDuplicates(Bool_t flag = kTRUE) { fRemoveDuplicates = flag; }
8a368fc2 115 void SetSkipFastCluster(Bool_t flag = kTRUE) { fSkipFastCluster = flag; }
116 void SetWeightPerEvent(Bool_t flag = kTRUE) { fWeightPerEvent = flag; }
3f3f12d9 117 void SetCustomBinning(const char* binningStr) { fCustomBinning = binningStr; }
640b9425 118 void SetPtOrder(Bool_t flag) { fPtOrder = flag; }
2b27d6f4 119 void SetTriggersFromDetector(Int_t flag) { fTriggersFromDetector = flag; }
2313a5d0 120 void SetMCUseUncheckedCentrality(Bool_t flag) { fMCUseUncheckedCentrality = flag; }
e0331fd9 121
32e49607 122 AliHelperPID* GetHelperPID() { return fHelperPID; }
123 void SetHelperPID(AliHelperPID* pid){ fHelperPID = pid; }
6e84bd0a 124
125 AliAnalysisUtils* GetAnalysisUtils() { return fAnalysisUtils; }
126 void SetAnalysisUtils(AliAnalysisUtils* utils){ fAnalysisUtils = utils; }
dc44bc1f 127
128 TMap* GetMap() { return fMap; }
129 void SetMap(TMap* map){ fMap = map; }
32e49607 130
e0331fd9 131 private:
132 AliAnalysisTaskPhiCorrelations(const AliAnalysisTaskPhiCorrelations &det);
133 AliAnalysisTaskPhiCorrelations& operator=(const AliAnalysisTaskPhiCorrelations &det);
134 void AddSettingsTree(); // add list of settings to output list
135 // Analysis methods
136 void AnalyseCorrectionMode(); // main algorithm to get correction maps
137 void AnalyseDataMode(); // main algorithm to get raw distributions
138 void Initialize(); // initialize some common pointer
7a028750 139 TObjArray* CloneAndReduceTrackList(TObjArray* tracks);
d6a8903f 140 void RemoveDuplicates(TObjArray* tracks);
3f3f12d9 141 void CleanUp(TObjArray* tracks, TObject* mcObj, Int_t maxLabel);
29cfdb5f 142 void SelectCharge(TObjArray* tracks);
3e09dd3e 143 AliGenEventHeader* GetFirstHeader();
e0331fd9 144
e0331fd9 145 // General configuration
146 Int_t fDebug; // Debug flag
147 Int_t fMode; // fMode = 0: data-like analysis
148 // fMode = 1: corrections analysis
418b56c5 149 Bool_t fReduceMemoryFootprint; // reduce memory consumption by writing less debug histograms
eed401dc 150 Bool_t fFillMixed; // enable event mixing (default: ON)
ac647b0f 151 Int_t fMixingTracks; // size of track buffer for event mixing
1bba939a 152 Bool_t fTwoTrackEfficiencyStudy; // two-track efficiency study on
d4b3dbfc 153 Float_t fTwoTrackEfficiencyCut; // enable two-track efficiency cut
7e9608f2 154 Float_t fTwoTrackCutMinRadius; // minimum radius for two-track efficiency cut
3bbad7c1 155 Int_t fUseVtxAxis; // use z vtx as axis (needs 7-10 times more memory!)
9894bedd 156 Bool_t fCourseCentralityBinning; // less centrality bins
04af8d15 157 Bool_t fSkipTrigger; // skip trigger selection
1ccd8a0a 158 Bool_t fInjectedSignals; // check header to skip injected signals in MC
e0331fd9 159
dc44bc1f 160 AliHelperPID* fHelperPID; // points to class for PID
161 AliAnalysisUtils* fAnalysisUtils; // points to class with common analysis utilities
162 TMap* fMap; // points to TMap class containing scaling factors for VZERO A signal
163
164 // Pointers to external UE classes
e0331fd9 165 AliAnalyseLeadingTrackUE* fAnalyseUE; //! points to class containing common analysis algorithms
166 AliUEHistograms* fHistos; //! points to class to handle histograms/containers
167 AliUEHistograms* fHistosMixed; //! points to class to handle mixed histograms/containers
168
418b56c5 169 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
170 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
171
e0331fd9 172 // Handlers and events
173 AliAODEvent* fAOD; //! AOD Event
85bfac17 174 AliESDEvent* fESD; //! ESD Event
e0331fd9 175 TClonesArray* fArrayMC; //! Array of MC particles
176 AliInputEventHandler* fInputHandler; //! Generic InputEventHandler
177 AliMCEvent* fMcEvent; //! MC event
d8ee8cd0 178 AliInputEventHandler* fMcHandler; //! MCEventHandler
2a910c25 179 AliEventPoolManager* fPoolMgr; //! event pool manager
e0331fd9 180
181 // Histogram settings
182 TList* fListOfHistos; // Output list of containers
183
184 // Event QA cuts
c05ff6be 185 Int_t fnTracksVertex; // QA tracks pointing to principal vertex
e0331fd9 186 Double_t fZVertex; // Position of Vertex in Z direction
2a910c25 187 TString fCentralityMethod; // Method to determine centrality
e0331fd9 188
189 // Track cuts
97dc2b4e 190 Double_t fTrackEtaCut; // Maximum Eta cut on particles
191 Double_t fTrackEtaCutMin; // Minimum Eta cut on particles
9da2f080 192 Int_t fOnlyOneEtaSide; // decides that only trigger particle from one eta side are considered (0 = all; -1 = negative, 1 = positive)
97270ee2 193 Double_t fPtMin; // Min pT to start correlations
194 TFormula* fDCAXYCut; // additional pt dependent cut on DCA XY (only for AOD)
418b56c5 195 UInt_t fFilterBit; // Select tracks from an specific track cut
196 UInt_t fTrackStatus; // if non-0, the bits set in this variable are required for each track
e0331fd9 197 UInt_t fSelectBit; // Select events according to AliAnalysisTaskJetServices bit maps
198 Bool_t fUseChargeHadrons; // Only use charge hadrons
5c9b9fa6 199 Int_t fParticleSpeciesTrigger; // Select which particle to use for the trigger [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
200 Int_t fParticleSpeciesAssociated; // Select which particle to use for the associated [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
9e35c487 201 Bool_t fCheckMotherPDG; // Check the PDG code of mother for secondaries
39c2cb38 202
2a910c25 203 Int_t fSelectCharge; // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
15b0fdd0 204 Int_t fTriggerSelectCharge; // select charge of trigger particle: 1: positive; -1 negative
205 Int_t fAssociatedSelectCharge; // select charge of associated particle: 1: positive; -1 negative
d38fa455 206 Float_t fTriggerRestrictEta; // restrict eta range for trigger particle (default: -1 [off])
00b6f3c6 207 Bool_t fEtaOrdering; // eta ordering, see AliUEHistograms.h for documentation
b0d56b29 208 Bool_t fCutConversions; // cut on conversions (inv mass)
209 Bool_t fCutResonances; // cut on resonances (inv mass)
97270ee2 210 Int_t fRejectResonanceDaughters; // reject all daughters of all resonance candidates (1: test method (cut at m_inv=0.9); 2: k0; 3: lambda)
a26093ba 211 Bool_t fFillOnlyStep0; // fill only step 0
212 Bool_t fSkipStep6; // skip step 6 when filling
5e053cad 213 Bool_t fRejectCentralityOutliers; // enable rejection of outliers in centrality vs no track correlation
ff9f18e4 214 Bool_t fRejectZeroTrackEvents; // reject events which have no tracks (using the eta, pT cuts defined)
f613255f 215 Bool_t fRemoveWeakDecays; // remove secondaries from weak decays from tracks and particles
d6a8903f 216 Bool_t fRemoveDuplicates; // remove particles with the same label (double reconstruction)
51d0a028 217 Bool_t fSkipFastCluster; // skip kFastOnly flagged events (only for data)
8a368fc2 218 Bool_t fWeightPerEvent; // weight with the number of trigger particles per event
3f3f12d9 219 TString fCustomBinning; // supersedes default binning if set, see AliUEHist::GetBinning or AliUEHistograms::AliUEHistograms for syntax and examples
640b9425 220 Bool_t fPtOrder; // apply pT,a < pt,t condition; default: kTRUE
2b27d6f4 221 Int_t fTriggersFromDetector; // 0 = tracks (default); 1 = VZERO_A; 2 = VZERO_C
2313a5d0 222 Bool_t fMCUseUncheckedCentrality; // use unchecked centrality (only applies to MC); default: kFALSE
d38fa455 223
c05ff6be 224 Bool_t fFillpT; // fill sum pT instead of number density
2a910c25 225
7e9608f2 226 ClassDef(AliAnalysisTaskPhiCorrelations, 39); // Analysis task for delta phi correlations
e0331fd9 227 };
228
a1c31636 229class AliDPhiBasicParticle : public AliVParticle
230{
231 public:
232 AliDPhiBasicParticle(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
233 : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge)
234 {
235 }
236 ~AliDPhiBasicParticle() {}
237
238 // kinematics
239 virtual Double_t Px() const { AliFatal("Not implemented"); return 0; }
240 virtual Double_t Py() const { AliFatal("Not implemented"); return 0; }
241 virtual Double_t Pz() const { AliFatal("Not implemented"); return 0; }
242 virtual Double_t Pt() const { return fpT; }
243 virtual Double_t P() const { AliFatal("Not implemented"); return 0; }
244 virtual Bool_t PxPyPz(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
245
246 virtual Double_t Xv() const { AliFatal("Not implemented"); return 0; }
247 virtual Double_t Yv() const { AliFatal("Not implemented"); return 0; }
248 virtual Double_t Zv() const { AliFatal("Not implemented"); return 0; }
249 virtual Bool_t XvYvZv(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
250
251 virtual Double_t OneOverPt() const { AliFatal("Not implemented"); return 0; }
252 virtual Double_t Phi() const { return fPhi; }
253 virtual Double_t Theta() const { AliFatal("Not implemented"); return 0; }
254
255
256 virtual Double_t E() const { AliFatal("Not implemented"); return 0; }
257 virtual Double_t M() const { AliFatal("Not implemented"); return 0; }
258
259 virtual Double_t Eta() const { return fEta; }
260 virtual Double_t Y() const { AliFatal("Not implemented"); return 0; }
261
262 virtual Short_t Charge() const { return fCharge; }
263 virtual Int_t GetLabel() const { AliFatal("Not implemented"); return 0; }
264 // PID
265 virtual Int_t PdgCode() const { AliFatal("Not implemented"); return 0; }
266 virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }
267
1d53fb34 268 virtual Bool_t IsEqual(const TObject* obj) const { return (obj->GetUniqueID() == GetUniqueID()); }
269
a1c31636 270 private:
271 Float_t fEta; // eta
272 Float_t fPhi; // phi
273 Float_t fpT; // pT
274 Short_t fCharge; // charge
275
276 ClassDef( AliDPhiBasicParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing
277};
278
e0331fd9 279#endif
280
281