26 class HepRandomEngine;
33 produces<GEMDigiCollection>();
34 produces<StripDigiSimLinks>(
"GEM");
35 produces<GEMDigiSimLinks>(
"GEM");
38 if (!rng.isAvailable()){
40 <<
"GEMDigiProducer::GEMDigiProducer() - RandomNumberGeneratorService is not present in configuration file.\n" 41 <<
"Add the service in the configuration file or remove the modules that require it.";
44 LogDebug(
"GEMDigiProducer") <<
"Using GEM" + ps.getParameter<
std::string>(
"digiModelString") +
"Model";
76 auto digis = std::make_unique<GEMDigiCollection>();
77 auto stripDigiSimLinks = std::make_unique<StripDigiSimLinks>();
78 auto gemDigiSimLinks = std::make_unique<GEMDigiSimLinks>();
81 std::map<uint32_t, edm::PSimHitContainer> hitMap;
83 hitMap[
hit.detUnitId()].emplace_back(
hit);
87 const auto & etaPartitions(
gemDigiModel_->getGeometry()->etaPartitions());
89 for (
const auto& roll: etaPartitions){
91 const uint32_t rawId(detId.rawId());
92 const auto &
simHits(hitMap[rawId]);
95 <<
"GEMDigiProducer: found " << simHits.size() <<
" hit(s) in eta partition" << rawId;
100 (*stripDigiSimLinks).insert(
gemDigiModel_->stripDigiSimLinks());
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
~GEMDigiProducer() override
GEMDigiProducer(const edm::ParameterSet &ps)
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
T const * product() const
void beginRun(const edm::Run &, const edm::EventSetup &) override
void produce(edm::Event &, const edm::EventSetup &) override
std::unique_ptr< GEMDigiModel > gemDigiModel_
StreamID streamID() const
T get(const Candidate &c)