AliPhysics  9df6235 (9df6235)
AliEmcalJetTask.h
Go to the documentation of this file.
1 #ifndef ALIEMCALJETTASK_H
2 #define ALIEMCALJETTASK_H
3 
4 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
7 class TClonesArray;
8 class TObjArray;
9 class AliVEvent;
10 class AliEmcalJetUtility;
11 
12 #include "TF1.h"
13 
14 #include <AliLog.h>
15 
16 #include "AliAnalysisTaskEmcal.h"
17 #include "AliFJWrapper.h"
18 #include "FJ_includes.h"
19 #include "AliEmcalJet.h"
20 #include "AliJetContainer.h"
21 #if !(defined(__CINT__) || defined(__MAKECINT__))
23 #endif
24 
25 namespace fastjet {
26  class PseudoJet;
27 }
28 
51  public:
52 
56 
57 #if !defined(__CINT__) && !defined(__MAKECINT__)
58  typedef fastjet::JetAlgorithm FJJetAlgo;
59  typedef fastjet::RecombinationScheme FJRecoScheme;
60 #endif
61 
63  AliEmcalJetTask(const char *name);
64  virtual ~AliEmcalJetTask();
65 
66  Bool_t Run();
67 
68  void SetGhostArea(Double_t gharea) { if (IsLocked()) return; fGhostArea = gharea; }
69  void SetJetsName(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
70  void SetJetsTag(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
71  void SetJetEtaRange(Double_t emi, Double_t ema) { if (IsLocked()) return; fJetEtaMin = emi ; fJetEtaMax = ema; }
72  void SetJetPhiRange(Double_t pmi, Double_t pma) { if (IsLocked()) return; fJetPhiMin = pmi ; fJetPhiMax = pma; }
73  void SetJetAlgo(EJetAlgo_t a) { if (IsLocked()) return; fJetAlgo = a ; }
74  void SetJetType(EJetType_t t) { if (IsLocked()) return; fJetType = t ; }
75  void SetLocked() { fLocked = kTRUE;}
76  void SetMinJetArea(Double_t a) { if (IsLocked()) return; fMinJetArea = a ; }
77  void SetMinJetPt(Double_t j) { if (IsLocked()) return; fMinJetPt = j ; }
78  void SetRecombScheme(ERecoScheme_t scheme) { if (IsLocked()) return; fRecombScheme = scheme; }
79  void SetTrackEfficiency(Double_t t) { if (IsLocked()) return; fTrackEfficiency = t ; }
80  void SetTrackEfficiencyOnlyForEmbedding(Bool_t b) { if (IsLocked()) return; fTrackEfficiencyOnlyForEmbedding = b ; }
81  void SetLegacyMode(Bool_t mode) { if (IsLocked()) return; fLegacyMode = mode ; }
82  void SetFillGhost(Bool_t b=kTRUE) { if (IsLocked()) return; fFillGhost = b ; }
83  void SetRadius(Double_t r) { if (IsLocked()) return; fRadius = r ; }
84 
85  void SetEtaRange(Double_t emi, Double_t ema);
86  void SetMinJetClusPt(Double_t min);
87  void SetMinJetClusE(Double_t min);
88  void SetMinJetTrackPt(Double_t min);
89  void SetPhiRange(Double_t pmi, Double_t pma);
90 
91  AliEmcalJetUtility* AddUtility(AliEmcalJetUtility* utility);
92 
93  Double_t GetGhostArea() { return fGhostArea ; }
94  const char* GetJetsName() { return fJetsName.Data() ; }
95  const char* GetJetsTag() { return fJetsTag.Data() ; }
96  Double_t GetJetEtaMin() { return fJetEtaMin ; }
97  Double_t GetJetEtaMax() { return fJetEtaMax ; }
98  Double_t GetJetPhiMin() { return fJetPhiMin ; }
99  Double_t GetJetPhiMax() { return fJetPhiMax ; }
100  UInt_t GetJetType() { return fJetType ; }
101  UInt_t GetJetAlgo() { return fJetAlgo ; }
102  Bool_t GetLegacyMode() { return fLegacyMode ; }
103  Double_t GetMinJetArea() { return fMinJetArea ; }
104  Double_t GetMinJetPt() { return fMinJetPt ; }
105  Int_t GetMinMCLabel() { return fMinMCLabel ; }
106  Double_t GetRadius() { return fRadius ; }
107  Int_t GetRecombScheme() { return fRecombScheme ; }
108  Double_t GetTrackEfficiency() { return fTrackEfficiency ; }
109  Bool_t GetTrackEfficiencyOnlyForEmbedding() { return fTrackEfficiencyOnlyForEmbedding; }
110 
111  TClonesArray* GetJets() { return fJets ; }
112  TObjArray* GetUtilities() { return fUtilities ; }
113 
114  void FillJetConstituents(AliEmcalJet *jet, std::vector<fastjet::PseudoJet>& constituents,
115  std::vector<fastjet::PseudoJet>& constituents_sub, Int_t flag = 0, TString particlesSubName = "");
116 
117  UInt_t FindJetAcceptanceType(Double_t eta, Double_t phi, Double_t r);
118 
119  void LoadTrackEfficiencyFunction(const std::string & path, const std::string & name);
120 
121  Bool_t IsLocked() const;
122  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
123  void SetType(Int_t t);
124 
132  void SetFillJetConsituents(Bool_t doFill) { fFillConstituents = doFill; }
133 
134  static AliEmcalJetTask* AddTaskEmcalJet(
135  const TString nTracks = "usedefault",
136  const TString nClusters = "usedefault",
138  const Double_t radius = 0.4,
140  const Double_t minTrPt = 0.15,
141  const Double_t minClPt = 0.30,
142  const Double_t ghostArea = 0.005,
144  const TString tag = "Jet",
145  const Double_t minJetPt = 0.,
146  const Bool_t lockTask = kTRUE,
147  const Bool_t bFillGhosts = kFALSE
148  );
149 
150 #if !defined(__CINT__) && !defined(__MAKECINT__)
151  static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo);
152  static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco);
153 #endif
154 
155  protected:
156 
157  Int_t FindJets();
158  void FillJetBranch();
159  void ExecOnce();
160  void InitEvent();
161  void InitUtilities();
162  void PrepareUtilities();
163  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
164  void TerminateUtilities();
165  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
166  Bool_t IsJetInEmcal(Double_t eta, Double_t phi, Double_t r);
167  Bool_t IsJetInDcal(Double_t eta, Double_t phi, Double_t r);
168  Bool_t IsJetInDcalOnly(Double_t eta, Double_t phi, Double_t r);
169  Bool_t IsJetInPhos(Double_t eta, Double_t phi, Double_t r);
170 
172 
173  EJetType_t fJetType;
174  EJetAlgo_t fJetAlgo;
175  ERecoScheme_t fRecombScheme;
187  //TF1 fTrackEfficiencyFunction;///< Function that describes the artificial tracking efficiency to be applied on top of the nominal tracking efficiency, as a function of track pT
191 
198 
199  TClonesArray *fJets;
201 
202  static const Int_t fgkConstIndexShift;
203 
204 #if !(defined(__CINT__) || defined(__MAKECINT__))
205  // Handle mapping between index and containers
208 #endif
209 
210  private:
211  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
212  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
213 
215  ClassDef(AliEmcalJetTask, 27);
217 };
218 #endif
Bool_t fTrackEfficiencyOnlyForEmbedding
Apply aritificial tracking inefficiency only for embedded tracks.
void SetJetsName(const char *n)
void SetRecombScheme(ERecoScheme_t scheme)
TClonesArray * fJets
!jet collection
double Double_t
Definition: External.C:58
Double_t GetJetPhiMax()
Double_t GetJetEtaMin()
void SetMinJetArea(Double_t a)
void SetJetPhiRange(Double_t pmi, Double_t pma)
Bool_t fIsEmcPart
!=true if emcal particles are given as input (for clusters)
Bool_t fIsInit
!=true if already initialized
Base task in the EMCAL framework.
Double_t fJetEtaMin
minimum eta to keep jet in output
EJetType_t fJetType
jet type (full, charged, neutral)
AliJetContainer::ERecoScheme_t ERecoScheme_t
Bool_t fApplyArtificialTrackingEfficiency
Flag to apply artificial tracking efficiency.
Bool_t fFillGhost
=true ghost particles will be filled in AliEmcalJet obj
const char * GetJetsName()
void SetLegacyMode(Bool_t mode)
void SetJetType(EJetType_t t)
Double_t GetTrackEfficiency()
void SetMinJetPt(Double_t j)
Double_t GetRadius()
AliEmcalContainerIndexMap< AliParticleContainer, AliVParticle > fParticleContainerIndexMap
! Mapping between index and particle containers
ERecoScheme_t fRecombScheme
recombination scheme used by fastjet
Bool_t fFillConstituents
If true jet consituents will be filled to the AliEmcalJet.
Double_t fTrackEfficiency
artificial tracking inefficiency (0...1)
Double_t GetMinJetArea()
void SetJetAlgo(EJetAlgo_t a)
Bool_t GetTrackEfficiencyOnlyForEmbedding()
void SetTrackEfficiency(Double_t t)
Double_t GetMinJetPt()
General jet finder task implementing a wrapper for FastJet.
void SetJetEtaRange(Double_t emi, Double_t ema)
Bool_t fIsPSelSet
!=true if physics selection was set
Bool_t fLocked
true if lock is set
Double_t fJetPhiMin
minimum phi to keep jet in output
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TString fJetsTag
tag of jet collection (usually = "Jets")
TObjArray * fUtilities
jet utilities (gen subtractor, constituent subtractor etc.)
void SetTrackEfficiencyOnlyForEmbedding(Bool_t b)
AliEmcalContainerIndexMap< AliClusterContainer, AliVCluster > fClusterContainerIndexMap
! Mapping between index and cluster containers
AliJetContainer::EJetAlgo_t EJetAlgo_t
Double_t fJetEtaMax
maximum eta to keep jet in output
Double_t fGhostArea
ghost area
Int_t mode
Definition: anaM.C:41
TObjArray * GetUtilities()
void SetGhostArea(Double_t gharea)
EJetAlgo_t fJetAlgo
jet algorithm (kt, akt, etc)
Double_t fJetPhiMax
maximum phi to keep jet in output
void SetJetsTag(const char *n)
Double_t fMinJetArea
min area to keep jet in output
Bool_t GetLegacyMode()
TString fJetsName
!name of jet collection
void SetFillGhost(Bool_t b=kTRUE)
Double_t fMinJetPt
min jet pt to keep jet in output
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
Double_t fRadius
jet radius
Bool_t fLegacyMode
!=true to enable FJ 2.x behavior
Double_t GetJetPhiMin()
Double_t GetJetEtaMax()
fastjet::JetAlgorithm FJJetAlgo
bool Bool_t
Definition: External.C:53
fastjet::RecombinationScheme FJRecoScheme
TClonesArray * GetJets()
void SetFillJetConsituents(Bool_t doFill)
Switch for whether to fill the AliEmcalJetConstituent objects (clusters and particles/tracks) ...
void SetRadius(Double_t r)
AliFJWrapper fFastJetWrapper
!fastjet wrapper
const char * GetJetsTag()
Double_t GetGhostArea()
static const Int_t fgkConstIndexShift
!contituent index shift
AliJetContainer::EJetType_t EJetType_t