1 #ifndef SimMuon_GEMDigitizer_ME0DigiProducer_h
2 #define SimMuon_GEMDigitizer_ME0DigiProducer_h
38 class HepRandomEngine;
66 produces<ME0DigiCollection>();
67 produces<StripDigiSimLinks>(
"ME0");
68 produces<ME0DigiSimLinks>(
"ME0");
73 <<
"ME0DigiProducer::ME0DigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n"
74 <<
"Add the service in the configuration file or remove the modules that require it.";
77 LogDebug(
"ME0DigiProducer") <<
"Using ME0" + ps.getParameter<
std::string>(
"digiModelString") +
"Model";
82 cf_token = consumes<CrossingFrame<PSimHit> >(
edm::InputTag(mix_, collection_));
83 geom_token_ = esConsumes<ME0Geometry, MuonGeometryRecord, edm::Transition::BeginRun>();
96 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
e.streamID());
104 auto digis = std::make_unique<ME0DigiCollection>();
105 auto stripDigiSimLinks = std::make_unique<StripDigiSimLinks>();
106 auto me0DigiSimLinks = std::make_unique<ME0DigiSimLinks>();
109 std::map<uint32_t, edm::PSimHitContainer> hitMap;
111 hitMap[
hit.detUnitId()].emplace_back(
hit);
115 const auto& etaPartitions(
ME0DigiModel_->getGeometry()->etaPartitions());
117 for (
const auto& roll : etaPartitions) {
119 const uint32_t rawId(detId.rawId());
120 const auto&
simHits(hitMap[rawId]);
122 LogDebug(
"ME0DigiProducer") <<
"ME0DigiProducer: found " <<
simHits.size() <<
" hit(s) in eta partition" << rawId;
127 (*stripDigiSimLinks).insert(
ME0DigiModel_->stripDigiSimLinks());