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 
34 
36 public:
38 
40 
41 private:
42  void produce(edm::Event&, const edm::EventSetup&) override;
43 
47 
50 
53 };
54 
56  : digiToken_(consumes<edm::DetSetVector<CTPPSDiamondDigi> >(iConfig.getParameter<edm::InputTag>("digiTag"))),
57  geometryToken_(esConsumes<CTPPSGeometry, VeryForwardRealGeometryRecord>()),
58  applyCalib_(iConfig.getParameter<bool>("applyCalibration")),
59  algo_(iConfig) {
60  if (applyCalib_) {
61  timingCalibrationToken_ = esConsumes<PPSTimingCalibration, PPSTimingCalibrationRcd>(
62  edm::ESInputTag(iConfig.getParameter<std::string>("timingCalibrationTag")));
63  }
64  produces<edm::DetSetVector<CTPPSDiamondRecHit> >();
65 }
66 
68  auto pOut = std::make_unique<edm::DetSetVector<CTPPSDiamondRecHit> >();
69 
70  // get the digi collection
72  iEvent.getByToken(digiToken_, digis);
73 
74  if (!digis->empty()) {
75  if (applyCalib_ && calibWatcher_.check(iSetup)) {
77  algo_.setCalibration(*hTimingCalib);
78  }
79  // get the geometry
81 
82  // produce the rechits collection
83  algo_.build(*geometry, *digis, *pOut);
84  }
85 
86  iEvent.put(std::move(pOut));
87 }
88 
91 
92  desc.add<edm::InputTag>("digiTag", edm::InputTag("ctppsDiamondRawToDigi", "TimingDiamond"))
93  ->setComment("input digis collection to retrieve");
94  desc.add<std::string>("timingCalibrationTag", "GlobalTag:PPSDiamondTimingCalibration")
95  ->setComment("input tag for timing calibrations retrieval");
96  desc.add<double>("timeSliceNs", 25.0 / 1024.0)
97  ->setComment("conversion constant between HPTDC timing bin size and nanoseconds");
98  desc.add<bool>("applyCalibration", true)->setComment("switch on/off the timing calibration");
99 
100  descr.add("ctppsDiamondRecHits", desc);
101 }
102 
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
VeryForwardRealGeometryRecord
Event setup record containing the real (actual) geometry information.
Definition: VeryForwardRealGeometryRecord.h:22
electrons_cff.bool
bool
Definition: electrons_cff.py:393
edm::ESInputTag
Definition: ESInputTag.h:87
CTPPSGeometry
The manager class for TOTEM RP geometry.
Definition: CTPPSGeometry.h:29
CTPPSDiamondRecHitProducer::calibWatcher_
edm::ESWatcher< PPSTimingCalibrationRcd > calibWatcher_
A watcher to detect timing calibration changes.
Definition: CTPPSDiamondRecHitProducer.cc:55
edm::ESWatcher< PPSTimingCalibrationRcd >
ESHandle.h
CTPPSDiamondRecHitProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: CTPPSDiamondRecHitProducer.cc:67
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
CTPPSDiamondRecHitProducerAlgorithm::build
void build(const CTPPSGeometry &, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &)
Definition: CTPPSDiamondRecHitProducerAlgorithm.cc:24
geometry
Definition: geometry.py:1
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CTPPSDiamondDigi
Definition: CTPPSDiamondDigi.h:16
EDProducer.h
CTPPSDiamondRecHitProducer::digiToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
Definition: CTPPSDiamondRecHitProducer.cc:50
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSDiamondRecHitProducer::applyCalib_
bool applyCalib_
Definition: CTPPSDiamondRecHitProducer.cc:57
ESGetToken.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CTPPSDiamondDigi.h
CTPPSDiamondRecHitProducerAlgorithm.h
CTPPSDiamondRecHit.h
edm::ESHandle
Definition: DTSurvey.h:22
CTPPSDiamondRecHitProducer::geometryToken_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryToken_
Definition: CTPPSDiamondRecHitProducer.cc:52
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSDiamondDetId.h
edm::ParameterSet
Definition: ParameterSet.h:47
CTPPSDiamondRecHitProducerAlgorithm::setCalibration
void setCalibration(const PPSTimingCalibration &)
Definition: CTPPSDiamondRecHitProducerAlgorithm.cc:19
Event.h
CTPPSDiamondRecHitProducerAlgorithm
Definition: CTPPSDiamondRecHitProducerAlgorithm.h:25
CTPPSDiamondRecHitProducer::timingCalibrationToken_
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd > timingCalibrationToken_
Definition: CTPPSDiamondRecHitProducer.cc:51
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
CTPPSDiamondRecHitProducer
Definition: CTPPSDiamondRecHitProducer.cc:35
VeryForwardRealGeometryRecord.h
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd >
CTPPSDiamondRecHitProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &)
Definition: CTPPSDiamondRecHitProducer.cc:89
CTPPSDiamondRecHitProducer::algo_
CTPPSDiamondRecHitProducerAlgorithm algo_
Definition: CTPPSDiamondRecHitProducer.cc:58
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
ESWatcher.h
CTPPSDiamondRecHitProducer::CTPPSDiamondRecHitProducer
CTPPSDiamondRecHitProducer(const edm::ParameterSet &)
Definition: CTPPSDiamondRecHitProducer.cc:55
PPSTimingCalibrationRcd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DetSet.h
ParameterSet.h
edm::Event
Definition: Event.h:73
StreamID.h
edm::InputTag
Definition: InputTag.h:15