ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/Jet.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/Jet.h (file contents):
Revision 1.22 by bendavid, Tue Jul 7 08:30:28 2009 UTC vs.
Revision 1.26 by bendavid, Mon May 10 15:13:29 2010 UTC

# Line 38 | Line 38 | namespace mithep
38          fTrackCountingHighPurBJetTagsDisc(0), fSoftMuonBJetTagsDisc(0),
39          fSoftMuonByIP3dBJetTagsDisc(0), fSoftMuonByPtBJetTagsDisc(0),
40          fSoftElectronByIP3dBJetTagsDisc(0), fSoftElectronByPtBJetTagsDisc(0),
41 +        fL1OffsetCorrectionScale(0),
42          fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
43 <        fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0),
43 >        fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL6LSBCorrectionScale(0),
44 >        fL7PartonCorrectionScale(0),
45          fCustomCorrectionScale(0) {}
46        Jet(Double_t px, Double_t py, Double_t pz, Double_t e) :
47          fRawMom(FourVector(px,py,pz,e)),
# Line 50 | Line 52 | namespace mithep
52          fTrackCountingHighPurBJetTagsDisc(0), fSoftMuonBJetTagsDisc(0),
53          fSoftMuonByIP3dBJetTagsDisc(0), fSoftMuonByPtBJetTagsDisc(0),
54          fSoftElectronByIP3dBJetTagsDisc(0), fSoftElectronByPtBJetTagsDisc(0),
55 +        fL1OffsetCorrectionScale(0),
56          fL2RelativeCorrectionScale(0), fL3AbsoluteCorrectionScale(0),
57 <        fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL7PartonCorrectionScale(0),
57 >        fL4EMFCorrectionScale(0), fL5FlavorCorrectionScale(0), fL6LSBCorrectionScale(0),
58 >        fL7PartonCorrectionScale(0),
59          fCustomCorrectionScale(0) {}
60  
61        Double_t      Alpha()                       const { return fAlpha;                        }
# Line 60 | Line 64 | namespace mithep
64                        { return fCombinedSecondaryVertexBJetTagsDisc;    }
65        Double_t      CombinedSecondaryVertexMVABJetTagsDisc()       const
66                        { return fCombinedSecondaryVertexMVABJetTagsDisc; }
67 +      Double_t      CombinedCorrectionScale()     const;
68        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 +      const BitMask8 &Corrections()               const { return fCorrections;                  }
74        Double_t      JetProbabilityBJetTagsDisc()                   const
75                        { return fJetProbabilityBJetTagsDisc;     }
76        Double_t      JetBProbabilityBJetTagsDisc()                  const
77                        { return fJetBProbabilityBJetTagsDisc;    }
78        Int_t         MatchedMCFlavor()             const { return fMatchedMCFlavor;           }
79 +      virtual Jet  *MakeCopy()                    const { return new Jet(*this);             }
80        virtual
81        UInt_t        NConstituents()               const { return 0;                          }
82        UInt_t        N()                           const { return NConstituents();            }
83 +      Double_t      L1OffsetCorrectionScale()     const { return fL1OffsetCorrectionScale;   }
84        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 +      Double_t      L6LSBCorrectionScale()        const { return fL6LSBCorrectionScale;      }
89        Double_t      L7PartonCorrectionScale()     const { return fL7PartonCorrectionScale;   }
90        EObjType      ObjType()                     const { return kJet;                       }      
91        Double_t      SimpleSecondaryVertexBJetTagsDisc()            const
# Line 96 | Line 105 | namespace mithep
105        Double_t      TrackCountingHighPurBJetTagsDisc()             const
106                        { return fTrackCountingHighPurBJetTagsDisc;  }
107        FourVectorM   RawMom()                      const { return fRawMom.V();                }
108 +      Double_t      SigmaEta()                    const { return fSigmaEta;                  }
109 +      Double_t      SigmaPhi()                    const { return fSigmaPhi;                  }
110        void          SetAlpha(Double_t val)              { fAlpha = val;                      }
111        void          SetBeta(Double_t val)               { fBeta  = val;                      }
112 +      void          SetSigmaEta(Double_t val)           { fSigmaEta = val;                   }
113 +      void          SetSigmaPhi(Double_t val)           { fSigmaPhi = val;                   }
114 +      void          SetCorrections(const BitMask8 &cor) { fCorrections = cor;                }
115        void          SetCombinedSecondaryVertexBJetTagsDisc(Double_t d)
116                        { fCombinedSecondaryVertexBJetTagsDisc = d;    }
117        void          SetCombinedSecondaryVertexMVABJetTagsDisc(Double_t d)
# Line 108 | Line 122 | namespace mithep
122                        { fJetBProbabilityBJetTagsDisc = d;    }
123        void          SetRawMom(const FourVectorM &mom) { fRawMom = mom; ClearMom();           }
124        void          SetMatchedMCFlavor(Int_t flavor)  { fMatchedMCFlavor = flavor;           }
125 +      void          SetL1OffsetCorrectionScale(Double_t s )  
126 +                      { fL1OffsetCorrectionScale = s; ClearMom(); }
127        void          SetL2RelativeCorrectionScale(Double_t s )  
128                        { fL2RelativeCorrectionScale = s; ClearMom(); }
129        void          SetL3AbsoluteCorrectionScale(Double_t s )  
# Line 116 | Line 132 | namespace mithep
132                        { fL4EMFCorrectionScale = s; ClearMom();      }
133        void          SetL5FlavorCorrectionScale(Double_t s )    
134                        { fL5FlavorCorrectionScale = s; ClearMom();   }
135 +      void          SetL6LSBCorrectionScale(Double_t s )  
136 +                      { fL6LSBCorrectionScale = s; ClearMom(); }
137        void          SetL7PartonCorrectionScale(Double_t s )    
138                        { fL7PartonCorrectionScale = s; ClearMom();   }
139        void          SetCustomCorrectionScale(Double_t s)        
# Line 139 | Line 157 | namespace mithep
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 +      Double32_t    fSigmaEta;                               //[0,0,14]sqrt(etaetaMoment)
161 +      Double32_t    fSigmaPhi;                               //[0,0,14]sqrt(phiphiMoment)
162        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
# Line 151 | Line 171 | namespace mithep
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 +      Double32_t    fL1OffsetCorrectionScale;                //[0,0,14]L1 correction scale
175        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 +      Double32_t    fL6LSBCorrectionScale;                   //[0,0,14]L7 correction scale
180        Double32_t    fL7PartonCorrectionScale;                //[0,0,14]L7 correction scale
181        Double32_t    fCustomCorrectionScale;                  //[0,0,14]custom correction scale
182        BitMask8      fCorrections;                            //mask of corrections to be applied
183  
184 <    ClassDef(Jet, 2) // Jet class
184 >    ClassDef(Jet, 4) // Jet class
185    };
186   }
187  
188   //--------------------------------------------------------------------------------------------------
189 < inline void mithep::Jet::GetMom() const
189 > inline Double_t mithep::Jet::CombinedCorrectionScale() const
190   {
191 <  // Get raw momentum values from stored values and apply all enabled corrections.
192 <
171 <  fCachedMom.SetCoordinates(fRawMom.Pt(),fRawMom.Eta(),fRawMom.Phi(),fRawMom.M());
191 >  // compute combined correction scale from all enabled corrections
192 >  Double_t scale = 1.0;
193  
194    if (CorrectionActive(L2))
195 <    fCachedMom *= fL2RelativeCorrectionScale;
195 >    scale *= fL2RelativeCorrectionScale;
196      
197    if (CorrectionActive(L3))
198 <    fCachedMom *= fL3AbsoluteCorrectionScale;
198 >    scale *= fL3AbsoluteCorrectionScale;
199    
200    if (CorrectionActive(L4))
201 <    fCachedMom *= fL4EMFCorrectionScale;
201 >    scale *= fL4EMFCorrectionScale;
202      
203    if (CorrectionActive(L5))
204 <    fCachedMom *= fL5FlavorCorrectionScale;
204 >    scale *= fL5FlavorCorrectionScale;
205      
206    if (CorrectionActive(L7))
207 <    fCachedMom *= fL7PartonCorrectionScale;
207 >    scale *= fL7PartonCorrectionScale;
208      
209    if (CorrectionActive(Custom))
210 <    fCachedMom *= fCustomCorrectionScale;
210 >    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   }
225   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines