10 constexpr
double highRangeCal = 1800.;
11 constexpr
double lowRangeCal = 260.;
12 constexpr
int rocMask = 0xE000;
13 constexpr
int rocOffset = 13;
29 const std::vector<CTPPSPixelDigi> &digi,
30 std::vector<CTPPSPixelCluster> &
clusters,
33 std::map<uint32_t, CTPPSPixelROCAnalysisMask>
const &
mask = maskera->
analysisMask;
34 std::set<std::pair<unsigned char, unsigned char> > maskedPixels;
38 for (
auto const &det :
mask) {
39 uint32_t planeId = det.first & ~rocMask;
41 if (planeId == detId) {
42 unsigned int rocNum = (det.first & rocMask) >> rocOffset;
44 throw cms::Exception(
"InvalidRocNumber") <<
"roc number from mask: " << rocNum;
45 for (
auto const &paio : det.second.maskedPixels) {
46 std::pair<unsigned char, unsigned char> pa = paio;
49 std::pair<int, int> modPix(modRow, modCol);
50 maskedPixels.insert(modPix);
56 edm::LogInfo(
"RPixDetClusterizer") << detId <<
" received digi.size()=" << digi.size();
68 uint8_t row = RPdit.row();
69 uint8_t column = RPdit.column();
70 if (row > maxRow || column > maxCol)
71 throw cms::Exception(
"CTPPSDigiOutofRange") <<
" row = " << row <<
" column = " << column;
73 std::pair<unsigned char, unsigned char>
pixel = std::make_pair(row, column);
74 unsigned short adc = RPdit.adc();
78 const bool is_in = maskedPixels.find(
pixel) != maskedPixels.end();
85 unsigned int index = column * maxRow + row;
100 unsigned int seedIndex = aSeed.
column() * maxRow + aSeed.
row();
111 while (!atempCluster.
empty()) {
113 auto curInd = atempCluster.
top();
115 for (
auto c =
std::max(0,
int(atempCluster.
col[curInd]) - 1);
116 c <
std::min(
int(atempCluster.
col[curInd]) + 2, maxCol);
118 for (
auto r =
std::max(0,
int(atempCluster.
row[curInd]) - 1);
119 r <
std::min(
int(atempCluster.
row[curInd]) + 2, maxRow);
121 unsigned int currIndex =
c * maxRow +
r;
166 <<
" ElectronADCGain = " <<
gain <<
" pedestal = " <<
pedestal;
169 edm::LogInfo(
"RPixCalibration") <<
"RPixDetClusterizer::calibrate: *** electrons < 0 *** --> " <<
electrons 170 <<
" --> electrons = 0";
float getPed(const int &col, const int &row) const
T getParameter(std::string const &) const
unsigned short adc[MAXSIZE]
std::map< unsigned int, RPixCalibDigi > calib_rpix_digi_map_
std::map< uint32_t, CTPPSPixelROCAnalysisMask > analysisMask
bool doSingleCalibration_
RPixDetClusterizer(edm::ParameterSet const &conf)
T getUntrackedParameter(std::string const &, T const &) const
float getGain(const int &col, const int &row) const
uint32_t getDetId() const
std::vector< RPixCalibDigi > SeedVector_
void make_cluster(RPixCalibDigi const &aSeed, std::vector< CTPPSPixelCluster > &clusters)
int VcaltoElectronOffset_
std::set< CTPPSPixelDigi > rpix_digi_set_
unsigned short SeedADCThreshold_
Log< level::Info, false > LogInfo
static constexpr uint8_t MAXROW
static constexpr uint8_t MAXCOL
unsigned short ADCThreshold_
const CTPPSPixelGainCalibration & getGainCalibration(const uint32_t &detid) const
bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc)
int calibrate(unsigned int, int, int, int, const CTPPSPixelGainCalibrations *pcalibration)
int transformToModule(const int colROC, const int rowROC, const int rocId, int &col, int &row) const
void buildClusters(unsigned int detId, const std::vector< CTPPSPixelDigi > &digi, std::vector< CTPPSPixelCluster > &clusters, const CTPPSPixelGainCalibrations *pcalibration, const CTPPSPixelAnalysisMask *mask)
int row() const
Access to digi information.
unsigned short top() const
uint16_t *__restrict__ uint16_t const *__restrict__ adc