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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

const RPCGeometry_pGeom
 
edm::ESGetToken< RPCClusterSize, RPCClusterSizeRcdclsToken
 
std::string collection_for_XF
 
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
 
edm::ESGetToken< RPCGeometry, MuonGeometryRecordgeomToken
 
std::string mix_
 
edm::ESGetToken< RPCStripNoises, RPCStripNoisesRcdnoiseToken
 
IRPCDigitizertheIRPCDigitizer
 
RPCDigitizertheRPCDigitizer
 
RPCSimSetUptheRPCSimSetUpIRPC
 
RPCSimSetUptheRPCSimSetUpRPC
 

Detailed Description

Definition at line 24 of file RPCandIRPCDigiProducer.h.

Member Typedef Documentation

◆ RPCDigitizerSimLinks

Definition at line 27 of file RPCandIRPCDigiProducer.h.

Constructor & Destructor Documentation

◆ RPCandIRPCDigiProducer()

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

Definition at line 36 of file RPCandIRPCDigiProducer.cc.

References clsToken, collection_for_XF, crossingFrameToken, Exception, geomToken, edm::ParameterSet::getParameter(), HLT_2022v14_cff::InputTag, mix_, noiseToken, AlCaHLTBitMon_QueryRunRegistry::string, theIRPCDigitizer, theRPCDigitizer, theRPCSimSetUpIRPC, and theRPCSimSetUpRPC.

36  {
37  produces<RPCDigiCollection>();
38  produces<RPCDigitizerSimLinks>("RPCDigiSimLink");
39 
40  //Name of Collection used for create the XF
41  mix_ = ps.getParameter<std::string>("mixLabel");
42  collection_for_XF = ps.getParameter<std::string>("InputCollection");
43 
45  if (!rng.isAvailable()) {
46  throw cms::Exception("Configuration")
47  << "RPCDigitizer requires the RandomNumberGeneratorService\n"
48  "which is not present in the configuration file. You must add the service\n"
49  "in the configuration file or remove the modules that require it.";
50  };
51 
54  theRPCDigitizer = new RPCDigitizer(ps);
56  crossingFrameToken = consumes<CrossingFrame<PSimHit>>(edm::InputTag(mix_, collection_for_XF));
57  geomToken = esConsumes<RPCGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
58  noiseToken = esConsumes<RPCStripNoises, RPCStripNoisesRcd, edm::Transition::BeginRun>();
59  clsToken = esConsumes<RPCClusterSize, RPCClusterSizeRcd, edm::Transition::BeginRun>();
60 }
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< RPCClusterSize, RPCClusterSizeRcd > clsToken
edm::ESGetToken< RPCStripNoises, RPCStripNoisesRcd > noiseToken
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > geomToken

◆ ~RPCandIRPCDigiProducer()

RPCandIRPCDigiProducer::~RPCandIRPCDigiProducer ( )
override

Definition at line 62 of file RPCandIRPCDigiProducer.cc.

References theIRPCDigitizer, theRPCDigitizer, theRPCSimSetUpIRPC, and theRPCSimSetUpRPC.

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

Member Function Documentation

◆ beginRun()

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

Definition at line 69 of file RPCandIRPCDigiProducer.cc.

References _pGeom, clsToken, options_cfi::eventSetup, geomToken, RPCClusterSize::getCls(), RPCStripNoises::getVNoise(), noiseToken, IRPCDigitizer::setGeometry(), RPCDigitizer::setGeometry(), RPCSimSetUp::setGeometry(), RPCSimSetUp::setRPCSetUp(), IRPCDigitizer::setRPCSimSetUp(), RPCDigitizer::setRPCSimSetUp(), theIRPCDigitizer, theRPCDigitizer, theRPCSimSetUpIRPC, and theRPCSimSetUpRPC.

69  {
71  const RPCGeometry* pGeom = &*hGeom;
72  _pGeom = &*hGeom;
74 
76 
77  //setup the two digi models
79  theRPCSimSetUpRPC->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
81  theRPCSimSetUpIRPC->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
82 
83  //setup the two digitizers
88 }
std::vector< NoiseItem > const & getVNoise() const
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:46
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:46
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:48
edm::ESGetToken< RPCClusterSize, RPCClusterSizeRcd > clsToken
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: IRPCDigitizer.h:48
const RPCGeometry * _pGeom
edm::ESGetToken< RPCStripNoises, RPCStripNoisesRcd > noiseToken
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > geomToken
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:41

