AliPhysics  857879d (857879d)
 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 SetJetsTag(const char *n) { if (IsLocked()) return; fJetsTag = n ; }
69  void SetJetEtaRange(Double_t emi, Double_t ema) { if (IsLocked()) return; fJetEtaMin = emi ; fJetEtaMax = ema; }
70  void SetJetPhiRange(Double_t pmi, Double_t pma) { if (IsLocked()) return; fJetPhiMin = pmi ; fJetPhiMax = pma; }
71  void SetJetAlgo(EJetAlgo_t a) { if (IsLocked()) return; fJetAlgo = a ; }
72  void SetJetType(EJetType_t t) { if (IsLocked()) return; fJetType = t ; }
73  void SetLocked() { fLocked = kTRUE;}
74  void SetMinJetArea(Double_t a) { if (IsLocked()) return; fMinJetArea = a ; }
75  void SetMinJetPt(Double_t j) { if (IsLocked()) return; fMinJetPt = j ; }
76  void SetRecombScheme(ERecoScheme_t scheme) { if (IsLocked()) return; fRecombScheme = scheme; }
77  void SetTrackEfficiency(Double_t t) { if (IsLocked()) return; fTrackEfficiency = t ; }
79  void SetLegacyMode(Bool_t mode) { if (IsLocked()) return; fLegacyMode = mode ; }
80  void SetFillGhost(Bool_t b=kTRUE) { if (IsLocked()) return; fFillGhost = b ; }
81  void SetRadius(Double_t r) { if (IsLocked()) return; fRadius = r ; }
82 
83  void SetEtaRange(Double_t emi, Double_t ema);
84  void SetMinJetClusPt(Double_t min);
85  void SetMinJetClusE(Double_t min);
86  void SetMinJetTrackPt(Double_t min);
87  void SetPhiRange(Double_t pmi, Double_t pma);
88 
90 
92  const char* GetJetsName() { return fJetsName.Data() ; }
93  const char* GetJetsTag() { return fJetsTag.Data() ; }
98  UInt_t GetJetType() { return fJetType ; }
99  UInt_t GetJetAlgo() { return fJetAlgo ; }
104  Double_t GetRadius() { return fRadius ; }
108 
109  TClonesArray* GetJets() { return fJets ; }
111 
112  void FillJetConstituents(AliEmcalJet *jet, std::vector<fastjet::PseudoJet>& constituents,
113  std::vector<fastjet::PseudoJet>& constituents_sub, Int_t flag = 0, TString particlesSubName = "");
114 
116 
117 
118  Bool_t IsLocked() const;
119  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
120  void SetType(Int_t t);
121 
123  const TString nTracks = "usedefault",
124  const TString nClusters = "usedefault",
126  const Double_t radius = 0.4,
128  const Double_t minTrPt = 0.15,
129  const Double_t minClPt = 0.30,
130  const Double_t ghostArea = 0.005,
132  const TString tag = "Jet",
133  const Double_t minJetPt = 0.,
134  const Bool_t lockTask = kTRUE,
135  const Bool_t bFillGhosts = kFALSE
136  );
137 
138 #if !defined(__CINT__) && !defined(__MAKECINT__)
139  static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo);
141 #endif
142 
143  protected:
144 
145  Int_t FindJets();
146  void FillJetBranch();
147  void ExecOnce();
148  void InitEvent();
149  void InitUtilities();
150  void PrepareUtilities();
151  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
152  void TerminateUtilities();
153  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
158 
159  TString fJetsTag; // tag of jet collection (usually = "Jets")
160 
161  EJetType_t fJetType; // jet type (full, charged, neutral)
162  EJetAlgo_t fJetAlgo; // jet algorithm (kt, akt, etc)
163  ERecoScheme_t fRecombScheme; // recombination scheme used by fastjet
164  Double_t fRadius; // jet radius
165  Double_t fMinJetArea; // min area to keep jet in output
166  Double_t fMinJetPt; // min jet pt to keep jet in output
167  Double_t fJetPhiMin; // minimum phi to keep jet in output
168  Double_t fJetPhiMax; // maximum phi to keep jet in output
169  Double_t fJetEtaMin; // minimum eta to keep jet in output
170  Double_t fJetEtaMax; // maximum eta to keep jet in output
171  Double_t fGhostArea; // ghost area
172  Double_t fTrackEfficiency; // artificial tracking inefficiency (0...1)
173  TObjArray *fUtilities; // jet utilities (gen subtractor, constituent subtractor etc.)
174  Bool_t fTrackEfficiencyOnlyForEmbedding; // Apply aritificial tracking inefficiency only for embedded tracks
175  Bool_t fLocked; // true if lock is set
176 
183 
184  TClonesArray *fJets;
186 
187  static const Int_t fgkConstIndexShift;
188 
189 #if !(defined(__CINT__) || defined(__MAKECINT__))
190  // Handle mapping between index and containers
193 #endif
194 
195  private:
196  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
197  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
198 
200  ClassDef(AliEmcalJetTask, 24);
202 };
203 #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
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:41
TObjArray * GetUtilities()
Bool_t IsJetInDcalOnly(Double_t eta, Double_t phi, Double_t r)
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 SetJetsTag(const char *n)
void SetMinJetTrackPt(Double_t min)
Bool_t GetLegacyMode()
void SetFillGhost(Bool_t b=kTRUE)
AliEmcalJetTask & operator=(const AliEmcalJetTask &)
void FillJetConstituents(AliEmcalJet *jet, std::vector< fastjet::PseudoJet > &constituents, std::vector< fastjet::PseudoJet > &constituents_sub, Int_t flag=0, TString particlesSubName="")
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
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
const char * GetJetsTag()
Bool_t IsJetInPhos(Double_t eta, Double_t phi, Double_t r)
Double_t GetGhostArea()
static const Int_t fgkConstIndexShift
fastjet wrapper
AliJetContainer::EJetType_t EJetType_t