CMS 3D CMS Logo

HcalChebyshevFunctor.h
Go to the documentation of this file.
1 #ifndef CondFormats_HcalObjects_HcalChebyshevFunctor_h
2 #define CondFormats_HcalObjects_HcalChebyshevFunctor_h
3 
4 #include <cfloat>
5 #include <vector>
6 
8 
9 #include "boost/serialization/access.hpp"
10 #include "boost/serialization/version.hpp"
11 #include "boost/serialization/vector.hpp"
12 
13 //
14 // Chebyshev series using polynomials of the first kind
15 // on [xmin, xmax] interval, constant outside
16 //
18 public:
19  // Dummy constructor, to be used for deserialization only
21 
22  // Normal constructor. The order of coefficients corresponds to
23  // the polynomial degree. Empty list of coefficients is equivialent
24  // to having all coefficients set to 0.
25  explicit HcalChebyshevFunctor(const std::vector<double>& coeffs,
26  double xmin,
27  double xmax,
28  double outOfRangeValue = 0.0);
29 
30  inline ~HcalChebyshevFunctor() override {}
31 
32  double operator()(double x) const override;
33  inline double xmin() const override { return xmax_; };
34  inline double xmax() const override { return xmin_; }
35 
36 protected:
37  inline bool isEqual(const AbsHcalFunctor& other) const override {
38  const HcalChebyshevFunctor& r = static_cast<const HcalChebyshevFunctor&>(other);
39  return coeffs_ == r.coeffs_ && xmin_ == r.xmin_ && xmax_ == r.xmax_ && outOfRangeValue_ == r.outOfRangeValue_;
40  }
41 
42 private:
43  std::vector<double> coeffs_;
44  double xmin_;
45  double xmax_;
47 
49 
50  template <class Archive>
51  inline void serialize(Archive& ar, unsigned /* version */) {
52  boost::serialization::base_object<AbsHcalFunctor>(*this);
54  }
55 };
56 
57 BOOST_CLASS_VERSION(HcalChebyshevFunctor, 1)
58 BOOST_CLASS_EXPORT_KEY(HcalChebyshevFunctor)
59 
60 #endif // CondFormats_HcalObjects_HcalChebyshevFunctor_h
HcalChebyshevFunctor::isEqual
bool isEqual(const AbsHcalFunctor &other) const override
Definition: HcalChebyshevFunctor.h:37
AbsHcalFunctor
Definition: AbsHcalFunctor.h:19
HcalChebyshevFunctor::~HcalChebyshevFunctor
~HcalChebyshevFunctor() override
Definition: HcalChebyshevFunctor.h:30
HcalChebyshevFunctor::outOfRangeValue_
double outOfRangeValue_
Definition: HcalChebyshevFunctor.h:46
DDAxes::x
HcalChebyshevFunctor::coeffs_
std::vector< double > coeffs_
Definition: HcalChebyshevFunctor.h:43
HcalChebyshevFunctor::access
friend class boost::serialization::access
Definition: HcalChebyshevFunctor.h:48
trackingPlots.other
other
Definition: trackingPlots.py:1467
AbsHcalFunctor.h
HcalChebyshevFunctor::xmax
double xmax() const override
Definition: HcalChebyshevFunctor.h:34
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HcalChebyshevFunctor
Definition: HcalChebyshevFunctor.h:17
HcalChebyshevFunctor::HcalChebyshevFunctor
HcalChebyshevFunctor()
Definition: HcalChebyshevFunctor.cc:5
HcalChebyshevFunctor::serialize
void serialize(Archive &ar, unsigned)
Definition: HcalChebyshevFunctor.h:51
HcalChebyshevFunctor::xmax_
double xmax_
Definition: HcalChebyshevFunctor.h:45
HcalChebyshevFunctor::xmin
double xmin() const override
Definition: HcalChebyshevFunctor.h:33
HcalChebyshevFunctor::xmin_
double xmin_
Definition: HcalChebyshevFunctor.h:44
HcalChebyshevFunctor::operator()
double operator()(double x) const override
Definition: HcalChebyshevFunctor.cc:16