Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:37:03

0001 #ifndef CondFormats_EcalObjects_EcalWeight_H
0002 #define CondFormats_EcalObjects_EcalWeight_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<EcalWeight>
0009  *
0010  **/
0011 
0012 #include <iostream>
0013 
0014 class EcalWeight {
0015 public:
0016   EcalWeight();
0017   EcalWeight(const double& awgt);
0018   EcalWeight(const EcalWeight& awgt);
0019   EcalWeight& operator=(const EcalWeight& 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 EcalWeight& rhs) const { return (wgt_ == rhs.wgt_); }
0026   bool operator!=(const EcalWeight& rhs) const { return (wgt_ != rhs.wgt_); }
0027   bool operator<(const EcalWeight& rhs) const { return (wgt_ < rhs.wgt_); }
0028   bool operator>(const EcalWeight& rhs) const { return (wgt_ > rhs.wgt_); }
0029   bool operator<=(const EcalWeight& rhs) const { return (wgt_ <= rhs.wgt_); }
0030   bool operator>=(const EcalWeight& rhs) const { return (wgt_ >= rhs.wgt_); }
0031 
0032 private:
0033   double wgt_;
0034 };
0035 
0036 //std::ostream& operator<<(std::ostream& os, const EcalWeight& wg) {
0037 //   return os << wg.value();
0038 //}
0039 
0040 #endif