Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "FWCore/Utilities/interface/Exception.h"
0002 
0003 #include "CondFormats/HcalObjects/interface/HcalLinearCompositionFunctor.h"
0004 
0005 HcalLinearCompositionFunctor::HcalLinearCompositionFunctor(std::shared_ptr<AbsHcalFunctor> p,
0006                                                            const double ia,
0007                                                            const double ib)
0008     : other_(p), a_(ia), b_(ib) {
0009   if (!other_.get())
0010     throw cms::Exception(
0011         "In HcalLinearCompositionFunctor constructor: "
0012         "can not use a null pointer to another functor");
0013 }
0014 
0015 double HcalLinearCompositionFunctor::operator()(const double x) const { return a_ * (*other_)(x) + b_; }
0016 
0017 BOOST_CLASS_EXPORT_IMPLEMENT(HcalLinearCompositionFunctor)