27 maskSource_(MaskSource::EventSetup),
28 deadSource_(MaskSource::EventSetup),
29 gemGeomToken_(esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>()) {
30 produces<GEMRecHitCollection>();
33 ge21Off_ =
config.getParameter<
bool>(
"ge21Off");
35 applyMasking_ =
config.getParameter<
bool>(
"applyMasking");
41 throw cms::Exception(
"GEMRecHitProducer") <<
"Masked Strips File cannot not be opened";
43 theGEMMaskedStripsObj = std::make_unique<GEMMaskedStrips>();
48 theGEMMaskedStripsObj->fillMaskVec(Item);
57 throw cms::Exception(
"GEMRecHitProducer") <<
"Dead Strips File cannot not be opened";
59 theGEMDeadStripsObj = std::make_unique<GEMDeadStrips>();
64 theGEMDeadStripsObj->fillDeadVec(Item);
68 if (maskSource_ == MaskSource::EventSetup) {
69 maskedStripsToken_ = esConsumes<GEMMaskedStrips, GEMMaskedStripsRcd, edm::Transition::BeginRun>();
71 if (deadSource_ == MaskSource::EventSetup) {
72 deadStripsToken_ = esConsumes<GEMDeadStrips, GEMDeadStripsRcd, edm::Transition::BeginRun>();
85 desc.add<
bool>(
"applyMasking",
false);
86 desc.add<
bool>(
"ge21Off",
false);
89 descriptions.
add(
"gemRecHitsDef",
desc);
117 if (tomask.rawId ==
rawId) {
118 const int bit = tomask.strip;
123 if (tomask.rawId ==
rawId) {
124 const int bit = tomask.strip;
145 auto recHitCollection = std::make_unique<GEMRecHitCollection>();
148 for (
auto gemdgIt = digis->begin(); gemdgIt != digis->end(); ++gemdgIt) {
150 const GEMDetId& gemId = (*gemdgIt).first;
157 if (
roll ==
nullptr) {
158 edm::LogError(
"BadDigiInput") <<
"Failed to find GEMEtaPartition for ID " << gemId;
168 auto gemmaskIt =
gemMask_.find(gemId);
170 mask = gemmaskIt->second;
constexpr int station() const
const GEMEtaPartition * etaPartition(GEMDetId id) const
Return a GEMEtaPartition given its id.
void produce(edm::Event &event, const edm::EventSetup &setup) override
The method which produces the rechits.
edm::ESGetToken< GEMMaskedStrips, GEMMaskedStripsRcd > maskedStripsToken_
GEMRecHitProducer(const edm::ParameterSet &config)
Constructor.
std::string fullPath() const
enum GEMRecHitProducer::MaskSource deadSource_
Log< level::Error, false > LogError
T const * product() const
edm::ESGetToken< GEMDeadStrips, GEMDeadStripsRcd > deadStripsToken_
edm::ESHandle< GEMGeometry > gemGeom_
std::unique_ptr< GEMDeadStrips > theGEMDeadStripsObj
std::map< GEMDetId, EtaPartitionMask > gemMask_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
std::unique_ptr< GEMMaskedStrips > theGEMMaskedStripsObj
~GEMRecHitProducer() override
Destructor.
constexpr uint32_t rawId() const
get the raw id
std::pair< const_iterator, const_iterator > Range
void add(std::string const &label, ParameterSetDescription const &psetDescription)
enum GEMRecHitProducer::MaskSource maskSource_
std::unique_ptr< GEMRecHitBaseAlgo > theAlgo
edm::EDGetTokenT< GEMDigiCollection > theGEMDigiToken
void beginRun(const edm::Run &, const edm::EventSetup &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.