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");
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;
236 m_CSCEffs[chId] = std::make_pair(type, eff);
252 descriptions.
add(
"cscChamberMasker", desc);
void copyDigis(edm::Event &event, edm::EDGetTokenT< C > &digiToken, std::unique_ptr< C > &filteredDigis)
void ageDigis(edm::Event &event, edm::EDGetTokenT< C > &digiToken, CLHEP::HepRandomEngine &randGen, std::unique_ptr< C > &filteredDigis)
edm::EDGetTokenT< CSCWireDigiCollection > m_wireDigiToken
static int rawIdMaker(int iendcap, int istation, int iring, int ichamber, int ilayer)
MuonDigiCollection< CSCDetId, CSCStripDigi > CSCStripDigiCollection
edm::EDGetTokenT< CSCStripDigiCollection > m_stripDigiToken
MuonDigiCollection< CSCDetId, CSCCLCTDigi > CSCCLCTDigiCollection
const ChamberContainer & chambers() const
Return a vector of all chambers.
edm::EDGetTokenT< CSCCLCTDigiCollection > m_clctDigiToken
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
void createMaskedChamberCollection(edm::ESHandle< CSCGeometry > &)
std::map< CSCDetId, std::pair< unsigned int, float > > m_CSCEffs
std::map< unsigned int, std::pair< unsigned int, float > > m_CSCChambEffs
~CSCChamberMasker() override
#define DEFINE_FWK_MODULE(type)
void beginRun(edm::Run const &, edm::EventSetup const &) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< CSCALCTDigiCollection > m_alctDigiToken
MuonDigiCollection< CSCDetId, CSCWireDigi > CSCWireDigiCollection
CSCChamberMasker(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
StreamID streamID() const
bool isUninitialized() const
static char chambers[264][20]
static void fillDescriptions(edm::ConfigurationDescriptions &)
MuonDigiCollection< CSCDetId, CSCALCTDigi > CSCALCTDigiCollection