CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
RPCandIRPCDigiProducer Class Reference

#include <RPCandIRPCDigiProducer.h>

Inheritance diagram for RPCandIRPCDigiProducer:
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
 
 RPCandIRPCDigiProducer (const edm::ParameterSet &ps)
 
void setRPCSetUp (const std::vector< RPCStripNoises::NoiseItem > &, const std::vector< double > &)
 
virtual ~RPCandIRPCDigiProducer ()
 
- 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 & itemsToGetFromEvent () 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

const RPCGeometry_pGeom
 
std::string collection_for_XF
 
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
 
std::string mix_
 
IRPCDigitizertheIRPCDigitizer
 
RPCDigitizertheRPCDigitizer
 
RPCSimSetUptheRPCSimSetUpIRPC
 
RPCSimSetUptheRPCSimSetUpRPC
 

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 22 of file RPCandIRPCDigiProducer.h.

Member Typedef Documentation

Definition at line 26 of file RPCandIRPCDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 40 of file RPCandIRPCDigiProducer.cc.

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

40  {
41 
42  produces<RPCDigiCollection>();
43  produces<RPCDigitizerSimLinks>("RPCDigiSimLink");
44 
45  //Name of Collection used for create the XF
46  mix_ = ps.getParameter<std::string>("mixLabel");
47  collection_for_XF = ps.getParameter<std::string>("InputCollection");
48 
50  if ( ! rng.isAvailable()) {
51  throw cms::Exception("Configuration")
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.";
55  };
56 
59  theRPCDigitizer = new RPCDigitizer(ps);
61  crossingFrameToken = consumes<CrossingFrame<PSimHit>>(edm::InputTag(mix_,collection_for_XF));
62 }
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
T getParameter(std::string const &) const
RPCandIRPCDigiProducer::~RPCandIRPCDigiProducer ( )
virtual

Definition at line 64 of file RPCandIRPCDigiProducer.cc.

64  {
65  delete theRPCDigitizer;
66  delete theIRPCDigitizer;
67  delete theRPCSimSetUpRPC;
68  delete theRPCSimSetUpIRPC;
69 }

Member Function Documentation

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

Definition at line 71 of file RPCandIRPCDigiProducer.cc.

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

71  {
72 
74  eventSetup.get<MuonGeometryRecord>().get( hGeom );
75  const RPCGeometry *pGeom = &*hGeom;
76  _pGeom = &*hGeom;
78  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);
79 
81  eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);
82 
83 
84  //setup the two digi models
86  theRPCSimSetUpRPC->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
88  theRPCSimSetUpIRPC->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
89 
90  //setup the two digitizers
91  theRPCDigitizer->setGeometry( pGeom );
92  theIRPCDigitizer->setGeometry( pGeom );
95 
96 }
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:47
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:48
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:49
std::vector< NoiseItem > const & getVNoise() const
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: IRPCDigitizer.h:49
const RPCGeometry * _pGeom
const T & get() const
Definition: EventSetup.h:56
std::vector< ClusterSizeItem > const & getCls() const
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: IRPCDigitizer.h:47
void setRPCSetUp(const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< float > &vcls)
Definition: RPCSimSetUp.cc:45
void RPCandIRPCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Produces the EDM products,

Definition at line 98 of file RPCandIRPCDigiProducer.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().

98  {
99 
101  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
102 
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";
106 
109 
110  std::unique_ptr<MixCollection<PSimHit> >
111  hits( new MixCollection<PSimHit>(cf.product()) );
112 
113  // Create empty output
114  std::unique_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
115  std::unique_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks() );
116 
117  theRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine); //make "bakelite RPC" digitizer do the action
118  theIRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine); //make "IRPC" digitizer do the action
119 
120  e.put( std::move(pDigis));
121  //store the SimDigiLinks in the event
122  e.put(std::move(RPCDigitSimLink),"RPCDigiSimLink");
123 }
#define LogDebug(id)
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
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:457
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void doAction(MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink, CLHEP::HepRandomEngine *)
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
StreamID streamID() const
Definition: Event.h:81
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
def move(src, dest)
Definition: eostools.py:510
void RPCandIRPCDigiProducer::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  ,
const std::vector< double > &   
)

Member Data Documentation

const RPCGeometry* RPCandIRPCDigiProducer::_pGeom
private

Definition at line 52 of file RPCandIRPCDigiProducer.h.

std::string RPCandIRPCDigiProducer::collection_for_XF
private

Definition at line 48 of file RPCandIRPCDigiProducer.h.

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

Definition at line 51 of file RPCandIRPCDigiProducer.h.

std::string RPCandIRPCDigiProducer::mix_
private

Definition at line 47 of file RPCandIRPCDigiProducer.h.

IRPCDigitizer* RPCandIRPCDigiProducer::theIRPCDigitizer
private

Definition at line 41 of file RPCandIRPCDigiProducer.h.

RPCDigitizer* RPCandIRPCDigiProducer::theRPCDigitizer
private

Definition at line 40 of file RPCandIRPCDigiProducer.h.

RPCSimSetUp* RPCandIRPCDigiProducer::theRPCSimSetUpIRPC
private

Definition at line 43 of file RPCandIRPCDigiProducer.h.

RPCSimSetUp* RPCandIRPCDigiProducer::theRPCSimSetUpRPC
private

Definition at line 42 of file RPCandIRPCDigiProducer.h.