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