AliPhysics  97344c9 (97344c9)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskIDFragmentationFunction.h
Go to the documentation of this file.
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 AliEmcalJet;
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;
29 class AliAnalysisTaskPID;
30 
32 #include "AliPID.h"
33 
35 public:
39 
40  virtual void UserCreateOutputObjects();
41  virtual void Init();
42  virtual void LocalInit() {Init();}
43 
45  virtual void Terminate(Option_t* );
46  virtual Bool_t Notify();
47 
48  virtual void SetNonStdFile(char* c){fNonStdFile = c;}
49 
51 
54 
57 
60 
62  virtual TString GetNameJetContainer() const { return fNameJetContainer;}
63 
66 
67  virtual void UseAODInputJets(Bool_t b) {fUseAODInputJets = b;}
70  virtual void SetEventClass(Int_t i){fEventClass = i;}
71  virtual void SetMaxVertexZ(Float_t z){fMaxVertexZ = z;}
72 
73  virtual void SetFFRadius(Float_t r = 0.4) { fFFRadius = r; }
74  virtual void SetMCPtHardCut(Float_t ptHardCut) { fMCPtHardCut = ptHardCut; }
75 
78 
79  virtual Bool_t GetFillDCA() const { return fFillDCA; }
80  virtual void SetFillDCA(Bool_t flag) { fFillDCA = flag; }
81 
83  virtual void SetUseInclusivePIDtask(Bool_t flag) {fUseInclusivePIDtask = flag; }
84 
85  virtual Bool_t GetUseJetPIDtask() const {return fUseJetPIDtask; }
86  virtual void SetUseJetPIDtask(Bool_t flag) {fUseJetPIDtask = flag; }
87 
88  virtual Bool_t GetUseJetUEPIDtask() const {return fUseJetUEPIDtask; }
89  virtual void SetUseJetUEPIDtask(Bool_t flag) {fUseJetUEPIDtask = flag; }
90 
91  //Begin of underlying event calculations
92  virtual TList* GetUEJetsWithRandomConeMethod(AliJetContainer* jetContainer, Double_t coneRadius, Double_t maxEtaTrack);
94  virtual AliEmcalJet* GetRandomCone(AliEmcalJet* processedJet, Double_t dEtaConeMax, Double_t dDistance) const;
95  virtual AliEmcalJet* GetPerpendicularCone(AliEmcalJet* processedJet, Double_t perpAngle) const;
96  virtual TList* GetTracksInCone(const AliEmcalJet* jet, AliParticleContainer* particleContainer = 0x0) const;
97  Bool_t IsParticleInCone(const AliVParticle* part1, const AliVParticle* part2, Double_t dRMax) const;
98  virtual Bool_t IsRCJCOverlap(const AliVParticle* part, Double_t dDistance) const;
99 
100  //Filling the efficiency containers of the specified task with the generated jet yield
101  virtual void PerformJetMonteCarloAnalysisGeneratedYield(AliEmcalJet* jet, AliVParticle* trackVP, AliAnalysisTaskPID* task, Double_t centPercent, AliJetContainer* mcJetContainer = 0x0);
102 
103  //Jet Track Calculations, including filling of the efficiency containers. If no task is specified, the function loops over all Jet tasks in fJetPIDtask, using trackRejectedByTask[] to decide if the track is accepted. If a task is specified, everything is done (without checking further) for the specified task.
104  virtual void AnalyseJetTrack(AliVTrack* track, AliEmcalJet* jet, AliAnalysisTaskPID* task, const Bool_t* trackRejectedByTask, Double_t centPercent, AliMCParticleContainer* mcParticleContainer = 0x0);
105 
106  //Fill DCA
107  virtual void FillDCA(AliVTrack* track, AliMCParticleContainer* mcParticleContainer);
108 
109  //End of underlying event calculations
110 
111  static void SetProperties(TH1* h,const char* x, const char* y);
112  static void SetProperties(TH1* h,const char* x, const char* y,const char* z);
113  static void SetProperties(THnSparse* h,Int_t dim, const char** labels);
114 
115  void SetStoreXi(Bool_t storeXi) { fStoreXi = storeXi; }
116  Bool_t GetStoreXi() { return fStoreXi; }
117 
119  Float_t GetFFRadius() const { return fFFRadius; }
123  Float_t GetMCPtHardCut() const { return fMCPtHardCut; }
124 
125  Double_t GetDistanceJetTrack(const AliEmcalJet* jet, const AliVParticle* track, Bool_t useInternalFlag = kTRUE) const;
126 
128  Double_t GetMCStrangenessFactorCMS(AliAODMCParticle* daughter, AliMCParticleContainer* mcParticleContainer) const;
129 
130  Double_t GetPerpendicularMomentumTrackJet(const AliEmcalJet* jet, const AliVParticle* track, Bool_t useInternalFlag = kTRUE) const;
131 
132  Bool_t IsSecondaryWithStrangeMotherMC(AliAODMCParticle* part, AliMCParticleContainer* mcParticleContainer);
133 
135  void SetNamesOfInclusivePIDtasks(Int_t numNames, const TString* names);
136 
137  const TString* GetNamesOfJetPIDtasks() const { return fNameJetPIDtask; };
138  void SetNamesOfJetPIDtasks(Int_t numNames, const TString* names);
139 
141  void SetNamesOfJetUEPIDtasks(Int_t numNames, const TString* names, const TString* methods = 0x0);
142 
143 
144  Bool_t GetIsPP() const { return fIsPP; };
145  void SetIsPP(Bool_t flag) { fIsPP = flag; };
146 
147  UInt_t GetRCTrials() const { return fRCTrials; }
148  void SetRCTrials(UInt_t trials) {fRCTrials = trials; }
149 
150  const TString* GetUEMethods() const { return fUEMethods; }
151  void SetUEMethods(const TString* names);
152 
154  void SetOnlyLeadingJets(Bool_t onlyLeadingJets) { fOnlyLeadingJets = onlyLeadingJets; }
155 
157  void RemoveJetContainer(const char* n) {fJetCollArray.Remove(GetJetContainer(n));}
158 
159 
160  protected:
161 
165  AliAODExtension *fAODExtension;
166  TString fNonStdFile; // name of delta aod file to catch the extension
167 
168  TString fCentralityEstimator; // Estimator for the Centrality, V0M is default, set to be V0A for pPb-collisions
169 
175 
176  Bool_t fUseAODInputJets; // take jets from in/output - only relevant if AOD event both in input AND output and we want to use output
177  Bool_t fUsePhysicsSelection; // switch for event selection
178  UInt_t fEvtSelectionMask; // trigger class selection
179  Int_t fEventClass; // centrality class selection
180  Float_t fMaxVertexZ; // maximum abs(z) position of primiary vertex [cm]
181 
182  Float_t fFFRadius; // if radius > 0 construct FF from tracks within cone around jet axis, otherwise use trackRefs
183  Float_t fFFMinLTrackPt; // reject jets with leading track with pt smaller than this value
184  Float_t fFFMaxTrackPt; // reject jets containing any track with pt larger than this value
185  Int_t fFFMinnTracks; // reject jets with less tracks than this value
186 
187  Float_t fAvgTrials; // average number of trials per event
188 
189  // histogram bins
190 
191  Bool_t fStoreXi; // Store Xi = -ln(z) explicitly
192  Bool_t fStudyTransversalJetStructure; // Store observables related to transversal jet structure
193 
194  // Histograms
195  TList *fCommonHistList; // List of common histos
196 
200  TH1F *fh1VertexZ;
201  TH1F *fh1EvtMult;
202  TH1F *fh1EvtCent;
203 
204  TProfile* fh1Xsec;
205  TH1F* fh1Trials;
206  TH1F* fh1PtHard;
208 
210 
212  TH1F *fh1nGenJets;
213 
216 
220 
221  TH2F *fhDCA_XY_prim_MCID[AliPID::kSPECIES];
222  TH2F *fhDCA_Z_prim_MCID[AliPID::kSPECIES];
223 
224  TH2F *fhDCA_XY_sec_MCID[AliPID::kSPECIES];
225  TH2F *fhDCA_Z_sec_MCID[AliPID::kSPECIES];
226 
227  TRandom3* fRandom;
228 
229  Bool_t fOnlyLeadingJets; // Flag indicating whether some histos are filled with leading jets only or all jets
230  Float_t fMCPtHardCut; // Cut on MC pThard (smaller that threshold), if set to non-negative value
231 
232  AliAnalysisUtils *fAnaUtils;
233 
234  // PID framework
235  Int_t fNumInclusivePIDtasks; // Number of inclusive PID tasks used
236  Int_t fNumJetPIDtasks; // Number of jet PID tasks used
237  Int_t fNumJetUEPIDtasks; // Number of jet UE PID tasks used
238 
239  TString* fNameInclusivePIDtask; //[fNumInclusivePIDtasks] Names of the tasks for inclusive PID spectra
240  TString* fNameJetPIDtask; //[fNumJetPIDtasks] Names of the tasks for jet PID spectra
241  TString* fNameJetUEPIDtask; //[fNumJetUEPIDtasks] Names of the tasks for jet UE PID spectra
242 
246 
247  Bool_t fUseInclusivePIDtask; // Process inclusive PID spectra?
248  Bool_t fUseJetPIDtask; // Process jet PID spectra?
249  Bool_t fUseJetUEPIDtask; // Process jet UE PID spectra?
250 
251  Bool_t fIsPP; // Is pp collision system? -> If yes, centrality will be set to -1
252 
253  Bool_t fFillDCA; //Shall the DCA histograms be filled?
254 
255  //Underlying event members
257  TString* fUEMethods; //[fNumJetUEPIDtasks] Names for the underlying event methods
258 
259 private:
260  AliAnalysisTaskIDFragmentationFunction(const AliAnalysisTaskIDFragmentationFunction&); //Not implemented in AliAnalysisTaskEmcalJet
261  AliAnalysisTaskIDFragmentationFunction& operator=(const AliAnalysisTaskIDFragmentationFunction); //Not implemented AliAnalysisTaskEmcalJet
262 
264 };
265 
266 
268 {
269  delete [] fNameInclusivePIDtask;
270  fNameInclusivePIDtask = 0x0;
271 
272  if (!names || numNames < 0) {
274  return;
275  }
276 
277  fNumInclusivePIDtasks = numNames;
278 
279  if (numNames > 0) {
280  fNameInclusivePIDtask = new TString[numNames];
281  SetUseInclusivePIDtask(kTRUE);
282 
283  for (Int_t i = 0; i < numNames; i++) {
284  fNameInclusivePIDtask[i] = names[i];
285  }
286  }
287 }
288 
290 {
291  delete [] fNameJetPIDtask;
292  fNameJetPIDtask = 0x0;
293 
294  if (!names || numNames < 0) {
295  fNumJetPIDtasks = 0;
296  return;
297  }
298 
299  fNumJetPIDtasks = numNames;
300 
301  if (numNames > 0) {
302  fNameJetPIDtask = new TString[numNames];
303  SetUseJetPIDtask(kTRUE);
304 
305  for (Int_t i = 0; i < numNames; i++) {
306  fNameJetPIDtask[i] = names[i];
307  }
308  }
309 }
310 
312 {
313  delete [] fNameJetUEPIDtask;
314  fNameJetUEPIDtask = 0x0;
315 
316  if (!names || numNames < 0) {
317  fNumJetUEPIDtasks = 0;
318  return;
319  }
320 
321  fNumJetUEPIDtasks = numNames;
322 
323  if (numNames > 0) {
324  fNameJetUEPIDtask = new TString[numNames];
325  SetUseJetUEPIDtask(kTRUE);
326 
327  for (Int_t i = 0; i < numNames; i++) {
328  fNameJetUEPIDtask[i] = names[i];
329  }
330 
331  if(methods) {
332  SetUEMethods(methods);
333  }
334  else {
335  TString* defaultMethods = 0x0;
336  switch(numNames) {
337  case 1:
338  defaultMethods = new TString[1];
339  defaultMethods[1] = "RC";
340  SetUEMethods(defaultMethods);
341  break;
342  case 2:
343  defaultMethods = new TString[2];
344  defaultMethods[1] = "RC";
345  defaultMethods[2] = "PC";
346  SetUEMethods(defaultMethods);
347  break;
348  default:
349  std::cout << "Too many Underlying event PID tasks to specify default methods. Please specify them yourselves for each task by giving TString array as third argument in SetNamesOfJetUEPIDtasks!" << std::endl;
350  break;
351  }
352  delete defaultMethods;
353  defaultMethods = 0x0;
354  }
355  }
356 }
357 
359  if (fNumJetUEPIDtasks < 1) {
360  std::cout << "Number of Underlying event PID tasks has to be greater than 0 to set the methods" << std::endl;
361  return;
362  }
363  delete [] fUEMethods;
364  fUEMethods = 0x0;
365  if (!names) {
366  return;
367  }
368 
370 
371  for (Int_t i = 0; i < fNumJetUEPIDtasks; ++i) {
372  fUEMethods[i] = names[i];
373  }
374 }
375 
376 #endif
TString fNonStdFile
where we take the jets from can be input or output AOD
TH1F * fh1EvtCent
number of reconstructed tracks after cuts
double Double_t
Definition: External.C:58
Definition: External.C:260
static void SetProperties(TH1 *h, const char *x, const char *y)
TH1F * fh1nGenJets
number of jets from reconstructed tracks per event
Definition: External.C:236
AliJetContainer * GetJetContainer(Int_t i=0) const
void SetNamesOfJetPIDtasks(Int_t numNames, const TString *names)
virtual void AnalyseJetTrack(AliVTrack *track, AliEmcalJet *jet, AliAnalysisTaskPID *task, const Bool_t *trackRejectedByTask, Double_t centPercent, AliMCParticleContainer *mcParticleContainer=0x0)
TH2F * fhDCA_XY_sec_MCID[AliPID::kSPECIES]
DCA Z for all rec. prim. particles sorted by MC-ID.
ClassDef(AliAnalysisTaskIDFragmentationFunction, 23)
AliAnalysisTaskPID ** fJetUEPIDtask
Pointer to tasks for jet PID spectra.
Int_t fNumInclusivePIDtasks
Object to use analysis utils like pile-up rejection.
TCanvas * c
Definition: TestFitELoss.C:172
Double_t GetDistanceJetTrack(const AliEmcalJet *jet, const AliVParticle *track, Bool_t useInternalFlag=kTRUE) const
Bool_t IsSecondaryWithStrangeMotherMC(AliAODMCParticle *part, AliMCParticleContainer *mcParticleContainer)
Container for particles within the EMCAL framework.
virtual TList * GetUEJetsWithRandomConeMethod(AliJetContainer *jetContainer, Double_t coneRadius, Double_t maxEtaTrack)
TObjArray fParticleCollArray
particle/track collection array
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Double_t GetMCStrangenessFactorCMS(AliAODMCParticle *daughter, AliMCParticleContainer *mcParticleContainer) const
virtual Bool_t IsRCJCOverlap(const AliVParticle *part, Double_t dDistance) const
int Int_t
Definition: External.C:63
void SetNamesOfInclusivePIDtasks(Int_t numNames, const TString *names)
TH2F * fhDCA_Z_sec_MCID[AliPID::kSPECIES]
DCA XY for all rec. sec. particles sorted by MC-ID.
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Bool_t fUseInclusivePIDtask
Pointer to tasks for jet UE PID spectra.
TRandom3 * fRandom
DCA Z for all rec. sec. particles sorted by MC-ID.
Double_t GetPerpendicularMomentumTrackJet(const AliEmcalJet *jet, const AliVParticle *track, Bool_t useInternalFlag=kTRUE) const
AliAnalysisTaskPID ** fJetPIDtask
Pointer to tasks for inclusive PID spectra.
virtual void FillDCA(AliVTrack *track, AliMCParticleContainer *mcParticleContainer)
TH2F * fhJetPtRefMultEta8
Jet pT vs. reference multiplicity (|eta|<0.5)
TObjArray fJetCollArray
jet collection array
virtual void PerformJetMonteCarloAnalysisGeneratedYield(AliEmcalJet *jet, AliVParticle *trackVP, AliAnalysisTaskPID *task, Double_t centPercent, AliJetContainer *mcJetContainer=0x0)
virtual AliEmcalJet * GetPerpendicularCone(AliEmcalJet *processedJet, Double_t perpAngle) const
TH2F * fhJetPtMultPercent
Jet pT vs. reference multiplicity (|eta|<0.8)
TH2F * fhDCA_XY_prim_MCID[AliPID::kSPECIES]
Jet pT vs. multiplicity percentile (usually V0M)
void SetNamesOfJetUEPIDtasks(Int_t numNames, const TString *names, const TString *methods=0x0)
virtual TList * GetUEJetsWithPerpendicularConeMethod(AliJetContainer *jetContainer)
TH1F * fh1nRecJetsCuts
Number events before and after the cut on MC pT hard.
AliAODExtension * fAODExtension
AOD event with jet branch (case we have AOD both in input and output)
Base task in the EMCAL jet framework.
Bool_t IsParticleInCone(const AliVParticle *part1, const AliVParticle *part2, Double_t dRMax) const
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
virtual AliEmcalJet * GetRandomCone(AliEmcalJet *processedJet, Double_t dEtaConeMax, Double_t dDistance) const
const char Option_t
Definition: External.C:48
virtual TList * GetTracksInCone(const AliEmcalJet *jet, AliParticleContainer *particleContainer=0x0) const
AliAnalysisTaskIDFragmentationFunction & operator=(const AliAnalysisTaskIDFragmentationFunction)
bool Bool_t
Definition: External.C:53
Bool_t fOnlyLeadingJets
TRandom3 for background estimation.
TH2F * fhDCA_XY
number of jets from generated tracks per event
TH2F * fhDCA_Z_prim_MCID[AliPID::kSPECIES]
DCA XY for all rec. prim. particles sorted by MC-ID.
Container for MC-true particles within the EMCAL framework.
Container for jet within the EMCAL jet framework.
Definition: External.C:196