File indexing completed on 2024-09-07 04:35:39
0001 #ifndef CondFormats_HcalObjects_HFPhase1PMTData_h
0002 #define CondFormats_HcalObjects_HFPhase1PMTData_h
0003
0004 #include "boost/serialization/access.hpp"
0005 #include "boost/serialization/version.hpp"
0006 #include "boost/serialization/shared_ptr.hpp"
0007 #include "boost/version.hpp"
0008 #if BOOST_VERSION < 106400
0009 #include "boost/serialization/array.hpp"
0010 #else
0011 #include "boost/serialization/boost_array.hpp"
0012 #endif
0013 #include "CondFormats/HcalObjects/interface/AbsHcalFunctor.h"
0014
0015 class HFPhase1PMTData {
0016 public:
0017
0018 enum {
0019 T_0_MIN = 0,
0020
0021 T_0_MAX,
0022 T_1_MIN,
0023 T_1_MAX,
0024 ASYMM_MIN,
0025
0026 ASYMM_MAX,
0027 N_PMT_CUTS
0028 };
0029 typedef boost::array<std::shared_ptr<AbsHcalFunctor>, N_PMT_CUTS> Cuts;
0030
0031
0032 inline HFPhase1PMTData() : minCharge0_(0.0), minCharge1_(0.0), minChargeAsymm_(0.0) {}
0033
0034
0035 inline HFPhase1PMTData(const Cuts& cutShapes, const float charge0, const float charge1, const float minQAsymm)
0036 : cuts_(cutShapes), minCharge0_(charge0), minCharge1_(charge1), minChargeAsymm_(minQAsymm) {}
0037
0038
0039 inline const AbsHcalFunctor& cut(const unsigned which) const { return *cuts_.at(which); }
0040
0041
0042
0043
0044
0045 inline float minCharge0() const { return minCharge0_; }
0046 inline float minCharge1() const { return minCharge1_; }
0047
0048
0049 inline float minChargeAsymm() const { return minChargeAsymm_; }
0050
0051
0052 inline bool operator==(const HFPhase1PMTData& r) const {
0053 if (minCharge0_ != r.minCharge0_)
0054 return false;
0055 if (minCharge1_ != r.minCharge1_)
0056 return false;
0057 if (minChargeAsymm_ != r.minChargeAsymm_)
0058 return false;
0059 for (unsigned i = 0; i < N_PMT_CUTS; ++i)
0060 if (!(*cuts_[i] == *r.cuts_[i]))
0061 return false;
0062 return true;
0063 }
0064
0065 inline bool operator!=(const HFPhase1PMTData& r) const { return !(*this == r); }
0066
0067 private:
0068 Cuts cuts_;
0069 float minCharge0_;
0070 float minCharge1_;
0071 float minChargeAsymm_;
0072
0073 friend class boost::serialization::access;
0074
0075 template <class Archive>
0076 inline void serialize(Archive& ar, unsigned ) {
0077 ar & cuts_ & minCharge0_ & minCharge1_ & minChargeAsymm_;
0078 }
0079 };
0080
0081 BOOST_CLASS_VERSION(HFPhase1PMTData, 1)
0082
0083 #endif