AliPhysics  66e96a0 (66e96a0)
 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 
86  Double_t GetGhostArea() { return fGhostArea ; }
87  const char* GetJetsName() { return fJetsName.Data() ; }
88  Double_t GetJetEtaMin() { return fJetEtaMin ; }
89  Double_t GetJetEtaMax() { return fJetEtaMax ; }
90  Double_t GetJetPhiMin() { return fJetPhiMin ; }
91  Double_t GetJetPhiMax() { return fJetPhiMax ; }
92  UInt_t GetJetType() { return fJetType ; }
93  UInt_t GetJetAlgo() { return fJetAlgo ; }
94  Bool_t GetLegacyMode() { return fLegacyMode ; }
95  Double_t GetMinJetArea() { return fMinJetArea ; }
96  Double_t GetMinJetPt() { return fMinJetPt ; }
97  Int_t GetMinMCLabel() { return fMinMCLabel ; }
98  Double_t GetRadius() { return fRadius ; }
99  Int_t GetRecombScheme() { return fRecombScheme ; }
100  Double_t GetTrackEfficiency() { return fTrackEfficiency ; }
101 
102  TClonesArray* GetJets() { return fJets ; }
103  TObjArray* GetUtilities() { return fUtilities ; }
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 
108  Int_t GetIndexSub(Double_t phi_sub, std::vector<fastjet::PseudoJet>& constituents_unsub);
109 
110  Bool_t IsLocked() const;
111  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
112  void SetType(Int_t t);
113 
114 #if !defined(__CINT__) && !defined(__MAKECINT__)
115  static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo);
117 #endif
118 
119  protected:
120 
121  Int_t FindJets();
122  void FillJetBranch();
123  void ExecOnce();
124  void InitUtilities();
125  void PrepareUtilities();
126  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
127  void TerminateUtilities();
128  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
129 
130  TString fJetsTag; // tag of jet collection (usually = "Jets")
131 
132  EJetType_t fJetType; // jet type (full, charged, neutral)
133  EJetAlgo_t fJetAlgo; // jet algorithm (kt, akt, etc)
134  ERecoScheme_t fRecombScheme; // recombination scheme used by fastjet
135  Double_t fRadius; // jet radius
136  Double_t fMinJetArea; // min area to keep jet in output
137  Double_t fMinJetPt; // min jet pt to keep jet in output
138  Double_t fJetPhiMin; // minimum phi to keep jet in output
139  Double_t fJetPhiMax; // maximum phi to keep jet in output
140  Double_t fJetEtaMin; // minimum eta to keep jet in output
141  Double_t fJetEtaMax; // maximum eta to keep jet in output
142  Double_t fGhostArea; // ghost area
143  Double_t fTrackEfficiency; // artificial tracking inefficiency (0...1)
144  TObjArray *fUtilities; // jet utilities (gen subtractor, constituent subtractor etc.)
145  Bool_t fLocked; // true if lock is set
146 
147  TString fJetsName;
148  Bool_t fIsInit;
149  Bool_t fIsPSelSet;
150  Bool_t fIsEmcPart;
151  Bool_t fLegacyMode;
152  Bool_t fFillGhost;
153 
154  TClonesArray *fJets;
156 
157  static const Int_t fgkConstIndexShift;
158 
159  private:
160  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
161  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
162 
164  ClassDef(AliEmcalJetTask, 23);
166 };
167 #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)
General jet finder task implementing a wrapper for FastJet.
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 &)
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)
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