62 #include "CLHEP/Random/RandomEngine.h" 85 template<
typename T,
typename C = MuonDigiCollection<CSCDetId, T> >
88 CLHEP::HepRandomEngine & randGen,
89 std::unique_ptr<C> & filteredDigis);
91 template<
typename T,
typename C = MuonDigiCollection<CSCDetId, T> >
94 std::unique_ptr<C> & filteredDigis);
102 std::map<CSCDetId, std::pair<unsigned int,float> >
m_CSCEffs;
126 produces<CSCStripDigiCollection>(
"MuonCSCStripDigi");
127 produces<CSCWireDigiCollection>(
"MuonCSCWireDigi");
128 produces<CSCCLCTDigiCollection>(
"MuonCSCCLCTDigi");
129 produces<CSCALCTDigiCollection>(
"MuonCSCALCTDigi");
165 event.put(
std::move(filteredStripDigis),
"MuonCSCStripDigi");
166 event.put(
std::move(filteredWireDigis),
"MuonCSCWireDigi");
167 event.put(
std::move(filteredCLCTDigis),
"MuonCSCCLCTDigi");
168 event.put(
std::move(filteredALCTDigis),
"MuonCSCALCTDigi");
173 template<
typename T,
typename C>
177 std::unique_ptr<C> & filteredDigis)
183 event.getByToken(digiToken, digis);
184 for (
const auto & j : (*digis) )
186 auto digiItr = j.second.first;
187 auto last = j.second.second;
191 for( ; digiItr !=
last; ++digiItr)
193 filteredDigis->insertDigi(cscDetId,*digiItr);
201 template<
typename T,
typename C>
205 CLHEP::HepRandomEngine & randGen,
206 std::unique_ptr<C> & filteredDigis)
212 event.getByToken(digiToken, digis);
214 for (
const auto & j : (*digis) )
216 auto digiItr = j.second.first;
217 auto last = j.second.second;
224 for( ; digiItr !=
last; ++digiItr) {
231 std::pair<unsigned int, float> typeEff = chEffIt->second;
232 int type = typeEff.first % 10;
233 int layer = typeEff.first/10;
235 bool doRandomize =
false;
238 type ==
EFF_CHAMBER) && (layer == 0 || cscDetId.
layer() == layer)) doRandomize =
true;
240 if (!doRandomize || (randGen.flat() <= typeEff.second)) {
241 filteredDigis->insertDigi(cscDetId,*digiItr);
275 if ( agingPair.first != rawId)
continue;
277 type = agingPair.second.first;
278 eff = agingPair.second.second;
279 m_CSCEffs[chId] = std::make_pair(type, eff);
300 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
#define DEFINE_FWK_MODULE(type)
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< unsigned int, std::pair< unsigned int, float > > m_CSCChambEffs
~CSCChamberMasker() override
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 &)
std::map< CSCDetId, std::pair< unsigned int, float > > m_CSCEffs
MuonDigiCollection< CSCDetId, CSCALCTDigi > CSCALCTDigiCollection