test
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::EDConsumerBase edm::ProductRegistryHelper

Public Types

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

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual 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 > &)
 
virtual ~RPCDigiProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string collection_for_XF
 
edm::EDGetTokenT
< CrossingFrame< PSimHit > > 
crossingFrameToken
 
std::string mix_
 
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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 38 of file RPCDigiProducer.cc.

References collection_for_XF, crossingFrameToken, edm::hlt::Exception, edm::ParameterSet::getParameter(), mix_, AlCaHLTBitMon_QueryRunRegistry::string, theDigitizer, and theRPCSimSetUp.

38  {
39 
40  produces<RPCDigiCollection>();
41  produces<RPCDigitizerSimLinks>("RPCDigiSimLink");
42 
43  //Name of Collection used for create the XF
44  mix_ = ps.getParameter<std::string>("mixLabel");
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  theRPCSimSetUp = new RPCSimSetUp(ps);
55  theDigitizer = new RPCDigitizer(ps);
56  crossingFrameToken = consumes<CrossingFrame<PSimHit>>(edm::InputTag(mix_,collection_for_XF));
57 }
T getParameter(std::string const &) const
std::string mix_
std::string collection_for_XF
RPCSimSetUp * theRPCSimSetUp
RPCDigitizer * theDigitizer
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
RPCDigiProducer::~RPCDigiProducer ( )
virtual

Definition at line 59 of file RPCDigiProducer.cc.

References theDigitizer, and theRPCSimSetUp.

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

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 64 of file RPCDigiProducer.cc.

References edm::EventSetup::get(), RPCSimSetUp::setGeometry(), RPCDigitizer::setGeometry(), RPCSimSetUp::setRPCSetUp(), RPCDigitizer::setRPCSimSetUp(), theDigitizer, and theRPCSimSetUp.

64  {
65 
67  eventSetup.get<MuonGeometryRecord>().get( hGeom );
68  const RPCGeometry *pGeom = &*hGeom;
69 
71  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);
72 
74  eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);
75 
76  theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
77 // theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls());
78 
79  theDigitizer->setGeometry( pGeom );
80  theRPCSimSetUp->setGeometry( pGeom );
82 }
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:50
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:48
RPCSimSetUp * theRPCSimSetUp
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:52
const T & get() const
Definition: EventSetup.h:55
RPCDigitizer * theDigitizer
void setRPCSetUp(const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< float > &vcls)
Definition: RPCSimSetUp.cc:45
void RPCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 84 of file RPCDigiProducer.cc.

References crossingFrameToken, RPCDigitizer::doAction(), edm::Event::getByToken(), edm::RandomNumberGenerator::getEngine(), edm::Handle< T >::product(), edm::Event::put(), edm::Event::streamID(), and theDigitizer.

84  {
85 
87  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
88 
90  // Obsolate code, based on getByLabel
91  // e.getByLabel(mix_, collection_for_XF, cf);
92  //New code, based on tokens
94 
95  std::auto_ptr<MixCollection<PSimHit> >
96  hits( new MixCollection<PSimHit>(cf.product()) );
97 
98  // Create empty output
99  std::auto_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
100  std::auto_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks() );
101 
102  // run the digitizer
103  theDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine);
104 
105  // store them in the event
106  e.put(pDigis);
107  e.put(RPCDigitSimLink,"RPCDigiSimLink");
108 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
void doAction(MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink, CLHEP::HepRandomEngine *)
Definition: RPCDigitizer.cc:23
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
T const * product() const
Definition: Handle.h:81
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &) const =0
Use this engine in event methods.
StreamID streamID() const
Definition: Event.h:75
RPCDigitizer * theDigitizer
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
void RPCDigiProducer::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  ,
const std::vector< double > &   
)

Member Data Documentation

std::string RPCDigiProducer::collection_for_XF
private

Definition at line 42 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

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

Definition at line 45 of file RPCDigiProducer.h.

Referenced by produce(), and RPCDigiProducer().

std::string RPCDigiProducer::mix_
private

Definition at line 41 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

RPCDigitizer* RPCDigiProducer::theDigitizer
private

Definition at line 37 of file RPCDigiProducer.h.

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

RPCSimSetUp* RPCDigiProducer::theRPCSimSetUp
private

Definition at line 38 of file RPCDigiProducer.h.

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