ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Jet.h
Revision: 1.27
Committed: Sun May 30 14:00:24 2010 UTC (14 years, 11 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014
Changes since 1.26: +22 -4 lines
Log Message:
Add new btag variables

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Jet.h,v 1.26 2010/05/10 15:13:29 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),
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),
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 L2RelativeCorrectionScale() const { return fL2RelativeCorrectionScale; }
89 Double_t L3AbsoluteCorrectionScale() const { return fL3AbsoluteCorrectionScale; }
90 Double_t L4EMFCorrectionScale() const { return fL4EMFCorrectionScale; }
91 Double_t L5FlavorCorrectionScale() const { return fL5FlavorCorrectionScale; }
92 Double_t L6LSBCorrectionScale() const { return fL6LSBCorrectionScale; }
93 Double_t L7PartonCorrectionScale() const { return fL7PartonCorrectionScale; }
94 EObjType ObjType() const { return kJet; }
95 Double_t SimpleSecondaryVertexBJetTagsDisc() const
96 { return fSimpleSecondaryVertexBJetTagsDisc; }
97 Double_t SimpleSecondaryVertexHighEffBJetTagsDisc() const
98 { return fSimpleSecondaryVertexHighEffBJetTagsDisc; }
99 Double_t SimpleSecondaryVertexHighPurBJetTagsDisc() const
100 { return fSimpleSecondaryVertexHighPurBJetTagsDisc; }
101 Double_t SoftMuonBJetTagsDisc() const
102 { return fSoftMuonBJetTagsDisc; }
103 Double_t SoftMuonByIP3dBJetTagsDisc() const
104 { return fSoftMuonByIP3dBJetTagsDisc; }
105 Double_t SoftMuonByPtBJetTagsDisc() const
106 { return fSoftMuonByPtBJetTagsDisc; }
107 Double_t SoftElectronByIP3dBJetTagsDisc() const
108 { return fSoftElectronByIP3dBJetTagsDisc; }
109 Double_t SoftElectronByPtBJetTagsDisc() const
110 { return fSoftElectronByPtBJetTagsDisc; }
111 Double_t TrackCountingHighEffBJetTagsDisc() const
112 { return fTrackCountingHighEffBJetTagsDisc; }
113 Double_t TrackCountingHighPurBJetTagsDisc() const
114 { return fTrackCountingHighPurBJetTagsDisc; }
115 Double_t GhostTrackBJetTagsDisc() const
116 { return fGhostTrackBJetTagsDisc; }
117 FourVectorM RawMom() const { return fRawMom.V(); }
118 Double_t SigmaEta() const { return fSigmaEta; }
119 Double_t SigmaPhi() const { return fSigmaPhi; }
120 void SetAlpha(Double_t val) { fAlpha = val; }
121 void SetBeta(Double_t val) { fBeta = val; }
122 void SetSigmaEta(Double_t val) { fSigmaEta = val; }
123 void SetSigmaPhi(Double_t val) { fSigmaPhi = val; }
124 void SetCorrections(const BitMask8 &cor) { fCorrections = cor; }
125 void SetCombinedSecondaryVertexBJetTagsDisc(Double_t d)
126 { fCombinedSecondaryVertexBJetTagsDisc = d; }
127 void SetCombinedSecondaryVertexMVABJetTagsDisc(Double_t d)
128 { fCombinedSecondaryVertexMVABJetTagsDisc = d; }
129 void SetJetProbabilityBJetTagsDisc(Double_t d)
130 { fJetProbabilityBJetTagsDisc = d; }
131 void SetJetBProbabilityBJetTagsDisc(Double_t d)
132 { fJetBProbabilityBJetTagsDisc = d; }
133 void SetRawMom(const FourVectorM &mom) { fRawMom = mom; ClearMom(); }
134 void SetMatchedMCFlavor(Int_t flavor) { fMatchedMCFlavor = flavor; }
135 void SetL1OffsetCorrectionScale(Double_t s )
136 { fL1OffsetCorrectionScale = s; ClearMom(); }
137 void SetL2RelativeCorrectionScale(Double_t s )
138 { fL2RelativeCorrectionScale = s; ClearMom(); }
139 void SetL3AbsoluteCorrectionScale(Double_t s )
140 { fL3AbsoluteCorrectionScale = s; ClearMom(); }
141 void SetL4EMFCorrectionScale(Double_t s )
142 { fL4EMFCorrectionScale = s; ClearMom(); }
143 void SetL5FlavorCorrectionScale(Double_t s )
144 { fL5FlavorCorrectionScale = s; ClearMom(); }
145 void SetL6LSBCorrectionScale(Double_t s )
146 { fL6LSBCorrectionScale = s; ClearMom(); }
147 void SetL7PartonCorrectionScale(Double_t s )
148 { fL7PartonCorrectionScale = s; ClearMom(); }
149 void SetCustomCorrectionScale(Double_t s)
150 { fCustomCorrectionScale = s; ClearMom(); }
151 void SetSimpleSecondaryVertexBJetTagsDisc(Double_t d)
152 { fSimpleSecondaryVertexBJetTagsDisc = d; }
153 void SetSimpleSecondaryVertexHighEffBJetTagsDisc(Double_t d)
154 { fSimpleSecondaryVertexHighEffBJetTagsDisc = d; }
155 void SetSimpleSecondaryVertexHighPurBJetTagsDisc(Double_t d)
156 { fSimpleSecondaryVertexHighPurBJetTagsDisc = d; }
157 void SetSoftMuonBJetTagsDisc(Double_t d) { fSoftMuonBJetTagsDisc = d; }
158 void SetSoftMuonByIP3dBJetTagsDisc(Double_t d) { fSoftMuonByIP3dBJetTagsDisc = d; }
159 void SetSoftMuonByPtBJetTagsDisc(Double_t d) { fSoftMuonByPtBJetTagsDisc = d; }
160 void SetSoftElectronByIP3dBJetTagsDisc(Double_t d) { fSoftElectronByIP3dBJetTagsDisc = d; }
161 void SetSoftElectronByPtBJetTagsDisc(Double_t d) { fSoftElectronByPtBJetTagsDisc = d; }
162 void SetTrackCountingHighEffBJetTagsDisc(Double_t d)
163 { fTrackCountingHighEffBJetTagsDisc = d; }
164 void SetTrackCountingHighPurBJetTagsDisc(Double_t d)
165 { fTrackCountingHighPurBJetTagsDisc = d; }
166 void SetGhostTrackBJetTagsDisc(Double_t d) { fGhostTrackBJetTagsDisc = d; }
167
168 protected:
169 void GetMom() const;
170
171 Vect4M fRawMom; //uncorrected four momentum of jet
172 Double32_t fAlpha; //[0,0,14]jet vertex alpha variable
173 Double32_t fBeta; //[0,0,14]jet vertex beta variable
174 Int_t fMatchedMCFlavor; //[0,0,14]pdg of matched quark flavor
175 Double32_t fSigmaEta; //[0,0,14]sqrt(etaetaMoment)
176 Double32_t fSigmaPhi; //[0,0,14]sqrt(phiphiMoment)
177 Double32_t fJetProbabilityBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
178 Double32_t fJetBProbabilityBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
179 Double32_t fSimpleSecondaryVertexBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
180 Double32_t fSimpleSecondaryVertexHighEffBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
181 Double32_t fSimpleSecondaryVertexHighPurBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
182 Double32_t fCombinedSecondaryVertexBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
183 Double32_t fCombinedSecondaryVertexMVABJetTagsDisc; //[0,0,14]discriminants b-tagging algos
184 Double32_t fTrackCountingHighEffBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
185 Double32_t fTrackCountingHighPurBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
186 Double32_t fSoftMuonBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
187 Double32_t fSoftMuonByIP3dBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
188 Double32_t fSoftMuonByPtBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
189 Double32_t fSoftElectronByIP3dBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
190 Double32_t fSoftElectronByPtBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
191 Double32_t fGhostTrackBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
192 Double32_t fL1OffsetCorrectionScale; //[0,0,14]L1 correction scale
193 Double32_t fL2RelativeCorrectionScale; //[0,0,14]L2 correction scale
194 Double32_t fL3AbsoluteCorrectionScale; //[0,0,14]L3 correction scale
195 Double32_t fL4EMFCorrectionScale; //[0,0,14]L4 correction scale
196 Double32_t fL5FlavorCorrectionScale; //[0,0,14]L5 correction scale
197 Double32_t fL6LSBCorrectionScale; //[0,0,14]L7 correction scale
198 Double32_t fL7PartonCorrectionScale; //[0,0,14]L7 correction scale
199 Double32_t fCustomCorrectionScale; //[0,0,14]custom correction scale
200 BitMask8 fCorrections; //mask of corrections to be applied
201
202 ClassDef(Jet, 5) // Jet class
203 };
204 }
205
206 //--------------------------------------------------------------------------------------------------
207 inline Double_t mithep::Jet::CombinedCorrectionScale() const
208 {
209 // compute combined correction scale from all enabled corrections
210 Double_t scale = 1.0;
211
212 if (CorrectionActive(L2))
213 scale *= fL2RelativeCorrectionScale;
214
215 if (CorrectionActive(L3))
216 scale *= fL3AbsoluteCorrectionScale;
217
218 if (CorrectionActive(L4))
219 scale *= fL4EMFCorrectionScale;
220
221 if (CorrectionActive(L5))
222 scale *= fL5FlavorCorrectionScale;
223
224 if (CorrectionActive(L7))
225 scale *= fL7PartonCorrectionScale;
226
227 if (CorrectionActive(Custom))
228 scale *= fCustomCorrectionScale;
229
230 return scale;
231 }
232
233 //--------------------------------------------------------------------------------------------------
234 inline void mithep::Jet::GetMom() const
235 {
236 // Get raw momentum values from stored values and apply all enabled corrections.
237
238 fCachedMom.SetCoordinates(fRawMom.Pt(),fRawMom.Eta(),fRawMom.Phi(),fRawMom.M());
239
240 fCachedMom *= CombinedCorrectionScale();
241
242 }
243 #endif