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);
105 for (
auto gems :
gemGeom_->etaPartitions()) {
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;
167 if (!recHits.
empty())
168 recHitCollection->put(gemId, recHits.
begin(), recHits.
end());
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
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.
enum GEMRecHitProducer::MaskSource deadSource_
constexpr uint32_t rawId() const
get the raw id
Log< level::Error, false > LogError
const uint16_t range(const Frame &aFrame)
edm::ESGetToken< GEMDeadStrips, GEMDeadStripsRcd > deadStripsToken_
edm::ESHandle< GEMGeometry > gemGeom_
std::unique_ptr< GEMDeadStrips > theGEMDeadStripsObj
std::map< GEMDetId, EtaPartitionMask > gemMask_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
std::unique_ptr< GEMMaskedStrips > theGEMMaskedStripsObj
~GEMRecHitProducer() override
Destructor.
std::pair< const_iterator, const_iterator > Range
T const * product() const
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
enum GEMRecHitProducer::MaskSource maskSource_
tuple config
parse the configuration file
std::string fullPath() const
std::unique_ptr< GEMRecHitBaseAlgo > theAlgo
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::EDGetTokenT< GEMDigiCollection > theGEMDigiToken
void beginRun(const edm::Run &, const edm::EventSetup &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)