AliPhysics  97a96ce (97a96ce)
 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 /* 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 <AliLog.h>
13 
14 #include "AliAnalysisTaskEmcal.h"
15 #include "AliFJWrapper.h"
16 #include "FJ_includes.h"
17 #include "AliEmcalJet.h"
18 #include "AliJetContainer.h"
19 
20 namespace fastjet {
21  class PseudoJet;
22 }
23 
46  public:
47 
51 
52 #if !defined(__CINT__) && !defined(__MAKECINT__)
53  typedef fastjet::JetAlgorithm FJJetAlgo;
54  typedef fastjet::RecombinationScheme FJRecoScheme;
55 #endif
56 
58  AliEmcalJetTask(const char *name);
59  virtual ~AliEmcalJetTask();
60 
61  Bool_t Run();
62 
63  void SetGhostArea(Double_t gharea) { if (IsLocked()) return; fGhostArea = gharea; }
64  void SetJetsName(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
65  void SetJetEtaRange(Double_t emi, Double_t ema) { if (IsLocked()) return; fJetEtaMin = emi ; fJetEtaMax = ema; }
66  void SetJetPhiRange(Double_t pmi, Double_t pma) { if (IsLocked()) return; fJetPhiMin = pmi ; fJetPhiMax = pma; }
67  void SetJetAlgo(EJetAlgo_t a) { if (IsLocked()) return; fJetAlgo = a ; }
68  void SetJetType(EJetType_t t) { if (IsLocked()) return; fJetType = t ; }
69  void SetLocked() { fLocked = kTRUE;}
70  void SetMinJetArea(Double_t a) { if (IsLocked()) return; fMinJetArea = a ; }
71  void SetMinJetPt(Double_t j) { if (IsLocked()) return; fMinJetPt = j ; }
72  void SetRecombScheme(ERecoScheme_t scheme) { if (IsLocked()) return; fRecombScheme = scheme; }
73  void SetTrackEfficiency(Double_t t) { if (IsLocked()) return; fTrackEfficiency = t ; }
74  void SetLegacyMode(Bool_t mode) { if (IsLocked()) return; fLegacyMode = mode ; }
75  void SetFillGhost(Bool_t b=kTRUE) { if (IsLocked()) return; fFillGhost = b ; }
76  void SetRadius(Double_t r) { if (IsLocked()) return; fRadius = r ; }
77 
78  void SetEtaRange(Double_t emi, Double_t ema);
79  void SetMinJetClusPt(Double_t min);
80  void SetMinJetClusE(Double_t min);
81  void SetMinJetTrackPt(Double_t min);
82  void SetPhiRange(Double_t pmi, Double_t pma);
83 
85 
87  const char* GetJetsName() { return fJetsName.Data() ; }
92  UInt_t GetJetType() { return fJetType ; }
93  UInt_t GetJetAlgo() { return fJetAlgo ; }
98  Double_t GetRadius() { return fRadius ; }
101 
102  TClonesArray* GetJets() { return fJets ; }
104 
105  void FillJetConstituents(AliEmcalJet *jet, std::vector<fastjet::PseudoJet>& constituents,
106  std::vector<fastjet::PseudoJet>& constituents_sub, Int_t flag = 0, TClonesArray *particles_sub = 0);
107 
109 
110  Int_t GetIndexSub(Double_t phi_sub, std::vector<fastjet::PseudoJet>& constituents_unsub);
111 
112  Bool_t IsLocked() const;
113  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
114  void SetType(Int_t t);
115 
116 #if !defined(__CINT__) && !defined(__MAKECINT__)
117  static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo);
119 #endif
120 
121  protected:
122 
123  Int_t FindJets();
124  void FillJetBranch();
125  void ExecOnce();
126  void InitUtilities();
127  void PrepareUtilities();
128  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
129  void TerminateUtilities();
130  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
133 
134  TString fJetsTag; // tag of jet collection (usually = "Jets")
135 
136  EJetType_t fJetType; // jet type (full, charged, neutral)
137  EJetAlgo_t fJetAlgo; // jet algorithm (kt, akt, etc)
138  ERecoScheme_t fRecombScheme; // recombination scheme used by fastjet
139  Double_t fRadius; // jet radius
140  Double_t fMinJetArea; // min area to keep jet in output
141  Double_t fMinJetPt; // min jet pt to keep jet in output
142  Double_t fJetPhiMin; // minimum phi to keep jet in output
143  Double_t fJetPhiMax; // maximum phi to keep jet in output
144  Double_t fJetEtaMin; // minimum eta to keep jet in output
145  Double_t fJetEtaMax; // maximum eta to keep jet in output
146  Double_t fGhostArea; // ghost area
147  Double_t fTrackEfficiency; // artificial tracking inefficiency (0...1)
148  TObjArray *fUtilities; // jet utilities (gen subtractor, constituent subtractor etc.)
149  Bool_t fLocked; // true if lock is set
150 
157 
158  TClonesArray *fJets;
160 
161  static const Int_t fgkConstIndexShift;
162 
163  private:
164  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
165  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
166 
168  ClassDef(AliEmcalJetTask, 23);
170 };
171 #endif
void SetJetsName(const char *n)
void SetRecombScheme(ERecoScheme_t scheme)
TClonesArray * fJets
=true ghost particles will be filled in AliEmcalJet obj
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 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
Bool_t IsJetInEmcal(Double_t eta, Double_t phi, Double_t r)
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)
General jet finder task implementing a wrapper for FastJet.
void SetJetEtaRange(Double_t emi, Double_t ema)
Bool_t fIsPSelSet
=true if already initialized
UInt_t FindJetAcceptanceType(Double_t eta, Double_t phi, Double_t r)
int Int_t
Definition: External.C:63
Bool_t IsJetInDcal(Double_t eta, Double_t phi, Double_t r)
unsigned int UInt_t
Definition: External.C:33
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 &)
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
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)
bool Bool_t
Definition: External.C:53
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