15 params_(conf), SeedVector_(0)
32 std::map<uint32_t, CTPPSPixelROCAnalysisMask>
const &
mask = maskera->
analysisMask;
33 std::map<uint32_t, CTPPSPixelROCAnalysisMask>::const_iterator mask_it = mask.find(detId);
35 std::set<std::pair<unsigned char, unsigned char> > maskedPixels;
36 if( mask_it != mask.end()) maskedPixels = mask_it->second.maskedPixels;
51 uint8_t row = RPdit.row();
52 uint8_t column = RPdit.column();
53 if( row > maxRow || column > maxCol)
55 <<
" row = " << row <<
" column = "<<column;
57 std::pair<unsigned char, unsigned char>
pixel = std::make_pair(row,column);
58 unsigned short adc = RPdit.adc();
62 const bool is_in = maskedPixels.find(pixel) != maskedPixels.end();
65 electrons =
calibrate(detId,adc,row,column,pcalibrations);
68 unsigned int index = column*maxRow + row;
82 unsigned int seedIndex = aSeed.
column()*maxRow + aSeed.
row();
93 while ( ! atempCluster.
empty()) {
95 auto curInd = atempCluster.
top();
100 unsigned int currIndex =
c*maxRow +
r;
104 clusters.push_back(acluster);
116 clusters.push_back(cluster);
130 gain = DetCalibs.
getGain(col,row)*highRangeCal/lowRangeCal;
131 pedestal = DetCalibs.
getPed(col,row);
138 electrons =
int(adc*gain-pedestal);
142 if(
verbosity_)
edm::LogInfo(
"RPixCalibration") <<
"calibrate: adc = " << adc <<
" electrons = " << electrons <<
" gain = " << gain <<
" pedestal = " <<
pedestal ;
146 electrons =
int(adc*gain-pedestal);
147 if(
verbosity_)
edm::LogInfo(
"RPixCalibration") <<
"calibrate: adc = " << adc <<
" electrons = " << electrons <<
" ElectronADCGain = " << gain <<
" pedestal = " <<
pedestal ;
150 edm::LogInfo(
"RPixCalibration") <<
"RPixDetClusterizer::calibrate: *** electrons < 0 *** --> " << electrons <<
" --> electrons = 0";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned short adc[MAXSIZE]
std::map< uint32_t, CTPPSPixelROCAnalysisMask > analysisMask
bool doSingleCalibration_
RPixDetClusterizer(edm::ParameterSet const &conf)
const CTPPSPixelGainCalibration & getGainCalibration(const uint32_t &detid) const
int row() const
Access to digi information.
std::vector< RPixCalibDigi > SeedVector_
uint32_t getDetId() const
void make_cluster(RPixCalibDigi const &aSeed, std::vector< CTPPSPixelCluster > &clusters)
int VcaltoElectronOffset_
std::set< CTPPSPixelDigi > rpix_digi_set_
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
unsigned short SeedADCThreshold_
static constexpr uint8_t MAXROW
std::map< unsigned int, RPixCalibDigi > calib_rpix_digi_map_
static constexpr uint8_t MAXCOL
unsigned short ADCThreshold_
bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc)
int calibrate(unsigned int, int, int, int, const CTPPSPixelGainCalibrations *pcalibration)
float getPed(const int &col, const int &row) const
void buildClusters(unsigned int detId, const std::vector< CTPPSPixelDigi > &digi, std::vector< CTPPSPixelCluster > &clusters, const CTPPSPixelGainCalibrations *pcalibration, const CTPPSPixelAnalysisMask *mask)
unsigned short top() const
float getGain(const int &col, const int &row) const