Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-12-02 04:24:21

0001 // -*- C++ -*-
0002 #ifndef METRECO_CORR_MET_DATA_H
0003 #define METRECO_CORR_MET_DATA_H
0004 
0005 /// \class CorrMETData
0006 ///
0007 /// \short a MET correction term
0008 ///
0009 /// CorrMETData represents a MET correction term.
0010 ///
0011 /// \author Michael Schmitt, Richard Cavanaugh The University of Florida; Tai Sakuma, Texas A&M University
0012 
0013 //____________________________________________________________________________||
0014 struct CorrMETData {
0015   double mex;
0016   double mey;
0017 
0018   double sumet;  // to be deleted
0019 
0020   CorrMETData() : mex(0.0), mey(0.0), sumet(0.0) {}
0021 
0022   CorrMETData(const CorrMETData& corr) : mex(corr.mex), mey(corr.mey), sumet(corr.sumet) {}
0023 
0024   CorrMETData& operator=(const CorrMETData&) = default;
0025 
0026   CorrMETData& operator+=(const CorrMETData& rhs) {
0027     mex += rhs.mex;
0028     mey += rhs.mey;
0029     sumet += rhs.sumet;
0030     return *this;
0031   }
0032 
0033   CorrMETData& operator*=(const double& rhs) {
0034     mex *= rhs;
0035     mey *= rhs;
0036     sumet *= rhs;
0037     return *this;
0038   }
0039 
0040   friend CorrMETData operator+(const CorrMETData& lhs, const CorrMETData& rhs) { return CorrMETData(lhs) += rhs; }
0041 
0042   friend CorrMETData operator*(const double& lhs, const CorrMETData& rhs) { return CorrMETData(rhs) *= lhs; }
0043 
0044   friend CorrMETData operator*(const CorrMETData& lhs, const double& rhs) { return CorrMETData(lhs) *= rhs; }
0045 };
0046 
0047 //____________________________________________________________________________||
0048 #endif  // METRECO_CORR_MET_DATA_H