ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Jet.h
Revision: 1.26
Committed: Mon May 10 15:13:29 2010 UTC (14 years, 11 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_014pre3, Mit_014pre2, Mit_014pre1
Changes since 1.25: +18 -4 lines
Log Message:
Add L1 and L6 jet correction variables

File Contents

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