File indexing completed on 2024-04-06 12:27:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "RecoPPS/Local/interface/TotemT2RecHitProducerAlgorithm.h"
0010
0011 #include "DataFormats/Common/interface/DetSetNew.h"
0012 #include "DataFormats/CTPPSDetId/interface/TotemT2DetId.h"
0013
0014 void TotemT2RecHitProducerAlgorithm::build(const TotemGeometry& geom,
0015 const edmNew::DetSetVector<TotemT2Digi>& input,
0016 edmNew::DetSetVector<TotemT2RecHit>& output) {
0017 for (const auto& vec : input) {
0018 const TotemT2DetId detid(vec.detId());
0019
0020
0021 edmNew::DetSetVector<TotemT2RecHit>::FastFiller filler(output, detid);
0022
0023 for (const auto& digi : vec) {
0024 const int t_lead = digi.leadingEdge(), t_trail = digi.trailingEdge();
0025
0026 double tot = 0.;
0027 if (digi.hasLE() && digi.hasTE()) {
0028 tot = (t_trail - t_lead) * ts_to_ns_;
0029 }
0030 double ch_t_precis = ts_to_ns_ / 2.0;
0031
0032
0033 const auto& tile = geom.tile(detid);
0034
0035
0036 filler.emplace_back(tile.centre(), t_lead * ts_to_ns_, ch_t_precis, tot);
0037 }
0038 }
0039 }