]>
Commit | Line | Data |
---|---|---|
914d486c | 1 | #ifndef ALIEMCALJETTASK_H |
2 | #define ALIEMCALJETTASK_H | |
48d874ff | 3 | |
48d874ff | 4 | class TClonesArray; |
b65fac7a | 5 | class AliVEvent; |
8082a80b | 6 | class AliRhoParameter; |
48d874ff | 7 | |
7030f36f | 8 | namespace fastjet { |
9 | class PseudoJet; | |
10 | } | |
11 | ||
d14d6e2c | 12 | #include "AliLog.h" |
48d874ff | 13 | #include "AliAnalysisTaskSE.h" |
8082a80b | 14 | #include "AliFJWrapper.h" |
48d874ff | 15 | |
914d486c | 16 | class AliEmcalJetTask : public AliAnalysisTaskSE { |
48d874ff | 17 | public: |
6a20534a | 18 | |
19 | enum JetType { | |
20 | kNone=0, | |
21 | kKT=1<<0, | |
22 | kAKT=1<<1, | |
23 | kFullJet=1<<2, | |
24 | kChargedJet=1<<3, | |
25 | kNeutralJet=1<<4, | |
26 | kR020Jet=1<<5, | |
27 | kR030Jet=1<<6, | |
28 | kR040Jet=1<<7, | |
29 | kRX1Jet=1<<8, // user defined radii, use SetRadius(Double_t) | |
30 | kRX2Jet=1<<9, | |
d1f2e0d9 | 31 | kRX3Jet=1<<10 |
6a20534a | 32 | }; |
33 | ||
34 | ||
914d486c | 35 | AliEmcalJetTask(); |
36 | AliEmcalJetTask(const char *name); | |
37 | virtual ~AliEmcalJetTask(); | |
48d874ff | 38 | |
b65fac7a | 39 | void UserCreateOutputObjects(); |
40 | void UserExec(Option_t *option); | |
41 | void Terminate(Option_t *option); | |
42 | ||
83c097da | 43 | Bool_t IsLocked() { if(fLocked) {AliFatal("Jet finder task is locked! Changing properties is not allowed."); return kTRUE;} else return kFALSE;}; |
44 | void SetLocked() { fLocked = kTRUE;} | |
df803211 | 45 | void SelectConstituents(UInt_t constSel, UInt_t MCconstSel) { fConstSel = constSel; fMCConstSel = MCconstSel; }; |
83c097da | 46 | void SetAlgo(Int_t a) { if(IsLocked()) return; if (a==0) fJetType |= kKT; else fJetType |= kAKT; } // for backward compatibility only |
47 | void SetClusName(const char *n) { if(IsLocked()) return; fCaloName = n ; } | |
48 | void SetJetsName(const char *n) { if(IsLocked()) return; fJetsName = n ; } | |
8082a80b | 49 | void SetJetsSubName(const char *n) { fJetsSubName = n ; } |
83c097da | 50 | void SetJetType(UInt_t t) { if(IsLocked()) return; fJetType = t ; } |
51 | void SetMarkConstituents(UInt_t m) { if(IsLocked()) return; fMarkConst = m ; } | |
52 | void SetMinJetArea(Double_t a) { if(IsLocked()) return; fMinJetArea = a ; } | |
53 | void SetMinJetClusPt(Double_t min) { if(IsLocked()) return; fMinJetClusPt = min ; } | |
54 | void SetMinJetPt(Double_t j) { if(IsLocked()) return; fMinJetPt = j ; } | |
55 | void SetMinJetTrackPt(Double_t min) { if(IsLocked()) return; fMinJetTrackPt = min ; } | |
56 | void SetRadius(Double_t r) { if(IsLocked()) return; fRadius = r ; if ((fJetType & (kRX1Jet|kRX2Jet|kRX3Jet)) == 0) AliWarning("Radius value will be ignored if jet type is not set to a user defined radius (kRX1Jet,kRX2Jet,kRX3Jet)."); } | |
57 | void SetTrackEfficiency(Double_t t) { if(IsLocked()) return; fTrackEfficiency = t ; } | |
58 | void SetTracksName(const char *n) { if(IsLocked()) return; fTracksName = n ; } | |
59 | void SetType(Int_t t) { if(IsLocked()) return; | |
60 | if (t==0) fJetType |= kFullJet; | |
6a20534a | 61 | else if (t==1) fJetType |= kChargedJet; |
62 | else if (t==2) fJetType |= kNeutralJet; } // for backward compatibility only | |
83c097da | 63 | void SetEtaRange(Double_t emi, Double_t ema) {if(IsLocked()) return; fEtaMin = emi; fEtaMax = ema; } |
64 | void SetPhiRange(Double_t pmi, Double_t pma) {if(IsLocked()) return; fPhiMin = pmi; fPhiMax = pma; } | |
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 SetGhostArea(Double_t gharea) { if(IsLocked()) return; fGhostArea = gharea; } | |
68 | void SetMinMCLabel(Int_t s) { if(IsLocked()) return; fMinMCLabel = s ; } | |
69 | void SetRecombScheme(Int_t scheme) { if(IsLocked()) return; fRecombScheme = scheme; } | |
6421eeb0 | 70 | void SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB) |
d14d6e2c | 71 | { |
72 | if(!fIsPSelSet) | |
73 | { | |
74 | fIsPSelSet = kTRUE; | |
75 | fOfflineTriggerMask = offlineTriggerMask; | |
76 | } | |
77 | else | |
78 | { | |
79 | AliWarning("Manually setting the event selection for jet finders is not allowed! Using trigger=old_trigger | your_trigger"); | |
80 | fOfflineTriggerMask = fOfflineTriggerMask | offlineTriggerMask; | |
81 | } | |
82 | } | |
83c097da | 83 | void SetLegacyMode(Bool_t mode) { if(IsLocked()) return; fLegacyMode = mode; } |
ffdca6aa | 84 | void SetCodeDebug(Bool_t val) { fCodeDebug = val; } |
6a20534a | 85 | |
8082a80b | 86 | void SetRhoName(const char *n) { fRhoName = n ; } |
87 | void SetRhomName(const char *n) { fRhomName = n ; } | |
88 | void SetGenericSubtraction(Bool_t b) { fDoGenericSubtraction = b; } | |
89 | void SetConstituentSubtraction(Bool_t b) { fDoConstituentSubtraction = b; } | |
90 | void SetUseExternalBkg(Bool_t b, Double_t rho, Double_t rhom) { fUseExternalBkg = b; fRho = rho; fRhom = rhom;} | |
91 | ||
6a20534a | 92 | UInt_t GetJetType() { return fJetType; } |
5d0a5007 | 93 | Bool_t GetLegacyMode() { return fLegacyMode; } |
8082a80b | 94 | TString GetJetsSubName() { return fJetsSubName; } |
6a20534a | 95 | |
bf287539 | 96 | const char* GetJetsName() { return fJetsName.Data(); } |
97 | Double_t GetRadius() { return fRadius; } | |
98 | const char* GetTracksName() { return fTracksName.Data(); } | |
99 | const char* GetClusName() { return fCaloName.Data(); } | |
100 | UInt_t GetMarkConstituents() { return fMarkConst; } | |
101 | Double_t GetMinJetArea() { return fMinJetArea; } | |
102 | Double_t GetMinJetClusPt() { return fMinJetClusPt; } | |
103 | Double_t GetMinJetPt() { return fMinJetPt; } | |
104 | Double_t GetMinJetTrackPt() { return fMinJetTrackPt; } | |
105 | Double_t GetTrackEfficiency() { return fTrackEfficiency; } | |
106 | Double_t GetGhostArea() { return fGhostArea; } | |
107 | Int_t GetMinMCLabel() { return fMinMCLabel; } | |
108 | Int_t GetRecombScheme() { return fRecombScheme; } | |
109 | Double_t GetEtaMin() { return fEtaMin; } | |
110 | Double_t GetEtaMax() { return fEtaMax; } | |
111 | Double_t GetPhiMin() { return fPhiMin; } | |
112 | Double_t GetPhiMax() { return fPhiMax; } | |
113 | Double_t GetJetEtaMin() { return fJetEtaMin; } | |
114 | Double_t GetJetEtaMax() { return fJetEtaMax; } | |
115 | Double_t GetJetPhiMin() { return fJetPhiMin; } | |
116 | Double_t GetJetPhiMax() { return fJetPhiMax; } | |
117 | ||
118 | AliVEvent* GetEvent() { return fEvent;} | |
119 | TClonesArray* GetClusters() { return fClus;} | |
120 | TClonesArray* GetTracks() { return fTracks;} | |
121 | TClonesArray* GetJets() { return fJets;} | |
122 | ||
48d874ff | 123 | protected: |
04905231 | 124 | void FindJets(); |
125 | Bool_t DoInit(); | |
ca5c29fa | 126 | Bool_t GetSortedArray(Int_t indexes[], std::vector<fastjet::PseudoJet> array) const; |
48d874ff | 127 | |
900f5135 | 128 | TString fTracksName; // name of track collection |
129 | TString fCaloName; // name of calo cluster collection | |
7efbea04 | 130 | TString fJetsName; // name of jet collection |
8082a80b | 131 | TString fJetsSubName; // name of subtracted jet collection |
6a20534a | 132 | UInt_t fJetType; // jet type (algorithm, radius, constituents) |
133 | UInt_t fConstSel; // select constituents from a previous jet finding | |
134 | UInt_t fMCConstSel; // select MC constituents (label!=0) from a previous jet finding | |
7030f36f | 135 | UInt_t fMarkConst; // constituents are marked (via TObject::SetBit) as belonging to the # leading jets |
48d874ff | 136 | Double_t fRadius; // jet radius |
f5f3c8e9 | 137 | Double_t fMinJetTrackPt; // min jet track momentum (applied before clustering) |
138 | Double_t fMinJetClusPt; // min jet cluster momentum (applied before clustering) | |
04905231 | 139 | Double_t fPhiMin; // minimum phi for constituents (applied before clustering) |
140 | Double_t fPhiMax; // maximum phi for constituents (applied before clustering) | |
141 | Double_t fEtaMin; // minimum eta for constituents (applied before clustering) | |
142 | Double_t fEtaMax; // maximum eta for constituents (applied before clustering) | |
f5f3c8e9 | 143 | Double_t fMinJetArea; // min area to keep jet in output |
144 | Double_t fMinJetPt; // min jet pt to keep jet in output | |
c9ad772c | 145 | Double_t fJetPhiMin; // minimum phi to keep jet in output |
146 | Double_t fJetPhiMax; // maximum phi to keep jet in output | |
147 | Double_t fJetEtaMin; // minimum eta to keep jet in output | |
148 | Double_t fJetEtaMax; // maximum eta to keep jet in output | |
1f9c287f | 149 | Double_t fGhostArea; // ghost area |
a7477843 | 150 | Int_t fMinMCLabel; // minimum MC label value for the tracks/clusters being considered MC particles |
7071e730 | 151 | Int_t fRecombScheme; // recombination scheme used by fastjet |
6421eeb0 | 152 | Double_t fTrackEfficiency; // artificial tracking inefficiency (0...1) |
04905231 | 153 | Bool_t fIsInit; //!=true if already initialized |
83c097da | 154 | Bool_t fLocked; // true if lock is set |
d14d6e2c | 155 | Bool_t fIsPSelSet; //!=true if physics selection was set |
04905231 | 156 | Bool_t fIsMcPart; //!=true if MC particles are given as input |
157 | Bool_t fIsEmcPart; //!=true if emcal particles are given as input (for clusters) | |
5d0a5007 | 158 | Bool_t fLegacyMode; //! if true, enable FJ 2.x behavior |
ffdca6aa | 159 | Bool_t fCodeDebug; // use nontested code changes |
8082a80b | 160 | |
161 | Bool_t fDoGenericSubtraction; // calculate generic subtraction | |
162 | Bool_t fDoConstituentSubtraction; // calculate constituent subtraction | |
163 | Bool_t fUseExternalBkg; // use external background for generic subtractor | |
164 | TString fRhoName; // name of rho | |
165 | TString fRhomName; // name of rhom | |
166 | Double_t fRho; // pT background density | |
167 | Double_t fRhom; // mT background density | |
168 | ||
48d874ff | 169 | TClonesArray *fJets; //!jet collection |
8082a80b | 170 | TClonesArray *fJetsSub; //!subtracted jet collection |
b65fac7a | 171 | AliVEvent *fEvent; //!current event |
04905231 | 172 | TClonesArray *fTracks; //!tracks collection |
173 | TClonesArray *fClus; //!cluster collection | |
8082a80b | 174 | AliRhoParameter *fRhoParam; //!event rho |
175 | AliRhoParameter *fRhomParam; //!event rhom | |
48d874ff | 176 | |
177 | private: | |
914d486c | 178 | AliEmcalJetTask(const AliEmcalJetTask&); // not implemented |
179 | AliEmcalJetTask &operator=(const AliEmcalJetTask&); // not implemented | |
48d874ff | 180 | |
83c097da | 181 | ClassDef(AliEmcalJetTask, 13) // Jet producing task |
48d874ff | 182 | }; |
183 | #endif |