#include <RPCDigiProducer.h>
Public Types | |
typedef RPCDigitizer::RPCDigiSimLinks | RPCDigitizerSimLinks |
Public Member Functions | |
virtual void | beginRun (edm::Run &, const edm::EventSetup &) |
virtual void | endRun (edm::Run &, const edm::EventSetup &) |
virtual void | produce (edm::Event &e, const edm::EventSetup &c) |
RPCDigiProducer (const edm::ParameterSet &ps) | |
void | setRPCSetUp (std::vector< RPCStripNoises::NoiseItem >, std::vector< double >) |
virtual | ~RPCDigiProducer () |
Private Attributes | |
std::string | collection_for_XF |
RPCDigitizer * | theDigitizer |
RPCSimSetUp * | theRPCSimSetUp |
Definition at line 19 of file RPCDigiProducer.h.
Definition at line 23 of file RPCDigiProducer.h.
RPCDigiProducer::RPCDigiProducer | ( | const edm::ParameterSet & | ps | ) | [explicit] |
Definition at line 39 of file RPCDigiProducer.cc.
References collection_for_XF, Exception, edm::ParameterSet::getParameter(), theDigitizer, and theRPCSimSetUp.
{ produces<RPCDigiCollection>(); produces<RPCDigitizerSimLinks>("RPCDigiSimLink"); //Name of Collection used for create the XF collection_for_XF = ps.getParameter<std::string>("InputCollection"); edm::Service<edm::RandomNumberGenerator> rng; if ( ! rng.isAvailable()) { throw cms::Exception("Configuration") << "RPCDigitizer requires the RandomNumberGeneratorService\n" "which is not present in the configuration file. You must add the service\n" "in the configuration file or remove the modules that require it."; } CLHEP::HepRandomEngine& engine = rng->getEngine(); theRPCSimSetUp = new RPCSimSetUp(ps); theDigitizer = new RPCDigitizer(ps,engine); }
RPCDigiProducer::~RPCDigiProducer | ( | ) | [virtual] |
Definition at line 64 of file RPCDigiProducer.cc.
References theDigitizer, and theRPCSimSetUp.
{ delete theDigitizer; delete theRPCSimSetUp; }
void RPCDigiProducer::beginRun | ( | edm::Run & | r, |
const edm::EventSetup & | eventSetup | ||
) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 69 of file RPCDigiProducer.cc.
References edm::EventSetup::get(), RPCDigitizer::setGeometry(), RPCSimSetUp::setGeometry(), RPCSimSetUp::setRPCSetUp(), RPCDigitizer::setRPCSimSetUp(), theDigitizer, and theRPCSimSetUp.
{ edm::ESHandle<RPCGeometry> hGeom; eventSetup.get<MuonGeometryRecord>().get( hGeom ); const RPCGeometry *pGeom = &*hGeom; edm::ESHandle<RPCStripNoises> noiseRcd; eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd); edm::ESHandle<RPCClusterSize> clsRcd; eventSetup.get<RPCClusterSizeRcd>().get(clsRcd); theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls()); // theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls()); theDigitizer->setGeometry( pGeom ); theRPCSimSetUp->setGeometry( pGeom ); theDigitizer->setRPCSimSetUp( theRPCSimSetUp ); }
virtual void RPCDigiProducer::endRun | ( | edm::Run & | , |
const edm::EventSetup & | |||
) | [inline, virtual] |
void RPCDigiProducer::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Produces the EDM products,
Implements edm::EDProducer.
Definition at line 89 of file RPCDigiProducer.cc.
References collection_for_XF, RPCDigitizer::doAction(), edm::Event::getByLabel(), edm::Handle< T >::product(), edm::Event::put(), and theDigitizer.
{ edm::Handle<CrossingFrame<PSimHit> > cf; e.getByLabel("mix", collection_for_XF, cf); std::auto_ptr<MixCollection<PSimHit> > hits( new MixCollection<PSimHit>(cf.product()) ); // Create empty output std::auto_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection()); std::auto_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks() ); // run the digitizer theDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink); // store them in the event e.put(pDigis); e.put(RPCDigitSimLink,"RPCDigiSimLink"); }
void RPCDigiProducer::setRPCSetUp | ( | std::vector< RPCStripNoises::NoiseItem > | , |
std::vector< double > | |||
) |
std::string RPCDigiProducer::collection_for_XF [private] |
Definition at line 42 of file RPCDigiProducer.h.
Referenced by produce(), and RPCDigiProducer().
RPCDigitizer* RPCDigiProducer::theDigitizer [private] |
Definition at line 38 of file RPCDigiProducer.h.
Referenced by beginRun(), produce(), RPCDigiProducer(), and ~RPCDigiProducer().
RPCSimSetUp* RPCDigiProducer::theRPCSimSetUp [private] |
Definition at line 39 of file RPCDigiProducer.h.
Referenced by beginRun(), RPCDigiProducer(), and ~RPCDigiProducer().