27 maskSource_(MaskSource::EventSetup),
28 deadSource_(MaskSource::EventSetup),
29 gemGeomToken_(esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>()) {
30 produces<GEMRecHitCollection>();
33 applyMasking_ =
config.getParameter<
bool>(
"applyMasking");
39 throw cms::Exception(
"GEMRecHitProducer") <<
"Masked Strips File cannot not be opened";
41 theGEMMaskedStripsObj = std::make_unique<GEMMaskedStrips>();
46 theGEMMaskedStripsObj->fillMaskVec(Item);
55 throw cms::Exception(
"GEMRecHitProducer") <<
"Dead Strips File cannot not be opened";
57 theGEMDeadStripsObj = std::make_unique<GEMDeadStrips>();
62 theGEMDeadStripsObj->fillDeadVec(Item);
66 if (maskSource_ == MaskSource::EventSetup) {
67 maskedStripsToken_ = esConsumes<GEMMaskedStrips, GEMMaskedStripsRcd, edm::Transition::BeginRun>();
69 if (deadSource_ == MaskSource::EventSetup) {
70 deadStripsToken_ = esConsumes<GEMDeadStrips, GEMDeadStripsRcd, edm::Transition::BeginRun>();
83 desc.add<
bool>(
"applyMasking",
false);
86 descriptions.
add(
"gemRecHitsDef",
desc);
109 const int rawId = gemId.
rawId();
111 if (tomask.rawId == rawId) {
112 const int bit = tomask.strip;
117 if (tomask.rawId == rawId) {
118 const int bit = tomask.strip;
139 auto recHitCollection = std::make_unique<GEMRecHitCollection>();
142 for (
auto gemdgIt = digis->begin(); gemdgIt != digis->end(); ++gemdgIt) {
144 const GEMDetId& gemId = (*gemdgIt).first;
148 if (roll ==
nullptr) {
149 edm::LogError(
"BadDigiInput") <<
"Failed to find GEMEtaPartition for ID " << gemId;
159 auto gemmaskIt =
gemMask_.find(gemId);
161 mask = gemmaskIt->second;