CMS 3D CMS Logo

CTPPSDiamondRecHitProducer.cc
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of PPS offline software.
4  * Authors:
5  * Laurent Forthomme (laurent.forthomme@cern.ch)
6  * Nicola Minafra (nicola.minafra@cern.ch)
7  *
8  ****************************************************************************/
9 
10 #include <memory>
11 
18 
22 
25 
29 
31 
35 
37 public:
39 
41 
42 private:
43  void produce(edm::Event&, const edm::EventSetup&) override;
44 
49 
53 
56 };
57 
59  : digiToken_(consumes<edm::DetSetVector<CTPPSDiamondDigi> >(iConfig.getParameter<edm::InputTag>("digiTag"))),
61  applyCalib_(iConfig.getParameter<bool>("applyCalibration")),
62  algo_(iConfig) {
63  if (applyCalib_) {
64  timingCalibrationToken_ = esConsumes<PPSTimingCalibration, PPSTimingCalibrationRcd>(
65  edm::ESInputTag(iConfig.getParameter<std::string>("timingCalibrationTag")));
66  timingCalibrationLUTToken_ = esConsumes<PPSTimingCalibrationLUT, PPSTimingCalibrationLUTRcd>();
67  }
68  produces<edm::DetSetVector<CTPPSDiamondRecHit> >();
69 }
70 
72  auto pOut = std::make_unique<edm::DetSetVector<CTPPSDiamondRecHit> >();
73 
74  // get the digi collection
75  const auto& digis = iEvent.get(digiToken_);
76 
77  if (!digis.empty()) {
78  if (applyCalib_ && (calibWatcher_.check(iSetup) or lutWatcher_.check(iSetup)))
80 
81  // produce the rechits collection
82  algo_.build(iSetup.getData(geometryToken_), digis, *pOut);
83  }
84 
85  iEvent.put(std::move(pOut));
86 }
87 
90 
91  desc.add<edm::InputTag>("digiTag", edm::InputTag("ctppsDiamondRawToDigi", "TimingDiamond"))
92  ->setComment("input digis collection to retrieve");
93  desc.add<std::string>("timingCalibrationTag", ":PPSDiamondTimingCalibration")
94  ->setComment("input tag for timing calibrations retrieval");
95  desc.add<double>("timeSliceNs", 25.0 / 1024.0)
96  ->setComment("conversion constant between HPTDC timing bin size and nanoseconds");
97  desc.add<bool>("applyCalibration", true)->setComment("switch on/off the timing calibration");
98 
99  descr.add("ctppsDiamondRecHits", desc);
100 }
101 
void build(const CTPPSGeometry &, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &) override
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd > timingCalibrationToken_
static void fillDescriptions(edm::ConfigurationDescriptions &)
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
edm::ESWatcher< PPSTimingCalibrationLUTRcd > lutWatcher_
void produce(edm::Event &, const edm::EventSetup &) override
Event setup record containing the real (actual) geometry information.
int iEvent
Definition: GenABIO.cc:224
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:30
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
void setCalibration(const PPSTimingCalibration &calib, const PPSTimingCalibrationLUT &calibLUT)
HLT enums.
edm::ESGetToken< PPSTimingCalibrationLUT, PPSTimingCalibrationLUTRcd > timingCalibrationLUTToken_
CTPPSDiamondRecHitProducerAlgorithm algo_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryToken_
CTPPSDiamondRecHitProducer(const edm::ParameterSet &)
edm::ESWatcher< PPSTimingCalibrationRcd > calibWatcher_
A watcher to detect timing calibration changes.
def move(src, dest)
Definition: eostools.py:511