19 for (
const auto& vec :
input) {
34 const float x_width = 2.0 * diamondDimensions.
xHalfWidth;
35 const float y_width = 2.0 * diamondDimensions.yHalfWidth;
36 const float z_width = 2.0 * diamondDimensions.zHalfWidth;
38 const int sector = detid.arm(),
station = detid.station(), plane = detid.plane(), channel = detid.channel();
40 std::vector<double> lut;
43 if (lut.size() != 1024)
44 lut = std::vector<double>(1024, 0.0);
47 const auto& ch_params =
55 for (
const auto& digi : vec) {
56 const int t_lead = digi.leadingEdge(), t_trail = digi.trailingEdge();
58 if (t_lead == 0 && t_trail == 0)
61 double tot = -1., ch_t_twc = 0.;
62 if (t_lead != 0 && t_trail != 0) {
66 ch_t_twc =
calib_fct_->evaluate(std::vector<double>{
tot}, ch_params);
72 const int time_slice =
76 const double t0 = (t_lead % 1024) *
ts_to_ns_ + lut[t_lead % 1024] - ch_t_twc;
91 digi.hptdcErrorFlags(),
void build(const CTPPSGeometry &, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &) override
const PPSTimingCalibration * calib_
DB-loaded calibration object.
const Translation & translation() const
constexpr bool isNotFinite(T x)
double timeOffset(int key1, int key2, int key3, int key4=-1) const
bool apply_calib_
Switch on/off the timing calibration.
static std::string const input
const PPSTimingCalibrationLUT * calibLUT_
float parentZPosition() const
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
std::unique_ptr< reco::FormulaEvaluator > calib_fct_
Timing correction formula.
The manager class for TOTEM RP geometry.
std::vector< double > parameters(int key1, int key2, int key3, int key4) const
static constexpr int TIMESLICE_WITHOUT_LEADING
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
double ts_to_ns_
Conversion constant between time slice and absolute time (in ns)