AliPhysics  8bb951a (8bb951a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalJetTask.h
Go to the documentation of this file.
1 #ifndef ALIEMCALJETTASK_H
2 #define ALIEMCALJETTASK_H
3 
4 class TClonesArray;
5 class TObjArray;
6 class AliVEvent;
7 class AliEMCALGeometry;
9 
10 #include "AliLog.h"
11 #include "AliAnalysisTaskEmcal.h"
12 #include "AliFJWrapper.h"
13 #include "FJ_includes.h"
14 #include "AliAODMCParticle.h"
15 #include "AliEmcalJet.h"
16 #include "AliJetContainer.h"
17 
18 namespace fastjet {
19  class PseudoJet;
20 }
21 
23  public:
24 
28 
29 #if !defined(__CINT__) && !defined(__MAKECINT__)
30  typedef fastjet::JetAlgorithm FJJetAlgo;
31  typedef fastjet::RecombinationScheme FJRecoScheme;
32 #endif
33 
35  AliEmcalJetTask(const char *name);
36  virtual ~AliEmcalJetTask();
37 
38  Bool_t Run();
39 
40  void SetGhostArea(Double_t gharea) { if (IsLocked()) return; fGhostArea = gharea; }
41  void SetJetsName(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
42  void SetJetEtaRange(Double_t emi, Double_t ema) { if (IsLocked()) return; fJetEtaMin = emi ; fJetEtaMax = ema; }
43  void SetJetPhiRange(Double_t pmi, Double_t pma) { if (IsLocked()) return; fJetPhiMin = pmi ; fJetPhiMax = pma; }
44  void SetJetAlgo(EJetAlgo_t a) { if (IsLocked()) return; fJetAlgo = a ; }
45  void SetJetType(EJetType_t t) { if (IsLocked()) return; fJetType = t ; }
46  void SetLocked() { fLocked = kTRUE;}
47  void SetMinJetArea(Double_t a) { if (IsLocked()) return; fMinJetArea = a ; }
48  void SetMinJetPt(Double_t j) { if (IsLocked()) return; fMinJetPt = j ; }
49  void SetRecombScheme(ERecoScheme_t scheme) { if (IsLocked()) return; fRecombScheme = scheme; }
50  void SetTrackEfficiency(Double_t t) { if (IsLocked()) return; fTrackEfficiency = t ; }
51  void SetLegacyMode(Bool_t mode) { if (IsLocked()) return; fLegacyMode = mode ; }
52  void SetFillGhost(Bool_t b=kTRUE) { if (IsLocked()) return; fFillGhost = b ; }
53  void SetRadius(Double_t r) { if (IsLocked()) return; fRadius = r ; }
54 
55  void SetEtaRange(Double_t emi, Double_t ema);
56  void SetMinJetClusPt(Double_t min);
57  void SetMinJetClusE(Double_t min);
58  void SetMinJetTrackPt(Double_t min);
59  void SetPhiRange(Double_t pmi, Double_t pma);
60 
62 
63  Double_t GetGhostArea() { return fGhostArea ; }
64  const char* GetJetsName() { return fJetsName.Data() ; }
65  Double_t GetJetEtaMin() { return fJetEtaMin ; }
66  Double_t GetJetEtaMax() { return fJetEtaMax ; }
67  Double_t GetJetPhiMin() { return fJetPhiMin ; }
68  Double_t GetJetPhiMax() { return fJetPhiMax ; }
69  UInt_t GetJetType() { return fJetType ; }
70  UInt_t GetJetAlgo() { return fJetAlgo ; }
71  Bool_t GetLegacyMode() { return fLegacyMode ; }
72  Double_t GetMinJetArea() { return fMinJetArea ; }
73  Double_t GetMinJetPt() { return fMinJetPt ; }
74  Int_t GetMinMCLabel() { return fMinMCLabel ; }
75  Double_t GetRadius() { return fRadius ; }
76  Int_t GetRecombScheme() { return fRecombScheme ; }
77  Double_t GetTrackEfficiency() { return fTrackEfficiency ; }
78 
79  TClonesArray* GetJets() { return fJets ; }
80  TObjArray* GetUtilities() { return fUtilities ; }
81 
82  void FillJetConstituents(AliEmcalJet *jet, std::vector<fastjet::PseudoJet>& constituents,
83  std::vector<fastjet::PseudoJet>& constituents_sub, Int_t flag = 0, TClonesArray *particles_sub = 0);
84 
85  Int_t GetIndexSub(Double_t phi_sub, std::vector<fastjet::PseudoJet>& constituents_unsub);
86 
87  Bool_t IsLocked() const;
88  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
89  void SetType(Int_t t);
90 
91 #if !defined(__CINT__) && !defined(__MAKECINT__)
94 #endif
95 
96  protected:
97 
98  Int_t FindJets();
99  void FillJetBranch();
100  void ExecOnce();
101  void InitUtilities();
102  void PrepareUtilities();
103  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
104  void TerminateUtilities();
105  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
106 
107  TString fJetsTag; // tag of jet collection (usually = "Jets")
108 
109  EJetType_t fJetType; // jet type (full, charged, neutral)
110  EJetAlgo_t fJetAlgo; // jet algorithm (kt, akt, etc)
111  ERecoScheme_t fRecombScheme; // recombination scheme used by fastjet
112  Double_t fRadius; // jet radius
113  Double_t fMinJetArea; // min area to keep jet in output
114  Double_t fMinJetPt; // min jet pt to keep jet in output
115  Double_t fJetPhiMin; // minimum phi to keep jet in output
116  Double_t fJetPhiMax; // maximum phi to keep jet in output
117  Double_t fJetEtaMin; // minimum eta to keep jet in output
118  Double_t fJetEtaMax; // maximum eta to keep jet in output
119  Double_t fGhostArea; // ghost area
120  Double_t fTrackEfficiency; // artificial tracking inefficiency (0...1)
121  TObjArray *fUtilities; // jet utilities (gen subtractor, constituent subtractor etc.)
122  Bool_t fLocked; // true if lock is set
123 
124  TString fJetsName;
125  Bool_t fIsInit;
126  Bool_t fIsPSelSet;
127  Bool_t fIsEmcPart;
128  Bool_t fLegacyMode;
129  Bool_t fFillGhost;
130 
131  TClonesArray *fJets;
133 
134  static const Int_t fgkConstIndexShift;
135 
136  private:
137  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
138  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
139 
140  ClassDef(AliEmcalJetTask, 23) // Jet producing task
141 };
142 #endif
void SetJetsName(const char *n)
void SetRecombScheme(ERecoScheme_t scheme)
TClonesArray * fJets
=true ghost particles will be filled in AliEmcalJet obj
Double_t GetJetPhiMax()
Double_t GetJetEtaMin()
void SetMinJetArea(Double_t a)
void SetJetPhiRange(Double_t pmi, Double_t pma)
Bool_t fIsEmcPart
=true if physics selection was set
void SetEtaRange(Double_t emi, Double_t ema)
Bool_t IsLocked() const
Bool_t fIsInit
name of jet collection
Base task in the EMCAL framework.
EJetType_t fJetType
AliJetContainer::ERecoScheme_t ERecoScheme_t
void FillJetConstituents(AliEmcalJet *jet, std::vector< fastjet::PseudoJet > &constituents, std::vector< fastjet::PseudoJet > &constituents_sub, Int_t flag=0, TClonesArray *particles_sub=0)
AliEmcalJetUtility * AddUtility(AliEmcalJetUtility *utility)
Bool_t fFillGhost
=true to enable FJ 2.x behavior
const char * GetJetsName()
void SetLegacyMode(Bool_t mode)
void SetJetType(EJetType_t t)
void ExecuteUtilities(AliEmcalJet *jet, Int_t ij)
Double_t GetTrackEfficiency()
void SetMinJetPt(Double_t j)
Double_t GetRadius()
ERecoScheme_t fRecombScheme
Double_t fTrackEfficiency
Double_t GetMinJetArea()
void SetJetAlgo(EJetAlgo_t a)
virtual ~AliEmcalJetTask()
Int_t GetRecombScheme()
void SetTrackEfficiency(Double_t t)
Double_t GetMinJetPt()
static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco)
void SetJetEtaRange(Double_t emi, Double_t ema)
Bool_t fIsPSelSet
=true if already initialized
TObjArray * fUtilities
AliJetContainer::EJetAlgo_t EJetAlgo_t
Bool_t GetSortedArray(Int_t indexes[], std::vector< fastjet::PseudoJet > array) const
Int_t mode
Definition: anaM.C:40
TObjArray * GetUtilities()
Int_t fMinMCLabel
minimum MC label value for the tracks/clusters being considered MC particles
void SetMinJetClusE(Double_t min)
void SetType(Int_t t)
void SelectCollisionCandidates(UInt_t offlineTriggerMask=AliVEvent::kMB)
void SetGhostArea(Double_t gharea)
EJetAlgo_t fJetAlgo
static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo)
void SetMinJetTrackPt(Double_t min)
Bool_t GetLegacyMode()
void SetFillGhost(Bool_t b=kTRUE)
AliEmcalJetTask & operator=(const AliEmcalJetTask &)
Bool_t fLegacyMode
=true if emcal particles are given as input (for clusters)
Double_t GetJetPhiMin()
void SetMinJetClusPt(Double_t min)
Double_t GetJetEtaMax()
fastjet::JetAlgorithm FJJetAlgo
Int_t GetIndexSub(Double_t phi_sub, std::vector< fastjet::PseudoJet > &constituents_unsub)
void SetPhiRange(Double_t pmi, Double_t pma)
fastjet::RecombinationScheme FJRecoScheme
TClonesArray * GetJets()
void SetRadius(Double_t r)
AliFJWrapper fFastJetWrapper
jet collection
Double_t GetGhostArea()
static const Int_t fgkConstIndexShift
fastjet wrapper
AliJetContainer::EJetType_t EJetType_t