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

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

Detailed Description

Definition at line 23 of file RPCDigiProducer.h.

Member Typedef Documentation

◆ RPCDigitizerSimLinks

Definition at line 25 of file RPCDigiProducer.h.

Constructor & Destructor Documentation

◆ RPCDigiProducer()

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

Definition at line 36 of file RPCDigiProducer.cc.

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  theRPCSimSetUp = new RPCSimSetUp(ps);
52  theDigitizer = new RPCDigitizer(ps);
53  crossingFrameToken = consumes<CrossingFrame<PSimHit>>(edm::InputTag(mix_, collection_for_XF));
54  geomToken = esConsumes<RPCGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
55  noiseToken = esConsumes<RPCStripNoises, RPCStripNoisesRcd, edm::Transition::BeginRun>();
56  clsToken = esConsumes<RPCClusterSize, RPCClusterSizeRcd, edm::Transition::BeginRun>();
57 }

References clsToken, collection_for_XF, crossingFrameToken, Exception, geomToken, edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, mix_, noiseToken, 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  const RPCGeometry* pGeom = &*hGeom;
67 
68  edm::ESHandle<RPCStripNoises> noiseRcd = eventSetup.getHandle(noiseToken);
69 
71 
73  theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), clsRcd->getCls());
74  // theRPCSimSetUp->setRPCSetUp(noiseRcd->getVNoise(), noiseRcd->getCls());
75 
76  theDigitizer->setGeometry(pGeom);
77  // theRPCSimSetUp->setGeometry( pGeom );
79 }

References clsToken, geomToken, RPCClusterSize::getCls(), edm::EventSetup::getHandle(), RPCStripNoises::getVNoise(), noiseToken, 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 81 of file RPCDigiProducer.cc.

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

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

◆ clsToken

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

Definition at line 51 of file RPCDigiProducer.h.

Referenced by beginRun(), and RPCDigiProducer().

◆ collection_for_XF

std::string RPCDigiProducer::collection_for_XF
private

Definition at line 43 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

◆ crossingFrameToken

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

Definition at line 46 of file RPCDigiProducer.h.

Referenced by produce(), and RPCDigiProducer().

◆ geomToken

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

Definition at line 49 of file RPCDigiProducer.h.

Referenced by beginRun(), and RPCDigiProducer().

◆ mix_

std::string RPCDigiProducer::mix_
private

Definition at line 42 of file RPCDigiProducer.h.

Referenced by RPCDigiProducer().

◆ noiseToken

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

Definition at line 50 of file RPCDigiProducer.h.

Referenced by beginRun(), and RPCDigiProducer().

◆ theDigitizer

RPCDigitizer* RPCDigiProducer::theDigitizer
private

Definition at line 38 of file RPCDigiProducer.h.

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

◆ theRPCSimSetUp

RPCSimSetUp* RPCDigiProducer::theRPCSimSetUp
private

Definition at line 39 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
RPCClusterSize::getCls
std::vector< ClusterSizeItem > const & getCls() const
Definition: RPCClusterSize.h:23
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
RPCDigitizer::setRPCSimSetUp
void setRPCSimSetUp(RPCSimSetUp *simsetup)
Definition: RPCDigitizer.h:48
RPCDigiProducer::theDigitizer
RPCDigitizer * theDigitizer
Definition: RPCDigiProducer.h:38
RPCDigiProducer::theRPCSimSetUp
RPCSimSetUp * theRPCSimSetUp
Definition: RPCDigiProducer.h:39
RPCDigitizer
Definition: RPCDigitizer.h:33
RPCSimSetUp::setGeometry
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCSimSetUp.h:47
edm::Handle
Definition: AssociativeIterator.h:50
RPCDigiProducer::geomToken
edm::ESGetToken< RPCGeometry, MuonGeometryRecord > geomToken
Definition: RPCDigiProducer.h:49
MixCollection
Definition: MixCollection.h:10
edm::ESHandle< RPCGeometry >
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
RPCDigiCollection
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
Definition: RPCDigiCollection.h:13
RPCDigiProducer::clsToken
edm::ESGetToken< RPCClusterSize, RPCClusterSizeRcd > clsToken
Definition: RPCDigiProducer.h:51
edm::Service< edm::RandomNumberGenerator >
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
RPCDigiProducer::RPCDigitizerSimLinks
RPCDigitizer::RPCDigiSimLinks RPCDigitizerSimLinks
Definition: RPCDigiProducer.h:25
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
RPCDigiProducer::collection_for_XF
std::string collection_for_XF
Definition: RPCDigiProducer.h:43
Exception
Definition: hltDiff.cc:245
RPCDigiProducer::mix_
std::string mix_
Definition: RPCDigiProducer.h:42
RPCDigitizer::setGeometry
void setGeometry(const RPCGeometry *geom)
sets geometry
Definition: RPCDigitizer.h:46
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RPCDigiProducer::noiseToken
edm::ESGetToken< RPCStripNoises, RPCStripNoisesRcd > noiseToken
Definition: RPCDigiProducer.h:50
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:42
RPCDigiProducer::crossingFrameToken
edm::EDGetTokenT< CrossingFrame< PSimHit > > crossingFrameToken
Definition: RPCDigiProducer.h:46
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37