CMS 3D CMS Logo

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

Public Member Functions

 CTPPSDiamondRecHitProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Member Functions

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

Private Attributes

CTPPSDiamondRecHitProducerAlgorithm algo_
 
edm::ESWatcher< PPSTimingCalibrationRcdcalibWatcher_
 A watcher to detect timing calibration changes. More...
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
 
edm::ESInputTag timingCalibrationTag_
 Label to timing calibration tag. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 34 of file CTPPSDiamondRecHitProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 54 of file CTPPSDiamondRecHitProducer.cc.

54  :
55  digiToken_( consumes<edm::DetSetVector<CTPPSDiamondDigi> >( iConfig.getParameter<edm::InputTag>( "digiTag" ) ) ),
56  timingCalibrationTag_( iConfig.getParameter<std::string>( "timingCalibrationTag" ) ),
57  algo_( iConfig )
58 {
59  produces<edm::DetSetVector<CTPPSDiamondRecHit> >();
60 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
CTPPSDiamondRecHitProducerAlgorithm algo_
edm::ESInputTag timingCalibrationTag_
Label to timing calibration tag.

Member Function Documentation

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

Definition at line 89 of file CTPPSDiamondRecHitProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

90 {
92 
93  desc.add<edm::InputTag>( "digiTag", edm::InputTag( "ctppsDiamondRawToDigi", "TimingDiamond" ) )
94  ->setComment( "input digis collection to retrieve" );
95  desc.add<std::string>( "timingCalibrationTag", "GlobalTag:PPSDiamondTimingCalibration" )
96  ->setComment( "input tag for timing calibrations retrieval" );
97  desc.add<double>( "timeSliceNs", 25.0/1024.0 )
98  ->setComment( "conversion constant between HPTDC timing bin size and nanoseconds" );
99  desc.add<int>( "timeShift", 0 ) // to be determined at calibration level, will be replaced by a map channel id -> time shift
100  ->setComment( "overall time offset to apply on all hits in all channels" );
101 
102  descr.add( "ctppsDiamondRecHits", desc );
103 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CTPPSDiamondRecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 63 of file CTPPSDiamondRecHitProducer.cc.

References algo_, CTPPSDiamondRecHitProducerAlgorithm::build(), calibWatcher_, edm::ESWatcher< T >::check(), digiToken_, geometry, edm::EventSetup::get(), edm::Event::getByToken(), eostools::move(), edm::Event::put(), CTPPSDiamondRecHitProducerAlgorithm::setCalibration(), and timingCalibrationTag_.

64 {
65  auto pOut = std::make_unique<edm::DetSetVector<CTPPSDiamondRecHit> >();
66 
67  // get the digi collection
69  iEvent.getByToken( digiToken_, digis );
70 
71  if ( !digis->empty() ) {
72  if ( calibWatcher_.check( iSetup ) ) {
74  iSetup.get<PPSTimingCalibrationRcd>().get( timingCalibrationTag_, hTimingCalib );
75  algo_.setCalibration( *hTimingCalib );
76  }
77  // get the geometry
79  iSetup.get<VeryForwardRealGeometryRecord>().get( geometry );
80 
81  // produce the rechits collection
82  algo_.build( *geometry, *digis, *pOut );
83  }
84 
85  iEvent.put( std::move( pOut ) );
86 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
void build(const CTPPSGeometry &, const edm::DetSetVector< CTPPSDiamondDigi > &, edm::DetSetVector< CTPPSDiamondRecHit > &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondDigi > > digiToken_
Event setup record containing the real (actual) geometry information.
EventSetup record for TOTEM/PPS timing calibration information.
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
ESHandle< TrackerGeometry > geometry
T get() const
Definition: EventSetup.h:71
CTPPSDiamondRecHitProducerAlgorithm algo_
edm::ESWatcher< PPSTimingCalibrationRcd > calibWatcher_
A watcher to detect timing calibration changes.
def move(src, dest)
Definition: eostools.py:511
edm::ESInputTag timingCalibrationTag_
Label to timing calibration tag.

Member Data Documentation

CTPPSDiamondRecHitProducerAlgorithm CTPPSDiamondRecHitProducer::algo_
private

Definition at line 51 of file CTPPSDiamondRecHitProducer.cc.

Referenced by produce().

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

A watcher to detect timing calibration changes.

Definition at line 49 of file CTPPSDiamondRecHitProducer.cc.

Referenced by produce().

edm::EDGetTokenT<edm::DetSetVector<CTPPSDiamondDigi> > CTPPSDiamondRecHitProducer::digiToken_
private

Definition at line 44 of file CTPPSDiamondRecHitProducer.cc.

Referenced by produce().

edm::ESInputTag CTPPSDiamondRecHitProducer::timingCalibrationTag_
private

Label to timing calibration tag.

Definition at line 47 of file CTPPSDiamondRecHitProducer.cc.

Referenced by produce().