CMS 3D CMS Logo

TimingRecHitProducerAlgorithm.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of PPS-TOTEM offline software.
4 * Authors:
5 * Laurent Forthomme (laurent.forthomme@cern.ch)
6 *
7 ****************************************************************************/
8 
9 #ifndef RecoPPS_Local_TimingRecHitProducerAlgorithm
10 #define RecoPPS_Local_TimingRecHitProducerAlgorithm
11 
14 
17 
21 template <typename G, typename D, typename R>
23 public:
25  : ts_to_ns_(iConfig.getParameter<double>("timeSliceNs")),
26  apply_calib_(iConfig.getParameter<bool>("applyCalibration")) {}
27  virtual ~TimingRecHitProducerAlgorithm() = default;
28 
30  calib_ = &calib;
31  calibLUT_ = &calibLUT;
32  calib_fct_ = std::make_unique<reco::FormulaEvaluator>(calib_->formula());
33  }
34  virtual void build(const G&, const D&, R&) = 0;
35 
36 protected:
38  double ts_to_ns_;
42  const PPSTimingCalibration* calib_{nullptr};
45  std::unique_ptr<reco::FormulaEvaluator> calib_fct_;
46 };
47 
48 #endif
const PPSTimingCalibration * calib_
DB-loaded calibration object.
virtual ~TimingRecHitProducerAlgorithm()=default
bool apply_calib_
Switch on/off the timing calibration.
virtual void build(const G &, const D &, R &)=0
const PPSTimingCalibrationLUT * calibLUT_
std::unique_ptr< reco::FormulaEvaluator > calib_fct_
Timing correction formula.
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
TimingRecHitProducerAlgorithm(const edm::ParameterSet &iConfig)
void setCalibration(const PPSTimingCalibration &calib, const PPSTimingCalibrationLUT &calibLUT)
const std::string & formula() const
double ts_to_ns_
Conversion constant between time slice and absolute time (in ns)