]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskTriggeredBF.h
end-of-line normalization
[u/mrichter/AliRoot.git] / PWGCF / EBYE / BalanceFunctions / AliAnalysisTaskTriggeredBF.h
1 #ifndef ALIANALYSISTASKTRIGGEREDBF_CXX
2 #define ALIANALYSISTASKTRIGGEREDBF_CXX
3
4 // Analysis task for the TriggeredBF code
5 // Authors: Panos Cristakoglou@cern.ch, m.weber@cern.ch
6
7 #include "AliLog.h"
8 #include "AliAnalysisTaskSE.h"
9 #include "AliBalanceTriggered.h"
10 #include "AliPIDResponse.h"
11 #include "AliPIDCombined.h"
12
13 class TList;
14 class TH1F;
15 class TH2F;
16
17 class AliBalanceTriggered;
18 class AliEventPoolManager;
19
20
21 class AliAnalysisTaskTriggeredBF : public AliAnalysisTaskSE {
22  public:
23   AliAnalysisTaskTriggeredBF(const char *name = "AliAnalysisTaskTriggeredBF");
24   virtual ~AliAnalysisTaskTriggeredBF(); 
25   
26   
27   virtual void   UserCreateOutputObjects();
28   virtual void   UserExec(Option_t *option);
29   virtual void   UserExecMix(Option_t*);
30   virtual void   FinishTaskOutput();
31   virtual void   Terminate(Option_t *);
32
33   void SetAnalysisObject(AliBalanceTriggered *const analysis) {
34     fBalance         = analysis;
35     }
36   void SetShufflingObject(AliBalanceTriggered *const analysisShuffled) {
37     fRunShuffling = kTRUE;
38     fShuffledBalance = analysisShuffled;
39   }
40   void SetMixingObject(AliBalanceTriggered *const analysisMixed) {
41     fRunMixing = kTRUE;
42     fMixedBalance = analysisMixed;
43   }
44   void SetMixingTracks(Int_t tracks) { fMixingTracks = tracks; }
45
46   void SetRunV0(Bool_t runV0 = kTRUE) { fRunV0 = runV0; }
47  
48   void SetVertexDiamond(Double_t vx, Double_t vy, Double_t vz) {
49     fVxMax = vx;
50     fVyMax = vy;
51     fVzMax = vz;
52   }
53
54   //==============AOD analysis==============//
55   void SetAODtrackCutBit(Int_t bit){
56     nAODtrackCutBit = bit;
57   }
58
59   void SetKinematicsCutsAOD(Double_t ptmin, Double_t ptmax, Double_t etamin, Double_t etamax){
60     fPtMin  = ptmin;  fPtMax  = ptmax;
61     fEtaMin = etamin; fEtaMax = etamax;
62
63   }
64
65   void SetExtraDCACutsAOD(Double_t DCAxy, Double_t DCAz){
66     fDCAxyCut  = DCAxy;
67     fDCAzCut = DCAz;
68   }
69
70    void SetExtraTPCCutsAOD(Double_t maxTPCchi2, Int_t minNClustersTPC){
71     fTPCchi2Cut      = maxTPCchi2;
72     fNClustersTPCCut = minNClustersTPC;
73   }
74
75   //Centrality
76   void SetCentralityEstimator(const char* centralityEstimator) {fCentralityEstimator = centralityEstimator;}
77   const char* GetCentralityEstimator(void)  const              {return fCentralityEstimator;}
78   void SetCentralityPercentileRange(Double_t min, Double_t max) { 
79     fUseCentrality = kTRUE;
80     fCentralityPercentileMin=min;
81     fCentralityPercentileMax=max;
82   }
83   void SetImpactParameterRange(Double_t min, Double_t max) { 
84     fUseCentrality = kTRUE;
85     fImpactParameterMin=min;
86     fImpactParameterMax=max;
87   }
88
89   //multiplicity
90   void SetMultiplicityRange(Int_t min, Int_t max) {
91     fUseMultiplicity = kTRUE;
92     fNumberOfAcceptedTracksMin = min;
93     fNumberOfAcceptedTracksMax = max;}
94   
95   void UseOfflineTrigger() {fUseOfflineTrigger = kTRUE;}
96   
97
98  private:
99   Float_t    IsEventAccepted(AliVEvent* event);
100   TObjArray* GetAcceptedTracks(AliVEvent* event);
101   TObjArray* GetAcceptedV0s(AliVEvent* event);
102   TObjArray* GetShuffledTracks(TObjArray* tracks);
103
104   AliBalanceTriggered *fBalance; //TriggeredBF object
105   Bool_t fRunShuffling;//run shuffling or not
106   AliBalanceTriggered *fShuffledBalance; //TriggeredBF object (shuffled)
107   Bool_t fRunMixing;//run mixing or not
108   Int_t  fMixingTracks;//number of tracks to mix
109   AliBalanceTriggered *fMixedBalance; //TriggeredBF object (mixed)
110   AliEventPoolManager*     fPoolMgr;         //! event pool manager
111   Bool_t fRunV0;
112
113   AliPIDResponse       *fPIDResponse;     //! PID response object
114   AliPIDCombined       *fPIDCombined;     //! combined PID object
115
116   TList *fList; //fList object
117   TList *fListTriggeredBF; //fList object
118   TList *fListTriggeredBFS; //fList object (shuffling)
119   TList *fListTriggeredBFM; //fList object (mixing)
120   TList *fHistListPIDQA;  //! list of histograms
121   TList *fHistListV0; // list of V0 histograms
122
123   TH1F *fHistEventStats; //event stats
124   TH2F *fHistCentStats; //centrality stats
125   TH1F *fHistTriggerStats; //trigger stats
126   TH1F *fHistTrackStats; //Track filter bit stats
127   TH1F *fHistVx; //x coordinate of the primary vertex
128   TH1F *fHistVy; //y coordinate of the primary vertex
129   TH1F *fHistVz; //z coordinate of the primary vertex
130
131   TH2F *fHistClus;//number of clusters (QA histogram)
132   TH2F *fHistDCA;//DCA  (QA histogram)
133   TH1F *fHistChi2;//track chi2 (QA histogram)
134   TH1F *fHistPt;//transverse momentum (QA histogram)
135   TH1F *fHistEta;//pseudorapidity (QA histogram)
136   TH1F *fHistPhi;//phi (QA histogram)
137   TH1F *fHistPhiBefore;//phi before v2 afterburner (QA histogram)
138   TH1F *fHistPhiAfter;//phi after v2 afterburner (QA histogram)
139   TH2F *fHistV0M;//V0 multiplicities (QA histogram)
140   TH2F *fHistRefTracks;//reference track multiplicities (QA histogram)
141
142   // V0 histograms
143   TH1F    *fHistV0MultiplicityBeforeTrigSel;             //! V0 multiplicity distribution
144   TH1F    *fHistV0MultiplicityForTrigEvt;                //! V0 multiplicity distribution
145   TH1F    *fHistV0MultiplicityForSelEvt;                 //! V0 multiplicity distribution
146   TH1F    *fHistV0MultiplicityForSelEvtNoTPCOnly;        //! V0 multiplicity distribution
147   TH1F    *fHistV0MultiplicityForSelEvtNoTPCOnlyNoPileup;//! V0 multiplicity distribution
148   
149   TH1F    *fHistMultiplicityBeforeTrigSel;              //! multiplicity distribution    
150   TH1F    *fHistMultiplicityForTrigEvt;                 //! multiplicity distribution
151   TH1F    *fHistMultiplicity;                           //! multiplicity distribution
152   TH1F    *fHistMultiplicityNoTPCOnly;                  //! multiplicity distribution
153   TH1F    *fHistMultiplicityNoTPCOnlyNoPileup;          //! multiplicity distribution
154
155   //before selection
156   TH1F* fHistV0InvMassK0;                           // Invariant mass K0
157   TH1F* fHistV0InvMassLambda;                       // Invariant mass Lambda
158   TH1F* fHistV0InvMassAntiLambda;                   // Invariant mass AntiLambda
159   TH2F* fHistV0Armenteros;                          // Armenteros plot
160
161   //after selection
162   TH1F* fHistV0SelInvMassK0;                           // Invariant mass K0
163   TH1F* fHistV0SelInvMassLambda;                       // Invariant mass Lambda
164   TH1F* fHistV0SelInvMassAntiLambda;                   // Invariant mass AntiLambda
165   TH2F* fHistV0SelArmenteros;                          // Armenteros plot
166  
167   TString fCentralityEstimator;      //"V0M","TRK","TKL","ZDC","FMD"
168   Bool_t fUseCentrality;//use the centrality (PbPb) or not (pp)
169   Double_t fCentralityPercentileMin;//centrality percentile min
170   Double_t fCentralityPercentileMax;//centrality percentile max
171   Double_t fImpactParameterMin;//impact parameter min (used for MC)
172   Double_t fImpactParameterMax;//impact parameter max (used for MC)
173
174   Bool_t fUseMultiplicity;//use the multiplicity cuts
175   Int_t fNumberOfAcceptedTracksMin;//min. number of number of accepted tracks (used for the multiplicity dependence study - pp)
176   Int_t fNumberOfAcceptedTracksMax;//max. number of number of accepted tracks (used for the multiplicity dependence study - pp)
177   TH1F *fHistNumberOfAcceptedTracks;//hisot to store the number of accepted tracks
178
179   Bool_t fUseOfflineTrigger;//Usage of the offline trigger selection
180
181   Double_t fVxMax;//vxmax
182   Double_t fVyMax;//vymax
183   Double_t fVzMax;//vzmax
184
185   Int_t nAODtrackCutBit;//track cut bit from track selection (only used for AODs)
186
187   Double_t fPtMin;//only used for AODs
188   Double_t fPtMax;//only used for AODs
189   Double_t fEtaMin;//only used for AODs
190   Double_t fEtaMax;//only used for AODs
191
192   Double_t fDCAxyCut;//only used for AODs
193   Double_t fDCAzCut;//only used for AODs
194
195   Double_t fTPCchi2Cut;//only used for AODs
196   Int_t fNClustersTPCCut;//only used for AODs
197
198  
199   AliAnalysisTaskTriggeredBF(const AliAnalysisTaskTriggeredBF&); // not implemented
200   AliAnalysisTaskTriggeredBF& operator=(const AliAnalysisTaskTriggeredBF&); // not implemented
201   
202   ClassDef(AliAnalysisTaskTriggeredBF, 1); // example of analysis
203 };
204
205 // class used for io with AliBalance (taken from AliAnalysisTaskPhiCorrelations)
206 class AliBFBasicParticle : public AliVParticle
207
208   public:
209   AliBFBasicParticle(Float_t eta, Float_t phi, Float_t pt, Short_t charge, Double_t correction)
210     : fEta(eta), fPhi(phi), fpT(pt), fCharge(charge), fCorrection(correction)
211     {
212     }
213     ~AliBFBasicParticle() {}
214     
215     // kinematics
216     virtual Double_t Px() const { AliFatal("Not implemented"); return 0; }
217     virtual Double_t Py() const { AliFatal("Not implemented"); return 0; }
218     virtual Double_t Pz() const { AliFatal("Not implemented"); return 0; }
219     virtual Double_t Pt() const { return fpT; }
220     virtual Double_t P() const { AliFatal("Not implemented"); return 0; }
221     virtual Bool_t   PxPyPz(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
222
223     virtual Double_t Xv() const { AliFatal("Not implemented"); return 0; }
224     virtual Double_t Yv() const { AliFatal("Not implemented"); return 0; }
225     virtual Double_t Zv() const { AliFatal("Not implemented"); return 0; }
226     virtual Bool_t   XvYvZv(Double_t[3]) const { AliFatal("Not implemented"); return 0; }
227
228     virtual Double_t OneOverPt()  const { AliFatal("Not implemented"); return 0; }
229     virtual Double_t Phi()        const { return fPhi; }
230     virtual Double_t Theta()      const { AliFatal("Not implemented"); return 0; }
231
232
233     virtual Double_t E()          const { AliFatal("Not implemented"); return 0; }
234     virtual Double_t M()          const { AliFatal("Not implemented"); return 0; }
235     
236     virtual Double_t Eta()        const { return fEta; }
237     virtual Double_t Y()          const { AliFatal("Not implemented"); return 0; }
238     
239     virtual Short_t Charge()      const { return fCharge; }
240     virtual Int_t   GetLabel()    const { AliFatal("Not implemented"); return 0; }
241
242     virtual Double_t Correction()        const { return fCorrection; } //=============================correction
243     
244     // PID
245     virtual Int_t   PdgCode()     const { AliFatal("Not implemented"); return 0; }      
246     virtual const Double_t *PID() const { AliFatal("Not implemented"); return 0; }
247     
248   private:
249     Float_t fEta;      // eta
250     Float_t fPhi;      // phi
251     Float_t fpT;       // pT
252     Short_t fCharge;   // charge
253     Double_t fCorrection; //============================correction
254
255     ClassDef( AliBFBasicParticle, 1); // class which contains only quantities requires for this analysis to reduce memory consumption for event mixing
256 };
257
258 #endif