Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-30 02:33:12

0001 //
0002 // This is the type which gets updated by each level
0003 // of jet corrections
0004 //
0005 // Igor Volobouev
0006 // Aug 3, 2012
0007 //
0008 
0009 #ifndef JetMETCorrections_FFTJetObjects_FFTJetCorrectorTransient_h
0010 #define JetMETCorrections_FFTJetObjects_FFTJetCorrectorTransient_h
0011 
0012 #include <cmath>
0013 #include "DataFormats/Math/interface/LorentzVector.h"
0014 
0015 class FFTJetCorrectorTransient {
0016 public:
0017   typedef math::XYZTLorentzVector LorentzVector;
0018 
0019   inline FFTJetCorrectorTransient(const LorentzVector& v,
0020                                   const double initialScale = 1.0,
0021                                   const double initialSigma = 0.0)
0022       : vec_(v), scale_(initialScale), variance_(initialSigma * initialSigma) {}
0023   FFTJetCorrectorTransient() = delete;
0024 
0025   inline const LorentzVector& vec() const { return vec_; }
0026   inline double scale() const { return scale_; }
0027   inline double sigma() const { return sqrt(variance_); }
0028   inline double variance() const { return variance_; }
0029 
0030   inline void setVec(const LorentzVector& v) { vec_ = v; }
0031   inline void setScale(const double s) { scale_ = s; }
0032   inline void setSigma(const double s) { variance_ = s * s; }
0033   inline void setVariance(const double v) { variance_ = fabs(v); }
0034 
0035   inline FFTJetCorrectorTransient& operator*=(const double& d) {
0036     // Do not change the sigma -- assume that it is relative to jet Pt
0037     vec_ *= d;
0038     scale_ *= d;
0039     return *this;
0040   }
0041 
0042 private:
0043   LorentzVector vec_;
0044   double scale_;
0045   double variance_;
0046 };
0047 
0048 #endif  // JetMETCorrections_FFTJetObjects_FFTJetCorrectorTransient_h