17 : ts_to_ns_(iConfig.getParameter<double>(
"timeSliceNs")),
18 apply_calib_(iConfig.getParameter<bool>(
"applyCalibration")) {}
28 for (
const auto& vec : input) {
43 const float x_width = 2.0 * diamondDimensions.
xHalfWidth;
44 const float y_width = 2.0 * diamondDimensions.yHalfWidth;
45 const float z_width = 2.0 * diamondDimensions.zHalfWidth;
48 const int sector = detid.arm(),
station = detid.station(), plane = detid.plane(), channel = detid.channel();
56 for (
const auto& digi : vec) {
57 const int t_lead = digi.leadingEdge(), t_trail = digi.trailingEdge();
59 if (t_lead == 0 && t_trail == 0)
62 double tot = -1., ch_t_twc = 0.;
63 if (t_lead != 0 && t_trail != 0) {
67 ch_t_twc =
calib_fct_->evaluate(std::vector<double>{tot}, ch_params);
73 const int time_slice =
77 const double t0 = (t_lead % 1024) *
ts_to_ns_ - ch_t_twc;
93 digi.hptdcErrorFlags(),
void build(const CTPPSGeometry &, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &)
const Translation & translation() const
constexpr bool isNotFinite(T x)
PPSTimingCalibration calib_
bool apply_calib_
Switch on/off the timing calibration.
const std::string & formula() const
const DiamondDimensions & getDiamondDimensions() const
double timeOffset(int key1, int key2, int key3, int key4=-1) const
static std::string const input
reference find_or_insert(det_id_type id)
std::vector< double > parameters(int key1, int key2, int key3, int key4) const
decltype(auto) emplace_back(Args &&...args)
double ts_to_ns_
Conversion constant between HPTDC time slice and absolute time (in ns)
static constexpr unsigned short MAX_CHANNEL
The manager class for TOTEM RP geometry.
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
std::unique_ptr< reco::FormulaEvaluator > calib_fct_
void setCalibration(const PPSTimingCalibration &)
float parentZPosition() const
static constexpr int TIMESLICE_WITHOUT_LEADING
CTPPSDiamondRecHitProducerAlgorithm(const edm::ParameterSet &conf)
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
double timePrecision(int key1, int key2, int key3, int key4=-1) const