ESWeight

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#ifndef CondFormats_ESObjects_ESWeight_H
#define CondFormats_ESObjects_ESWeight_H

/**
 * Author: Shahram Rahatlou, University of Rome & INFN
 * This is workaround in order to be able to use vector<double>
 * for ECAL weights. because of a conflict I need to define this trivial class
 * so that I can use POOL to store vector<ESWeight>
 *
 **/

#include <iostream>

class ESWeight {
public:
  ESWeight();
  ESWeight(const double& awgt);
  ESWeight(const ESWeight& awgt);
  ESWeight& operator=(const ESWeight& rhs);

  double value() const { return wgt_; }
  double operator()() const { return wgt_; }

  void setValue(const double& awgt) { wgt_ = awgt; }
  bool operator==(const ESWeight& rhs) const { return (wgt_ == rhs.wgt_); }
  bool operator!=(const ESWeight& rhs) const { return (wgt_ != rhs.wgt_); }
  bool operator<(const ESWeight& rhs) const { return (wgt_ < rhs.wgt_); }
  bool operator>(const ESWeight& rhs) const { return (wgt_ > rhs.wgt_); }
  bool operator<=(const ESWeight& rhs) const { return (wgt_ <= rhs.wgt_); }
  bool operator>=(const ESWeight& rhs) const { return (wgt_ >= rhs.wgt_); }

private:
  double wgt_;
};

//std::ostream& operator<<(std::ostream& os, const ESWeight& wg) {
//   return os << wg.value();
//}

#endif