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

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
 
 RPCDigiProducer (const edm::ParameterSet &ps)
 
void setRPCSetUp (const std::vector< RPCStripNoises::NoiseItem > &, const std::vector< double > &)
 
 ~RPCDigiProducer () 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

std::string collection_for_XF
 
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
 
std::string mix_
 
RPCDigitizertheDigitizer
 
RPCSimSetUptheRPCSimSetUp
 

Detailed Description

Definition at line 21 of file RPCDigiProducer.h.

Member Typedef Documentation

◆ RPCDigitizerSimLinks

Definition at line 23 of file RPCDigiProducer.h.

Constructor & Destructor Documentation

◆ RPCDigiProducer()

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

Definition at line 39 of file RPCDigiProducer.cc.

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 }

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

◆ ~RPCDigiProducer()

RPCDigiProducer::~RPCDigiProducer ( )
override

Definition at line 59 of file RPCDigiProducer.cc.

59  {
60  delete theDigitizer;
61  delete theRPCSimSetUp;
62 }

References theDigitizer, and theRPCSimSetUp.

Member Function Documentation

◆ beginRun()

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

Definition at line 64 of file RPCDigiProducer.cc.

64  {
66  eventSetup.get<MuonGeometryRecord>().get(hGeom);
67  const RPCGeometry* pGeom = &*hGeom;
68 
70  eventSetup.get<RPCStripNoisesRcd>().get(noiseRcd);
71 
73  eventSetup.get<RPCClusterSizeRcd>().get(clsRcd);
74 
76  theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
77  // theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls());
78 
79  theDigitizer->setGeometry(pGeom);
80  // theRPCSimSetUp->setGeometry( pGeom );
82 }

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

◆ produce()

void RPCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

Produces the EDM products,

Definition at line 84 of file RPCDigiProducer.cc.

84  {
86  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
87 
88  LogDebug("RPCDigiProducer") << "[RPCDigiProducer::produce] got the CLHEP::HepRandomEngine engine from the "
89  "edm::Event.streamID() and edm::Service<edm::RandomNumberGenerator>";
90  LogDebug("RPCDigiProducer") << "[RPCDigiProducer::produce] test the CLHEP::HepRandomEngine by firing once RandFlat "
91  "---- this must be the first time in SimMuon/RPCDigitizer";
92  LogDebug("RPCDigiProducer")
93  << "[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 
97  // Obsolate code, based on getByLabel
98  // e.getByLabel(mix_, collection_for_XF, cf);
99  //New code, based on tokens
100  e.getByToken(crossingFrameToken, cf);
101 
102  std::unique_ptr<MixCollection<PSimHit>> hits(new MixCollection<PSimHit>(cf.product()));
103 
104  // Create empty output
105  std::unique_ptr<RPCDigiCollection> pDigis(new RPCDigiCollection());
106  std::unique_ptr<RPCDigitizerSimLinks> RPCDigitSimLink(new RPCDigitizerSimLinks());
107 
108  // run the digitizer
109  theDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine);
110 
111  // store them in the event
112  e.put(std::move(pDigis));
113  e.put(std::move(RPCDigitSimLink), "RPCDigiSimLink");
114 }

References crossingFrameToken, RPCDigitizer::doAction(), MillePedeFileConverter_cfg::e, edm::RandomNumberGenerator::getEngine(), hfClusterShapes_cfi::hits, LogDebug, eostools::move(), edm::Handle< T >::product(), and theDigitizer.

◆ setRPCSetUp()

void RPCDigiProducer::setRPCSetUp ( const std::vector< RPCStripNoises::NoiseItem > &  ,
const std::vector< double > &   
)

Member Data Documentation

◆ collection_for_XF

std::string RPCDigiProducer::collection_for_XF
private

Definition at line 41 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

◆ crossingFrameToken

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

Definition at line 44 of file RPCDigiProducer.h.

Referenced by produce(), and RPCDigiProducer().

◆ mix_

std::string RPCDigiProducer::mix_
private

Definition at line 40 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

◆ theDigitizer

RPCDigitizer* RPCDigiProducer::theDigitizer
private

Definition at line 36 of file RPCDigiProducer.h.

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

◆ theRPCSimSetUp

RPCSimSetUp* RPCDigiProducer::theRPCSimSetUp
private

Definition at line 37 of file RPCDigiProducer.h.

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

RPCStripNoises::getVNoise
std::vector< NoiseItem > const & getVNoise() const
Definition: RPCStripNoises.h:24
RPCDigitizer::doAction
void doAction(MixCollection< PSimHit > &simHits, RPCDigiCollection &rpcDigis, RPCDigiSimLinks &rpcDigiSimLink, CLHEP::HepRandomEngine *)
Definition: RPCDigitizer.cc:19
edm::RandomNumberGenerator::getEngine
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
edm::Handle::product
T const * product() const
Definition: Handle.h:70
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
RPCClusterSizeRcd
Definition: RPCClusterSizeRcd.h:24
RPCStripNoisesRcd
Definition: RPCStripNoisesRcd.h:24
RPCClusterSize::getCls
std::vector< ClusterSizeItem > const & getCls() const
Definition: RPCClusterSize.h:23
RPCDigitizer::setRPCSimSetUp
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:48
RPCDigiProducer::theDigitizer
RPCDigitizer * theDigitizer
Definition: RPCDigiProducer.h:36
RPCDigiProducer::theRPCSimSetUp
RPCSimSetUp * theRPCSimSetUp
Definition: RPCDigiProducer.h:37
RPCDigitizer
Definition: RPCDigitizer.h:33
RPCSimSetUp::setGeometry
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:47
edm::Handle
Definition: AssociativeIterator.h:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
MixCollection
Definition: MixCollection.h:11
edm::ESHandle< RPCGeometry >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
RPCDigiCollection
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
Definition: RPCDigiCollection.h:13
edm::Service< edm::RandomNumberGenerator >
RPCDigiProducer::RPCDigitizerSimLinks
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
Definition: RPCDigiProducer.h:23
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
RPCDigiProducer::collection_for_XF
std::string collection_for_XF
Definition: RPCDigiProducer.h:41
Exception
Definition: hltDiff.cc:246
RPCDigiProducer::mix_
std::string mix_
Definition: RPCDigiProducer.h:40
RPCDigitizer::setGeometry
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:46
RPCGeometry
Definition: RPCGeometry.h:20
RPCSimSetUp
Definition: RPCSimSetUp.h:28
RPCSimSetUp::setRPCSetUp
void setRPCSetUp(const std::vector< RPCStripNoises::NoiseItem > &vnoise, const std::vector< float > &vcls)
Definition: RPCSimSetUp.cc:44
RPCDigiProducer::crossingFrameToken
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
Definition: RPCDigiProducer.h:44
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37