1 #ifndef AliAnalysisTaskPhiCorrelations_H
2 #define AliAnalysisTaskPhiCorrelations_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////////////////////////////
9 // Analysis class for Underlying Event studies w.r.t. leading track
11 // Look for correlations on the tranverse regions w.r.t
12 // the leading track in the event
14 // This class needs input AODs.
15 // The output is a list of analysis-specific containers.
17 // The AOD can be either connected to the InputEventHandler
18 // for a chain of AOD files
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
25 // Jan Fiete Grosse-Oetringhaus
27 ////////////////////////////////////////////////////////////////////////
29 #include "AliAnalysisTask.h"
30 #include "AliUEHist.h"
32 #include "AliVParticle.h"
34 #include "THn.h" // in cxx file causes .../THn.h:257: error: conflicting declaration ‘typedef class THnT<float> THnF’
37 class AliAnalyseLeadingTrackUE;
38 class AliInputEventHandler;
40 class AliMCEventHandler;
41 class AliUEHistograms;
45 class AliEventPoolManager;
48 class AliAnalysisUtils;
51 class AliGenEventHeader;
55 class AliAnalysisTaskPhiCorrelations : public AliAnalysisTask
58 AliAnalysisTaskPhiCorrelations(const char* name="AliAnalysisTaskPhiCorrelations");
59 virtual ~AliAnalysisTaskPhiCorrelations();
62 // Implementation of interace methods
63 virtual void ConnectInputData(Option_t *);
64 virtual void CreateOutputObjects();
65 virtual void Exec(Option_t *option);
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; }
72 virtual void SetEventMixing(Bool_t flag) { fFillMixed = flag; }
73 virtual void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
74 virtual void SetTwoTrackEfficiencyStudy(Bool_t flag) { fTwoTrackEfficiencyStudy = flag; }
75 virtual void SetTwoTrackEfficiencyCut(Float_t value = 0.02, Float_t min = 0.8) { fTwoTrackEfficiencyCut = value; fTwoTrackCutMinRadius = min; }
76 virtual void SetUseVtxAxis(Int_t flag) { fUseVtxAxis = flag; }
77 virtual void SetCourseCentralityBinning(Bool_t flag) { fCourseCentralityBinning = flag; }
78 virtual void SetSkipTrigger(Bool_t flag) { fSkipTrigger = flag; }
79 virtual void SetInjectedSignals(Bool_t flag) { fInjectedSignals = flag; }
80 void SetRandomizeReactionPlane(Bool_t flag) { fRandomizeReactionPlane = flag; }
83 void SetEfficiencyCorrectionTriggers(THnF* hist) { fEfficiencyCorrectionTriggers = hist; }
84 void SetEfficiencyCorrectionAssociated(THnF* hist) { fEfficiencyCorrectionAssociated = hist; }
85 void SetCentralityWeights(TH1* hist) { fCentralityWeights = hist; }
88 void SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
89 void SetZVertex( Double_t val ) { fZVertex = val; }
90 void SetAcceptOnlyMuEvents( Bool_t val ) { fAcceptOnlyMuEvents = val; }
93 void SetTrackEtaCut( Double_t val ) { fTrackEtaCut = val; }
94 void SetTrackEtaCutMin( Double_t val ) { fTrackEtaCutMin = val; }
95 void SetOnlyOneEtaSide(Int_t flag) { fOnlyOneEtaSide = flag; }
96 void SetPtMin(Double_t val) { fPtMin = val; }
97 void SetFilterBit( UInt_t val ) { fFilterBit = val; }
98 void SetDCAXYCut(TFormula* value) { fDCAXYCut = value; }
99 void SetSharedClusterCut(Float_t value) { fSharedClusterCut = value; }
100 void SetCrossedRowsCut(Int_t value) { fCrossedRowsCut = value; }
101 void SetFoundFractionCut(Double_t value) { fFoundFractionCut = value; }
102 void SetTrackStatus(UInt_t status) { fTrackStatus = status; }
103 void SetCheckMotherPDG(Bool_t checkpdg) { fCheckMotherPDG = checkpdg; }
106 void SetTrackletDphiCut( Double_t val ) { fTrackletDphiCut = val; }
108 void SetEventSelectionBit( UInt_t val ) { fSelectBit = val; }
109 void SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
110 void SetSelectParticleSpecies( Int_t trigger, Int_t associated ) { fParticleSpeciesTrigger = trigger; fParticleSpeciesAssociated = associated; }
111 void SetSelectCharge(Int_t selectCharge) { fSelectCharge = selectCharge; }
112 void SetSelectTriggerCharge(Int_t selectCharge) { fTriggerSelectCharge = selectCharge; }
113 void SetSelectAssociatedCharge(Int_t selectCharge) { fAssociatedSelectCharge = selectCharge; }
114 void SetTriggerRestrictEta(Float_t eta) { fTriggerRestrictEta = eta; }
115 void SetEtaOrdering(Bool_t flag) { fEtaOrdering = flag; }
116 void SetPairCuts(Bool_t conversions, Bool_t resonances) { fCutConversions = conversions; fCutResonances = resonances; }
117 void SetRejectResonanceDaughters(Int_t value) { fRejectResonanceDaughters = value; }
118 void SetCentralityMethod(const char* method) { fCentralityMethod = method; }
119 void SetFillpT(Bool_t flag) { fFillpT = flag; }
120 void SetStepsFillSkip(Bool_t step0, Bool_t step6) { fFillOnlyStep0 = step0; fSkipStep6 = step6; }
121 void SetRejectCentralityOutliers(Bool_t flag = kTRUE) { fRejectCentralityOutliers = flag; }
122 void SetRejectZeroTrackEvents(Bool_t flag) { fRejectZeroTrackEvents = flag; }
123 void SetRemoveWeakDecays(Bool_t flag = kTRUE) { fRemoveWeakDecays = flag; }
124 void SetRemoveDuplicates(Bool_t flag = kTRUE) { fRemoveDuplicates = flag; }
125 void SetSkipFastCluster(Bool_t flag = kTRUE) { fSkipFastCluster = flag; }
126 void SetWeightPerEvent(Bool_t flag = kTRUE) { fWeightPerEvent = flag; }
127 void SetCustomBinning(const char* binningStr) { fCustomBinning = binningStr; }
128 void SetPtOrder(Bool_t flag) { fPtOrder = flag; }
129 void SetTriggersFromDetector(Int_t flag) { fTriggersFromDetector = flag; }
130 void SetAssociatedFromDetector(Int_t flag) { fAssociatedFromDetector = flag; }
131 void SetMCUseUncheckedCentrality(Bool_t flag) { fMCUseUncheckedCentrality = flag; }
133 AliHelperPID* GetHelperPID() { return fHelperPID; }
134 void SetHelperPID(AliHelperPID* pid){ fHelperPID = pid; }
136 AliAnalysisUtils* GetAnalysisUtils() { return fAnalysisUtils; }
137 void SetAnalysisUtils(AliAnalysisUtils* utils){ fAnalysisUtils = utils; }
139 TMap* GetMap() { return fMap; }
140 void SetMap(TMap* map){ fMap = map; }
143 AliAnalysisTaskPhiCorrelations(const AliAnalysisTaskPhiCorrelations &det);
144 AliAnalysisTaskPhiCorrelations& operator=(const AliAnalysisTaskPhiCorrelations &det);
145 void AddSettingsTree(); // add list of settings to output list
147 void AnalyseCorrectionMode(); // main algorithm to get correction maps
148 void AnalyseDataMode(); // main algorithm to get raw distributions
149 void Initialize(); // initialize some common pointer
150 TObjArray* CloneAndReduceTrackList(TObjArray* tracks);
151 void RemoveDuplicates(TObjArray* tracks);
152 void CleanUp(TObjArray* tracks, TObject* mcObj, Int_t maxLabel);
153 void SelectCharge(TObjArray* tracks);
154 AliGenEventHeader* GetFirstHeader();
155 Bool_t AcceptEventCentralityWeight(Double_t centrality);
156 void ShiftTracks(TObjArray* tracks, Double_t angle);
157 TObjArray* GetParticlesFromDetector(AliVEvent* inputEvent, Int_t idet);
160 // General configuration
161 Int_t fDebug; // Debug flag
162 Int_t fMode; // fMode = 0: data-like analysis
163 // fMode = 1: corrections analysis
164 Bool_t fReduceMemoryFootprint; // reduce memory consumption by writing less debug histograms
165 Bool_t fFillMixed; // enable event mixing (default: ON)
166 Int_t fMixingTracks; // size of track buffer for event mixing
167 Bool_t fTwoTrackEfficiencyStudy; // two-track efficiency study on
168 Float_t fTwoTrackEfficiencyCut; // enable two-track efficiency cut
169 Float_t fTwoTrackCutMinRadius; // minimum radius for two-track efficiency cut
170 Int_t fUseVtxAxis; // use z vtx as axis (needs 7-10 times more memory!)
171 Bool_t fCourseCentralityBinning; // less centrality bins
172 Bool_t fSkipTrigger; // skip trigger selection
173 Bool_t fInjectedSignals; // check header to skip injected signals in MC
174 Bool_t fRandomizeReactionPlane; // change the orientation of the RP by a random value by shifting all tracks
176 AliHelperPID* fHelperPID; // points to class for PID
177 AliAnalysisUtils* fAnalysisUtils; // points to class with common analysis utilities
178 TMap* fMap; // points to TMap class containing scaling factors for VZERO A signal
180 // Pointers to external UE classes
181 AliAnalyseLeadingTrackUE* fAnalyseUE; //! points to class containing common analysis algorithms
182 AliUEHistograms* fHistos; //! points to class to handle histograms/containers
183 AliUEHistograms* fHistosMixed; //! points to class to handle mixed histograms/containers
185 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
186 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
187 TH1* fCentralityWeights; // for centrality flattening
189 // Handlers and events
190 AliAODEvent* fAOD; //! AOD Event
191 AliESDEvent* fESD; //! ESD Event
192 TClonesArray* fArrayMC; //! Array of MC particles
193 AliInputEventHandler* fInputHandler; //! Generic InputEventHandler
194 AliMCEvent* fMcEvent; //! MC event
195 AliInputEventHandler* fMcHandler; //! MCEventHandler
196 AliEventPoolManager* fPoolMgr; //! event pool manager
198 // Histogram settings
199 TList* fListOfHistos; // Output list of containers
202 Int_t fnTracksVertex; // QA tracks pointing to principal vertex
203 Double_t fZVertex; // Position of Vertex in Z direction
204 Bool_t fAcceptOnlyMuEvents; // Only Events with at least one muon are accepted
205 TString fCentralityMethod; // Method to determine centrality
208 Double_t fTrackEtaCut; // Maximum Eta cut on particles
209 Double_t fTrackEtaCutMin; // Minimum Eta cut on particles
210 Int_t fOnlyOneEtaSide; // decides that only trigger particle from one eta side are considered (0 = all; -1 = negative, 1 = positive)
211 Double_t fPtMin; // Min pT to start correlations
212 TFormula* fDCAXYCut; // additional pt dependent cut on DCA XY (only for AOD)
213 Double_t fSharedClusterCut; // cut on shared clusters (only for AOD)
214 Int_t fCrossedRowsCut; // cut on crossed rows (only for AOD)
215 Double_t fFoundFractionCut; // cut on crossed rows/findable clusters (only for AOD)
216 UInt_t fFilterBit; // Select tracks from an specific track cut
217 UInt_t fTrackStatus; // if non-0, the bits set in this variable are required for each track
218 UInt_t fSelectBit; // Select events according to AliAnalysisTaskJetServices bit maps
219 Bool_t fUseChargeHadrons; // Only use charge hadrons
220 Int_t fParticleSpeciesTrigger; // Select which particle to use for the trigger [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
221 Int_t fParticleSpeciesAssociated; // Select which particle to use for the associated [ -1 (all, default) 0 (pions) 1 (kaons) 2 (protons) 3 (others) particles ]
222 Bool_t fCheckMotherPDG; // Check the PDG code of mother for secondaries
225 Double_t fTrackletDphiCut; //maximum Dphi cut on tracklets
227 Int_t fSelectCharge; // (un)like sign selection when building correlations: 0: no selection; 1: unlike sign; 2: like sign
228 Int_t fTriggerSelectCharge; // select charge of trigger particle: 1: positive; -1 negative
229 Int_t fAssociatedSelectCharge; // select charge of associated particle: 1: positive; -1 negative
230 Float_t fTriggerRestrictEta; // restrict eta range for trigger particle (default: -1 [off])
231 Bool_t fEtaOrdering; // eta ordering, see AliUEHistograms.h for documentation
232 Bool_t fCutConversions; // cut on conversions (inv mass)
233 Bool_t fCutResonances; // cut on resonances (inv mass)
234 Int_t fRejectResonanceDaughters; // reject all daughters of all resonance candidates (1: test method (cut at m_inv=0.9); 2: k0; 3: lambda)
235 Bool_t fFillOnlyStep0; // fill only step 0
236 Bool_t fSkipStep6; // skip step 6 when filling
237 Bool_t fRejectCentralityOutliers; // enable rejection of outliers in centrality vs no track correlation
238 Bool_t fRejectZeroTrackEvents; // reject events which have no tracks (using the eta, pT cuts defined)
239 Bool_t fRemoveWeakDecays; // remove secondaries from weak decays from tracks and particles
240 Bool_t fRemoveDuplicates; // remove particles with the same label (double reconstruction)
241 Bool_t fSkipFastCluster; // skip kFastOnly flagged events (only for data)
242 Bool_t fWeightPerEvent; // weight with the number of trigger particles per event
243 TString fCustomBinning; // supersedes default binning if set, see AliUEHist::GetBinning or AliUEHistograms::AliUEHistograms for syntax and examples
244 Bool_t fPtOrder; // apply pT,a < pt,t condition; default: kTRUE
245 Int_t fTriggersFromDetector; // 0 = tracks (default); 1 = VZERO_A; 2 = VZERO_C; 3 = SPD tracklets; 4 = forward muons
246 Int_t fAssociatedFromDetector; // 0 = tracks (default); 1 = VZERO_A; 2 = VZERO_C; 3 = SPD tracklets; 4 = forward muons
247 Bool_t fMCUseUncheckedCentrality; // use unchecked centrality (only applies to MC); default: kFALSE
249 Bool_t fFillpT; // fill sum pT instead of number density
251 ClassDef(AliAnalysisTaskPhiCorrelations, 46); // Analysis task for delta phi correlations
254 class AliDPhiBasicParticle : public AliVParticle
257 AliDPhiBasicParticle(Float_t eta, Float_t phi, Float_t pt, Short_t charge)
258 : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge)
261 ~AliDPhiBasicParticle() {}
264 virtual Double_t Px() const { AliFatal("Not implemented"); return 0; }
265 virtual Double_t Py() const { AliFatal("Not implemented"); return 0; }
266 virtual Double_t Pz() const { AliFatal("Not implemented"); return 0; }
267 virtual Double_t Pt() const { return fpT; }
268 virtual Double_t P() const { AliFatal("Not implemented"); return 0; }
269 virtual Bool_t PxPyPz(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
271 virtual Double_t Xv() const { AliFatal("Not implemented"); return 0; }
272 virtual Double_t Yv() const { AliFatal("Not implemented"); return 0; }
273 virtual Double_t Zv() const { AliFatal("Not implemented"); return 0; }
274 virtual Bool_t XvYvZv(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
276 virtual Double_t OneOverPt() const { AliFatal("Not implemented"); return 0; }
277 virtual Double_t Phi() const { return fPhi; }
278 virtual Double_t Theta() const { AliFatal("Not implemented"); return 0; }
281 virtual Double_t E() const { AliFatal("Not implemented"); return 0; }
282 virtual Double_t M() const { AliFatal("Not implemented"); return 0; }
284 virtual Double_t Eta() const { return fEta; }
285 virtual Double_t Y() const { AliFatal("Not implemented"); return 0; }
287 virtual Short_t Charge() const { return fCharge; }
288 virtual Int_t GetLabel() const { AliFatal("Not implemented"); return 0; }
290 virtual Int_t PdgCode() const { AliFatal("Not implemented"); return 0; }
291 virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }
293 virtual Bool_t IsEqual(const TObject* obj) const { return (obj->GetUniqueID() == GetUniqueID()); }
295 virtual void SetPhi(Double_t phi) { fPhi = phi; }
301 Short_t fCharge; // charge
303 ClassDef( AliDPhiBasicParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing