]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/UserTasks/AliAnalysisTaskIDFragmentationFunction.h
- Coverity fixes
[u/mrichter/AliRoot.git] / PWGJE / UserTasks / AliAnalysisTaskIDFragmentationFunction.h
1 // *************************************************************************
2 // * Task for Fragmentation Function Analysis in PWG4 Jet Task Force Train *
3 // *************************************************************************
4
5 #ifndef ALIANALYSISTASKIDFRAGMENTATIONFUNCTION_H
6 #define ALIANALYSISTASKIDFRAGMENTATIONFUNCTION_H
7
8 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
9  * See cxx source for full Copyright notice                               */
10
11 /* $Id$ */
12
13 class AliESDEvent;
14 class AliAODEvent;
15 class AliAODJet;
16 class AliAODExtension;
17 class TList;
18 class TH1F;
19 class TH2F;
20 class TH3F;
21 class TProfile;
22 class THnSparse; 
23 class TRandom3;
24 class TArrayS;
25 class AliAODTrack;
26 class AliAODMCParticle;
27
28 #include "AliAnalysisTaskSE.h"
29 #include "AliPID.h"
30   
31 class AliAnalysisTaskIDFragmentationFunction : public AliAnalysisTaskSE {
32
33  public:
34   
35   //----------------------------------------
36   class AliFragFuncHistos : public TObject
37   {
38     
39     public:
40     
41     AliFragFuncHistos(const char* name = "FFhistos", 
42                       Int_t nJetPt = 0, Float_t jetPtMin = 0, Float_t jetPtMax = 0,
43                       Int_t nPt = 0, Float_t ptMin = 0, Float_t ptMax = 0,
44                       Int_t nXi = 0, Float_t xiMin = 0, Float_t xiMax = 0,
45                       Int_t nZ  = 0, Float_t zMin  = 0, Float_t zMax  = 0);
46     
47     AliFragFuncHistos(const AliFragFuncHistos& copy);
48     AliFragFuncHistos& operator=(const AliFragFuncHistos &o);
49     virtual ~AliFragFuncHistos();
50     
51     virtual void DefineHistos();
52     virtual void FillFF(Float_t trackPt, Float_t jetPt,Bool_t incrementJetPt, Float_t norm = 0, Bool_t scaleStrangeness = kFALSE, Float_t scaleFacStrangeness = 1.);
53
54     virtual void AddToOutput(TList* list) const;
55
56   private:
57
58     Int_t   fNBinsJetPt; // FF histos bins
59     Float_t fJetPtMin;   // FF histos limits
60     Float_t fJetPtMax;   // FF histos limits
61     Int_t   fNBinsPt;    // FF histos bins
62     Float_t fPtMin;      // FF histos limits
63     Float_t fPtMax;      // FF histos limits
64     Int_t   fNBinsXi;    // FF histos bins
65     Float_t fXiMin;      // FF histos limits
66     Float_t fXiMax;      // FF histos limits
67     Int_t   fNBinsZ;     // FF histos bins
68     Float_t fZMin;       // FF histos limits
69     Float_t fZMax;       // FF histos limits
70   
71     TH2F*   fh2TrackPt;   //! FF: track transverse momentum 
72     TH2F*   fh2Xi;        //! FF: xi 
73     TH2F*   fh2Z;         //! FF: z  
74     TH1F*   fh1JetPt;     //! jet pt 
75
76     TString fNameFF;      // histo names prefix
77     
78     ClassDef(AliFragFuncHistos, 1);
79   };
80   
81   //----------------------------------------
82   class AliFragFuncQAJetHistos : public TObject
83   {
84
85   public:
86  
87     AliFragFuncQAJetHistos(const char* name = "QAJethistos",
88                 Int_t nPt  = 0, Float_t ptMin  = 0, Float_t ptMax  = 0,
89                 Int_t nEta = 0, Float_t etaMin = 0, Float_t etaMax = 0,
90                 Int_t nPhi = 0, Float_t phiMin = 0, Float_t phiMax = 0);
91       
92     AliFragFuncQAJetHistos(const AliFragFuncQAJetHistos& copy);
93     AliFragFuncQAJetHistos& operator=(const AliFragFuncQAJetHistos &o);
94     virtual ~AliFragFuncQAJetHistos();
95     virtual void DefineHistos();
96     virtual void FillJetQA(Float_t eta, Float_t phi, Float_t pt);
97     virtual void AddToOutput(TList* list) const;
98
99   private:
100     
101     Int_t   fNBinsPt;    // jet QA histos bins
102     Float_t fPtMin;      // jet QA histos limits
103     Float_t fPtMax;      // jet QA histos limits
104     Int_t   fNBinsEta;   // jet QA histos bins
105     Float_t fEtaMin;     // jet QA histos limits
106     Float_t fEtaMax;     // jet QA histos limits
107     Int_t   fNBinsPhi;   // jet QA histos bins
108     Float_t fPhiMin;     // jet QA histos limits
109     Float_t fPhiMax;     // jet QA histos limits
110     
111     TH2F*   fh2EtaPhi;   //! jet phi vs eta 
112     TH1F*   fh1Pt;       //! jet transverse momentum 
113     TString fNameQAJ;    // histo names prefix
114     
115     ClassDef(AliFragFuncQAJetHistos, 1);
116   };
117   
118   //----------------------------------------
119   class AliFragFuncQATrackHistos : public TObject
120   {
121
122   public:
123
124     AliFragFuncQATrackHistos(const char* name = "QATrackhistos", 
125                   Int_t nPt  = 0, Float_t ptMin  = 0, Float_t ptMax  = 0,
126                   Int_t nEta = 0, Float_t etaMin = 0, Float_t etaMax = 0,
127                   Int_t nPhi = 0, Float_t phiMin = 0, Float_t phiMax = 0, 
128                   Float_t ptThresh = 0);
129     
130     AliFragFuncQATrackHistos(const AliFragFuncQATrackHistos& copy);
131     AliFragFuncQATrackHistos& operator=(const AliFragFuncQATrackHistos &o);
132     virtual ~AliFragFuncQATrackHistos();
133     virtual void DefineHistos();
134     virtual void FillTrackQA(Float_t eta, Float_t phi, Float_t pt, Bool_t weightPt = kFALSE, Float_t norm = 0., Bool_t scaleStrangeness = kFALSE, Float_t scaleFacStrangeness = 1.);
135     virtual void AddToOutput(TList* list) const;
136
137   private:
138     
139     Int_t   fNBinsPt;    // track QA histos bins in pt
140     Float_t fPtMin;      // track QA histos limits in pt
141     Float_t fPtMax;      // track QA histos limits in pt
142     Int_t   fNBinsEta;   // track QA histos bins in eta
143     Float_t fEtaMin;     // track QA histos limits in eta
144     Float_t fEtaMax;     // track QA histos limits in eta
145     Int_t   fNBinsPhi;   // track QA histos bins in phi
146     Float_t fPhiMin;     // track QA histos limits in phi
147     Float_t fPhiMax;     // track QA histos limits in phi
148
149     Float_t fHighPtThreshold; //  high pt track phi vs eta distribution
150
151     TH2F*   fh2EtaPhi;        //! track phi vs eta 
152     TH1F*   fh1Pt;            //! track transverse momentum 
153     TH2F*   fh2HighPtEtaPhi;  //! phi vs eta for high pt (>fgHighPtThreshold) tracks
154     TH2F*   fh2PhiPt;         //! track phi vs pt
155
156     TString fNameQAT;         // histo names prefix
157     
158     ClassDef(AliFragFuncQATrackHistos, 2);
159   };
160   
161
162   AliAnalysisTaskIDFragmentationFunction(); 
163   AliAnalysisTaskIDFragmentationFunction(const char *name);
164   AliAnalysisTaskIDFragmentationFunction(const  AliAnalysisTaskIDFragmentationFunction &copy);
165   AliAnalysisTaskIDFragmentationFunction& operator=(const  AliAnalysisTaskIDFragmentationFunction &o);
166   virtual ~AliAnalysisTaskIDFragmentationFunction();
167   
168   virtual void   UserCreateOutputObjects();
169   virtual void   Init();
170   virtual void   LocalInit() {Init();}
171
172   virtual void   UserExec(Option_t *option);
173   virtual void   Terminate(Option_t* );
174   virtual Bool_t Notify();
175
176   virtual void   SetNonStdFile(char* c){fNonStdFile = c;} 
177
178   virtual void   SetTrackTypeGen(Int_t i){fTrackTypeGen = i;}
179   virtual void   SetJetTypeGen(Int_t i){fJetTypeGen = i;}
180   virtual void   SetJetTypeRecEff(Int_t i){fJetTypeRecEff = i;}
181
182   virtual void   SetBranchRecBackClusters(const char* c){fBranchRecBckgClusters = c;}
183   virtual void   SetBranchGenJets(const char* c){fBranchGenJets = c;}
184   virtual void   SetBranchRecJets(const char* c){fBranchRecJets = c;}
185   virtual void   SetBranchEmbeddedJets(const char* c){fBranchEmbeddedJets = c;}
186
187   virtual void   SetTrackCuts(Float_t trackPt = 0.15, Float_t trackEtaMin = -0.9, Float_t trackEtaMax = 0.9, 
188                               Float_t trackPhiMin = 0., Float_t trackPhiMax = 2*TMath::Pi())
189   {fTrackPtCut = trackPt; fTrackEtaMin = trackEtaMin; fTrackEtaMax = trackEtaMax; 
190     fTrackPhiMin = trackPhiMin; fTrackPhiMax = trackPhiMax;}
191
192   virtual void   UseExtraTracks()        { fUseExtraTracks =  1;}
193   virtual void   UseExtraonlyTracks()    { fUseExtraTracks = -1;}
194
195   virtual void   UseExtraTracksBgr()     { fUseExtraTracksBgr =  1;}
196   virtual void   UseExtraonlyTracksBgr() { fUseExtraTracksBgr = -1;}
197
198   virtual void   SetCutFractionPtEmbedded(Float_t cut = 0) { fCutFractionPtEmbedded = cut; }
199   virtual void   SetUseEmbeddedJetAxis(Bool_t b = kTRUE)   { fUseEmbeddedJetAxis = b; }
200   virtual void   SetUseEmbeddedJetPt(Bool_t  b = kTRUE)    { fUseEmbeddedJetPt   = b; }
201
202   virtual void   UseAODInputJets(Bool_t b) {fUseAODInputJets = b;}  
203   virtual void   SetFilterMask(UInt_t i) {fFilterMask = i;}
204   virtual void   UsePhysicsSelection(Bool_t b) {fUsePhysicsSelection = b;}
205   virtual void   SetEventSelectionMask(UInt_t i){fEvtSelectionMask = i;}
206   virtual void   SetEventClass(Int_t i){fEventClass = i;}
207   virtual void   SetMaxVertexZ(Float_t z){fMaxVertexZ = z;}
208   virtual void   SetJetCuts(Float_t jetPt = 5., Float_t jetEtaMin = -0.5, Float_t jetEtaMax = 0.5, 
209                             Float_t jetPhiMin = 0., Float_t jetPhiMax = 2*TMath::Pi())
210   {fJetPtCut = jetPt; fJetEtaMin = jetEtaMin; fJetEtaMax = jetEtaMax; 
211     fJetPhiMin = jetPhiMin; fJetPhiMax = jetPhiMax;}
212
213   virtual void   SetFFRadius(Float_t r = 0.4) { fFFRadius = r; }
214   virtual void   SetFFMinLTrackPt(Float_t pt = -1) { fFFMinLTrackPt = pt; }
215   virtual void   SetFFMaxTrackPt(Float_t pt = -1) { fFFMaxTrackPt = pt; }
216   virtual void   SetFFMinNTracks(Int_t nTracks = 0) { fFFMinnTracks = nTracks; }
217   virtual void   SetFFBckgRadius(Float_t r = 0.7) { fFFBckgRadius = r; }
218   virtual void   SetBckgMode(Bool_t bg = 1) { fBckgMode = bg; }
219   virtual void   SetBckgType(Int_t bg0 = 0, Int_t bg1 = 0,Int_t bg2 = 0, Int_t bg3 = 0, Int_t bg4 = 0) 
220   { fBckgType[0] = bg0; fBckgType[1] = bg1; fBckgType[2] = bg2; fBckgType[3] = bg3; fBckgType[4] = bg4; }
221   virtual void   SetQAMode(Int_t qa = 3)      {fQAMode = qa;}
222   virtual void   SetFFMode(Int_t ff = 1)      {fFFMode = ff;}
223   virtual void   SetIDFFMode(Int_t idff = 0)      {fIDFFMode = idff;}
224   virtual void   SetEffMode(Int_t eff = 1)    {fEffMode = eff;}
225   virtual void   SetJSMode(Int_t js = 1)      {fJSMode = js;}
226
227   static  void   SetProperties(TH1* h,const char* x, const char* y);
228   static  void   SetProperties(TH1* h,const char* x, const char* y,const char* z);
229   static  void   SetProperties(THnSparse* h,const Int_t dim, const char** labels);
230
231   void   SetHighPtThreshold(Float_t pt = 5.) { fQATrackHighPtThreshold = pt; }
232
233   void   SetFFHistoBins(Int_t nJetPt = 245, Float_t jetPtMin = 5, Float_t jetPtMax = 250, 
234                         Int_t nPt = 200, Float_t ptMin = 0., Float_t ptMax = 200., 
235                         Int_t nXi = 70, Float_t xiMin = 0., Float_t xiMax = 7.,
236                         Int_t nZ = 22,  Float_t zMin = 0.,  Float_t zMax = 1.1)
237   { fFFNBinsJetPt = nJetPt; fFFJetPtMin = jetPtMin; fFFJetPtMax = jetPtMax; 
238     fFFNBinsPt = nPt; fFFPtMin = ptMin; fFFPtMax = ptMax;
239     fFFNBinsXi = nXi; fFFXiMin = xiMin; fFFXiMax = xiMax;
240     fFFNBinsZ  = nZ;  fFFZMin  = zMin;  fFFZMax  = zMax; }
241
242   void  SetQAJetHistoBins(Int_t nPt = 300, Float_t ptMin = 0., Float_t ptMax = 300.,
243                           Int_t nEta = 20, Float_t etaMin = -1.0, Float_t etaMax = 1.0,
244                           Int_t nPhi = 60, Float_t phiMin = 0., Float_t phiMax = 2*TMath::Pi())
245     { fQAJetNBinsPt = nPt; fQAJetPtMin = ptMin; fQAJetPtMax = ptMax;
246       fQAJetNBinsEta = nEta; fQAJetEtaMin = etaMin; fQAJetEtaMax = etaMax;
247       fQAJetNBinsPhi = nPhi; fQAJetPhiMin = phiMin; fQAJetPhiMax = phiMax; }
248   
249   void  SetQATrackHistoBins(Int_t nPt = 200, Float_t ptMin = 0., Float_t ptMax = 200.,
250                             Int_t nEta = 20, Float_t etaMin = -1.0, Float_t etaMax = 1.0,
251                             Int_t nPhi = 60, Float_t phiMin = 0., Float_t phiMax = 2*TMath::Pi())
252   { fQATrackNBinsPt = nPt; fQATrackPtMin = ptMin; fQATrackPtMax = ptMax;
253     fQATrackNBinsEta = nEta; fQATrackEtaMin = etaMin; fQATrackEtaMax = etaMax;
254     fQATrackNBinsPhi = nPhi; fQATrackPhiMin = phiMin; fQATrackPhiMax = phiMax; }
255   
256
257
258   Float_t  GetFFRadius() const { return fFFRadius; }
259   Float_t  GetFFMinLTrackPt() const { return fFFMinLTrackPt; }
260   Float_t  GetFFMaxTrackPt() const { return fFFMaxTrackPt; }
261   Float_t  GetFFMinNTracks() const { return fFFMinnTracks; }
262   Float_t  GetFFBckgRadius() const { return fFFBckgRadius; }
263   void     GetJetTracksTrackrefs(TList* l, const AliAODJet* j, const Double_t minPtL, const Double_t maxPt, Bool_t& isBadPt);
264   void     GetJetTracksPointing(TList* in, TList* out, const AliAODJet* j, const Double_t r, Double_t& sumPt, const Double_t minPtL, const Double_t maxPt, Bool_t& isBadPt);  
265   void     GetTracksOutOfNJets(Int_t nCases, TList* in, TList* out, const TList* jets, Double_t& pt);
266   void     GetTracksOutOfNJetsStat(Int_t nCases, TList* in, TList* out, const TList* jets, Double_t& pt, Double_t &normFactor);
267   void     GetTracksTiltedwrpJetAxis(Float_t alpha, TList* inputlist, TList* outputlist, const AliAODJet* jet, Double_t radius, Double_t& sumPt);
268   void     GetTracksTiltedwrpJetAxisWindow(Float_t alpha, TList* inputlist, TList* outputlist, const AliAODJet* jet, Double_t radius, Double_t& sumPt, Double_t &normFactor);
269
270   void     AssociateGenRec(TList* tracksAODMCCharged,TList* tracksRec, TArrayI& indexAODTr,TArrayI& indexMCTr,TArrayS& isRefGen,TH2F* fh2PtRecVsGen);
271
272   void     FillSingleTrackHistosRecGen(AliFragFuncQATrackHistos* trackQAGen, AliFragFuncQATrackHistos* trackQARec, TList* tracksGen, 
273                                        const TArrayI& indexAODTr, const TArrayS& isRefGen, const Bool_t scaleStrangeness = kFALSE);
274
275
276   void     FillJetTrackHistosRec(AliFragFuncHistos* histRec,  AliAODJet* jet, 
277                                  TList* jetTrackList, const TList* tracksGen, const TList* tracksRec, const TArrayI& indexAODTr,
278                                  const TArrayS& isRefGen, TList* jetTrackListTR = 0, const Bool_t scaleStrangeness = kFALSE,
279                                  Bool_t fillJS = kFALSE, TProfile* hProNtracksLeadingJet = 0, TProfile** hProDelRPtSum = 0, TProfile* hProDelR80pcPt = 0);
280
281
282   Float_t  CalcJetArea(const Float_t etaJet, const Float_t rc) const;
283   void     GetClusterTracksOutOf1Jet(AliAODJet* jet, TList* outputlist, Double_t &normFactor);
284   void     GetClusterTracksMedian(TList* outputlist, Double_t &normFactor);
285
286   void     FillBckgHistos(Int_t type, TList* inputtracklist, TList* inputjetlist, AliAODJet* jet, 
287                           AliFragFuncHistos* ffbckghistocuts,AliFragFuncQATrackHistos* qabckghistos,TH1F* fh1Mult = 0); 
288  
289   Double_t GetMCStrangenessFactor(const Double_t pt) const;
290   Double_t GetMCStrangenessFactorCMS(AliAODMCParticle* daughter) const;
291   
292   Bool_t IsSecondaryWithStrangeMotherMC(AliAODMCParticle* part);
293
294   void FillJetShape(AliAODJet* jet, TList* list,  TProfile* hProNtracksLeadingJet, TProfile** hProDelRPtSum, TProfile* hProDelR80pcPt=0, Double_t dPhiUE=0, Double_t normUE = 0, Bool_t scaleStrangeness = kFALSE);
295
296   const TString* GetNamesOfInclusivePIDtasks() const { return fNameInclusivePIDtask; };
297   void SetNamesOfInclusivePIDtasks(const Int_t numNames, TString* names);
298   
299   const TString* GetNamesOfJetPIDtasks() const { return fNameJetPIDtask; };
300   void SetNamesOfJetPIDtasks(const Int_t numNames, TString* names);
301         
302         
303         Bool_t GetIsPP() const { return fIsPP; };
304         void SetIsPP(Bool_t flag) { fIsPP = flag; };
305   
306   Bool_t GetOnlyLeadingJets() const { return fOnlyLeadingJets; }
307   void SetOnlyLeadingJets(Bool_t onlyLeadingJets) { fOnlyLeadingJets = onlyLeadingJets; }
308   
309   // Consts
310   enum {kTrackUndef=0, kTrackAOD, kTrackAODQualityCuts, kTrackAODCuts, 
311         kTrackAODExtra, kTrackAODExtraonly, kTrackAODExtraCuts, kTrackAODExtraonlyCuts, 
312         kTrackKineAll, kTrackKineCharged, kTrackKineChargedAcceptance, 
313         kTrackAODMCAll, kTrackAODMCCharged, kTrackAODMCChargedAcceptance, kTrackAODMCChargedSecS, kTrackAODMCChargedSecNS, kTrackAOCMCChargedPrimAcceptance};
314   enum {kJetsUndef=0, kJetsRec, kJetsRecAcceptance, kJetsGen, kJetsGenAcceptance, kJetsKine, kJetsKineAcceptance,kJetsEmbedded};
315   enum {kBckgNone=0, kBckgPerp, kBckgOutLJ, kBckgOut2J, kBckgClusters, kBckgClustersOutLeading, kBckgOut3J, kBckgOutAJ, kBckgOutLJStat, 
316         kBckgOut2JStat, kBckgOut3JStat, kBckgOutAJStat,  kBckgASide, kBckgASideWindow, kBckgPerpWindow, kBckgPerp2, kBckgPerp2Area};
317
318  
319  protected:
320   
321   Int_t   GetListOfTracks(TList* list, Int_t type);
322   Int_t   GetListOfJets(TList* list, Int_t type);
323   Int_t   GetListOfBckgJets(TList *list, Int_t type);
324
325   AliESDEvent* fESD;      // ESD event
326   AliAODEvent* fAOD;      // AOD event
327   AliAODEvent* fAODJets;  // AOD event with jet branch (case we have AOD both in input and output)
328   AliAODExtension  *fAODExtension; //! where we take the jets from can be input or output AOD
329   TString       fNonStdFile; // name of delta aod file to catch the extension
330  
331  
332   TString fBranchRecJets;         // branch name for reconstructed jets
333   TString fBranchRecBckgClusters; // branch name for reconstructed background clusters 
334   TString fBranchGenJets;         // branch name for generated jets
335   TString fBranchEmbeddedJets;    // branch name for embedded jets
336
337   Int_t   fTrackTypeGen;        // type of generated tracks
338   Int_t   fJetTypeGen;          // type of generated jets
339
340   Int_t   fJetTypeRecEff;       // type of jets used for filling reconstruction efficiency histos
341
342   Bool_t  fUseAODInputJets;     // take jets from in/output - only relevant if AOD event both in input AND output and we want to use output
343   UInt_t  fFilterMask;          // filter bit for selected tracks
344   Bool_t  fUsePhysicsSelection; // switch for event selection
345   UInt_t  fEvtSelectionMask;    // trigger class selection
346   Int_t   fEventClass;          // centrality class selection
347   Float_t fMaxVertexZ;          // maximum abs(z) position of primiary vertex [cm]
348
349   // track cuts
350   Float_t fTrackPtCut;    // track transverse momentum cut
351   Float_t fTrackEtaMin;   // track eta cut
352   Float_t fTrackEtaMax;   // track eta cut
353   Float_t fTrackPhiMin;   // track phi cut
354   Float_t fTrackPhiMax;   // track phi cut
355   
356   Int_t   fUseExtraTracks;         // +/- 1: embedded extra/extra only tracks, default: 0 (ignore extra tracks)
357   Int_t   fUseExtraTracksBgr;      // +/- 1: background: use embedded extra/extra only tracks, default: 0 (ignore extra tracks)
358   Float_t fCutFractionPtEmbedded;  // cut on ratio of embedded pt found in jet
359   Bool_t  fUseEmbeddedJetAxis;     // use axis of embedded jet for FF
360   Bool_t  fUseEmbeddedJetPt;       // use axis of embedded jet for FF
361
362   // jet cuts
363   Float_t fJetPtCut;      // jet transverse momentum cut
364   Float_t fJetEtaMin;     // jet eta cut
365   Float_t fJetEtaMax;     // jet eta cut
366   Float_t fJetPhiMin;     // jet phi cut
367   Float_t fJetPhiMax;     // jet phi cut
368
369   Float_t fFFRadius;        // if radius > 0 construct FF from tracks within cone around jet axis, otherwise use trackRefs  
370   Float_t fFFMinLTrackPt;   // reject jets with leading track with pt smaller than this value
371   Float_t fFFMaxTrackPt;    // reject jets containing any track with pt larger than this value
372   Int_t   fFFMinnTracks;    // reject jets with less tracks than this value
373   Float_t fFFBckgRadius;    // compute background outside cone of this radius around jet axes
374   Bool_t  fBckgMode;        // Set background subtraction mode
375   Int_t   fBckgType[5];     // Set background subtraction mode
376   Int_t   fQAMode;          // QA mode: 0x00=0 none, 0x01=1 track qa, 0x10=2 track qa, 0x11=3 both
377   Int_t   fFFMode;          // fragmentation function mode
378   Int_t   fIDFFMode;        // identified fragmentation function mode (implicitely enables also normal fragmentation function mode (but not effeciency, background etc.)!)
379   Int_t   fEffMode;         // efficiency mode
380   Int_t   fJSMode;          // jet shape mode
381
382   Float_t fAvgTrials;       // average number of trials per event
383   
384   TList* fTracksRecCuts;           //! reconstructed tracks after cuts
385   TList* fTracksRecCutsEfficiency; //! reconstructed tracks after cuts for efficiency
386   TList* fTracksGen;               //! generated tracks 
387   TList* fTracksAODMCCharged;      //! AOD MC tracks 
388   TList* fTracksAODMCChargedSecNS; //! AOD MC tracks - secondaries (non-strangeness) 
389   TList* fTracksAODMCChargedSecS;  //! AOD MC tracks - secondaries (from strangeness)
390   TList* fTracksRecQualityCuts;    //! reconstructed tracks after quality cuts, no acceptance/pt cut
391
392   
393   TList* fJetsRec;        //! jets from reconstructed tracks
394   TList* fJetsRecCuts;    //! jets from reonstructed tracks after jet cuts 
395   TList* fJetsGen;        //! jets from generated tracks
396   TList* fJetsRecEff;     //! jets used for reconstruction efficiency histos 
397   TList* fJetsEmbedded;   //! jets used for embedding
398
399   TList* fBckgJetsRec;      //! jets from reconstructed tracks
400   TList* fBckgJetsRecCuts;  //! jets from reonstructed tracks after jet cuts
401   TList* fBckgJetsGen;      //! jets from generated tracks
402  
403   
404   AliFragFuncQATrackHistos* fQATrackHistosRecCuts;  //! track QA: reconstructed tracks after cuts
405   AliFragFuncQATrackHistos* fQATrackHistosGen;      //! track QA: generated tracks
406   
407   AliFragFuncQAJetHistos*  fQAJetHistosRec;             //! jet QA: jets from reconstructed tracks
408   AliFragFuncQAJetHistos*  fQAJetHistosRecCuts;         //! jet QA: jets from reconstructed tracks after jet cuts 
409   AliFragFuncQAJetHistos*  fQAJetHistosRecCutsLeading;  //! jet QA: leading jet from reconstructed tracks after jet cuts 
410   AliFragFuncQAJetHistos*  fQAJetHistosGen;             //! jet QA: jets from generated tracks  
411   AliFragFuncQAJetHistos*  fQAJetHistosGenLeading;      //! jet QA: leading jet from generated tracks  
412   AliFragFuncQAJetHistos*  fQAJetHistosRecEffLeading;   //! jet QA: leading jet used for reconstruction efficiency histos  
413   
414
415   AliFragFuncHistos*  fFFHistosRecCuts;         //! FF reconstructed tracks after cuts (leading jet) 
416   AliFragFuncHistos*  fFFHistosRecCutsInc;      //! inclusive FF (all jets) 
417   AliFragFuncHistos*  fFFHistosRecLeadingTrack; //! FF reconstructed tracks after cuts: leading track pt / jet pt (all jets)
418
419   AliFragFuncHistos*  fFFHistosGen;             //! FF generated tracks after cuts 
420   AliFragFuncHistos*  fFFHistosGenInc;          //! inclusive FF (all jets) 
421   AliFragFuncHistos*  fFFHistosGenLeadingTrack; //! FF reconstructed tracks after cuts: leading track pt / jet pt (all jets)
422
423   Float_t  fQATrackHighPtThreshold;       // track QA high transverse momentum threshold
424   
425   // histogram bins  
426
427   Int_t   fFFNBinsJetPt;    // FF histos bins
428   Float_t fFFJetPtMin;      // FF histos limits
429   Float_t fFFJetPtMax;      // FF histos limits
430
431   Int_t   fFFNBinsPt;       // FF histos bins
432   Float_t fFFPtMin;         // FF histos limits
433   Float_t fFFPtMax;         // FF histos limits
434
435   Int_t   fFFNBinsXi;       // FF histos bins
436   Float_t fFFXiMin;         // FF histos limits
437   Float_t fFFXiMax;         // FF histos limits
438
439   Int_t   fFFNBinsZ;        // FF histos bins
440   Float_t fFFZMin;          // FF histos limits
441   Float_t fFFZMax;          // FF histos limits
442
443   Int_t   fQAJetNBinsPt;    // jet QA histos bins
444   Float_t fQAJetPtMin;      // jet QA histos limits
445   Float_t fQAJetPtMax;      // jet QA histos limits
446   
447   Int_t   fQAJetNBinsEta;   // jet QA histos bins
448   Float_t fQAJetEtaMin;     // jet QA histos limits
449   Float_t fQAJetEtaMax;     // jet QA histos limits
450   
451   Int_t   fQAJetNBinsPhi;   // jet QA histos bins
452   Float_t fQAJetPhiMin;     // jet QA histos limits
453   Float_t fQAJetPhiMax;     // jet QA histos limits
454   
455   Int_t   fQATrackNBinsPt;  // track QA histos bins
456   Float_t fQATrackPtMin;    // track QA histos limits
457   Float_t fQATrackPtMax;    // track QA histos limits
458   
459   Int_t   fQATrackNBinsEta; // track QA histos bins
460   Float_t fQATrackEtaMin;   // track QA histos limits
461   Float_t fQATrackEtaMax;   // track QA histos limits
462   
463   Int_t   fQATrackNBinsPhi; // track QA histos bins
464   Float_t fQATrackPhiMin;   // track QA histos limits
465   Float_t fQATrackPhiMax;   // track QA histos limits
466   
467   // Histograms
468   TList *fCommonHistList;         // List of common histos
469   
470   TH1F  *fh1EvtSelection;         //! event cuts 
471   TH1F  *fh1VertexNContributors;  //! NContributors to prim vertex
472   TH1F  *fh1VertexZ;              //! prim vertex z distribution
473   TH1F  *fh1EvtMult;              //! number of reconstructed tracks after cuts 
474   TH1F  *fh1EvtCent;              //! centrality percentile 
475
476   TProfile* fh1Xsec;              //! pythia cross section and trials
477   TH1F*     fh1Trials;            //! sum of trials
478   TH1F*     fh1PtHard;            //! pt hard of the event
479   TH1F*     fh1PtHardTrials;      //! pt hard of the event
480
481   TH1F  *fh1nRecJetsCuts;         //! number of jets from reconstructed tracks per event 
482   TH1F  *fh1nGenJets;             //! number of jets from generated tracks per event
483   TH1F  *fh1nRecEffJets;          //! number of jets for reconstruction eff per event
484   TH1F  *fh1nEmbeddedJets;        //! number of embedded jets per event
485
486   TH1F  *fh1nRecBckgJetsCuts;     //! number of jets from reconstructed tracks per event
487   TH1F  *fh1nGenBckgJets;         //! number of jets from generated tracks per event
488   TH2F  *fh2PtRecVsGenPrim;       //! association rec/gen MC: rec vs gen pt, primaries 
489   TH2F  *fh2PtRecVsGenSec;        //! association rec/gen MC: rec vs gen pt, secondaries 
490
491   // tracking efficiency / secondaries
492   
493   AliFragFuncQATrackHistos* fQATrackHistosRecEffGen;      //! tracking efficiency: generated primaries 
494   AliFragFuncQATrackHistos* fQATrackHistosRecEffRec;      //! tracking efficiency: reconstructed primaries
495   AliFragFuncQATrackHistos* fQATrackHistosSecRecNS;       //! reconstructed secondaries (non-strangeness)
496   AliFragFuncQATrackHistos* fQATrackHistosSecRecS;        //! reconstructed secondaries (strange mothers)
497   AliFragFuncQATrackHistos* fQATrackHistosSecRecSsc;      //! reconstructed secondaries (strange mothers) - scale factor
498
499   AliFragFuncHistos*  fFFHistosRecEffRec;                 //! tracking efficiency: FF reconstructed primaries
500   AliFragFuncHistos*  fFFHistosSecRecNS;                  //! secondary contamination: FF reconstructed secondaries (non-strangeness)
501   AliFragFuncHistos*  fFFHistosSecRecS;                   //! secondary contamination: FF reconstructed secondaries (strange mothers)
502   AliFragFuncHistos*  fFFHistosSecRecSsc;                 //! secondary contamination: FF reconstructed secondaries (strange mothers) - scale factor
503
504
505   // Background
506   TH1F  *fh1BckgMult0; //! background multiplicity
507   TH1F  *fh1BckgMult1; //! background multiplicity
508   TH1F  *fh1BckgMult2; //! background multiplicity
509   TH1F  *fh1BckgMult3; //! background multiplicity
510   TH1F  *fh1BckgMult4; //! background multiplicity
511
512   // embedding
513   TH1F* fh1FractionPtEmbedded;         //! ratio embedded pt in rec jet to embedded jet pt 
514   TH1F* fh1IndexEmbedded;              //! index embedded jet matching to leading rec jet 
515   TH2F* fh2DeltaPtVsJetPtEmbedded;     //! delta pt rec - embedded jet
516   TH2F* fh2DeltaPtVsRecJetPtEmbedded;  //! delta pt rec - embedded jet
517   TH1F* fh1DeltaREmbedded;             //! delta R  rec - embedded jet
518
519
520   AliFragFuncQATrackHistos* fQABckgHisto0RecCuts;  //! track QA: reconstructed tracks after cuts
521   AliFragFuncQATrackHistos* fQABckgHisto0Gen;      //! track QA: generated tracks
522   AliFragFuncQATrackHistos* fQABckgHisto1RecCuts;  //! track QA: reconstructed tracks after cuts
523   AliFragFuncQATrackHistos* fQABckgHisto1Gen;      //! track QA: generated tracks
524   AliFragFuncQATrackHistos* fQABckgHisto2RecCuts;  //! track QA: reconstructed tracks after cuts
525   AliFragFuncQATrackHistos* fQABckgHisto2Gen;      //! track QA: generated tracks
526   AliFragFuncQATrackHistos* fQABckgHisto3RecCuts;  //! track QA: reconstructed tracks after cuts
527   AliFragFuncQATrackHistos* fQABckgHisto3Gen;      //! track QA: generated tracks
528   AliFragFuncQATrackHistos* fQABckgHisto4RecCuts;  //! track QA: reconstructed tracks after cuts
529   AliFragFuncQATrackHistos* fQABckgHisto4Gen;      //! track QA: generated tracks
530   
531   AliFragFuncHistos*  fFFBckgHisto0RecCuts;       //! Bckg (outside leading jet or 2 jets or more) FF reconstructed tracks after cuts 
532   AliFragFuncHistos*  fFFBckgHisto0Gen;           //! Bckg (outside leading jet or 2 jets or more) FF generated tracks after cuts 
533   AliFragFuncHistos*  fFFBckgHisto1RecCuts;       //! Bckg (outside leading jet or 2 jets or more) FF reconstructed tracks after cuts 
534   AliFragFuncHistos*  fFFBckgHisto1Gen;           //! Bckg (outside leading jet or 2 jets or more) FF generated tracks after cuts 
535   AliFragFuncHistos*  fFFBckgHisto2RecCuts;       //! Bckg (outside leading jet or 2 jets or more) FF reconstructed tracks after cuts 
536   AliFragFuncHistos*  fFFBckgHisto2Gen;           //! Bckg (outside leading jet or 2 jets or more) FF generated tracks after cuts 
537   AliFragFuncHistos*  fFFBckgHisto3RecCuts;       //! Bckg (outside leading jet or 3 jets or more) FF reconstructed tracks after cuts 
538   AliFragFuncHistos*  fFFBckgHisto3Gen;           //! Bckg (outside leading jet or 3 jets or more) FF generated tracks after cuts 
539   AliFragFuncHistos*  fFFBckgHisto4RecCuts;       //! Bckg (outside leading jet or 4 jets or more) FF reconstructed tracks after cuts 
540   AliFragFuncHistos*  fFFBckgHisto4Gen;           //! Bckg (outside leading jet or 4 jets or more) FF generated tracks after cuts 
541
542   AliFragFuncHistos*  fFFBckgHisto0RecEffRec;     //! Bckg (outside leading jet or 2 jets or more) FF reconstructed primaries after cuts 
543   AliFragFuncHistos*  fFFBckgHisto0SecRecNS;      //! secondary contamination: FF reconstructed secondaries (non-strangeness)
544   AliFragFuncHistos*  fFFBckgHisto0SecRecS;       //! secondary contamination: FF reconstructed secondaries (strange mothers)
545   AliFragFuncHistos*  fFFBckgHisto0SecRecSsc;     //! secondary contamination: FF reconstructed secondaries (strange mothers) - scale factor
546
547   TProfile* fProNtracksLeadingJet;          //! jet shape 
548   TProfile* fProDelR80pcPt;                 //! jet shape 
549   TProfile* fProDelRPtSum[5];               //! jet shape 
550
551   TProfile* fProNtracksLeadingJetGen;       //! jet shape 
552   TProfile* fProDelR80pcPtGen;              //! jet shape 
553   TProfile* fProDelRPtSumGen[5];            //! jet shape 
554
555   TProfile* fProNtracksLeadingJetBgrPerp2;  //! jet shape 
556   TProfile* fProDelRPtSumBgrPerp2[5];       //! jet shape 
557
558   TProfile* fProNtracksLeadingJetRecPrim;   //! jet shape 
559   TProfile* fProDelR80pcPtRecPrim;          //! jet shape 
560   TProfile* fProDelRPtSumRecPrim[5];        //! jet shape 
561
562   TProfile* fProNtracksLeadingJetRecSecNS;  //! jet shape 
563   TProfile* fProDelRPtSumRecSecNS[5];       //! jet shape 
564
565   TProfile* fProNtracksLeadingJetRecSecS;   //! jet shape 
566   TProfile* fProDelRPtSumRecSecS[5];        //! jet shape 
567
568   TProfile* fProNtracksLeadingJetRecSecSsc; //! jet shape 
569   TProfile* fProDelRPtSumRecSecSsc[5];      //! jet shape 
570   
571
572   TRandom3* fRandom;                        // TRandom3 for background estimation 
573   
574   Bool_t fOnlyLeadingJets;                  // Flag indicating whether some histos are filled with leading jets only or all jets
575   
576   // PID framework
577   Int_t fNumInclusivePIDtasks;              // Number of inclusive PID tasks used 
578   Int_t fNumJetPIDtasks;                    // Number of jet PID tasks used
579   
580   TString* fNameInclusivePIDtask;           // Names of the tasks for inclusive PID spectra
581   TString* fNameJetPIDtask;                 // Names of the tasks for jet PID spectra
582   
583   AliAnalysisTaskPID** fInclusivePIDtask;   // Pointer to tasks for inclusive PID spectra
584   AliAnalysisTaskPID** fJetPIDtask;         // Pointer to tasks for jet PID spectra
585   
586   Bool_t fUseInclusivePIDtask;              // Process inclusive PID spectra?
587   Bool_t fUseJetPIDtask;                    // Process jet PID spectra?
588   
589   Bool_t fIsPP;                             // Is pp collision system? -> If yes, centrality will be set to -1
590   
591   AliFragFuncHistos* fIDFFHistosRecCuts[AliPID::kSPECIES];    //! Identified FF reconstructed tracks after cuts 
592   AliFragFuncHistos* fIDFFHistosGen[AliPID::kSPECIES];    //! Identified FF generated tracks after cuts 
593
594   ClassDef(AliAnalysisTaskIDFragmentationFunction, 18);
595 };
596
597
598 inline void AliAnalysisTaskIDFragmentationFunction::SetNamesOfInclusivePIDtasks(const Int_t numNames, TString* names)
599 {
600   delete [] fNameInclusivePIDtask;
601   fNameInclusivePIDtask = 0x0;
602     
603   delete [] fInclusivePIDtask;
604   fInclusivePIDtask = 0x0;
605   
606   if (!names || numNames < 0) {
607     fNumInclusivePIDtasks = 0;
608     return;
609   }
610   
611   fNumInclusivePIDtasks = numNames;
612   
613   if (numNames > 0) {
614     fNameInclusivePIDtask = new TString[numNames];
615     fInclusivePIDtask = new AliAnalysisTaskPID*[numNames];
616     
617     for (Int_t i = 0; i < numNames; i++) {
618       fNameInclusivePIDtask[i] = names[i];
619       fInclusivePIDtask[i] = 0x0;
620     }
621   }  
622 }
623
624 inline void AliAnalysisTaskIDFragmentationFunction::SetNamesOfJetPIDtasks(const Int_t numNames, TString* names)
625 {
626   delete [] fNameJetPIDtask;
627   fNameJetPIDtask = 0x0;
628     
629   delete [] fJetPIDtask;
630   fJetPIDtask = 0x0;
631   
632   if (!names || numNames < 0) {
633     fNumJetPIDtasks = 0;
634     return;
635   }
636   
637   fNumJetPIDtasks = numNames;
638   
639   if (numNames > 0) {
640     fNameJetPIDtask = new TString[numNames];
641     fJetPIDtask = new AliAnalysisTaskPID*[numNames];
642     
643     for (Int_t i = 0; i < numNames; i++) {
644       fNameJetPIDtask[i] = names[i];
645       fJetPIDtask[i] = 0x0;
646     }
647   }  
648 }
649
650 #endif