1 #ifndef SimMuon_GEMDigitizer_ME0DigiPreRecoProducer_h 2 #define SimMuon_GEMDigitizer_ME0DigiPreRecoProducer_h 34 class HepRandomEngine;
57 : digiPreRecoModelString_(ps.getParameter<
std::
string>(
"digiPreRecoModelString")),
59 produces<ME0DigiPreRecoCollection>();
62 if (!rng.isAvailable()) {
64 <<
"ME0DigiPreRecoProducer::ME0PreRecoDigiProducer() - RandomNumberGeneratorService is not present in " 65 "configuration file.\n" 66 <<
"Add the service in the configuration file or remove the modules that require it.";
68 LogDebug(
"ME0DigiPreRecoProducer") <<
"Using ME0" + digiPreRecoModelString_ +
"Model";
73 cf_token = consumes<CrossingFrame<PSimHit> >(
edm::InputTag(mix_, collection_));
74 geom_token_ = esConsumes<ME0Geometry, MuonGeometryRecord, edm::Transition::BeginRun>();
88 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
e.streamID());
96 auto digis = std::make_unique<ME0DigiPreRecoCollection>();
99 std::map<uint32_t, edm::PSimHitContainer> hitMap;
101 hitMap[
hit.detUnitId()].push_back(
hit);
107 for (
const auto& roll : etaPartitions) {
109 const uint32_t rawId(detId.rawId());
110 const auto&
simHits(hitMap[rawId]);
112 LogDebug(
"ME0DigiPreRecoProducer") <<
"ME0DigiPreRecoProducer: found " <<
simHits.size()
113 <<
" hit(s) in eta partition" << rawId;
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< ME0DigiPreRecoModel > me0DigiPreRecoModel_
void beginRun(const edm::Run &, const edm::EventSetup &) override
T const * product() const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
ME0DigiPreRecoProducer(const edm::ParameterSet &ps)
~ME0DigiPreRecoProducer() override
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
std::string digiPreRecoModelString_
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_