34 #include "CLHEP/Random/RandFlat.h" 37 class HepRandomEngine;
42 produces<RPCDigiCollection>();
43 produces<RPCDigitizerSimLinks>(
"RPCDigiSimLink");
50 if ( ! rng.isAvailable()) {
52 <<
"RPCDigitizer requires the RandomNumberGeneratorService\n" 53 "which is not present in the configuration file. You must add the service\n" 54 "in the configuration file or remove the modules that require it.";
61 crossingFrameToken = consumes<CrossingFrame<PSimHit>>(
edm::InputTag(mix_,collection_for_XF));
65 delete theRPCDigitizer;
66 delete theIRPCDigitizer;
67 delete theRPCSimSetUpRPC;
68 delete theRPCSimSetUpIRPC;
85 theRPCSimSetUpRPC->setGeometry( pGeom );
86 theRPCSimSetUpRPC->setRPCSetUp(noiseRcd->
getVNoise(), clsRcd->
getCls());
87 theRPCSimSetUpIRPC->setGeometry( pGeom );
88 theRPCSimSetUpIRPC->setRPCSetUp(noiseRcd->
getVNoise(), clsRcd->
getCls());
91 theRPCDigitizer->setGeometry( pGeom );
92 theIRPCDigitizer->setGeometry( pGeom );
93 theRPCDigitizer->setRPCSimSetUp( theRPCSimSetUpRPC );
94 theIRPCDigitizer->setRPCSimSetUp( theRPCSimSetUpIRPC );
103 LogDebug (
"RPCandIRPCDigiProducer")<<
"[RPCandIRPCDigiProducer::produce] got the CLHEP::HepRandomEngine engine from the edm::Event.streamID() and edm::Service<edm::RandomNumberGenerator>";
104 LogDebug (
"RPCandIRPCDigiProducer")<<
"[RPCandIRPCDigiProducer::produce] test the CLHEP::HepRandomEngine by firing once RandFlat ---- this must be the first time in SimMuon/RPCDigitizer";
105 LogDebug (
"RPCandIRPCDigiProducer")<<
"[RPCandIRPCDigiProducer::produce] to activate the test go in RPCandIRPCDigiProducer.cc and uncomment the line below";
110 std::unique_ptr<MixCollection<PSimHit> >
117 theRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine);
118 theIRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine);
T getParameter(std::string const &) const
RPCandIRPCDigiProducer(const edm::ParameterSet &ps)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void beginRun(const edm::Run &, const edm::EventSetup &) override
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
std::vector< NoiseItem > const & getVNoise() const
void produce(edm::Event &e, const edm::EventSetup &c) override
~RPCandIRPCDigiProducer() override
T const * product() const
StreamID streamID() const
std::vector< ClusterSizeItem > const & getCls() const