CMS 3D CMS Logo

HFPhase1PMTData.h
Go to the documentation of this file.
1 #ifndef CondFormats_HcalObjects_HFPhase1PMTData_h
2 #define CondFormats_HcalObjects_HFPhase1PMTData_h
3 
4 #include "boost/serialization/access.hpp"
5 #include "boost/serialization/version.hpp"
6 #include "boost/serialization/shared_ptr.hpp"
7 #include "boost/version.hpp"
8 #if BOOST_VERSION < 106400
9 #include "boost/serialization/array.hpp"
10 #else
11 #include "boost/serialization/boost_array.hpp"
12 #endif
14 
16 public:
17  // Functor enum for the cut shapes
18  enum {
19  T_0_MIN = 0, // Min time measurement allowed for the first anode,
20  // depending on charge or energy
21  T_0_MAX, // Max time measurement allowed for the first anode
22  T_1_MIN, // Min time measurement allowed for the second anode
23  T_1_MAX, // Max time measurement allowed for the second anode
24  ASYMM_MIN, // Minimum allowed charge (or energy) asymmetry,
25  // depending on charge (or energy)
26  ASYMM_MAX, // Maximum allowed asymmetry
28  };
29  typedef boost::array<std::shared_ptr<AbsHcalFunctor>, N_PMT_CUTS> Cuts;
30 
31  // Dummy constructor, to be used for deserialization only
32  inline HFPhase1PMTData() : minCharge0_(0.0), minCharge1_(0.0), minChargeAsymm_(0.0) {}
33 
34  // Normal constructor
35  inline HFPhase1PMTData(const Cuts& cutShapes, const float charge0, const float charge1, const float minQAsymm)
36  : cuts_(cutShapes), minCharge0_(charge0), minCharge1_(charge1), minChargeAsymm_(minQAsymm) {}
37 
38  // Get the cut shape
39  inline const AbsHcalFunctor& cut(const unsigned which) const { return *cuts_.at(which); }
40 
41  // Minimum charge on the first/second anode needed for
42  // a reliable timing measurement. Setting this charge
43  // to a very high value will disable timing measurements
44  // on that anode.
45  inline float minCharge0() const { return minCharge0_; }
46  inline float minCharge1() const { return minCharge1_; }
47 
48  // Minimum total charge for applying the charge asymmetry cut
49  inline float minChargeAsymm() const { return minChargeAsymm_; }
50 
51  // Deep comparison operators (useful for serialization tests)
52  inline bool operator==(const HFPhase1PMTData& r) const {
53  if (minCharge0_ != r.minCharge0_)
54  return false;
55  if (minCharge1_ != r.minCharge1_)
56  return false;
57  if (minChargeAsymm_ != r.minChargeAsymm_)
58  return false;
59  for (unsigned i = 0; i < N_PMT_CUTS; ++i)
60  if (!(*cuts_[i] == *r.cuts_[i]))
61  return false;
62  return true;
63  }
64 
65  inline bool operator!=(const HFPhase1PMTData& r) const { return !(*this == r); }
66 
67 private:
69  float minCharge0_;
70  float minCharge1_;
72 
74 
75  template <class Archive>
76  inline void serialize(Archive& ar, unsigned /* version */) {
78  }
79 };
80 
81 BOOST_CLASS_VERSION(HFPhase1PMTData, 1)
82 
83 #endif // CondFormats_HcalObjects_HFPhase1PMTData_h
mps_fire.i
i
Definition: mps_fire.py:428
AbsHcalFunctor
Definition: AbsHcalFunctor.h:19
HFPhase1PMTData::operator!=
bool operator!=(const HFPhase1PMTData &r) const
Definition: HFPhase1PMTData.h:65
HFPhase1PMTData::Cuts
boost::array< std::shared_ptr< AbsHcalFunctor >, N_PMT_CUTS > Cuts
Definition: HFPhase1PMTData.h:29
HFPhase1PMTData
Definition: HFPhase1PMTData.h:15
HFPhase1PMTData::serialize
void serialize(Archive &ar, unsigned)
Definition: HFPhase1PMTData.h:76
HFPhase1PMTData::minChargeAsymm_
float minChargeAsymm_
Definition: HFPhase1PMTData.h:71
HFPhase1PMTData::minChargeAsymm
float minChargeAsymm() const
Definition: HFPhase1PMTData.h:49
HFPhase1PMTData::T_0_MAX
Definition: HFPhase1PMTData.h:21
HFPhase1PMTData::HFPhase1PMTData
HFPhase1PMTData()
Definition: HFPhase1PMTData.h:32
HFPhase1PMTData::N_PMT_CUTS
Definition: HFPhase1PMTData.h:27
HFPhase1PMTData::access
friend class boost::serialization::access
Definition: HFPhase1PMTData.h:73
HFPhase1PMTData::T_0_MIN
Definition: HFPhase1PMTData.h:19
HFPhase1PMTData::T_1_MIN
Definition: HFPhase1PMTData.h:22
HFPhase1PMTData::operator==
bool operator==(const HFPhase1PMTData &r) const
Definition: HFPhase1PMTData.h:52
AbsHcalFunctor.h
HFPhase1PMTData::minCharge0
float minCharge0() const
Definition: HFPhase1PMTData.h:45
HFPhase1PMTData::minCharge0_
float minCharge0_
Definition: HFPhase1PMTData.h:69
HFPhase1PMTData::minCharge1_
float minCharge1_
Definition: HFPhase1PMTData.h:70
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HFPhase1PMTData::T_1_MAX
Definition: HFPhase1PMTData.h:23
HFPhase1PMTData::cuts_
Cuts cuts_
Definition: HFPhase1PMTData.h:68
HFPhase1PMTData::HFPhase1PMTData
HFPhase1PMTData(const Cuts &cutShapes, const float charge0, const float charge1, const float minQAsymm)
Definition: HFPhase1PMTData.h:35
HFPhase1PMTData::cut
const AbsHcalFunctor & cut(const unsigned which) const
Definition: HFPhase1PMTData.h:39
HFPhase1PMTData::ASYMM_MAX
Definition: HFPhase1PMTData.h:26
HFPhase1PMTData::ASYMM_MIN
Definition: HFPhase1PMTData.h:24
eostools.which
def which(cmd)
Definition: eostools.py:336
HFPhase1PMTData::minCharge1
float minCharge1() const
Definition: HFPhase1PMTData.h:46