CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
RPCDigiProducer Class Reference

#include <RPCDigiProducer.h>

Inheritance diagram for RPCDigiProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Types

typedef
RPCDigitizer::RPCDigiSimLinks 
RPCDigitizerSimLinks
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

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 ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

std::string collection_for_XF
 
RPCDigitizertheDigitizer
 
RPCSimSetUptheRPCSimSetUp
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 19 of file RPCDigiProducer.h.

Member Typedef Documentation

Definition at line 23 of file RPCDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 39 of file RPCDigiProducer.cc.

References collection_for_XF, edm::hlt::Exception, edm::ParameterSet::getParameter(), theDigitizer, and theRPCSimSetUp.

39  {
40 
41  produces<RPCDigiCollection>();
42  produces<RPCDigitizerSimLinks>("RPCDigiSimLink");
43 
44  //Name of Collection used for create the XF
45  collection_for_XF = ps.getParameter<std::string>("InputCollection");
46 
48  if ( ! rng.isAvailable()) {
49  throw cms::Exception("Configuration")
50  << "RPCDigitizer requires the RandomNumberGeneratorService\n"
51  "which is not present in the configuration file. You must add the service\n"
52  "in the configuration file or remove the modules that require it.";
53  }
54 
55 
56  CLHEP::HepRandomEngine& engine = rng->getEngine();
57 
58  theRPCSimSetUp = new RPCSimSetUp(ps);
59  theDigitizer = new RPCDigitizer(ps,engine);
60 
61 
62 }
T getParameter(std::string const &) const
std::string collection_for_XF
RPCSimSetUp * theRPCSimSetUp
RPCDigitizer * theDigitizer
RPCDigiProducer::~RPCDigiProducer ( )
virtual

Definition at line 64 of file RPCDigiProducer.cc.

References theDigitizer, and theRPCSimSetUp.

64  {
65  delete theDigitizer;
66  delete theRPCSimSetUp;
67 }
RPCSimSetUp * theRPCSimSetUp
RPCDigitizer * theDigitizer

Member Function Documentation

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.

69  {
70 
72  eventSetup.get<MuonGeometryRecord>().get( hGeom );
73  const RPCGeometry *pGeom = &*hGeom;
74 
76  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);
77 
79  eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);
80 
81  theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
82 // theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls());
83 
84  theDigitizer->setGeometry( pGeom );
85  theRPCSimSetUp->setGeometry( pGeom );
87 }
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:44
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:46
RPCSimSetUp * theRPCSimSetUp
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:46
void setRPCSetUp(std::vector< RPCStripNoises::NoiseItem > vnoise, std::vector< float > vcls)
Definition: RPCSimSetUp.cc:46
const T & get() const
Definition: EventSetup.h:55
RPCDigitizer * theDigitizer
virtual void RPCDigiProducer::endRun ( edm::Run ,
const edm::EventSetup  
)
inlinevirtual

Reimplemented from edm::EDProducer.

Definition at line 29 of file RPCDigiProducer.h.

29 {;}
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.

89  {
90 
92  e.getByLabel("mix", collection_for_XF, cf);
93 
94  std::auto_ptr<MixCollection<PSimHit> >
95  hits( new MixCollection<PSimHit>(cf.product()) );
96 
97  // Create empty output
98  std::auto_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
99  std::auto_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks() );
100 
101  // run the digitizer
102  theDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink);
103 
104  // store them in the event
105  e.put(pDigis);
106  e.put(RPCDigitSimLink,"RPCDigiSimLink");
107 }
std::string collection_for_XF
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
void doAction(MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink)
Definition: RPCDigitizer.cc:24
T const * product() const
Definition: Handle.h:74
RPCDigitizer * theDigitizer
void RPCDigiProducer::setRPCSetUp ( std::vector< RPCStripNoises::NoiseItem ,
std::vector< double >   
)

Member Data Documentation

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().