29 maskSource_(MaskSource::EventSetup),
30 deadSource_(MaskSource::EventSetup) {
32 produces<RPCRecHitCollection>();
35 theRPCMaskedStripsObj = std::make_unique<RPCMaskedStrips>();
36 theRPCDeadStripsObj = std::make_unique<RPCDeadStrips>();
39 if (maskSource ==
"File") {
44 std::cerr <<
"Masked Strips File cannot not be opened" << std::endl;
51 MaskVec.push_back(Item);
59 if (deadSource ==
"File") {
64 std::cerr <<
"Dead Strips File cannot not be opened" << std::endl;
84 std::vector<RPCMaskedStrips::MaskItem>::iterator posVec;
85 for (posVec =
MaskVec.begin(); posVec !=
MaskVec.end(); ++posVec) {
87 Item.
rawId = (*posVec).rawId;
88 Item.
strip = (*posVec).strip;
89 theRPCMaskedStripsObj->MaskVec.push_back(Item);
97 std::vector<RPCDeadStrips::DeadItem>::iterator posVec;
98 for (posVec =
DeadVec.begin(); posVec !=
DeadVec.end(); ++posVec) {
100 Item.
rawId = (*posVec).rawId;
101 Item.
strip = (*posVec).strip;
102 theRPCDeadStripsObj->DeadVec.push_back(Item);
119 auto recHitCollection = std::make_unique<RPCRecHitCollection>();
123 for (
auto rpcdgIt = digis->begin(); rpcdgIt != digis->end(); ++rpcdgIt) {
125 const RPCDetId& rpcId = (*rpcdgIt).first;
128 const RPCRoll* roll = rpcGeom.roll(rpcId);
129 if (roll ==
nullptr) {
130 edm::LogError(
"BadDigiInput") <<
"Failed to find RPCRoll for ID " << rpcId;
139 const int rawId = rpcId.
rawId();
140 for (
const auto& tomask : theRPCMaskedStripsObj->MaskVec) {
141 if (tomask.rawId == rawId) {
142 const int bit = tomask.strip;
147 for (
const auto& tomask : theRPCDeadStripsObj->DeadVec) {
148 if (tomask.rawId == rawId) {
149 const int bit = tomask.strip;
157 if (!recHits.
empty())
158 recHitCollection->put(rpcId, recHits.
begin(), recHits.
end());
const edm::ESGetToken< RPCGeometry, MuonGeometryRecord > theRPCGeomToken
edm::ESGetToken< RPCDeadStrips, RPCDeadStripsRcd > theReadoutDeadStripsToken
constexpr uint32_t rawId() const
get the raw id
std::unique_ptr< RPCRecHitBaseAlgo > theAlgo
void beginRun(const edm::Run &, const edm::EventSetup &) override
Log< level::Error, false > LogError
const uint16_t range(const Frame &aFrame)
enum RPCRecHitProducer::MaskSource deadSource_
bool getData(T &iHolder) const
void produce(edm::Event &event, const edm::EventSetup &setup) override
The method which produces the rechits.
const edm::EDGetTokenT< RPCDigiCollection > theRPCDigiLabel
std::bitset< maskSIZE > RollMask
std::vector< RPCDeadStrips::DeadItem > DeadVec
RPCRecHitProducer(const edm::ParameterSet &config)
Constructor.
edm::ESGetToken< RPCMaskedStrips, RPCMaskedStripsRcd > theReadoutMaskedStripsToken
std::pair< const_iterator, const_iterator > Range
std::vector< DeadRegion > DeadVec
T getParameter(std::string const &) const
tuple config
parse the configuration file
enum RPCRecHitProducer::MaskSource maskSource_
std::string fullPath() const
std::vector< RPCMaskedStrips::MaskItem > MaskVec