AliPhysics  27f281d (27f281d)
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 #include "TRandom3.h"
14 
15 #include <AliLog.h>
16 
17 #include "AliAnalysisTaskEmcal.h"
18 #include "AliFJWrapper.h"
19 #include "FJ_includes.h"
20 #include "AliEmcalJet.h"
21 #include "AliJetContainer.h"
22 #if !(defined(__CINT__) || defined(__MAKECINT__))
24 #endif
25 
26 namespace fastjet {
27  class PseudoJet;
28 }
29 
52  public:
53 
57 
58 #if !defined(__CINT__) && !defined(__MAKECINT__)
59  typedef fastjet::JetAlgorithm FJJetAlgo;
60  typedef fastjet::RecombinationScheme FJRecoScheme;
61 #endif
62 
64  AliEmcalJetTask(const char *name);
65  virtual ~AliEmcalJetTask();
66 
67  Bool_t Run();
68 
69  void SetGhostArea(Double_t gharea) { if (IsLocked()) return; fGhostArea = gharea; }
70  void SetJetsName(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
71  void SetJetsTag(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
72  void SetJetEtaRange(Double_t emi, Double_t ema) { if (IsLocked()) return; fJetEtaMin = emi ; fJetEtaMax = ema; }
73  void SetJetPhiRange(Double_t pmi, Double_t pma) { if (IsLocked()) return; fJetPhiMin = pmi ; fJetPhiMax = pma; }
74  void SetJetAlgo(EJetAlgo_t a) { if (IsLocked()) return; fJetAlgo = a ; }
75  void SetJetType(EJetType_t t) { if (IsLocked()) return; fJetType = t ; }
76  void SetLocked() { fLocked = kTRUE;}
77  void SetMinJetArea(Double_t a) { if (IsLocked()) return; fMinJetArea = a ; }
78  void SetMinJetPt(Double_t j) { if (IsLocked()) return; fMinJetPt = j ; }
79  void SetRecombScheme(ERecoScheme_t scheme) { if (IsLocked()) return; fRecombScheme = scheme; }
80  void SetTrackEfficiency(Double_t t) { if (IsLocked()) return; fTrackEfficiency = t ; }
81  void SetTrackEfficiencyOnlyForEmbedding(Bool_t b) { if (IsLocked()) return; fTrackEfficiencyOnlyForEmbedding = b ; }
82  void SetEnableAliBasicParticleCompatibility(Bool_t b) { if (IsLocked()) return; fEnableAliBasicParticleCompatibility = b; }
83  void SetLegacyMode(Bool_t mode) { if (IsLocked()) return; fLegacyMode = mode ; }
84  void SetFillGhost(Bool_t b=kTRUE) { if (IsLocked()) return; fFillGhost = b ; }
85  void SetRadius(Double_t r) { if (IsLocked()) return; fRadius = r ; }
86 
87  void SetEtaRange(Double_t emi, Double_t ema);
88  void SetMinJetClusPt(Double_t min);
89  void SetMinJetClusE(Double_t min);
90  void SetMinJetTrackPt(Double_t min);
91  void SetPhiRange(Double_t pmi, Double_t pma);
92 
93  AliEmcalJetUtility* AddUtility(AliEmcalJetUtility* utility);
94 
95  Double_t GetGhostArea() { return fGhostArea ; }
96  const char* GetJetsName() { return fJetsName.Data() ; }
97  const char* GetJetsTag() { return fJetsTag.Data() ; }
98  Double_t GetJetEtaMin() { return fJetEtaMin ; }
99  Double_t GetJetEtaMax() { return fJetEtaMax ; }
100  Double_t GetJetPhiMin() { return fJetPhiMin ; }
101  Double_t GetJetPhiMax() { return fJetPhiMax ; }
102  UInt_t GetJetType() { return fJetType ; }
103  UInt_t GetJetAlgo() { return fJetAlgo ; }
104  Bool_t GetLegacyMode() { return fLegacyMode ; }
105  Double_t GetMinJetArea() { return fMinJetArea ; }
106  Double_t GetMinJetPt() { return fMinJetPt ; }
107  Int_t GetMinMCLabel() { return fMinMCLabel ; }
108  Double_t GetRadius() { return fRadius ; }
109  Int_t GetRecombScheme() { return fRecombScheme ; }
110  Double_t GetTrackEfficiency() { return fTrackEfficiency ; }
111  Bool_t GetTrackEfficiencyOnlyForEmbedding() { return fTrackEfficiencyOnlyForEmbedding; }
112 
113  TClonesArray* GetJets() { return fJets ; }
114  TObjArray* GetUtilities() { return fUtilities ; }
115 
116  void FillJetConstituents(AliEmcalJet *jet, std::vector<fastjet::PseudoJet>& constituents,
117  std::vector<fastjet::PseudoJet>& constituents_sub, Int_t flag = 0, TString particlesSubName = "");
118 
119  UInt_t FindJetAcceptanceType(Double_t eta, Double_t phi, Double_t r);
120 
121  void LoadTrackEfficiencyFunction(const std::string & path, const std::string & name);
122 
123  Bool_t IsLocked() const;
124  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
125  void SetType(Int_t t);
126 
134  void SetFillJetConsituents(Bool_t doFill) { fFillConstituents = doFill; }
135 
136  static AliEmcalJetTask* AddTaskEmcalJet(
137  const TString nTracks = "usedefault",
138  const TString nClusters = "usedefault",
140  const Double_t radius = 0.4,
142  const Double_t minTrPt = 0.15,
143  const Double_t minClPt = 0.30,
144  const Double_t ghostArea = 0.005,
146  const TString tag = "Jet",
147  const Double_t minJetPt = 0.,
148  const Bool_t lockTask = kTRUE,
149  const Bool_t bFillGhosts = kFALSE
150  );
151 
152 #if !defined(__CINT__) && !defined(__MAKECINT__)
153  static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo);
154  static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco);
155 #endif
156 
157  protected:
158 
159  Int_t FindJets();
160  void FillJetBranch();
161  void ExecOnce();
162  void InitEvent();
163  void InitUtilities();
164  void PrepareUtilities();
165  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
166  void TerminateUtilities();
167  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
168  Bool_t IsJetInEmcal(Double_t eta, Double_t phi, Double_t r);
169  Bool_t IsJetInDcal(Double_t eta, Double_t phi, Double_t r);
170  Bool_t IsJetInDcalOnly(Double_t eta, Double_t phi, Double_t r);
171  Bool_t IsJetInPhos(Double_t eta, Double_t phi, Double_t r);
172 
174 
175  EJetType_t fJetType;
176  EJetAlgo_t fJetAlgo;
177  ERecoScheme_t fRecombScheme;
191  TRandom3 fRandom;
194 
202 
203  TClonesArray *fJets;
205 
206  static const Int_t fgkConstIndexShift;
207 
208 #if !(defined(__CINT__) || defined(__MAKECINT__))
209  // Handle mapping between index and containers
212 #endif
213 
214  private:
215  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
216  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
217 
219  ClassDef(AliEmcalJetTask, 29);
221 };
222 #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
Bool_t fEnableAliBasicParticleCompatibility
Flag to allow compatibility with AliBasicParticle constituents.
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.)
TF1 * fTrackEfficiencyFunction
Function that describes the artificial tracking efficiency to be applied on top of the nominal tracki...
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 SetEnableAliBasicParticleCompatibility(Bool_t b)
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
TRandom3 fRandom
! Random number generator for artificial tracking efficiency
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