AliPhysics  cdeda5a (cdeda5a)
 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 #if !(defined(__CINT__) || defined(__MAKECINT__))
21 #endif
22 
23 namespace fastjet {
24  class PseudoJet;
25 }
26 
49  public:
50 
54 
55 #if !defined(__CINT__) && !defined(__MAKECINT__)
56  typedef fastjet::JetAlgorithm FJJetAlgo;
57  typedef fastjet::RecombinationScheme FJRecoScheme;
58 #endif
59 
61  AliEmcalJetTask(const char *name);
62  virtual ~AliEmcalJetTask();
63 
64  Bool_t Run();
65 
66  void SetGhostArea(Double_t gharea) { if (IsLocked()) return; fGhostArea = gharea; }
67  void SetJetsName(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
68  void SetJetEtaRange(Double_t emi, Double_t ema) { if (IsLocked()) return; fJetEtaMin = emi ; fJetEtaMax = ema; }
69  void SetJetPhiRange(Double_t pmi, Double_t pma) { if (IsLocked()) return; fJetPhiMin = pmi ; fJetPhiMax = pma; }
70  void SetJetAlgo(EJetAlgo_t a) { if (IsLocked()) return; fJetAlgo = a ; }
71  void SetJetType(EJetType_t t) { if (IsLocked()) return; fJetType = t ; }
72  void SetLocked() { fLocked = kTRUE;}
73  void SetMinJetArea(Double_t a) { if (IsLocked()) return; fMinJetArea = a ; }
74  void SetMinJetPt(Double_t j) { if (IsLocked()) return; fMinJetPt = j ; }
75  void SetRecombScheme(ERecoScheme_t scheme) { if (IsLocked()) return; fRecombScheme = scheme; }
76  void SetTrackEfficiency(Double_t t) { if (IsLocked()) return; fTrackEfficiency = t ; }
78  void SetLegacyMode(Bool_t mode) { if (IsLocked()) return; fLegacyMode = mode ; }
79  void SetFillGhost(Bool_t b=kTRUE) { if (IsLocked()) return; fFillGhost = b ; }
80  void SetRadius(Double_t r) { if (IsLocked()) return; fRadius = r ; }
81 
82  void SetEtaRange(Double_t emi, Double_t ema);
83  void SetMinJetClusPt(Double_t min);
84  void SetMinJetClusE(Double_t min);
85  void SetMinJetTrackPt(Double_t min);
86  void SetPhiRange(Double_t pmi, Double_t pma);
87 
89 
91  const char* GetJetsName() { return fJetsName.Data() ; }
96  UInt_t GetJetType() { return fJetType ; }
97  UInt_t GetJetAlgo() { return fJetAlgo ; }
102  Double_t GetRadius() { return fRadius ; }
106 
107  TClonesArray* GetJets() { return fJets ; }
109 
110  void FillJetConstituents(AliEmcalJet *jet, std::vector<fastjet::PseudoJet>& constituents,
111  std::vector<fastjet::PseudoJet>& constituents_sub, Int_t flag = 0, TClonesArray *particles_sub = 0);
112 
114 
115  Int_t GetIndexSub(Double_t phi_sub, std::vector<fastjet::PseudoJet>& constituents_unsub);
116 
117  Bool_t IsLocked() const;
118  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
119  void SetType(Int_t t);
120 
122  const TString nTracks = "usedefault",
123  const TString nClusters = "usedefault",
125  const Double_t radius = 0.4,
127  const Double_t minTrPt = 0.15,
128  const Double_t minClPt = 0.30,
129  const Double_t ghostArea = 0.005,
131  const TString tag = "Jet",
132  const Double_t minJetPt = 0.,
133  const Bool_t lockTask = kTRUE,
134  const Bool_t bFillGhosts = kFALSE
135  );
136 
137 #if !defined(__CINT__) && !defined(__MAKECINT__)
138  static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo);
140 #endif
141 
142  protected:
143 
144  Int_t FindJets();
145  void FillJetBranch();
146  void ExecOnce();
147  void InitUtilities();
148  void PrepareUtilities();
149  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
150  void TerminateUtilities();
151  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
154 
155  TString fJetsTag; // tag of jet collection (usually = "Jets")
156 
157  EJetType_t fJetType; // jet type (full, charged, neutral)
158  EJetAlgo_t fJetAlgo; // jet algorithm (kt, akt, etc)
159  ERecoScheme_t fRecombScheme; // recombination scheme used by fastjet
160  Double_t fRadius; // jet radius
161  Double_t fMinJetArea; // min area to keep jet in output
162  Double_t fMinJetPt; // min jet pt to keep jet in output
163  Double_t fJetPhiMin; // minimum phi to keep jet in output
164  Double_t fJetPhiMax; // maximum phi to keep jet in output
165  Double_t fJetEtaMin; // minimum eta to keep jet in output
166  Double_t fJetEtaMax; // maximum eta to keep jet in output
167  Double_t fGhostArea; // ghost area
168  Double_t fTrackEfficiency; // artificial tracking inefficiency (0...1)
169  TObjArray *fUtilities; // jet utilities (gen subtractor, constituent subtractor etc.)
170  Bool_t fTrackEfficiencyOnlyForEmbedding; // Apply aritificial tracking inefficiency only for embedded tracks
171  Bool_t fLocked; // true if lock is set
172 
179 
180  TClonesArray *fJets;
182 
183  static const Int_t fgkConstIndexShift;
184 
185 #if !(defined(__CINT__) || defined(__MAKECINT__))
186  // Handle mapping between index and containers
189 #endif
190 
191  private:
192  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
193  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
194 
196  ClassDef(AliEmcalJetTask, 24);
198 };
199 #endif
Bool_t fTrackEfficiencyOnlyForEmbedding
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()
AliEmcalContainerIndexMap< AliParticleContainer, AliVParticle > fParticleContainerIndexMap
! Mapping between index and particle containers
ERecoScheme_t fRecombScheme
Double_t fTrackEfficiency
Double_t GetMinJetArea()
void SetJetAlgo(EJetAlgo_t a)
Bool_t GetTrackEfficiencyOnlyForEmbedding()
virtual ~AliEmcalJetTask()
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
void SetTrackEfficiencyOnlyForEmbedding(Bool_t b)
AliEmcalContainerIndexMap< AliClusterContainer, AliVCluster > fClusterContainerIndexMap
contituent index shift
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()
static AliEmcalJetTask * AddTaskEmcalJet(const TString nTracks="usedefault", const TString nClusters="usedefault", const AliJetContainer::EJetAlgo_t jetAlgo=AliJetContainer::antikt_algorithm, const Double_t radius=0.4, const AliJetContainer::EJetType_t jetType=AliJetContainer::kFullJet, const Double_t minTrPt=0.15, const Double_t minClPt=0.30, const Double_t ghostArea=0.005, const AliJetContainer::ERecoScheme_t reco=AliJetContainer::pt_scheme, const TString tag="Jet", const Double_t minJetPt=0., const Bool_t lockTask=kTRUE, const Bool_t bFillGhosts=kFALSE)
void SetRadius(Double_t r)
AliFJWrapper fFastJetWrapper
jet collection
Double_t GetGhostArea()
static const Int_t fgkConstIndexShift
fastjet wrapper
AliJetContainer::EJetType_t EJetType_t