1 #ifndef SimMuon_GEMDigitizer_ME0DigiProducer_h
2 #define SimMuon_GEMDigitizer_ME0DigiProducer_h
36 class HepRandomEngine;
62 produces<ME0DigiCollection>();
63 produces<ME0DigiSimLinks>(
"ME0");
66 if (!rng.isAvailable()) {
68 <<
"ME0DigiProducer::ME0DigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n"
69 <<
"Add the service in the configuration file or remove the modules that require it.";
72 LogDebug(
"ME0DigiProducer") <<
"Using ME0" + ps.getParameter<
std::string>(
"digiModelString") +
"Model";
77 cf_token = consumes<CrossingFrame<PSimHit> >(
edm::InputTag(mix_, collection_));
78 geom_token_ = esConsumes<ME0Geometry, MuonGeometryRecord, edm::Transition::BeginRun>();
99 auto digis = std::make_unique<ME0DigiCollection>();
100 auto me0DigiSimLinks = std::make_unique<ME0DigiSimLinks>();
103 std::map<uint32_t, edm::PSimHitContainer> hitMap;
104 for (
const auto&
hit : hits) {
105 hitMap[
hit.detUnitId()].emplace_back(
hit);
109 const auto& etaPartitions(
ME0DigiModel_->getGeometry()->etaPartitions());
111 for (
const auto& roll : etaPartitions) {
113 const uint32_t rawId(detId.rawId());
114 const auto&
simHits(hitMap[rawId]);
116 LogDebug(
"ME0DigiProducer") <<
"ME0DigiProducer: found " << simHits.size() <<
" hit(s) in eta partition" << rawId;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void beginRun(const edm::Run &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
ME0DigiProducer(const edm::ParameterSet &ps)
std::unique_ptr< ME0DigiModel > ME0DigiModel_
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_
~ME0DigiProducer() override
edm::DetSetVector< ME0DigiSimLink > ME0DigiSimLinks
T const * product() const
T getParameter(std::string const &) const
StreamID streamID() const
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void produce(edm::Event &, const edm::EventSetup &) override