AliPhysics  1976924 (1976924)
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 ; }
78  void SetTrackEfficiencyOnlyForEmbedding(Bool_t b) { if (IsLocked()) return; fTrackEfficiencyOnlyForEmbedding = b ; }
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 
89  AliEmcalJetUtility* AddUtility(AliEmcalJetUtility* utility);
90 
91  Double_t GetGhostArea() { return fGhostArea ; }
92  const char* GetJetsName() { return fJetsName.Data() ; }
93  const char* GetJetsTag() { return fJetsTag.Data() ; }
94  Double_t GetJetEtaMin() { return fJetEtaMin ; }
95  Double_t GetJetEtaMax() { return fJetEtaMax ; }
96  Double_t GetJetPhiMin() { return fJetPhiMin ; }
97  Double_t GetJetPhiMax() { return fJetPhiMax ; }
98  UInt_t GetJetType() { return fJetType ; }
99  UInt_t GetJetAlgo() { return fJetAlgo ; }
100  Bool_t GetLegacyMode() { return fLegacyMode ; }
101  Double_t GetMinJetArea() { return fMinJetArea ; }
102  Double_t GetMinJetPt() { return fMinJetPt ; }
103  Int_t GetMinMCLabel() { return fMinMCLabel ; }
104  Double_t GetRadius() { return fRadius ; }
105  Int_t GetRecombScheme() { return fRecombScheme ; }
106  Double_t GetTrackEfficiency() { return fTrackEfficiency ; }
107  Bool_t GetTrackEfficiencyOnlyForEmbedding() { return fTrackEfficiencyOnlyForEmbedding; }
108 
109  TClonesArray* GetJets() { return fJets ; }
110  TObjArray* GetUtilities() { return fUtilities ; }
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 
115  UInt_t FindJetAcceptanceType(Double_t eta, Double_t phi, Double_t r);
116 
117 
118  Bool_t IsLocked() const;
119  void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB);
120  void SetType(Int_t t);
121 
129  void SetFillJetConsituents(Bool_t doFill) { fFillConstituents = doFill; }
130 
131  static AliEmcalJetTask* AddTaskEmcalJet(
132  const TString nTracks = "usedefault",
133  const TString nClusters = "usedefault",
135  const Double_t radius = 0.4,
137  const Double_t minTrPt = 0.15,
138  const Double_t minClPt = 0.30,
139  const Double_t ghostArea = 0.005,
141  const TString tag = "Jet",
142  const Double_t minJetPt = 0.,
143  const Bool_t lockTask = kTRUE,
144  const Bool_t bFillGhosts = kFALSE
145  );
146 
147 #if !defined(__CINT__) && !defined(__MAKECINT__)
148  static FJJetAlgo ConvertToFJAlgo(EJetAlgo_t algo);
149  static FJRecoScheme ConvertToFJRecoScheme(ERecoScheme_t reco);
150 #endif
151 
152  protected:
153 
154  Int_t FindJets();
155  void FillJetBranch();
156  void ExecOnce();
157  void InitEvent();
158  void InitUtilities();
159  void PrepareUtilities();
160  void ExecuteUtilities(AliEmcalJet* jet, Int_t ij);
161  void TerminateUtilities();
162  Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const;
163  Bool_t IsJetInEmcal(Double_t eta, Double_t phi, Double_t r);
164  Bool_t IsJetInDcal(Double_t eta, Double_t phi, Double_t r);
165  Bool_t IsJetInDcalOnly(Double_t eta, Double_t phi, Double_t r);
166  Bool_t IsJetInPhos(Double_t eta, Double_t phi, Double_t r);
167 
169 
170  EJetType_t fJetType;
171  EJetAlgo_t fJetAlgo;
172  ERecoScheme_t fRecombScheme;
186 
193 
194  TClonesArray *fJets;
196 
197  static const Int_t fgkConstIndexShift;
198 
199 #if !(defined(__CINT__) || defined(__MAKECINT__))
200  // Handle mapping between index and containers
203 #endif
204 
205  private:
206  AliEmcalJetTask(const AliEmcalJetTask&); // not implemented
207  AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented
208 
210  ClassDef(AliEmcalJetTask, 26);
212 };
213 #endif
Bool_t fTrackEfficiencyOnlyForEmbedding
tituent Apply aritificial tracking inefficiency only for embedded tracks
void SetJetsName(const char *n)
void SetRecombScheme(ERecoScheme_t scheme)
TClonesArray * fJets
!jet collection
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 emcal particles are given as input (for clusters)
Bool_t fIsInit
!=true if already initialized
Base task in the EMCAL framework.
Double_t fJetEtaMin
minimum eta to keep jet in output
EJetType_t fJetType
jet type (full, charged, neutral)
AliJetContainer::ERecoScheme_t ERecoScheme_t
Bool_t fFillGhost
=true ghost particles will be filled in AliEmcalJet obj
const char * GetJetsName()
void SetLegacyMode(Bool_t mode)
void SetJetType(EJetType_t t)
Double_t GetTrackEfficiency()
void SetMinJetPt(Double_t j)
Double_t GetRadius()
AliEmcalContainerIndexMap< AliParticleContainer, AliVParticle > fParticleContainerIndexMap
! Mapping between index and particle containers
ERecoScheme_t fRecombScheme
recombination scheme used by fastjet
Bool_t fFillConstituents
If true jet consituents will be filled to the AliEmcalJet.
Double_t fTrackEfficiency
artificial tracking inefficiency (0...1)
Double_t GetMinJetArea()
void SetJetAlgo(EJetAlgo_t a)
Bool_t GetTrackEfficiencyOnlyForEmbedding()
void SetTrackEfficiency(Double_t t)
Double_t GetMinJetPt()
General jet finder task implementing a wrapper for FastJet.
void SetJetEtaRange(Double_t emi, Double_t ema)
Bool_t fIsPSelSet
!=true if physics selection was set
Bool_t fLocked
true if lock is set
Double_t fJetPhiMin
minimum phi to keep jet in output
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
TString fJetsTag
tag of jet collection (usually = "Jets")
TObjArray * fUtilities
jet utilities (gen subtractor, constituent subtractor etc.)
void SetTrackEfficiencyOnlyForEmbedding(Bool_t b)
AliEmcalContainerIndexMap< AliClusterContainer, AliVCluster > fClusterContainerIndexMap
! Mapping between index and cluster containers
AliJetContainer::EJetAlgo_t EJetAlgo_t
Double_t fJetEtaMax
maximum eta to keep jet in output
Double_t fGhostArea
ghost area
Int_t mode
Definition: anaM.C:41
TObjArray * GetUtilities()
void SetGhostArea(Double_t gharea)
EJetAlgo_t fJetAlgo
jet algorithm (kt, akt, etc)
Double_t fJetPhiMax
maximum phi to keep jet in output
void SetJetsTag(const char *n)
Double_t fMinJetArea
min area to keep jet in output
Bool_t GetLegacyMode()
TString fJetsName
!name of jet collection
void SetFillGhost(Bool_t b=kTRUE)
Double_t fMinJetPt
min jet pt to keep jet in output
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:51
Double_t fRadius
jet radius
Bool_t fLegacyMode
!=true to enable FJ 2.x behavior
Double_t GetJetPhiMin()
Double_t GetJetEtaMax()
fastjet::JetAlgorithm FJJetAlgo
bool Bool_t
Definition: External.C:53
fastjet::RecombinationScheme FJRecoScheme
TClonesArray * GetJets()
void SetFillJetConsituents(Bool_t doFill)
Switch for whether to fill the AliEmcalJetConstituent objects (clusters and particles/tracks) ...
void SetRadius(Double_t r)
AliFJWrapper fFastJetWrapper
!fastjet wrapper
const char * GetJetsTag()
Double_t GetGhostArea()
static const Int_t fgkConstIndexShift
!contituent index shift
AliJetContainer::EJetType_t EJetType_t