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<>

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 Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
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 > &)
 
 ~RPCandIRPCDigiProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

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

Detailed Description

Definition at line 22 of file RPCandIRPCDigiProducer.h.

Member Typedef Documentation

Definition at line 25 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(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

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 
58  theRPCDigitizer = new RPCDigitizer(ps);
60  crossingFrameToken = consumes<CrossingFrame<PSimHit>>(edm::InputTag(mix_, collection_for_XF));
61 }
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
T getParameter(std::string const &) const
RPCandIRPCDigiProducer::~RPCandIRPCDigiProducer ( )
override

Definition at line 63 of file RPCandIRPCDigiProducer.cc.

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

Member Function Documentation

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

Definition at line 70 of file RPCandIRPCDigiProducer.cc.

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

70  {
72  eventSetup.get<MuonGeometryRecord>().get(hGeom);
73  const RPCGeometry* pGeom = &*hGeom;
74  _pGeom = &*hGeom;
76  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);
77 
79  eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);
80 
81  //setup the two digi models
83  theRPCSimSetUpRPC->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
85  theRPCSimSetUpIRPC->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
86 
87  //setup the two digitizers
92 }
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:46
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:47
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:48
std::vector< NoiseItem > const & getVNoise() const
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: IRPCDigitizer.h:48
const RPCGeometry * _pGeom
T get() const
Definition: EventSetup.h:73
std::vector< ClusterSizeItem > const & getCls() const
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: IRPCDigitizer.h:46
void setRPCSetUp(const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< float > &vcls)
Definition: RPCSimSetUp.cc:44
void RPCandIRPCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Produces the EDM products,

Definition at line 94 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().

94  {
96  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
97 
98  LogDebug("RPCandIRPCDigiProducer") << "[RPCandIRPCDigiProducer::produce] got the CLHEP::HepRandomEngine engine from "
99  "the edm::Event.streamID() and edm::Service<edm::RandomNumberGenerator>";
100  LogDebug("RPCandIRPCDigiProducer") << "[RPCandIRPCDigiProducer::produce] test the CLHEP::HepRandomEngine by firing "
101  "once RandFlat ---- this must be the first time in SimMuon/RPCDigitizer";
102  LogDebug("RPCandIRPCDigiProducer") << "[RPCandIRPCDigiProducer::produce] to activate the test go in "
103  "RPCandIRPCDigiProducer.cc and uncomment the line below";
104 
107 
108  std::unique_ptr<MixCollection<PSimHit>> hits(new MixCollection<PSimHit>(cf.product()));
109 
110  // Create empty output
111  std::unique_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
112  std::unique_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks());
113 
114  theRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine); //make "bakelite RPC" digitizer do the action
115  theIRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine); //make "IRPC" digitizer do the action
116 
117  e.put(std::move(pDigis));
118  //store the SimDigiLinks in the event
119  e.put(std::move(RPCDigitSimLink), "RPCDigiSimLink");
120 }
#define LogDebug(id)
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
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:19
T const * product() const
Definition: Handle.h:69
StreamID streamID() const
Definition: Event.h:96
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
def move(src, dest)
Definition: eostools.py:511
void RPCandIRPCDigiProducer::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  ,
const std::vector< double > &   
)

Member Data Documentation

const RPCGeometry* RPCandIRPCDigiProducer::_pGeom
private

Definition at line 50 of file RPCandIRPCDigiProducer.h.

std::string RPCandIRPCDigiProducer::collection_for_XF
private

Definition at line 46 of file RPCandIRPCDigiProducer.h.

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

Definition at line 49 of file RPCandIRPCDigiProducer.h.

std::string RPCandIRPCDigiProducer::mix_
private

Definition at line 45 of file RPCandIRPCDigiProducer.h.

IRPCDigitizer* RPCandIRPCDigiProducer::theIRPCDigitizer
private

Definition at line 39 of file RPCandIRPCDigiProducer.h.

RPCDigitizer* RPCandIRPCDigiProducer::theRPCDigitizer
private

Definition at line 38 of file RPCandIRPCDigiProducer.h.

RPCSimSetUp* RPCandIRPCDigiProducer::theRPCSimSetUpIRPC
private

Definition at line 41 of file RPCandIRPCDigiProducer.h.

RPCSimSetUp* RPCandIRPCDigiProducer::theRPCSimSetUpRPC
private

Definition at line 40 of file RPCandIRPCDigiProducer.h.