60 #include "CLHEP/Random/RandomEngine.h"
82 template <
typename T,
typename C = MuonDigiCollection<CSCDetId, T>>
85 CLHEP::HepRandomEngine &randGen,
86 std::unique_ptr<C> &filteredDigis);
88 template <
typename T,
typename C = MuonDigiCollection<CSCDetId, T>>
97 std::map<CSCDetId, std::pair<unsigned int, float>>
m_CSCEffs;
116 produces<CSCStripDigiCollection>(
"MuonCSCStripDigi");
117 produces<CSCWireDigiCollection>(
"MuonCSCWireDigi");
118 produces<CSCCLCTDigiCollection>(
"MuonCSCCLCTDigi");
119 produces<CSCALCTDigiCollection>(
"MuonCSCALCTDigi");
131 CLHEP::HepRandomEngine &randGen = randGenService->
getEngine(
event.streamID());
146 event.put(
std::move(filteredStripDigis),
"MuonCSCStripDigi");
147 event.put(
std::move(filteredWireDigis),
"MuonCSCWireDigi");
148 event.put(
std::move(filteredCLCTDigis),
"MuonCSCCLCTDigi");
149 event.put(
std::move(filteredALCTDigis),
"MuonCSCALCTDigi");
153 template <
typename T,
typename C>
157 event.getByToken(digiToken, digis);
158 for (
const auto &
j : (*digis)) {
159 auto digiItr =
j.second.first;
160 auto last =
j.second.second;
164 for (; digiItr !=
last; ++digiItr) {
165 filteredDigis->insertDigi(cscDetId, *digiItr);
172 template <
typename T,
typename C>
175 CLHEP::HepRandomEngine &randGen,
176 std::unique_ptr<C> &filteredDigis) {
179 event.getByToken(digiToken, digis);
181 for (
const auto &
j : (*digis)) {
182 auto digiItr =
j.second.first;
183 auto last =
j.second.second;
190 for (; digiItr !=
last; ++digiItr) {
194 std::pair<unsigned int, float> typeEff = chEffIt->second;
195 int type = typeEff.first % 10;
196 int layer = typeEff.first / 10;
198 bool doRandomize =
false;
201 (layer == 0 || cscDetId.
layer() == layer))
204 if (!doRandomize || (randGen.flat() <= typeEff.second)) {
205 filteredDigis->insertDigi(cscDetId, *digiItr);
231 if (agingPair.first != rawId)
234 type = agingPair.second.first;
235 eff = agingPair.second.second;
252 descriptions.
add(
"cscChamberMasker", desc);