ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Jet.h
Revision: 1.20
Committed: Wed Mar 11 18:11:18 2009 UTC (16 years, 1 month ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_008pre2
Changes since 1.19: +20 -77 lines
Log Message:
Split Jet into Jet base class and CaloJet inheriting class

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: Jet.h,v 1.19 2009/03/05 10:55:21 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 "MitAna/DataTree/interface/Particle.h"
15
16 namespace mithep
17 {
18 class Jet : public Particle
19 {
20 public:
21 enum ECorr {
22 L1 = 0,
23 L2,
24 L3,
25 L4,
26 L5,
27 L6,
28 L7,
29 Custom
30 };
31
32 Jet() :
33 fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
34 fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
35 fSimpleSecondaryVertexBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
36 fCombinedSecondaryVertexMVABJetTagsDisc(0), fImpactParameterMVABJetTagsDisc(0),
37 fTrackCountingHighEffBJetTagsDisc(0), fTrackCountingHighPurBJetTagsDisc(0),
38 fSoftMuonBJetTagsDisc(0), fSoftMuonNoIPBJetTagsDisc(0),
39 fSoftElectronBJetTagsDisc(0), fL2RelativeCorrectionScale(0),
40 fL3AbsoluteCorrectionScale(0), fL4EMFCorrectionScale(0),
41 fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0),
42 fCustomCorrectionScale(0) {}
43 Jet(Double_t px, Double_t py, Double_t pz, Double_t e) :
44 fRawMom(FourVector(px,py,pz,e)),
45 fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
46 fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
47 fSimpleSecondaryVertexBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
48 fCombinedSecondaryVertexMVABJetTagsDisc(0), fImpactParameterMVABJetTagsDisc(0),
49 fTrackCountingHighEffBJetTagsDisc(0), fTrackCountingHighPurBJetTagsDisc(0),
50 fSoftMuonBJetTagsDisc(0), fSoftMuonNoIPBJetTagsDisc(0),
51 fSoftElectronBJetTagsDisc(0), fL2RelativeCorrectionScale(0),
52 fL3AbsoluteCorrectionScale(0), fL4EMFCorrectionScale(0),
53 fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0),
54 fCustomCorrectionScale(0) {}
55
56 Double_t Alpha() const { return fAlpha; }
57 Double_t Beta() const { return fBeta; }
58 Double_t CombinedSecondaryVertexBJetTagsDisc() const
59 { return fCombinedSecondaryVertexBJetTagsDisc; }
60 Double_t CombinedSecondaryVertexMVABJetTagsDisc() const
61 { return fCombinedSecondaryVertexMVABJetTagsDisc; }
62 Double_t CustomCorrectionScale() const { return fCustomCorrectionScale; }
63 void DisableCorrection(ECorr c) { fCorrections.ClearBit(c); ClearMom(); }
64 void DisableCorrections() { fCorrections.Clear(); ClearMom(); }
65 void EnableCorrection(ECorr c) { fCorrections.SetBit(c); ClearMom(); }
66 Bool_t CorrectionActive(ECorr c) const { return fCorrections.TestBit(c); }
67 Double_t ImpactParameterMVABJetTagsDisc() const
68 { return fImpactParameterMVABJetTagsDisc; }
69 Double_t JetProbabilityBJetTagsDisc() const
70 { return fJetProbabilityBJetTagsDisc; }
71 Double_t JetBProbabilityBJetTagsDisc() const
72 { return fJetBProbabilityBJetTagsDisc; }
73 Int_t MatchedMCFlavor() const { return fMatchedMCFlavor; }
74 virtual UInt_t NConstituents() const { return 0; }
75 UInt_t N() const { return NConstituents(); }
76 Double_t L2RelativeCorrectionScale() const { return fL2RelativeCorrectionScale; }
77 Double_t L3AbsoluteCorrectionScale() const { return fL3AbsoluteCorrectionScale; }
78 Double_t L4EMFCorrectionScale() const { return fL4EMFCorrectionScale; }
79 Double_t L5FlavorCorrectionScale() const { return fL5FlavorCorrectionScale; }
80 Double_t L7PartonCorrectionScale() const { return fL7PartonCorrectionScale; }
81 EObjType ObjType() const { return kJet; }
82 Double_t SimpleSecondaryVertexBJetTagsDisc() const
83 { return fSimpleSecondaryVertexBJetTagsDisc; }
84 Double_t SoftMuonBJetTagsDisc() const
85 { return fSoftMuonBJetTagsDisc; }
86 Double_t SoftMuonNoIPBJetTagsDisc() const
87 { return fSoftMuonNoIPBJetTagsDisc; }
88 Double_t SoftElectronBJetTagsDisc() const
89 { return fSoftElectronBJetTagsDisc; }
90 Double_t TrackCountingHighEffBJetTagsDisc() const
91 { return fTrackCountingHighEffBJetTagsDisc; }
92 Double_t TrackCountingHighPurBJetTagsDisc() const
93 { return fTrackCountingHighPurBJetTagsDisc; }
94 const FourVectorM &RawMom() const { return fRawMom; }
95 void SetAlpha(Double_t val) { fAlpha = val; }
96 void SetBeta(Double_t val) { fBeta = val; }
97 void SetCombinedSecondaryVertexBJetTagsDisc(Double_t d)
98 { fCombinedSecondaryVertexBJetTagsDisc = d; }
99 void SetCombinedSecondaryVertexMVABJetTagsDisc(Double_t d)
100 { fCombinedSecondaryVertexMVABJetTagsDisc = d; }
101 void SetImpactParameterMVABJetTagsDisc (Double_t d)
102 { fImpactParameterMVABJetTagsDisc = d; }
103 void SetJetProbabilityBJetTagsDisc(Double_t d)
104 { fJetProbabilityBJetTagsDisc = d; }
105 void SetJetBProbabilityBJetTagsDisc(Double_t d)
106 { fJetBProbabilityBJetTagsDisc = d; }
107 void SetRawMom(const FourVectorM &mom) { fRawMom = mom; ClearMom(); }
108 void SetMatchedMCFlavor(Int_t flavor) { fMatchedMCFlavor = flavor; }
109 void SetL2RelativeCorrectionScale(Double_t s )
110 { fL2RelativeCorrectionScale = s; ClearMom(); }
111 void SetL3AbsoluteCorrectionScale(Double_t s )
112 { fL3AbsoluteCorrectionScale = s; ClearMom(); }
113 void SetL4EMFCorrectionScale(Double_t s )
114 { fL4EMFCorrectionScale = s; ClearMom(); }
115 void SetL5FlavorCorrectionScale(Double_t s )
116 { fL5FlavorCorrectionScale = s; ClearMom(); }
117 void SetL7PartonCorrectionScale(Double_t s )
118 { fL7PartonCorrectionScale = s; ClearMom(); }
119 void SetCustomCorrectionScale(Double_t s)
120 { fCustomCorrectionScale = s; ClearMom(); }
121 void SetSimpleSecondaryVertexBJetTagsDisc(Double_t d)
122 { fSimpleSecondaryVertexBJetTagsDisc = d; }
123 void SetSoftMuonBJetTagsDisc(Double_t d) { fSoftMuonBJetTagsDisc = d; }
124 void SetSoftMuonNoIPBJetTagsDisc(Double_t d) { fSoftMuonNoIPBJetTagsDisc = d; }
125 void SetSoftElectronBJetTagsDisc(Double_t d) { fSoftElectronBJetTagsDisc = d; }
126 void SetTrackCountingHighEffBJetTagsDisc(Double_t d)
127 { fTrackCountingHighEffBJetTagsDisc = d; }
128 void SetTrackCountingHighPurBJetTagsDisc(Double_t d)
129 { fTrackCountingHighPurBJetTagsDisc = d; }
130
131 protected:
132 void GetMom() const;
133
134 FourVectorM32 fRawMom; //uncorrected four momentum of jet
135 Double32_t fAlpha; //jet vertex association alpha variable
136 Double32_t fBeta; //jet vertex association beta variable
137 Int_t fMatchedMCFlavor; //pdg of the quark flavor that the jet matched to
138 Double32_t fJetProbabilityBJetTagsDisc; //discriminants from b-tagging algos
139 Double32_t fJetBProbabilityBJetTagsDisc; //discriminants from b-tagging algos
140 Double32_t fSimpleSecondaryVertexBJetTagsDisc; //discriminants from b-tagging algos
141 Double32_t fCombinedSecondaryVertexBJetTagsDisc; //discriminants from b-tagging algos
142 Double32_t fCombinedSecondaryVertexMVABJetTagsDisc; //discriminants from b-tagging algos
143 Double32_t fImpactParameterMVABJetTagsDisc; //discriminants from b-tagging algos
144 Double32_t fTrackCountingHighEffBJetTagsDisc; //discriminants from b-tagging algos
145 Double32_t fTrackCountingHighPurBJetTagsDisc; //discriminants from b-tagging algos
146 Double32_t fSoftMuonBJetTagsDisc; //discriminants from b-tagging algos
147 Double32_t fSoftMuonNoIPBJetTagsDisc; //discriminants from b-tagging algos
148 Double32_t fSoftElectronBJetTagsDisc; //discriminants from b-tagging algos
149 Double32_t fL2RelativeCorrectionScale; //L2 correction scale
150 Double32_t fL3AbsoluteCorrectionScale; //L3 correction scale
151 Double32_t fL4EMFCorrectionScale; //L4 correction scale
152 Double32_t fL5FlavorCorrectionScale; //L5 correction scale
153 Double32_t fL7PartonCorrectionScale; //L7 correction scale
154 Double32_t fCustomCorrectionScale; //custom correction scale
155 BitMask8 fCorrections; //mask of corrections to be applied
156
157 ClassDef(Jet, 1) // Jet class
158 };
159 }
160
161 //--------------------------------------------------------------------------------------------------
162 inline void mithep::Jet::GetMom() const
163 {
164 // Get raw momentum values from stored values and apply all enabled corrections.
165
166 fCachedMom = fRawMom;
167
168 if (CorrectionActive(L2))
169 fCachedMom *= fL2RelativeCorrectionScale;
170
171 if (CorrectionActive(L3))
172 fCachedMom *= fL3AbsoluteCorrectionScale;
173
174 if (CorrectionActive(L4))
175 fCachedMom *= fL4EMFCorrectionScale;
176
177 if (CorrectionActive(L5))
178 fCachedMom *= fL5FlavorCorrectionScale;
179
180 if (CorrectionActive(L7))
181 fCachedMom *= fL7PartonCorrectionScale;
182
183 if (CorrectionActive(Custom))
184 fCachedMom *= fCustomCorrectionScale;
185 }
186 #endif