CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
RPCDigiProducer Class Reference

#include <RPCDigiProducer.h>

Inheritance diagram for RPCDigiProducer:
edm::stream::EDProducer<>

Public Types

typedef RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
 
- 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
 

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 
 RPCDigiProducer (const edm::ParameterSet &ps)
 
void setRPCSetUp (const std::vector< RPCStripNoises::NoiseItem > &, const std::vector< double > &)
 
 ~RPCDigiProducer () override
 
- 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
 

Private Attributes

edm::ESGetToken< RPCClusterSize, RPCClusterSizeRcdclsToken
 
std::string collection_for_XF
 
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordgeomToken
 
std::string mix_
 
edm::ESGetToken< RPCStripNoises, RPCStripNoisesRcdnoiseToken
 
RPCDigitizertheDigitizer
 
RPCSimSetUptheRPCSimSetUp
 

Detailed Description

Definition at line 23 of file RPCDigiProducer.h.

Member Typedef Documentation

◆ RPCDigitizerSimLinks

Definition at line 25 of file RPCDigiProducer.h.

Constructor & Destructor Documentation

◆ RPCDigiProducer()

RPCDigiProducer::RPCDigiProducer ( const edm::ParameterSet ps)
explicit

Definition at line 35 of file RPCDigiProducer.cc.

References clsToken, collection_for_XF, crossingFrameToken, Exception, geomToken, edm::ParameterSet::getParameter(), HLT_2022v12_cff::InputTag, mix_, noiseToken, AlCaHLTBitMon_QueryRunRegistry::string, theDigitizer, and theRPCSimSetUp.

35  {
36  produces<RPCDigiCollection>();
37  produces<RPCDigitizerSimLinks>("RPCDigiSimLink");
38 
39  //Name of Collection used for create the XF
40  mix_ = ps.getParameter<std::string>("mixLabel");
41  collection_for_XF = ps.getParameter<std::string>("InputCollection");
42 
44  if (!rng.isAvailable()) {
45  throw cms::Exception("Configuration")
46  << "RPCDigitizer requires the RandomNumberGeneratorService\n"
47  "which is not present in the configuration file. You must add the service\n"
48  "in the configuration file or remove the modules that require it.";
49  }
50  theRPCSimSetUp = new RPCSimSetUp(ps);
51  theDigitizer = new RPCDigitizer(ps);
52  crossingFrameToken = consumes<CrossingFrame<PSimHit>>(edm::InputTag(mix_, collection_for_XF));
53  geomToken = esConsumes<RPCGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
54  noiseToken = esConsumes<RPCStripNoises, RPCStripNoisesRcd, edm::Transition::BeginRun>();
55  clsToken = esConsumes<RPCClusterSize, RPCClusterSizeRcd, edm::Transition::BeginRun>();
56 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::string mix_
std::string collection_for_XF
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > geomToken
RPCSimSetUp * theRPCSimSetUp
edm::ESGetToken< RPCStripNoises, RPCStripNoisesRcd > noiseToken
edm::ESGetToken< RPCClusterSize, RPCClusterSizeRcd > clsToken
RPCDigitizer * theDigitizer
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken

◆ ~RPCDigiProducer()

RPCDigiProducer::~RPCDigiProducer ( )
override

Definition at line 58 of file RPCDigiProducer.cc.

References theDigitizer, and theRPCSimSetUp.

58  {
59  delete theDigitizer;
60  delete theRPCSimSetUp;
61 }
RPCSimSetUp * theRPCSimSetUp
RPCDigitizer * theDigitizer

Member Function Documentation

◆ beginRun()

void RPCDigiProducer::beginRun ( const edm::Run r,
const edm::EventSetup eventSetup 
)
override

Definition at line 63 of file RPCDigiProducer.cc.

References clsToken, options_cfi::eventSetup, geomToken, RPCClusterSize::getCls(), RPCStripNoises::getVNoise(), noiseToken, RPCDigitizer::setGeometry(), RPCSimSetUp::setGeometry(), RPCSimSetUp::setRPCSetUp(), RPCDigitizer::setRPCSimSetUp(), theDigitizer, and theRPCSimSetUp.

63  {
65  const RPCGeometry* pGeom = &*hGeom;
66 
68 
70 
72  theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
73  // theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls());
74 
75  theDigitizer->setGeometry(pGeom);
76  // theRPCSimSetUp->setGeometry( pGeom );
78 }
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > geomToken
std::vector< NoiseItem > const & getVNoise() const
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:46
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:46
RPCSimSetUp * theRPCSimSetUp
edm::ESGetToken< RPCStripNoises, RPCStripNoisesRcd > noiseToken
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:48
edm::ESGetToken< RPCClusterSize, RPCClusterSizeRcd > clsToken
std::vector< ClusterSizeItem > const & getCls() const
RPCDigitizer * theDigitizer
void setRPCSetUp(const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< float > &vcls)
Definition: RPCSimSetUp.cc:41

◆ produce()

void RPCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Produces the EDM products,

Definition at line 80 of file RPCDigiProducer.cc.

References crossingFrameToken, RPCDigitizer::doAction(), MillePedeFileConverter_cfg::e, edm::RandomNumberGenerator::getEngine(), hfClusterShapes_cfi::hits, LogDebug, eostools::move(), edm::Handle< T >::product(), and theDigitizer.

80  {
82  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
83 
84  LogDebug("RPCDigiProducer") << "[RPCDigiProducer::produce] got the CLHEP::HepRandomEngine engine from the "
85  "edm::Event.streamID() and edm::Service<edm::RandomNumberGenerator>";
86  LogDebug("RPCDigiProducer") << "[RPCDigiProducer::produce] test the CLHEP::HepRandomEngine by firing once RandFlat "
87  "---- this must be the first time in SimMuon/RPCDigitizer";
88  LogDebug("RPCDigiProducer")
89  << "[RPCDigiProducer::produce] to activate the test go in RPCDigiProducer.cc and uncomment the line below";
90  // LogDebug ("RPCDigiProducer")<<"[RPCDigiProducer::produce] Fired RandFlat :: "<<CLHEP::RandFlat::shoot(engine);
91 
93  // Obsolate code, based on getByLabel
94  // e.getByLabel(mix_, collection_for_XF, cf);
95  //New code, based on tokens
96  e.getByToken(crossingFrameToken, cf);
97 
98  std::unique_ptr<MixCollection<PSimHit>> hits(new MixCollection<PSimHit>(cf.product()));
99 
100  // Create empty output
101  std::unique_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
102  std::unique_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks());
103 
104  // run the digitizer
105  theDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine);
106 
107  // store them in the event
108  e.put(std::move(pDigis));
109  e.put(std::move(RPCDigitSimLink), "RPCDigiSimLink");
110 }
T const * product() const
Definition: Handle.h:70
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
void doAction(MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink, CLHEP::HepRandomEngine *)
Definition: RPCDigitizer.cc:19
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
RPCDigitizer * theDigitizer
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
#define LogDebug(id)

