1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: Jet.h,v 1.17 2009/02/26 20:28:59 bendavid Exp $
|
3 |
//
|
4 |
// Jet
|
5 |
//
|
6 |
// Jet class to hold reconstructed jet information.
|
7 |
//
|
8 |
// Authors: S.Xie, C.Loizides
|
9 |
//--------------------------------------------------------------------------------------------------
|
10 |
|
11 |
#ifndef MITANA_DATATREE_JET_H
|
12 |
#define MITANA_DATATREE_JET_H
|
13 |
|
14 |
#include "MitAna/DataTree/interface/Particle.h"
|
15 |
#include "MitAna/DataTree/interface/Track.h"
|
16 |
#include "MitAna/DataTree/interface/CaloTower.h"
|
17 |
|
18 |
namespace mithep
|
19 |
{
|
20 |
class Jet : public Particle
|
21 |
{
|
22 |
public:
|
23 |
enum ECorr {
|
24 |
L1 = 0,
|
25 |
L2,
|
26 |
L3,
|
27 |
L4,
|
28 |
L5,
|
29 |
L6,
|
30 |
L7,
|
31 |
Custom
|
32 |
};
|
33 |
|
34 |
Jet() :
|
35 |
fMaxEInEmTowers(0), fMaxEInHadTowers(0), fEnergyFractionH(0), fEnergyFractionEm(0),
|
36 |
fHadEnergyInHB(0), fHadEnergyInHO(0), fHadEnergyInHE(0), fHadEnergyInHF(0),
|
37 |
fEmEnergyInEB(0), fEmEnergyInEE(0), fEmEnergyInHF(0), fTowersArea(0), fN(0),
|
38 |
fN60(0), fN90(0), fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
|
39 |
fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
|
40 |
fSimpleSecondaryVertexBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
|
41 |
fCombinedSecondaryVertexMVABJetTagsDisc(0), fImpactParameterMVABJetTagsDisc(0),
|
42 |
fTrackCountingHighEffBJetTagsDisc(0), fTrackCountingHighPurBJetTagsDisc(0),
|
43 |
fSoftMuonBJetTagsDisc(0), fSoftMuonNoIPBJetTagsDisc(0),
|
44 |
fSoftElectronBJetTagsDisc(0), fL2RelativeCorrectionScale(0),
|
45 |
fL3AbsoluteCorrectionScale(0), fL4EMFCorrectionScale(0),
|
46 |
fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0) {}
|
47 |
Jet(Double_t px, Double_t py, Double_t pz, Double_t e) :
|
48 |
fRawMom(FourVector(px,py,pz,e)),
|
49 |
fMaxEInEmTowers(0), fMaxEInHadTowers(0), fEnergyFractionH(0), fEnergyFractionEm(0),
|
50 |
fHadEnergyInHB(0), fHadEnergyInHO(0), fHadEnergyInHE(0), fHadEnergyInHF(0),
|
51 |
fEmEnergyInEB(0), fEmEnergyInEE(0), fEmEnergyInHF(0), fTowersArea(0), fN(0),
|
52 |
fN60(0), fN90(0), fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
|
53 |
fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
|
54 |
fSimpleSecondaryVertexBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
|
55 |
fCombinedSecondaryVertexMVABJetTagsDisc(0), fImpactParameterMVABJetTagsDisc(0),
|
56 |
fTrackCountingHighEffBJetTagsDisc(0), fTrackCountingHighPurBJetTagsDisc(0),
|
57 |
fSoftMuonBJetTagsDisc(0), fSoftMuonNoIPBJetTagsDisc(0),
|
58 |
fSoftElectronBJetTagsDisc(0), fL2RelativeCorrectionScale(0),
|
59 |
fL3AbsoluteCorrectionScale(0), fL4EMFCorrectionScale(0),
|
60 |
fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0) {}
|
61 |
|
62 |
Double_t Alpha() const { return fAlpha; }
|
63 |
Double_t Beta() const { return fBeta; }
|
64 |
Double_t CombinedSecondaryVertexBJetTagsDisc() const
|
65 |
{ return fCombinedSecondaryVertexBJetTagsDisc; }
|
66 |
Double_t CombinedSecondaryVertexMVABJetTagsDisc() const
|
67 |
{ return fCombinedSecondaryVertexMVABJetTagsDisc; }
|
68 |
Double_t CustomCorrectionScale() const { return fCustomCorrectionScale; }
|
69 |
void DisableCorrection(ECorr c) { fCorrections.ClearBit(c); ClearMom(); }
|
70 |
void DisableCorrections() { fCorrections.Clear(); ClearMom(); }
|
71 |
Double_t EmEnergyInEB() const { return fEmEnergyInEB; }
|
72 |
Double_t EmEnergyInEE() const { return fEmEnergyInEE; }
|
73 |
Double_t EmEnergyInHF() const { return fEmEnergyInHF; }
|
74 |
void EnableCorrection(ECorr c) { fCorrections.SetBit(c); ClearMom(); }
|
75 |
Bool_t CorrectionActive(ECorr c) const { return fCorrections.TestBit(c); }
|
76 |
Double_t EnergyFractionH() const { return fEnergyFractionH; }
|
77 |
Double_t EnergyFractionEm() const { return fEnergyFractionEm; }
|
78 |
Double_t HadEnergyInHO() const { return fHadEnergyInHO; }
|
79 |
Double_t HadEnergyInHB() const { return fHadEnergyInHB; }
|
80 |
Double_t HadEnergyInHF() const { return fHadEnergyInHF; }
|
81 |
Double_t HadEnergyInHE() const { return fHadEnergyInHE; }
|
82 |
Bool_t HasTower(const CaloTower *t) const { return fTowers.HasObject(t); }
|
83 |
Double_t ImpactParameterMVABJetTagsDisc() const
|
84 |
{ return fImpactParameterMVABJetTagsDisc; }
|
85 |
Double_t JetProbabilityBJetTagsDisc() const
|
86 |
{ return fJetProbabilityBJetTagsDisc; }
|
87 |
Double_t JetBProbabilityBJetTagsDisc() const
|
88 |
{ return fJetBProbabilityBJetTagsDisc; }
|
89 |
Int_t MatchedMCFlavor() const { return fMatchedMCFlavor; }
|
90 |
Double_t MaxEInEmTowers() const { return fMaxEInEmTowers; }
|
91 |
Double_t MaxEInHadTowers() const { return fMaxEInHadTowers; }
|
92 |
UShort_t N() const { return fN; }
|
93 |
UShort_t N60() const { return fN60; }
|
94 |
UShort_t N90() const { return fN90; }
|
95 |
UInt_t NTowers() const { return fTowers.GetEntries(); }
|
96 |
Double_t L2RelativeCorrectionScale() const { return fL2RelativeCorrectionScale; }
|
97 |
Double_t L3AbsoluteCorrectionScale() const { return fL3AbsoluteCorrectionScale; }
|
98 |
Double_t L4EMFCorrectionScale() const { return fL4EMFCorrectionScale; }
|
99 |
Double_t L5FlavorCorrectionScale() const { return fL5FlavorCorrectionScale; }
|
100 |
Double_t L7PartonCorrectionScale() const { return fL7PartonCorrectionScale; }
|
101 |
EObjType ObjType() const { return kJet; }
|
102 |
Double_t SimpleSecondaryVertexBJetTagsDisc() const
|
103 |
{ return fSimpleSecondaryVertexBJetTagsDisc; }
|
104 |
Double_t SoftMuonBJetTagsDisc() const
|
105 |
{ return fSoftMuonBJetTagsDisc; }
|
106 |
Double_t SoftMuonNoIPBJetTagsDisc() const
|
107 |
{ return fSoftMuonNoIPBJetTagsDisc; }
|
108 |
Double_t SoftElectronBJetTagsDisc() const
|
109 |
{ return fSoftElectronBJetTagsDisc; }
|
110 |
Double_t TrackCountingHighEffBJetTagsDisc() const
|
111 |
{ return fTrackCountingHighEffBJetTagsDisc; }
|
112 |
Double_t TrackCountingHighPurBJetTagsDisc() const
|
113 |
{ return fTrackCountingHighPurBJetTagsDisc; }
|
114 |
const CaloTower
|
115 |
*Tower(UInt_t i) const { return fTowers.At(i); }
|
116 |
Double_t TowersArea() const { return fTowersArea; }
|
117 |
void AddTower(const CaloTower *tower) { fTowers.Add(tower); }
|
118 |
const FourVectorM &RawMom() const { return fRawMom; }
|
119 |
void SetAlpha(Double_t val) { fAlpha = val; }
|
120 |
void SetBeta(Double_t val) { fBeta = val; }
|
121 |
void SetCombinedSecondaryVertexBJetTagsDisc(Double_t d)
|
122 |
{ fCombinedSecondaryVertexBJetTagsDisc = d; }
|
123 |
void SetCombinedSecondaryVertexMVABJetTagsDisc(Double_t d)
|
124 |
{ fCombinedSecondaryVertexMVABJetTagsDisc = d; }
|
125 |
void SetEmEnergyInEB(Double_t val) { fEmEnergyInEB = val; }
|
126 |
void SetEmEnergyInEE(Double_t val) { fEmEnergyInEE = val; }
|
127 |
void SetEmEnergyInHF(Double_t val) { fEmEnergyInHF = val; }
|
128 |
void SetEnergyFractionH(Double_t val) { fEnergyFractionH = val; }
|
129 |
void SetEnergyFractionEm(Double_t val) { fEnergyFractionEm = val; }
|
130 |
void SetHadEnergyInHO(Double_t val) { fHadEnergyInHO = val; }
|
131 |
void SetHadEnergyInHB(Double_t val) { fHadEnergyInHB = val; }
|
132 |
void SetHadEnergyInHF(Double_t val) { fHadEnergyInHF = val; }
|
133 |
void SetHadEnergyInHE(Double_t val) { fHadEnergyInHE = val; }
|
134 |
void SetImpactParameterMVABJetTagsDisc (Double_t d)
|
135 |
{ fImpactParameterMVABJetTagsDisc = d; }
|
136 |
void SetJetProbabilityBJetTagsDisc(Double_t d)
|
137 |
{ fJetProbabilityBJetTagsDisc = d; }
|
138 |
void SetJetBProbabilityBJetTagsDisc(Double_t d)
|
139 |
{ fJetBProbabilityBJetTagsDisc = d; }
|
140 |
void SetRawMom(const FourVectorM &mom) { fRawMom = mom; ClearMom(); }
|
141 |
void SetN(UShort_t n) { fN = n; }
|
142 |
void SetN60(UShort_t n) { fN60 = n; }
|
143 |
void SetN90(UShort_t n) { fN90 = n; }
|
144 |
void SetMatchedMCFlavor(Int_t flavor) { fMatchedMCFlavor = flavor; }
|
145 |
void SetMaxEInEmTowers(Double_t val) { fMaxEInEmTowers = val; }
|
146 |
void SetMaxEInHadTowers(Double_t val) { fMaxEInHadTowers = val; }
|
147 |
void SetL2RelativeCorrectionScale(Double_t s )
|
148 |
{ fL2RelativeCorrectionScale = s; ClearMom(); }
|
149 |
void SetL3AbsoluteCorrectionScale(Double_t s )
|
150 |
{ fL3AbsoluteCorrectionScale = s; ClearMom(); }
|
151 |
void SetL4EMFCorrectionScale(Double_t s )
|
152 |
{ fL4EMFCorrectionScale = s; ClearMom(); }
|
153 |
void SetL5FlavorCorrectionScale(Double_t s )
|
154 |
{ fL5FlavorCorrectionScale = s; ClearMom(); }
|
155 |
void SetL7PartonCorrectionScale(Double_t s )
|
156 |
{ fL7PartonCorrectionScale = s; ClearMom(); }
|
157 |
void SetCustomCorrectionScale(Double_t s)
|
158 |
{ fCustomCorrectionScale = s; ClearMom(); }
|
159 |
void SetSimpleSecondaryVertexBJetTagsDisc(Double_t d)
|
160 |
{ fSimpleSecondaryVertexBJetTagsDisc = d; }
|
161 |
void SetSoftMuonBJetTagsDisc(Double_t d) { fSoftMuonBJetTagsDisc = d; }
|
162 |
void SetSoftMuonNoIPBJetTagsDisc(Double_t d) { fSoftMuonNoIPBJetTagsDisc = d; }
|
163 |
void SetSoftElectronBJetTagsDisc(Double_t d) { fSoftElectronBJetTagsDisc = d; }
|
164 |
void SetTowersArea(Double_t val) { fTowersArea = val; }
|
165 |
void SetTrackCountingHighEffBJetTagsDisc(Double_t d)
|
166 |
{ fTrackCountingHighEffBJetTagsDisc = d; }
|
167 |
void SetTrackCountingHighPurBJetTagsDisc(Double_t d)
|
168 |
{ fTrackCountingHighPurBJetTagsDisc = d; }
|
169 |
|
170 |
protected:
|
171 |
void GetMom() const;
|
172 |
|
173 |
FourVectorM32 fRawMom; //uncorrected four momentum of jet
|
174 |
Double32_t fMaxEInEmTowers; //maximum energy in EM towers
|
175 |
Double32_t fMaxEInHadTowers; //maximum energy in HCAL towers
|
176 |
Double32_t fEnergyFractionH; //hadronic energy fraction
|
177 |
Double32_t fEnergyFractionEm; //electromagnetic energy fraction
|
178 |
Double32_t fHadEnergyInHB; //hadronic energy in HB
|
179 |
Double32_t fHadEnergyInHO; //hadronic energy in HO
|
180 |
Double32_t fHadEnergyInHE; //hadronic energy in HE
|
181 |
Double32_t fHadEnergyInHF; //hadronic energy in HF
|
182 |
Double32_t fEmEnergyInEB; //electromagnetic energy in EB
|
183 |
Double32_t fEmEnergyInEE; //electromagnetic energy in EE
|
184 |
Double32_t fEmEnergyInHF; //electromagnetic energy extracted from HF
|
185 |
Double32_t fTowersArea; //area of contributing towers
|
186 |
UShort_t fN; //number of constituents
|
187 |
UShort_t fN60; //number constituents with 60% of total energy
|
188 |
UShort_t fN90; //number constituents with 90% of total energy
|
189 |
Double32_t fAlpha; //jet vertex association alpha variable
|
190 |
Double32_t fBeta; //jet vertex association beta variable
|
191 |
Int_t fMatchedMCFlavor; //pdg of the quark flavor that the jet matched to
|
192 |
Double32_t fJetProbabilityBJetTagsDisc; //discriminants from b-tagging algos
|
193 |
Double32_t fJetBProbabilityBJetTagsDisc; //discriminants from b-tagging algos
|
194 |
Double32_t fSimpleSecondaryVertexBJetTagsDisc; //discriminants from b-tagging algos
|
195 |
Double32_t fCombinedSecondaryVertexBJetTagsDisc; //discriminants from b-tagging algos
|
196 |
Double32_t fCombinedSecondaryVertexMVABJetTagsDisc; //discriminants from b-tagging algos
|
197 |
Double32_t fImpactParameterMVABJetTagsDisc; //discriminants from b-tagging algos
|
198 |
Double32_t fTrackCountingHighEffBJetTagsDisc; //discriminants from b-tagging algos
|
199 |
Double32_t fTrackCountingHighPurBJetTagsDisc; //discriminants from b-tagging algos
|
200 |
Double32_t fSoftMuonBJetTagsDisc; //discriminants from b-tagging algos
|
201 |
Double32_t fSoftMuonNoIPBJetTagsDisc; // discriminants from b-tagging algos
|
202 |
Double32_t fSoftElectronBJetTagsDisc; //discriminants from b-tagging algos
|
203 |
Double32_t fL2RelativeCorrectionScale; //L2 correction scale
|
204 |
Double32_t fL3AbsoluteCorrectionScale; //L3 correction scale
|
205 |
Double32_t fL4EMFCorrectionScale; //L4 correction scale
|
206 |
Double32_t fL5FlavorCorrectionScale; //L5 correction scale
|
207 |
Double32_t fL7PartonCorrectionScale; //L7 correction scale
|
208 |
Double32_t fCustomCorrectionScale; //custom correction scale
|
209 |
BitMask8 fCorrections; //mask of corrections to be applied
|
210 |
RefArray<CaloTower> fTowers; //calo towers assigned to this jet
|
211 |
|
212 |
ClassDef(Jet, 1) // Jet class
|
213 |
};
|
214 |
}
|
215 |
|
216 |
//--------------------------------------------------------------------------------------------------
|
217 |
inline void mithep::Jet::GetMom() const
|
218 |
{
|
219 |
// Get momentum values from stored values.
|
220 |
|
221 |
fCachedMom = fRawMom;
|
222 |
|
223 |
if (CorrectionActive(L2))
|
224 |
fCachedMom *= fL2RelativeCorrectionScale;
|
225 |
|
226 |
if (CorrectionActive(L3))
|
227 |
fCachedMom *= fL3AbsoluteCorrectionScale;
|
228 |
|
229 |
if (CorrectionActive(L4))
|
230 |
fCachedMom *= fL4EMFCorrectionScale;
|
231 |
|
232 |
if (CorrectionActive(L5))
|
233 |
fCachedMom *= fL5FlavorCorrectionScale;
|
234 |
|
235 |
if (CorrectionActive(L7))
|
236 |
fCachedMom *= fL7PartonCorrectionScale;
|
237 |
|
238 |
if (CorrectionActive(Custom))
|
239 |
fCachedMom *= fCustomCorrectionScale;
|
240 |
}
|
241 |
#endif
|