1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: Jet.h,v 1.27 2010/05/30 14:00:24 bendavid Exp $
|
3 |
//
|
4 |
// Jet
|
5 |
//
|
6 |
// Base jet class to hold reconstructed jet information.
|
7 |
//
|
8 |
// Authors: S.Xie, C.Loizides, J.Bendavid
|
9 |
//--------------------------------------------------------------------------------------------------
|
10 |
|
11 |
#ifndef MITANA_DATATREE_JET_H
|
12 |
#define MITANA_DATATREE_JET_H
|
13 |
|
14 |
#include "MitCommon/DataFormats/interface/Vect4M.h"
|
15 |
#include "MitAna/DataTree/interface/Particle.h"
|
16 |
|
17 |
namespace mithep
|
18 |
{
|
19 |
class Jet : public Particle
|
20 |
{
|
21 |
public:
|
22 |
enum ECorr {
|
23 |
L1 = 0,
|
24 |
L2,
|
25 |
L3,
|
26 |
L4,
|
27 |
L5,
|
28 |
L6,
|
29 |
L7,
|
30 |
Custom
|
31 |
};
|
32 |
|
33 |
Jet() :
|
34 |
fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
|
35 |
fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
|
36 |
fSimpleSecondaryVertexBJetTagsDisc(0), fSimpleSecondaryVertexHighEffBJetTagsDisc(0),
|
37 |
fSimpleSecondaryVertexHighPurBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
|
38 |
fCombinedSecondaryVertexMVABJetTagsDisc(0), fTrackCountingHighEffBJetTagsDisc(0),
|
39 |
fTrackCountingHighPurBJetTagsDisc(0), fSoftMuonBJetTagsDisc(0),
|
40 |
fSoftMuonByIP3dBJetTagsDisc(0), fSoftMuonByPtBJetTagsDisc(0),
|
41 |
fSoftElectronByIP3dBJetTagsDisc(0), fSoftElectronByPtBJetTagsDisc(0),
|
42 |
fGhostTrackBJetTagsDisc(0),
|
43 |
fL1OffsetCorrectionScale(0), fJetArea(0),
|
44 |
fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
|
45 |
fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL6LSBCorrectionScale(0),
|
46 |
fL7PartonCorrectionScale(0),
|
47 |
fCustomCorrectionScale(0) {}
|
48 |
Jet(Double_t px, Double_t py, Double_t pz, Double_t e) :
|
49 |
fRawMom(FourVector(px,py,pz,e)),
|
50 |
fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
|
51 |
fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
|
52 |
fSimpleSecondaryVertexBJetTagsDisc(0), fSimpleSecondaryVertexHighEffBJetTagsDisc(0),
|
53 |
fSimpleSecondaryVertexHighPurBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
|
54 |
fCombinedSecondaryVertexMVABJetTagsDisc(0), fTrackCountingHighEffBJetTagsDisc(0),
|
55 |
fTrackCountingHighPurBJetTagsDisc(0), fSoftMuonBJetTagsDisc(0),
|
56 |
fSoftMuonByIP3dBJetTagsDisc(0), fSoftMuonByPtBJetTagsDisc(0),
|
57 |
fSoftElectronByIP3dBJetTagsDisc(0), fSoftElectronByPtBJetTagsDisc(0),
|
58 |
fGhostTrackBJetTagsDisc(0),
|
59 |
fL1OffsetCorrectionScale(0), fJetArea(0),
|
60 |
fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
|
61 |
fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL6LSBCorrectionScale(0),
|
62 |
fL7PartonCorrectionScale(0),
|
63 |
fCustomCorrectionScale(0) {}
|
64 |
|
65 |
Double_t Alpha() const { return fAlpha; }
|
66 |
Double_t Beta() const { return fBeta; }
|
67 |
Double_t CombinedSecondaryVertexBJetTagsDisc() const
|
68 |
{ return fCombinedSecondaryVertexBJetTagsDisc; }
|
69 |
Double_t CombinedSecondaryVertexMVABJetTagsDisc() const
|
70 |
{ return fCombinedSecondaryVertexMVABJetTagsDisc; }
|
71 |
Double_t CombinedCorrectionScale() const;
|
72 |
Double_t CustomCorrectionScale() const { return fCustomCorrectionScale; }
|
73 |
void DisableCorrection(ECorr c) { fCorrections.ClearBit(c); ClearMom(); }
|
74 |
void DisableCorrections() { fCorrections.Clear(); ClearMom(); }
|
75 |
void EnableCorrection(ECorr c) { fCorrections.SetBit(c); ClearMom(); }
|
76 |
Bool_t CorrectionActive(ECorr c) const { return fCorrections.TestBit(c); }
|
77 |
const BitMask8 &Corrections() const { return fCorrections; }
|
78 |
Double_t JetProbabilityBJetTagsDisc() const
|
79 |
{ return fJetProbabilityBJetTagsDisc; }
|
80 |
Double_t JetBProbabilityBJetTagsDisc() const
|
81 |
{ return fJetBProbabilityBJetTagsDisc; }
|
82 |
Int_t MatchedMCFlavor() const { return fMatchedMCFlavor; }
|
83 |
virtual Jet *MakeCopy() const { return new Jet(*this); }
|
84 |
virtual
|
85 |
UInt_t NConstituents() const { return 0; }
|
86 |
UInt_t N() const { return NConstituents(); }
|
87 |
Double_t L1OffsetCorrectionScale() const { return fL1OffsetCorrectionScale; }
|
88 |
Double_t JetArea() const { return fJetArea; }
|
89 |
Double_t L2RelativeCorrectionScale() const { return fL2RelativeCorrectionScale; }
|
90 |
Double_t L3AbsoluteCorrectionScale() const { return fL3AbsoluteCorrectionScale; }
|
91 |
Double_t L4EMFCorrectionScale() const { return fL4EMFCorrectionScale; }
|
92 |
Double_t L5FlavorCorrectionScale() const { return fL5FlavorCorrectionScale; }
|
93 |
Double_t L6LSBCorrectionScale() const { return fL6LSBCorrectionScale; }
|
94 |
Double_t L7PartonCorrectionScale() const { return fL7PartonCorrectionScale; }
|
95 |
EObjType ObjType() const { return kJet; }
|
96 |
Double_t SimpleSecondaryVertexBJetTagsDisc() const
|
97 |
{ return fSimpleSecondaryVertexBJetTagsDisc; }
|
98 |
Double_t SimpleSecondaryVertexHighEffBJetTagsDisc() const
|
99 |
{ return fSimpleSecondaryVertexHighEffBJetTagsDisc; }
|
100 |
Double_t SimpleSecondaryVertexHighPurBJetTagsDisc() const
|
101 |
{ return fSimpleSecondaryVertexHighPurBJetTagsDisc; }
|
102 |
Double_t SoftMuonBJetTagsDisc() const
|
103 |
{ return fSoftMuonBJetTagsDisc; }
|
104 |
Double_t SoftMuonByIP3dBJetTagsDisc() const
|
105 |
{ return fSoftMuonByIP3dBJetTagsDisc; }
|
106 |
Double_t SoftMuonByPtBJetTagsDisc() const
|
107 |
{ return fSoftMuonByPtBJetTagsDisc; }
|
108 |
Double_t SoftElectronByIP3dBJetTagsDisc() const
|
109 |
{ return fSoftElectronByIP3dBJetTagsDisc; }
|
110 |
Double_t SoftElectronByPtBJetTagsDisc() const
|
111 |
{ return fSoftElectronByPtBJetTagsDisc; }
|
112 |
Double_t TrackCountingHighEffBJetTagsDisc() const
|
113 |
{ return fTrackCountingHighEffBJetTagsDisc; }
|
114 |
Double_t TrackCountingHighPurBJetTagsDisc() const
|
115 |
{ return fTrackCountingHighPurBJetTagsDisc; }
|
116 |
Double_t GhostTrackBJetTagsDisc() const
|
117 |
{ return fGhostTrackBJetTagsDisc; }
|
118 |
FourVectorM RawMom() const { return fRawMom.V(); }
|
119 |
Double_t SigmaEta() const { return fSigmaEta; }
|
120 |
Double_t SigmaPhi() const { return fSigmaPhi; }
|
121 |
void SetAlpha(Double_t val) { fAlpha = val; }
|
122 |
void SetBeta(Double_t val) { fBeta = val; }
|
123 |
void SetSigmaEta(Double_t val) { fSigmaEta = val; }
|
124 |
void SetSigmaPhi(Double_t val) { fSigmaPhi = val; }
|
125 |
void SetCorrections(const BitMask8 &cor) { fCorrections = cor; }
|
126 |
void SetCombinedSecondaryVertexBJetTagsDisc(Double_t d)
|
127 |
{ fCombinedSecondaryVertexBJetTagsDisc = d; }
|
128 |
void SetCombinedSecondaryVertexMVABJetTagsDisc(Double_t d)
|
129 |
{ fCombinedSecondaryVertexMVABJetTagsDisc = d; }
|
130 |
void SetJetProbabilityBJetTagsDisc(Double_t d)
|
131 |
{ fJetProbabilityBJetTagsDisc = d; }
|
132 |
void SetJetBProbabilityBJetTagsDisc(Double_t d)
|
133 |
{ fJetBProbabilityBJetTagsDisc = d; }
|
134 |
void SetRawMom(const FourVectorM &mom) { fRawMom = mom; ClearMom(); }
|
135 |
void SetMatchedMCFlavor(Int_t flavor) { fMatchedMCFlavor = flavor; }
|
136 |
void SetL1OffsetCorrectionScale(Double_t s )
|
137 |
{ fL1OffsetCorrectionScale = s; ClearMom(); }
|
138 |
void SetJetArea(Double_t a) { fJetArea = a; }
|
139 |
void SetL2RelativeCorrectionScale(Double_t s )
|
140 |
{ fL2RelativeCorrectionScale = s; ClearMom(); }
|
141 |
void SetL3AbsoluteCorrectionScale(Double_t s )
|
142 |
{ fL3AbsoluteCorrectionScale = s; ClearMom(); }
|
143 |
void SetL4EMFCorrectionScale(Double_t s )
|
144 |
{ fL4EMFCorrectionScale = s; ClearMom(); }
|
145 |
void SetL5FlavorCorrectionScale(Double_t s )
|
146 |
{ fL5FlavorCorrectionScale = s; ClearMom(); }
|
147 |
void SetL6LSBCorrectionScale(Double_t s )
|
148 |
{ fL6LSBCorrectionScale = s; ClearMom(); }
|
149 |
void SetL7PartonCorrectionScale(Double_t s )
|
150 |
{ fL7PartonCorrectionScale = s; ClearMom(); }
|
151 |
void SetCustomCorrectionScale(Double_t s)
|
152 |
{ fCustomCorrectionScale = s; ClearMom(); }
|
153 |
void SetSimpleSecondaryVertexBJetTagsDisc(Double_t d)
|
154 |
{ fSimpleSecondaryVertexBJetTagsDisc = d; }
|
155 |
void SetSimpleSecondaryVertexHighEffBJetTagsDisc(Double_t d)
|
156 |
{ fSimpleSecondaryVertexHighEffBJetTagsDisc = d; }
|
157 |
void SetSimpleSecondaryVertexHighPurBJetTagsDisc(Double_t d)
|
158 |
{ fSimpleSecondaryVertexHighPurBJetTagsDisc = d; }
|
159 |
void SetSoftMuonBJetTagsDisc(Double_t d) { fSoftMuonBJetTagsDisc = d; }
|
160 |
void SetSoftMuonByIP3dBJetTagsDisc(Double_t d) { fSoftMuonByIP3dBJetTagsDisc = d; }
|
161 |
void SetSoftMuonByPtBJetTagsDisc(Double_t d) { fSoftMuonByPtBJetTagsDisc = d; }
|
162 |
void SetSoftElectronByIP3dBJetTagsDisc(Double_t d) { fSoftElectronByIP3dBJetTagsDisc = d; }
|
163 |
void SetSoftElectronByPtBJetTagsDisc(Double_t d) { fSoftElectronByPtBJetTagsDisc = d; }
|
164 |
void SetTrackCountingHighEffBJetTagsDisc(Double_t d)
|
165 |
{ fTrackCountingHighEffBJetTagsDisc = d; }
|
166 |
void SetTrackCountingHighPurBJetTagsDisc(Double_t d)
|
167 |
{ fTrackCountingHighPurBJetTagsDisc = d; }
|
168 |
void SetGhostTrackBJetTagsDisc(Double_t d) { fGhostTrackBJetTagsDisc = d; }
|
169 |
|
170 |
protected:
|
171 |
void GetMom() const;
|
172 |
|
173 |
Vect4M fRawMom; //uncorrected four momentum of jet
|
174 |
Double32_t fAlpha; //[0,0,14]jet vertex alpha variable
|
175 |
Double32_t fBeta; //[0,0,14]jet vertex beta variable
|
176 |
Int_t fMatchedMCFlavor; //[0,0,14]pdg of matched quark flavor
|
177 |
Double32_t fSigmaEta; //[0,0,14]sqrt(etaetaMoment)
|
178 |
Double32_t fSigmaPhi; //[0,0,14]sqrt(phiphiMoment)
|
179 |
Double32_t fJetProbabilityBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
180 |
Double32_t fJetBProbabilityBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
181 |
Double32_t fSimpleSecondaryVertexBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
182 |
Double32_t fSimpleSecondaryVertexHighEffBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
183 |
Double32_t fSimpleSecondaryVertexHighPurBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
184 |
Double32_t fCombinedSecondaryVertexBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
185 |
Double32_t fCombinedSecondaryVertexMVABJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
186 |
Double32_t fTrackCountingHighEffBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
187 |
Double32_t fTrackCountingHighPurBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
188 |
Double32_t fSoftMuonBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
189 |
Double32_t fSoftMuonByIP3dBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
190 |
Double32_t fSoftMuonByPtBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
191 |
Double32_t fSoftElectronByIP3dBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
192 |
Double32_t fSoftElectronByPtBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
193 |
Double32_t fGhostTrackBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
|
194 |
Double32_t fL1OffsetCorrectionScale; //[0,0,14]L1 correction scale
|
195 |
Double32_t fJetArea; //[0,0,14]infrared safe jet area
|
196 |
Double32_t fL2RelativeCorrectionScale; //[0,0,14]L2 correction scale
|
197 |
Double32_t fL3AbsoluteCorrectionScale; //[0,0,14]L3 correction scale
|
198 |
Double32_t fL4EMFCorrectionScale; //[0,0,14]L4 correction scale
|
199 |
Double32_t fL5FlavorCorrectionScale; //[0,0,14]L5 correction scale
|
200 |
Double32_t fL6LSBCorrectionScale; //[0,0,14]L7 correction scale
|
201 |
Double32_t fL7PartonCorrectionScale; //[0,0,14]L7 correction scale
|
202 |
Double32_t fCustomCorrectionScale; //[0,0,14]custom correction scale
|
203 |
BitMask8 fCorrections; //mask of corrections to be applied
|
204 |
|
205 |
ClassDef(Jet, 6) // Jet class
|
206 |
};
|
207 |
}
|
208 |
|
209 |
//--------------------------------------------------------------------------------------------------
|
210 |
inline Double_t mithep::Jet::CombinedCorrectionScale() const
|
211 |
{
|
212 |
// compute combined correction scale from all enabled corrections
|
213 |
Double_t scale = 1.0;
|
214 |
|
215 |
if (CorrectionActive(L1))
|
216 |
scale *= fL1OffsetCorrectionScale;
|
217 |
|
218 |
if (CorrectionActive(L2))
|
219 |
scale *= fL2RelativeCorrectionScale;
|
220 |
|
221 |
if (CorrectionActive(L3))
|
222 |
scale *= fL3AbsoluteCorrectionScale;
|
223 |
|
224 |
if (CorrectionActive(L4))
|
225 |
scale *= fL4EMFCorrectionScale;
|
226 |
|
227 |
if (CorrectionActive(L5))
|
228 |
scale *= fL5FlavorCorrectionScale;
|
229 |
|
230 |
if (CorrectionActive(L7))
|
231 |
scale *= fL7PartonCorrectionScale;
|
232 |
|
233 |
if (CorrectionActive(Custom))
|
234 |
scale *= fCustomCorrectionScale;
|
235 |
|
236 |
return scale;
|
237 |
}
|
238 |
|
239 |
//--------------------------------------------------------------------------------------------------
|
240 |
inline void mithep::Jet::GetMom() const
|
241 |
{
|
242 |
// Get raw momentum values from stored values and apply all enabled corrections.
|
243 |
|
244 |
fCachedMom.SetCoordinates(fRawMom.Pt(),fRawMom.Eta(),fRawMom.Phi(),fRawMom.M());
|
245 |
|
246 |
fCachedMom *= CombinedCorrectionScale();
|
247 |
|
248 |
}
|
249 |
#endif
|