◆ setRPCSetUp()

void RPCDigiProducer::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  ,
const std::vector< double > &   
)

Member Data Documentation

◆ clsToken

edm::ESGetToken<RPCClusterSize, RPCClusterSizeRcd> RPCDigiProducer::clsToken
private

Definition at line 51 of file RPCDigiProducer.h.

Referenced by beginRun(), and RPCDigiProducer().

◆ collection_for_XF

std::string RPCDigiProducer::collection_for_XF
private

Definition at line 43 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

◆ crossingFrameToken

edm::EDGetTokenT<CrossingFrame<PSimHit> > RPCDigiProducer::crossingFrameToken
private

Definition at line 46 of file RPCDigiProducer.h.

Referenced by produce(), and RPCDigiProducer().

◆ geomToken

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> RPCDigiProducer::geomToken
private

Definition at line 49 of file RPCDigiProducer.h.

Referenced by beginRun(), and RPCDigiProducer().

◆ mix_

std::string RPCDigiProducer::mix_
private

Definition at line 42 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

◆ noiseToken

edm::ESGetToken<RPCStripNoises, RPCStripNoisesRcd> RPCDigiProducer::noiseToken
private

Definition at line 50 of file RPCDigiProducer.h.

Referenced by beginRun(), and RPCDigiProducer().

◆ theDigitizer

RPCDigitizer* RPCDigiProducer::theDigitizer
private

Definition at line 38 of file RPCDigiProducer.h.

Referenced by beginRun(), produce(), RPCDigiProducer(), and ~RPCDigiProducer().

◆ theRPCSimSetUp

RPCSimSetUp* RPCDigiProducer::theRPCSimSetUp
private

Definition at line 39 of file RPCDigiProducer.h.

Referenced by beginRun(), RPCDigiProducer(), and ~RPCDigiProducer().