ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Jet.h
Revision: 1.28
Committed: Tue Mar 1 14:24:00 2011 UTC (14 years, 2 months ago) by mzanetti
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, HEAD
Branch point for: Mit_025c_branch
Changes since 1.27: +10 -4 lines
Log Message:
added interface for jet area

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 mzanetti 1.28 // $Id: Jet.h,v 1.27 2010/05/30 14:00:24 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 bendavid 1.27 fSimpleSecondaryVertexBJetTagsDisc(0), fSimpleSecondaryVertexHighEffBJetTagsDisc(0),
37     fSimpleSecondaryVertexHighPurBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
38 bendavid 1.22 fCombinedSecondaryVertexMVABJetTagsDisc(0), fTrackCountingHighEffBJetTagsDisc(0),
39     fTrackCountingHighPurBJetTagsDisc(0), fSoftMuonBJetTagsDisc(0),
40     fSoftMuonByIP3dBJetTagsDisc(0), fSoftMuonByPtBJetTagsDisc(0),
41     fSoftElectronByIP3dBJetTagsDisc(0), fSoftElectronByPtBJetTagsDisc(0),
42 bendavid 1.27 fGhostTrackBJetTagsDisc(0),
43 mzanetti 1.28 fL1OffsetCorrectionScale(0), fJetArea(0),
44 bendavid 1.22 fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
45 bendavid 1.26 fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL6LSBCorrectionScale(0),
46     fL7PartonCorrectionScale(0),
47 bendavid 1.19 fCustomCorrectionScale(0) {}
48 loizides 1.18 Jet(Double_t px, Double_t py, Double_t pz, Double_t e) :
49     fRawMom(FourVector(px,py,pz,e)),
50 bendavid 1.20 fAlpha(0), fBeta(0), fMatchedMCFlavor(0),
51 loizides 1.18 fJetProbabilityBJetTagsDisc(0), fJetBProbabilityBJetTagsDisc(0),
52 bendavid 1.27 fSimpleSecondaryVertexBJetTagsDisc(0), fSimpleSecondaryVertexHighEffBJetTagsDisc(0),
53     fSimpleSecondaryVertexHighPurBJetTagsDisc(0), fCombinedSecondaryVertexBJetTagsDisc(0),
54 bendavid 1.22 fCombinedSecondaryVertexMVABJetTagsDisc(0), fTrackCountingHighEffBJetTagsDisc(0),
55     fTrackCountingHighPurBJetTagsDisc(0), fSoftMuonBJetTagsDisc(0),
56     fSoftMuonByIP3dBJetTagsDisc(0), fSoftMuonByPtBJetTagsDisc(0),
57     fSoftElectronByIP3dBJetTagsDisc(0), fSoftElectronByPtBJetTagsDisc(0),
58 bendavid 1.27 fGhostTrackBJetTagsDisc(0),
59 mzanetti 1.28 fL1OffsetCorrectionScale(0), fJetArea(0),
60 bendavid 1.22 fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
61 bendavid 1.26 fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL6LSBCorrectionScale(0),
62     fL7PartonCorrectionScale(0),
63 bendavid 1.19 fCustomCorrectionScale(0) {}
64 loizides 1.1
65 loizides 1.21 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 bendavid 1.23 Double_t CombinedCorrectionScale() const;
72 loizides 1.21 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 bendavid 1.26 const BitMask8 &Corrections() const { return fCorrections; }
78 loizides 1.21 Double_t JetProbabilityBJetTagsDisc() const
79     { return fJetProbabilityBJetTagsDisc; }
80     Double_t JetBProbabilityBJetTagsDisc() const
81     { return fJetBProbabilityBJetTagsDisc; }
82     Int_t MatchedMCFlavor() const { return fMatchedMCFlavor; }
83 bendavid 1.23 virtual Jet *MakeCopy() const { return new Jet(*this); }
84 loizides 1.21 virtual
85     UInt_t NConstituents() const { return 0; }
86     UInt_t N() const { return NConstituents(); }
87 bendavid 1.26 Double_t L1OffsetCorrectionScale() const { return fL1OffsetCorrectionScale; }
88 mzanetti 1.28 Double_t JetArea() const { return fJetArea; }
89 loizides 1.21 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 bendavid 1.26 Double_t L6LSBCorrectionScale() const { return fL6LSBCorrectionScale; }
94 loizides 1.21 Double_t L7PartonCorrectionScale() const { return fL7PartonCorrectionScale; }
95     EObjType ObjType() const { return kJet; }
96     Double_t SimpleSecondaryVertexBJetTagsDisc() const
97     { return fSimpleSecondaryVertexBJetTagsDisc; }
98 bendavid 1.27 Double_t SimpleSecondaryVertexHighEffBJetTagsDisc() const
99     { return fSimpleSecondaryVertexHighEffBJetTagsDisc; }
100     Double_t SimpleSecondaryVertexHighPurBJetTagsDisc() const
101     { return fSimpleSecondaryVertexHighPurBJetTagsDisc; }
102 loizides 1.21 Double_t SoftMuonBJetTagsDisc() const
103     { return fSoftMuonBJetTagsDisc; }
104 bendavid 1.22 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 loizides 1.21 Double_t TrackCountingHighEffBJetTagsDisc() const
113     { return fTrackCountingHighEffBJetTagsDisc; }
114     Double_t TrackCountingHighPurBJetTagsDisc() const
115     { return fTrackCountingHighPurBJetTagsDisc; }
116 bendavid 1.27 Double_t GhostTrackBJetTagsDisc() const
117     { return fGhostTrackBJetTagsDisc; }
118 loizides 1.21 FourVectorM RawMom() const { return fRawMom.V(); }
119 sixie 1.24 Double_t SigmaEta() const { return fSigmaEta; }
120     Double_t SigmaPhi() const { return fSigmaPhi; }
121 loizides 1.21 void SetAlpha(Double_t val) { fAlpha = val; }
122     void SetBeta(Double_t val) { fBeta = val; }
123 sixie 1.24 void SetSigmaEta(Double_t val) { fSigmaEta = val; }
124     void SetSigmaPhi(Double_t val) { fSigmaPhi = val; }
125 bendavid 1.26 void SetCorrections(const BitMask8 &cor) { fCorrections = cor; }
126 loizides 1.21 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 bendavid 1.26 void SetL1OffsetCorrectionScale(Double_t s )
137     { fL1OffsetCorrectionScale = s; ClearMom(); }
138 mzanetti 1.28 void SetJetArea(Double_t a) { fJetArea = a; }
139 loizides 1.21 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 bendavid 1.26 void SetL6LSBCorrectionScale(Double_t s )
148     { fL6LSBCorrectionScale = s; ClearMom(); }
149 loizides 1.21 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 bendavid 1.27 void SetSimpleSecondaryVertexHighEffBJetTagsDisc(Double_t d)
156     { fSimpleSecondaryVertexHighEffBJetTagsDisc = d; }
157     void SetSimpleSecondaryVertexHighPurBJetTagsDisc(Double_t d)
158     { fSimpleSecondaryVertexHighPurBJetTagsDisc = d; }
159 loizides 1.21 void SetSoftMuonBJetTagsDisc(Double_t d) { fSoftMuonBJetTagsDisc = d; }
160 bendavid 1.22 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 loizides 1.21 void SetTrackCountingHighEffBJetTagsDisc(Double_t d)
165     { fTrackCountingHighEffBJetTagsDisc = d; }
166     void SetTrackCountingHighPurBJetTagsDisc(Double_t d)
167     { fTrackCountingHighPurBJetTagsDisc = d; }
168 bendavid 1.27 void SetGhostTrackBJetTagsDisc(Double_t d) { fGhostTrackBJetTagsDisc = d; }
169 sixie 1.9
170 loizides 1.2 protected:
171 loizides 1.18 void GetMom() const;
172 loizides 1.15
173 loizides 1.21 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 sixie 1.24 Double32_t fSigmaEta; //[0,0,14]sqrt(etaetaMoment)
178     Double32_t fSigmaPhi; //[0,0,14]sqrt(phiphiMoment)
179 loizides 1.21 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 bendavid 1.27 Double32_t fSimpleSecondaryVertexHighEffBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
183     Double32_t fSimpleSecondaryVertexHighPurBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
184 loizides 1.21 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 bendavid 1.22 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 bendavid 1.27 Double32_t fGhostTrackBJetTagsDisc; //[0,0,14]discriminants b-tagging algos
194 bendavid 1.26 Double32_t fL1OffsetCorrectionScale; //[0,0,14]L1 correction scale
195 mzanetti 1.28 Double32_t fJetArea; //[0,0,14]infrared safe jet area
196 loizides 1.21 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 bendavid 1.26 Double32_t fL6LSBCorrectionScale; //[0,0,14]L7 correction scale
201 loizides 1.21 Double32_t fL7PartonCorrectionScale; //[0,0,14]L7 correction scale
202     Double32_t fCustomCorrectionScale; //[0,0,14]custom correction scale
203 bendavid 1.20 BitMask8 fCorrections; //mask of corrections to be applied
204 loizides 1.2
205 mzanetti 1.28 ClassDef(Jet, 6) // Jet class
206 loizides 1.1 };
207     }
208 loizides 1.15
209     //--------------------------------------------------------------------------------------------------
210 bendavid 1.23 inline Double_t mithep::Jet::CombinedCorrectionScale() const
211 loizides 1.15 {
212 bendavid 1.23 // compute combined correction scale from all enabled corrections
213     Double_t scale = 1.0;
214 loizides 1.21
215 mzanetti 1.28 if (CorrectionActive(L1))
216     scale *= fL1OffsetCorrectionScale;
217    
218 bendavid 1.17 if (CorrectionActive(L2))
219 bendavid 1.23 scale *= fL2RelativeCorrectionScale;
220 bendavid 1.17
221     if (CorrectionActive(L3))
222 bendavid 1.23 scale *= fL3AbsoluteCorrectionScale;
223 bendavid 1.17
224     if (CorrectionActive(L4))
225 bendavid 1.23 scale *= fL4EMFCorrectionScale;
226 bendavid 1.17
227     if (CorrectionActive(L5))
228 bendavid 1.23 scale *= fL5FlavorCorrectionScale;
229 bendavid 1.17
230     if (CorrectionActive(L7))
231 bendavid 1.23 scale *= fL7PartonCorrectionScale;
232 bendavid 1.17
233     if (CorrectionActive(Custom))
234 bendavid 1.23 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 loizides 1.15 }
249 loizides 1.1 #endif