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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 21 of file RPCDigiProducer.h.

Member Typedef Documentation

Definition at line 25 of file RPCDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 39 of file RPCDigiProducer.cc.

References Exception, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

39  {
40 
41  produces<RPCDigiCollection>();
42  produces<RPCDigitizerSimLinks>("RPCDigiSimLink");
43 
44  //Name of Collection used for create the XF
45  mix_ = ps.getParameter<std::string>("mixLabel");
46  collection_for_XF = ps.getParameter<std::string>("InputCollection");
47 
49  if ( ! rng.isAvailable()) {
50  throw cms::Exception("Configuration")
51  << "RPCDigitizer requires the RandomNumberGeneratorService\n"
52  "which is not present in the configuration file. You must add the service\n"
53  "in the configuration file or remove the modules that require it.";
54  }
55  theRPCSimSetUp = new RPCSimSetUp(ps);
56  theDigitizer = new RPCDigitizer(ps);
57  crossingFrameToken = consumes<CrossingFrame<PSimHit>>(edm::InputTag(mix_,collection_for_XF));
58 }
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 60 of file RPCDigiProducer.cc.

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

Member Function Documentation

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

Definition at line 65 of file RPCDigiProducer.cc.

References edm::EventSetup::get(), RPCClusterSize::getCls(), and RPCStripNoises::getVNoise().

65  {
66 
68  eventSetup.get<MuonGeometryRecord>().get( hGeom );
69  const RPCGeometry *pGeom = &*hGeom;
70 
72  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);
73 
75  eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);
76 
77  theRPCSimSetUp->setGeometry( pGeom );
78  theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
79 // theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls());
80 
81  theDigitizer->setGeometry( pGeom );
82  // theRPCSimSetUp->setGeometry( pGeom );
84 }
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:47
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:48
RPCSimSetUp * theRPCSimSetUp
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:49
std::vector< NoiseItem > const & getVNoise() const
const T & get() const
Definition: EventSetup.h:56
RPCDigitizer * theDigitizer
std::vector< ClusterSizeItem > const & getCls() const
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,

Definition at line 86 of file RPCDigiProducer.cc.

References edm::Event::getByToken(), edm::RandomNumberGenerator::getEngine(), hfClusterShapes_cfi::hits, LogDebug, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), and edm::Event::streamID().

86  {
87 
89  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
90 
91  LogDebug ("RPCDigiProducer")<<"[RPCDigiProducer::produce] got the CLHEP::HepRandomEngine engine from the edm::Event.streamID() and edm::Service<edm::RandomNumberGenerator>";
92  LogDebug ("RPCDigiProducer")<<"[RPCDigiProducer::produce] test the CLHEP::HepRandomEngine by firing once RandFlat ---- this must be the first time in SimMuon/RPCDigitizer";
93  LogDebug ("RPCDigiProducer")<<"[RPCDigiProducer::produce] to activate the test go in RPCDigiProducer.cc and uncomment the line below";
94  // LogDebug ("RPCDigiProducer")<<"[RPCDigiProducer::produce] Fired RandFlat :: "<<CLHEP::RandFlat::shoot(engine);
95 
96 
98  // Obsolate code, based on getByLabel
99  // e.getByLabel(mix_, collection_for_XF, cf);
100  //New code, based on tokens
102 
103  std::unique_ptr<MixCollection<PSimHit> >
104  hits( new MixCollection<PSimHit>(cf.product()) );
105 
106  // Create empty output
107  std::unique_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
108  std::unique_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks() );
109 
110  // run the digitizer
111  theDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine);
112 
113  // store them in the event
114  e.put(std::move(pDigis));
115  e.put(std::move(RPCDigitSimLink),"RPCDigiSimLink");
116 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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:24
T const * product() const
Definition: Handle.h:81
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
StreamID streamID() const
Definition: Event.h:81
RPCDigitizer * theDigitizer
def move(src, dest)
Definition: eostools.py:510
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 44 of file RPCDigiProducer.h.

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

Definition at line 47 of file RPCDigiProducer.h.

std::string RPCDigiProducer::mix_
private

Definition at line 43 of file RPCDigiProducer.h.

RPCDigitizer* RPCDigiProducer::theDigitizer
private

Definition at line 39 of file RPCDigiProducer.h.

RPCSimSetUp* RPCDigiProducer::theRPCSimSetUp
private

Definition at line 40 of file RPCDigiProducer.h.