ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Jet.h
Revision: 1.23
Committed: Wed Sep 9 03:38:26 2009 UTC (15 years, 7 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_013, Mit_013pre1, Mit_012i, Mit_012h, Mit_012g, Mit_012f, Mit_012e, Mit_012d, Mit_012c, Mit_012b, Mit_012a, Mit_012, Mit_011a
Changes since 1.22: +25 -11 lines
Log Message:
Add MakeCopy functions and cleaned up some jetmet getters and setters

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.23 // $Id: Jet.h,v 1.22 2009/07/07 08:30:28 bendavid 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     fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
42     fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0),
43 bendavid 1.19 fCustomCorrectionScale(0) {}
44 loizides 1.18 Jet(Double_t px, Double_t py, Double_t pz, Double_t e) :
45     fRawMom(FourVector(px,py,pz,e)),
46 bendavid 1.20 fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
47 loizides 1.18 fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
48     fSimpleSecondaryVertexBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
49 bendavid 1.22 fCombinedSecondaryVertexMVABJetTagsDisc(0), fTrackCountingHighEffBJetTagsDisc(0),
50     fTrackCountingHighPurBJetTagsDisc(0), fSoftMuonBJetTagsDisc(0),
51     fSoftMuonByIP3dBJetTagsDisc(0), fSoftMuonByPtBJetTagsDisc(0),
52     fSoftElectronByIP3dBJetTagsDisc(0), fSoftElectronByPtBJetTagsDisc(0),
53     fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
54     fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0),
55 bendavid 1.19 fCustomCorrectionScale(0) {}
56 loizides 1.1
57 loizides 1.21 Double_t Alpha() const { return fAlpha; }
58     Double_t Beta() const { return fBeta; }
59     Double_t CombinedSecondaryVertexBJetTagsDisc() const
60     { return fCombinedSecondaryVertexBJetTagsDisc; }
61     Double_t CombinedSecondaryVertexMVABJetTagsDisc() const
62     { return fCombinedSecondaryVertexMVABJetTagsDisc; }
63 bendavid 1.23 Double_t CombinedCorrectionScale() const;
64 loizides 1.21 Double_t CustomCorrectionScale() const { return fCustomCorrectionScale; }
65     void DisableCorrection(ECorr c) { fCorrections.ClearBit(c); ClearMom(); }
66     void DisableCorrections() { fCorrections.Clear(); ClearMom(); }
67     void EnableCorrection(ECorr c) { fCorrections.SetBit(c); ClearMom(); }
68     Bool_t CorrectionActive(ECorr c) const { return fCorrections.TestBit(c); }
69     Double_t JetProbabilityBJetTagsDisc() const
70     { return fJetProbabilityBJetTagsDisc; }
71     Double_t JetBProbabilityBJetTagsDisc() const
72     { return fJetBProbabilityBJetTagsDisc; }
73     Int_t MatchedMCFlavor() const { return fMatchedMCFlavor; }
74 bendavid 1.23 virtual Jet *MakeCopy() const { return new Jet(*this); }
75 loizides 1.21 virtual
76     UInt_t NConstituents() const { return 0; }
77     UInt_t N() const { return NConstituents(); }
78     Double_t L2RelativeCorrectionScale() const { return fL2RelativeCorrectionScale; }
79     Double_t L3AbsoluteCorrectionScale() const { return fL3AbsoluteCorrectionScale; }
80     Double_t L4EMFCorrectionScale() const { return fL4EMFCorrectionScale; }
81     Double_t L5FlavorCorrectionScale() const { return fL5FlavorCorrectionScale; }
82     Double_t L7PartonCorrectionScale() const { return fL7PartonCorrectionScale; }
83     EObjType ObjType() const { return kJet; }
84     Double_t SimpleSecondaryVertexBJetTagsDisc() const
85     { return fSimpleSecondaryVertexBJetTagsDisc; }
86     Double_t SoftMuonBJetTagsDisc() const
87     { return fSoftMuonBJetTagsDisc; }
88 bendavid 1.22 Double_t SoftMuonByIP3dBJetTagsDisc() const
89     { return fSoftMuonByIP3dBJetTagsDisc; }
90     Double_t SoftMuonByPtBJetTagsDisc() const
91     { return fSoftMuonByPtBJetTagsDisc; }
92     Double_t SoftElectronByIP3dBJetTagsDisc() const
93     { return fSoftElectronByIP3dBJetTagsDisc; }
94     Double_t SoftElectronByPtBJetTagsDisc() const
95     { return fSoftElectronByPtBJetTagsDisc; }
96 loizides 1.21 Double_t TrackCountingHighEffBJetTagsDisc() const
97     { return fTrackCountingHighEffBJetTagsDisc; }
98     Double_t TrackCountingHighPurBJetTagsDisc() const
99     { return fTrackCountingHighPurBJetTagsDisc; }
100     FourVectorM RawMom() const { return fRawMom.V(); }
101     void SetAlpha(Double_t val) { fAlpha = val; }
102     void SetBeta(Double_t val) { fBeta = val; }
103     void SetCombinedSecondaryVertexBJetTagsDisc(Double_t d)
104     { fCombinedSecondaryVertexBJetTagsDisc = d; }
105     void SetCombinedSecondaryVertexMVABJetTagsDisc(Double_t d)
106     { fCombinedSecondaryVertexMVABJetTagsDisc = d; }
107     void SetJetProbabilityBJetTagsDisc(Double_t d)
108     { fJetProbabilityBJetTagsDisc = d; }
109     void SetJetBProbabilityBJetTagsDisc(Double_t d)
110     { fJetBProbabilityBJetTagsDisc = d; }
111     void SetRawMom(const FourVectorM &mom) { fRawMom = mom; ClearMom(); }
112     void SetMatchedMCFlavor(Int_t flavor) { fMatchedMCFlavor = flavor; }
113     void SetL2RelativeCorrectionScale(Double_t s )
114     { fL2RelativeCorrectionScale = s; ClearMom(); }
115     void SetL3AbsoluteCorrectionScale(Double_t s )
116     { fL3AbsoluteCorrectionScale = s; ClearMom(); }
117     void SetL4EMFCorrectionScale(Double_t s )
118     { fL4EMFCorrectionScale = s; ClearMom(); }
119     void SetL5FlavorCorrectionScale(Double_t s )
120     { fL5FlavorCorrectionScale = s; ClearMom(); }
121     void SetL7PartonCorrectionScale(Double_t s )
122     { fL7PartonCorrectionScale = s; ClearMom(); }
123     void SetCustomCorrectionScale(Double_t s)
124     { fCustomCorrectionScale = s; ClearMom(); }
125     void SetSimpleSecondaryVertexBJetTagsDisc(Double_t d)
126     { fSimpleSecondaryVertexBJetTagsDisc = d; }
127     void SetSoftMuonBJetTagsDisc(Double_t d) { fSoftMuonBJetTagsDisc = d; }
128 bendavid 1.22 void SetSoftMuonByIP3dBJetTagsDisc(Double_t d) { fSoftMuonByIP3dBJetTagsDisc = d; }
129     void SetSoftMuonByPtBJetTagsDisc(Double_t d) { fSoftMuonByPtBJetTagsDisc = d; }
130     void SetSoftElectronByIP3dBJetTagsDisc(Double_t d) { fSoftElectronByIP3dBJetTagsDisc = d; }
131     void SetSoftElectronByPtBJetTagsDisc(Double_t d) { fSoftElectronByPtBJetTagsDisc = d; }
132 loizides 1.21 void SetTrackCountingHighEffBJetTagsDisc(Double_t d)
133     { fTrackCountingHighEffBJetTagsDisc = d; }
134     void SetTrackCountingHighPurBJetTagsDisc(Double_t d)
135     { fTrackCountingHighPurBJetTagsDisc = d; }
136 sixie 1.9
137 loizides 1.2 protected:
138 loizides 1.18 void GetMom() const;
139 loizides 1.15
140 loizides 1.21 Vect4M fRawMom; //uncorrected four momentum of jet
141     Double32_t fAlpha; //[0,0,14]jet vertex alpha variable
142     Double32_t fBeta; //[0,0,14]jet vertex beta variable
143     Int_t fMatchedMCFlavor; //[0,0,14]pdg of matched quark flavor
144     Double32_t fJetProbabilityBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
145     Double32_t fJetBProbabilityBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
146     Double32_t fSimpleSecondaryVertexBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
147     Double32_t fCombinedSecondaryVertexBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
148     Double32_t fCombinedSecondaryVertexMVABJetTagsDisc; //[0,0,14]discriminants b-tagging algos
149     Double32_t fTrackCountingHighEffBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
150     Double32_t fTrackCountingHighPurBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
151     Double32_t fSoftMuonBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
152 bendavid 1.22 Double32_t fSoftMuonByIP3dBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
153     Double32_t fSoftMuonByPtBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
154     Double32_t fSoftElectronByIP3dBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
155     Double32_t fSoftElectronByPtBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
156 loizides 1.21 Double32_t fL2RelativeCorrectionScale; //[0,0,14]L2 correction scale
157     Double32_t fL3AbsoluteCorrectionScale; //[0,0,14]L3 correction scale
158     Double32_t fL4EMFCorrectionScale; //[0,0,14]L4 correction scale
159     Double32_t fL5FlavorCorrectionScale; //[0,0,14]L5 correction scale
160     Double32_t fL7PartonCorrectionScale; //[0,0,14]L7 correction scale
161     Double32_t fCustomCorrectionScale; //[0,0,14]custom correction scale
162 bendavid 1.20 BitMask8 fCorrections; //mask of corrections to be applied
163 loizides 1.2
164 bendavid 1.22 ClassDef(Jet, 2) // Jet class
165 loizides 1.1 };
166     }
167 loizides 1.15
168     //--------------------------------------------------------------------------------------------------
169 bendavid 1.23 inline Double_t mithep::Jet::CombinedCorrectionScale() const
170 loizides 1.15 {
171 bendavid 1.23 // compute combined correction scale from all enabled corrections
172     Double_t scale = 1.0;
173 loizides 1.21
174 bendavid 1.17 if (CorrectionActive(L2))
175 bendavid 1.23 scale *= fL2RelativeCorrectionScale;
176 bendavid 1.17
177     if (CorrectionActive(L3))
178 bendavid 1.23 scale *= fL3AbsoluteCorrectionScale;
179 bendavid 1.17
180     if (CorrectionActive(L4))
181 bendavid 1.23 scale *= fL4EMFCorrectionScale;
182 bendavid 1.17
183     if (CorrectionActive(L5))
184 bendavid 1.23 scale *= fL5FlavorCorrectionScale;
185 bendavid 1.17
186     if (CorrectionActive(L7))
187 bendavid 1.23 scale *= fL7PartonCorrectionScale;
188 bendavid 1.17
189     if (CorrectionActive(Custom))
190 bendavid 1.23 scale *= fCustomCorrectionScale;
191    
192     return scale;
193     }
194    
195     //--------------------------------------------------------------------------------------------------
196     inline void mithep::Jet::GetMom() const
197     {
198     // Get raw momentum values from stored values and apply all enabled corrections.
199    
200     fCachedMom.SetCoordinates(fRawMom.Pt(),fRawMom.Eta(),fRawMom.Phi(),fRawMom.M());
201    
202     fCachedMom *= CombinedCorrectionScale();
203    
204 loizides 1.15 }
205 loizides 1.1 #endif