CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TotemT2RecHitProducer Class Reference
Inheritance diagram for TotemT2RecHitProducer:
edm::stream::EDProducer<>

Public Member Functions

 TotemT2RecHitProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

TotemT2RecHitProducerAlgorithm algo_
 
const bool applyCalib_
 
edm::ESWatcher< PPSTimingCalibrationRcdcalibWatcher_
 A watcher to detect timing calibration changes. More...
 
edm::EDGetTokenT< edmNew::DetSetVector< TotemT2Digi > > digiToken_
 
edm::ESGetToken< TotemGeometry, TotemGeometryRcdgeometryToken_
 
edm::ESGetToken< PPSTimingCalibrationLUT, PPSTimingCalibrationLUTRcdtimingCalibrationLUTToken_
 
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcdtimingCalibrationToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 34 of file TotemT2RecHitProducer.cc.

Constructor & Destructor Documentation

◆ TotemT2RecHitProducer()

TotemT2RecHitProducer::TotemT2RecHitProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 54 of file TotemT2RecHitProducer.cc.

References applyCalib_, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and timingCalibrationToken_.

56  geometryToken_(esConsumes<TotemGeometry, TotemGeometryRcd>()),
57  applyCalib_(iConfig.getParameter<bool>("applyCalibration")),
58  algo_(iConfig) {
59  if (applyCalib_)
60  timingCalibrationToken_ = esConsumes<PPSTimingCalibration, PPSTimingCalibrationRcd>(
61  edm::ESInputTag(iConfig.getParameter<std::string>("timingCalibrationTag")));
62  produces<edmNew::DetSetVector<TotemT2RecHit> >();
63 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd > timingCalibrationToken_
edm::EDGetTokenT< edmNew::DetSetVector< TotemT2Digi > > digiToken_
TotemT2RecHitProducerAlgorithm algo_
edm::ESGetToken< TotemGeometry, TotemGeometryRcd > geometryToken_

Member Function Documentation

◆ fillDescriptions()

void TotemT2RecHitProducer::fillDescriptions ( edm::ConfigurationDescriptions descr)
static

Definition at line 82 of file TotemT2RecHitProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

82  {
84 
85  desc.add<edm::InputTag>("digiTag", edm::InputTag("totemT2Digis", "TotemT2"))
86  ->setComment("input digis collection to retrieve");
87  desc.add<std::string>("timingCalibrationTag", "GlobalTag:TotemT2TimingCalibration")
88  ->setComment("input tag for timing calibrations retrieval");
89  desc.add<double>("timeSliceNs", 25.0 / 1024.0)
90  ->setComment("conversion constant between timing bin size and nanoseconds");
91  desc.add<bool>("applyCalibration", false)->setComment("switch on/off the timing calibration");
92 
93  descr.add("totemT2RecHits", desc);
94 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void TotemT2RecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 65 of file TotemT2RecHitProducer.cc.

References algo_, applyCalib_, TotemT2RecHitProducerAlgorithm::build(), calibWatcher_, edm::ESWatcher< T >::check(), digiToken_, geometryToken_, edm::EventSetup::getData(), iEvent, eostools::move(), TimingRecHitProducerAlgorithm< G, D, R >::setCalibration(), timingCalibrationLUTToken_, and timingCalibrationToken_.

65  {
66  auto pOut = std::make_unique<edmNew::DetSetVector<TotemT2RecHit> >();
67 
68  // get the digi collection
69  const auto& digis = iEvent.get(digiToken_);
70 
71  if (!digis.empty()) {
72  if (applyCalib_ && calibWatcher_.check(iSetup))
74 
75  // produce the rechits collection
76  algo_.build(iSetup.getData(geometryToken_), digis, *pOut);
77  }
78 
79  iEvent.put(std::move(pOut));
80 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::ESGetToken< PPSTimingCalibrationLUT, PPSTimingCalibrationLUTRcd > timingCalibrationLUTToken_
edm::ESGetToken< PPSTimingCalibration, PPSTimingCalibrationRcd > timingCalibrationToken_
edm::EDGetTokenT< edmNew::DetSetVector< TotemT2Digi > > digiToken_
int iEvent
Definition: GenABIO.cc:224
void build(const TotemGeometry &, const edmNew::DetSetVector< TotemT2Digi > &, edmNew::DetSetVector< TotemT2RecHit > &) override
edm::ESWatcher< PPSTimingCalibrationRcd > calibWatcher_
A watcher to detect timing calibration changes.
TotemT2RecHitProducerAlgorithm algo_
edm::ESGetToken< TotemGeometry, TotemGeometryRcd > geometryToken_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
void setCalibration(const PPSTimingCalibration &calib, const PPSTimingCalibrationLUT &calibLUT)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

TotemT2RecHitProducerAlgorithm TotemT2RecHitProducer::algo_
private

Definition at line 51 of file TotemT2RecHitProducer.cc.

Referenced by produce().

◆ applyCalib_

const bool TotemT2RecHitProducer::applyCalib_
private

Definition at line 50 of file TotemT2RecHitProducer.cc.

Referenced by produce(), and TotemT2RecHitProducer().

◆ calibWatcher_

edm::ESWatcher<PPSTimingCalibrationRcd> TotemT2RecHitProducer::calibWatcher_
private

A watcher to detect timing calibration changes.

Definition at line 48 of file TotemT2RecHitProducer.cc.

Referenced by produce().

◆ digiToken_

edm::EDGetTokenT<edmNew::DetSetVector<TotemT2Digi> > TotemT2RecHitProducer::digiToken_
private

Definition at line 43 of file TotemT2RecHitProducer.cc.

Referenced by produce().

◆ geometryToken_

edm::ESGetToken<TotemGeometry, TotemGeometryRcd> TotemT2RecHitProducer::geometryToken_
private

Definition at line 46 of file TotemT2RecHitProducer.cc.

Referenced by produce().

◆ timingCalibrationLUTToken_

edm::ESGetToken<PPSTimingCalibrationLUT, PPSTimingCalibrationLUTRcd> TotemT2RecHitProducer::timingCalibrationLUTToken_
private

Definition at line 45 of file TotemT2RecHitProducer.cc.

Referenced by produce().

◆ timingCalibrationToken_

edm::ESGetToken<PPSTimingCalibration, PPSTimingCalibrationRcd> TotemT2RecHitProducer::timingCalibrationToken_
private

Definition at line 44 of file TotemT2RecHitProducer.cc.

Referenced by produce(), and TotemT2RecHitProducer().