16 params_(conf), SeedVector_(0)
33 std::map<uint32_t, CTPPSPixelROCAnalysisMask>
const &
mask = maskera->
analysisMask;
34 std::map<uint32_t, CTPPSPixelROCAnalysisMask>::const_iterator mask_it = mask.find(detId);
36 std::set<std::pair<unsigned char, unsigned char> > maskedPixels;
37 if( mask_it != mask.end()) maskedPixels = mask_it->second.maskedPixels;
52 uint8_t row = RPdit.row();
53 uint8_t column = RPdit.column();
54 if( row > maxRow || column > maxCol)
56 <<
" row = " << row <<
" column = "<<column;
58 std::pair<unsigned char, unsigned char>
pixel = std::make_pair(row,column);
59 unsigned short adc = RPdit.adc();
63 const bool is_in = maskedPixels.find(pixel) != maskedPixels.end();
66 electrons =
calibrate(detId,adc,row,column,pcalibrations);
69 unsigned int index = column*maxRow + row;
83 unsigned int seedIndex = aSeed.
column()*maxRow + aSeed.
row();
94 while ( ! atempCluster.
empty()) {
96 auto curInd = atempCluster.
top();
101 unsigned int currIndex =
c*maxRow +
r;
105 clusters.push_back(acluster);
117 clusters.push_back(cluster);
131 gain = DetCalibs.
getGain(col,row)*highRangeCal/lowRangeCal;
132 pedestal = DetCalibs.
getPed(col,row);
139 electrons =
int(adc*gain-pedestal);
143 if(
verbosity_)
edm::LogInfo(
"RPixCalibration") <<
"calibrate: adc = " << adc <<
" electrons = " << electrons <<
" gain = " << gain <<
" pedestal = " <<
pedestal ;
147 electrons =
int(adc*gain-pedestal);
148 if(
verbosity_)
edm::LogInfo(
"RPixCalibration") <<
"calibrate: adc = " << adc <<
" electrons = " << electrons <<
" ElectronADCGain = " << gain <<
" pedestal = " <<
pedestal ;
151 edm::LogInfo(
"RPixCalibration") <<
"RPixDetClusterizer::calibrate: *** electrons < 0 *** --> " << electrons <<
" --> electrons = 0";
int adc(sample_type sample)
get the ADC sample (12 bits)
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_
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