Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:06

0001 #ifndef CondFormats_ESObjects_ESWeight_H
0002 #define CondFormats_ESObjects_ESWeight_H
0003 
0004 /**
0005  * Author: Shahram Rahatlou, University of Rome & INFN
0006  * This is workaround in order to be able to use vector<double>
0007  * for ECAL weights. because of a conflict I need to define this trivial class
0008  * so that I can use POOL to store vector<ESWeight>
0009  *
0010  **/
0011 
0012 #include <iostream>
0013 
0014 class ESWeight {
0015 public:
0016   ESWeight();
0017   ESWeight(const double& awgt);
0018   ESWeight(const ESWeight& awgt);
0019   ESWeight& operator=(const ESWeight& rhs);
0020 
0021   double value() const { return wgt_; }
0022   double operator()() const { return wgt_; }
0023 
0024   void setValue(const double& awgt) { wgt_ = awgt; }
0025   bool operator==(const ESWeight& rhs) const { return (wgt_ == rhs.wgt_); }
0026   bool operator!=(const ESWeight& rhs) const { return (wgt_ != rhs.wgt_); }
0027   bool operator<(const ESWeight& rhs) const { return (wgt_ < rhs.wgt_); }
0028   bool operator>(const ESWeight& rhs) const { return (wgt_ > rhs.wgt_); }
0029   bool operator<=(const ESWeight& rhs) const { return (wgt_ <= rhs.wgt_); }
0030   bool operator>=(const ESWeight& rhs) const { return (wgt_ >= rhs.wgt_); }
0031 
0032 private:
0033   double wgt_;
0034 };
0035 
0036 //std::ostream& operator<<(std::ostream& os, const ESWeight& wg) {
0037 //   return os << wg.value();
0038 //}
0039 
0040 #endif