61 #include "CLHEP/Random/RandomEngine.h"
81 template <
typename T,
typename C = MuonDigiCollection<CSCDetId, T>>
84 CLHEP::HepRandomEngine &randGen,
85 std::unique_ptr<C> &filteredDigis);
87 template <
typename T,
typename C = MuonDigiCollection<CSCDetId, T>>
98 std::map<CSCDetId, std::pair<unsigned int, float>>
m_CSCEffs;
119 produces<CSCStripDigiCollection>(
"MuonCSCStripDigi");
120 produces<CSCWireDigiCollection>(
"MuonCSCWireDigi");
121 produces<CSCCLCTDigiCollection>(
"MuonCSCCLCTDigi");
122 produces<CSCALCTDigiCollection>(
"MuonCSCALCTDigi");
134 CLHEP::HepRandomEngine &randGen = randGenService->
getEngine(
event.streamID());
149 event.put(
std::move(filteredStripDigis),
"MuonCSCStripDigi");
150 event.put(
std::move(filteredWireDigis),
"MuonCSCWireDigi");
151 event.put(
std::move(filteredCLCTDigis),
"MuonCSCCLCTDigi");
152 event.put(
std::move(filteredALCTDigis),
"MuonCSCALCTDigi");
156 template <
typename T,
typename C>
160 event.getByToken(digiToken, digis);
161 for (
const auto &
j : (*digis)) {
162 auto digiItr =
j.second.first;
163 auto last =
j.second.second;
167 for (; digiItr !=
last; ++digiItr) {
168 filteredDigis->insertDigi(cscDetId, *digiItr);
175 template <
typename T,
typename C>
178 CLHEP::HepRandomEngine &randGen,
179 std::unique_ptr<C> &filteredDigis) {
182 event.getByToken(digiToken, digis);
184 for (
const auto &
j : (*digis)) {
185 auto digiItr =
j.second.first;
186 auto last =
j.second.second;
193 for (; digiItr !=
last; ++digiItr) {
197 std::pair<unsigned int, float> typeEff = chEffIt->second;
198 int type = typeEff.first % 10;
199 int layer = typeEff.first / 10;
201 bool doRandomize =
false;
207 if (!doRandomize || (randGen.flat() <= typeEff.second)) {
208 filteredDigis->insertDigi(cscDetId, *digiItr);
232 if (agingPair.first != rawId)
235 type = agingPair.second.first;
236 eff = agingPair.second.second;
253 descriptions.
add(
"cscChamberMasker",
desc);