◆ produce()

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

Produces the EDM products,

Definition at line 90 of file RPCandIRPCDigiProducer.cc.

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

90  {
92  CLHEP::HepRandomEngine* engine = &rng->getEngine(e.streamID());
93 
94  LogDebug("RPCandIRPCDigiProducer") << "[RPCandIRPCDigiProducer::produce] got the CLHEP::HepRandomEngine engine from "
95  "the edm::Event.streamID() and edm::Service<edm::RandomNumberGenerator>";
96  LogDebug("RPCandIRPCDigiProducer") << "[RPCandIRPCDigiProducer::produce] test the CLHEP::HepRandomEngine by firing "
97  "once RandFlat ---- this must be the first time in SimMuon/RPCDigitizer";
98  LogDebug("RPCandIRPCDigiProducer") << "[RPCandIRPCDigiProducer::produce] to activate the test go in "
99  "RPCandIRPCDigiProducer.cc and uncomment the line below";
100 
102  e.getByToken(crossingFrameToken, cf);
103 
104  std::unique_ptr<MixCollection<PSimHit>> 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  theRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine); //make "bakelite RPC" digitizer do the action
111  theIRPCDigitizer->doAction(*hits, *pDigis, *RPCDigitSimLink, engine); //make "IRPC" digitizer do the action
112 
113  e.put(std::move(pDigis));
114  //store the SimDigiLinks in the event
115  e.put(std::move(RPCDigitSimLink), "RPCDigiSimLink");
116 }
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
T const * product() const
Definition: Handle.h:70
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
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

◆ setRPCSetUp()

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

Member Data Documentation

◆ _pGeom

const RPCGeometry* RPCandIRPCDigiProducer::_pGeom
private

Definition at line 52 of file RPCandIRPCDigiProducer.h.

Referenced by beginRun().

◆ clsToken

edm::ESGetToken<RPCClusterSize, RPCClusterSizeRcd> RPCandIRPCDigiProducer::clsToken
private

Definition at line 57 of file RPCandIRPCDigiProducer.h.

Referenced by beginRun(), and RPCandIRPCDigiProducer().

◆ collection_for_XF

std::string RPCandIRPCDigiProducer::collection_for_XF
private

Definition at line 48 of file RPCandIRPCDigiProducer.h.

Referenced by RPCandIRPCDigiProducer().

◆ crossingFrameToken

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

Definition at line 51 of file RPCandIRPCDigiProducer.h.

Referenced by produce(), and RPCandIRPCDigiProducer().

◆ geomToken

edm::ESGetToken<RPCGeometry, MuonGeometryRecord> RPCandIRPCDigiProducer::geomToken
private

Definition at line 55 of file RPCandIRPCDigiProducer.h.

Referenced by beginRun(), and RPCandIRPCDigiProducer().

◆ mix_

std::string RPCandIRPCDigiProducer::mix_
private

Definition at line 47 of file RPCandIRPCDigiProducer.h.

Referenced by RPCandIRPCDigiProducer().

◆ noiseToken

edm::ESGetToken<RPCStripNoises, RPCStripNoisesRcd> RPCandIRPCDigiProducer::noiseToken
private

Definition at line 56 of file RPCandIRPCDigiProducer.h.

Referenced by beginRun(), and RPCandIRPCDigiProducer().

◆ theIRPCDigitizer

IRPCDigitizer* RPCandIRPCDigiProducer::theIRPCDigitizer
private

◆ theRPCDigitizer

RPCDigitizer* RPCandIRPCDigiProducer::theRPCDigitizer
private

◆ theRPCSimSetUpIRPC

RPCSimSetUp* RPCandIRPCDigiProducer::theRPCSimSetUpIRPC
private

◆ theRPCSimSetUpRPC

RPCSimSetUp* RPCandIRPCDigiProducer::theRPCSimSetUpRPC
private