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