1 #ifndef SimMuon_GEMDigitizer_ME0DigiProducer_h
2 #define SimMuon_GEMDigitizer_ME0DigiProducer_h
37 class HepRandomEngine;
64 produces<ME0DigiCollection>();
65 produces<StripDigiSimLinks>(
"ME0");
66 produces<ME0DigiSimLinks>(
"ME0");
71 <<
"ME0DigiProducer::ME0DigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n"
72 <<
"Add the service in the configuration file or remove the modules that require it.";
75 LogDebug(
"ME0DigiProducer") <<
"Using ME0" + ps.getParameter<
std::string>(
"digiModelString") +
"Model";
80 cf_token = consumes<CrossingFrame<PSimHit> >(
edm::InputTag(mix_, collection_));
94 CLHEP::HepRandomEngine* engine = &rng->
getEngine(
e.streamID());
102 auto digis = std::make_unique<ME0DigiCollection>();
103 auto stripDigiSimLinks = std::make_unique<StripDigiSimLinks>();
104 auto me0DigiSimLinks = std::make_unique<ME0DigiSimLinks>();
107 std::map<uint32_t, edm::PSimHitContainer> hitMap;
109 hitMap[
hit.detUnitId()].emplace_back(
hit);
113 const auto& etaPartitions(
ME0DigiModel_->getGeometry()->etaPartitions());
115 for (
const auto& roll : etaPartitions) {
117 const uint32_t rawId(detId.rawId());
118 const auto&
simHits(hitMap[rawId]);
120 LogDebug(
"ME0DigiProducer") <<
"ME0DigiProducer: found " <<
simHits.size() <<
" hit(s) in eta partition" << rawId;
125 (*stripDigiSimLinks).insert(
ME0DigiModel_->stripDigiSimLinks());