16 : ts_to_ns_(iConfig.getParameter<double>(
"timeSliceNs")),
17 apply_calib_(iConfig.getParameter<
bool>(
"applyCalibration")) {}
29 for (
const auto& vec :
input) {
44 const float x_width = 2.0 * diamondDimensions.
xHalfWidth;
45 const float y_width = 2.0 * diamondDimensions.yHalfWidth;
46 const float z_width = 2.0 * diamondDimensions.zHalfWidth;
48 const int sector = detid.arm(),
station = detid.station(), plane = detid.plane(), channel = detid.channel();
50 std::vector<double> lut;
53 if (lut.size() != 1024)
54 lut = std::vector<double>(1024, 0.0);
56 lut = std::vector<double>(1024, 0.0);
66 for (
const auto& digi : vec) {
67 const int t_lead = digi.leadingEdge(), t_trail = digi.trailingEdge();
69 if (t_lead == 0 && t_trail == 0)
72 double tot = -1., ch_t_twc = 0.;
73 if (t_lead != 0 && t_trail != 0) {
77 ch_t_twc =
calib_fct_->evaluate(std::vector<double>{
tot}, ch_params);
83 const int time_slice =
87 const double t0 = (t_lead % 1024) *
ts_to_ns_ + lut[t_lead % 1024] - ch_t_twc;
102 digi.hptdcErrorFlags(),
const Translation & translation() const
void build(const CTPPSGeometry &, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &)
constexpr bool isNotFinite(T x)
double timeOffset(int key1, int key2, int key3, int key4=-1) const
PPSTimingCalibration calib_
bool apply_calib_
Switch on/off the timing calibration.
void setCalibration(const PPSTimingCalibration &, const PPSTimingCalibrationLUT &)
static std::string const input
float parentZPosition() const
double ts_to_ns_
Conversion constant between HPTDC time slice and absolute time (in ns)
decltype(auto) emplace_back(Args &&... args)
std::vector< double > bins(int key1, int key2, int key3, int key4) const
static constexpr unsigned short MAX_CHANNEL
double timePrecision(int key1, int key2, int key3, int key4=-1) const
const DiamondDimensions & getDiamondDimensions() const
The manager class for TOTEM RP geometry.
std::unique_ptr< reco::FormulaEvaluator > calib_fct_
std::vector< double > parameters(int key1, int key2, int key3, int key4) const
static constexpr int TIMESLICE_WITHOUT_LEADING
PPSTimingCalibrationLUT calibLUT_
CTPPSDiamondRecHitProducerAlgorithm(const edm::ParameterSet &conf)
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
const std::string & formula() const