Skip to content

Commit

Permalink
pixel mask bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fabferro committed Jul 6, 2022
1 parent ccd5266 commit 7a266c4
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions RecoPPS/Local/src/RPixDetClusterizer.cc
Expand Up @@ -2,12 +2,15 @@
#include "FWCore/Utilities/interface/Exception.h"

#include "RecoPPS/Local/interface/RPixDetClusterizer.h"
#include "DataFormats/CTPPSDetId/interface/CTPPSPixelDetId.h"

namespace {
constexpr int maxCol = CTPPSPixelCluster::MAXCOL;
constexpr int maxRow = CTPPSPixelCluster::MAXROW;
constexpr double highRangeCal = 1800.;
constexpr double lowRangeCal = 260.;
constexpr int rocMask = 0xE000;
constexpr int rocOffset = 13;
} // namespace

RPixDetClusterizer::RPixDetClusterizer(edm::ParameterSet const &conf) : params_(conf), SeedVector_(0) {
Expand All @@ -28,11 +31,26 @@ void RPixDetClusterizer::buildClusters(unsigned int detId,
const CTPPSPixelGainCalibrations *pcalibrations,
const CTPPSPixelAnalysisMask *maskera) {
std::map<uint32_t, CTPPSPixelROCAnalysisMask> const &mask = maskera->analysisMask;
std::map<uint32_t, CTPPSPixelROCAnalysisMask>::const_iterator mask_it = mask.find(detId);

std::set<std::pair<unsigned char, unsigned char> > maskedPixels;
if (mask_it != mask.end())
maskedPixels = mask_it->second.maskedPixels;

// read and store masked pixels after converting ROC numbering into module numbering
CTPPSPixelIndices pI;
for (auto const &det : mask) {
uint32_t planeId = det.first & ~rocMask;

if (planeId == detId) {
unsigned int rocNum = (det.first & rocMask) >> rocOffset;
if (rocNum > 5)
throw cms::Exception("InvalidRocNumber") << "roc number from mask: " << rocNum;
for (auto const &paio : det.second.maskedPixels) {
std::pair<unsigned char, unsigned char> pa = paio;
int modCol, modRow;
pI.transformToModule(pa.second, pa.first, rocNum, modCol, modRow);
std::pair<int, int> modPix(modRow, modCol);
maskedPixels.insert(modPix);
}
}
}

if (verbosity_)
edm::LogInfo("RPixDetClusterizer") << detId << " received digi.size()=" << digi.size();
Expand Down

0 comments on commit 7a266c4

Please sign in to comment.