46 thePixelThreshold(conf.getParameter<
int>(
"ChannelThreshold")),
47 theSeedThreshold(conf.getParameter<
int>(
"SeedThreshold")),
48 theClusterThreshold(conf.getParameter<
int>(
"ClusterThreshold")),
49 theClusterThreshold_L1(conf.getParameter<
int>(
"ClusterThreshold_L1")),
50 theConversionFactor(conf.getParameter<
int>(
"VCaltoElectronGain")),
51 theConversionFactor_L1(conf.getParameter<
int>(
"VCaltoElectronGain_L1")),
52 theOffset(conf.getParameter<
int>(
"VCaltoElectronOffset")),
53 theOffset_L1(conf.getParameter<
int>(
"VCaltoElectronOffset_L1")),
54 theElectronPerADCGain(conf.getParameter<double>(
"ElectronPerADCGain")),
55 doPhase2Calibration(conf.getParameter<
bool>(
"Phase2Calibration")),
56 dropDuplicates(conf.getParameter<
bool>(
"DropDuplicates")),
57 thePhase2ReadoutMode(conf.getParameter<
int>(
"Phase2ReadoutMode")),
58 thePhase2DigiBaseline(conf.getParameter<double>(
"Phase2DigiBaseline")),
59 thePhase2KinkADC(conf.getParameter<
int>(
"Phase2KinkADC")),
64 doMissCalibrate(conf.getParameter<
bool>(
"MissCalibrate")),
65 doSplitClusters(conf.getParameter<
bool>(
"SplitClusters")) {
75 desc.add<
int>(
"ChannelThreshold", 1000);
76 desc.add<
bool>(
"MissCalibrate",
true);
77 desc.add<
bool>(
"SplitClusters",
false);
78 desc.add<
int>(
"VCaltoElectronGain", 65);
79 desc.add<
int>(
"VCaltoElectronGain_L1", 65);
80 desc.add<
int>(
"VCaltoElectronOffset", -414);
81 desc.add<
int>(
"VCaltoElectronOffset_L1", -414);
82 desc.add<
int>(
"SeedThreshold", 1000);
83 desc.add<
int>(
"ClusterThreshold_L1", 4000);
84 desc.add<
int>(
"ClusterThreshold", 4000);
85 desc.add<
double>(
"ElectronPerADCGain", 135.);
86 desc.add<
bool>(
"DropDuplicates",
true);
87 desc.add<
bool>(
"Phase2Calibration",
false);
88 desc.add<
int>(
"Phase2ReadoutMode", -1);
89 desc.add<
double>(
"Phase2DigiBaseline", 1200.);
90 desc.add<
int>(
"Phase2KinkADC", 8);
102 int nrows = topol.
nrows();
124 #include "PixelThresholdClusterizer.icc" 143 for (
int i = 0;
i < ci->size(); ++
i) {
155 #ifdef PIXELREGRESSION 156 static std::atomic<int> s_ic = 0;
165 edm::LogWarning(
"PixelThresholdClusterizer") <<
" copy_to_buffer called with empty or invalid range" << std::endl;
184 (*theSiPixelGainCalibrationService_)
193 auto adc = di->adc();
203 #ifdef PIXELREGRESSION 204 static std::atomic<int> eqD = 0;
208 int col = di->column();
210 int adc = (di->flag() != 0) ? di->adc() * 10 :
electron[
i];
213 #ifdef PIXELREGRESSION 217 std::cout <<
"VI " << eqD <<
' ' << ic <<
' ' <<
end - begin <<
' ' <<
i <<
' ' << di->adc() <<
' ' <<
adc <<
' ' 218 << adcOld << std::endl;
233 switch (occurrence) {
262 for (
int i = 0;
i < ci->size(); ++
i) {
294 const int dualslope =
int(dualslopeparam <= 1 ? 1. :
pow(2, dualslopeparam - 1));
321 float DBpedestal =
pedestal * DBgain;
327 float vcal =
adc * DBgain - DBpedestal;
365 std::stack<SiPixelCluster::PixelPos, std::vector<SiPixelCluster::PixelPos> > dead_pixel_stack;
392 acluster.
add(pix, seed_adc);
393 cldata.
add(pix, seed_adc);
396 bool dead_flag =
false;
397 while (!acluster.
empty()) {
399 auto curInd = acluster.
top();
401 for (
auto c =
std::max(0,
int(acluster.
y[curInd]) - 1);
404 for (
auto r =
std::max(0,
int(acluster.
x[curInd]) - 1);
410 if (!acluster.
add(newpix, newpix_adc))
414 cldata.
add(newpix, newpix_adc);
458 bool have_second_cluster =
false;
459 while (!dead_pixel_stack.empty()) {
462 dead_pixel_stack.pop();
470 output.push_back(second_cluster);
471 have_second_cluster =
true;
476 const std::vector<SiPixelCluster::Pixel>& branch_pixels = second_cluster.
pixels();
477 for (
unsigned int i = 0;
i < branch_pixels.size();
i++) {
478 auto const temp_x = branch_pixels[
i].x;
479 auto const temp_y = branch_pixels[
i].y;
480 auto const temp_adc = branch_pixels[
i].adc;
482 cluster.
add(newpix, temp_adc);
488 output.push_back(first_cluster);
const int theConversionFactor_L1
static void fillPSetDescription(edm::ParameterSetDescription &desc)
SiPixelArrayBuffer theBuffer
Data storage.
const int theClusterThreshold_L1
PixelThresholdClusterizer(edm::ParameterSet const &conf)
SiPixelCluster make_cluster(const SiPixelCluster::PixelPos &pix, edmNew::DetSetVector< SiPixelCluster >::FastFiller &output)
The actual clustering algorithm: group the neighboring pixels around the seed.
virtual int ncolumns() const =0
virtual int nrows() const =0
virtual bool isDead(const uint32_t &detID, const int &col, const int &row)=0
const int thePixelThreshold
const int thePhase2KinkADC
void set_adc(int row, int col, int adc)
const int thePhase2ReadoutMode
const int theSeedThreshold
const std::vector< Pixel > pixels() const
void add_adc(int row, int col, int adc)
int index(int row, int col) const
Definition of indexing within the buffer.
edm::DetSet< PixelDigi >::const_iterator DigiIterator
const bool doPhase2Calibration
void add(const PixelPos &pix, int adc)
virtual float getPedestal(const uint32_t &detID, const int &col, const int &row)=0
const bool doMissCalibrate
int theNumOfRows
Geometry-related information.
const double theElectronPerADCGain
std::vector< uint8_t > thePixelOccurrence
edmNew::DetSet< SiPixelCluster >::const_iterator ClusterIterator
void clear_buffer(DigiIterator begin, DigiIterator end)
Clear the internal buffer array.
void setSize(int rows, int cols)
std::vector< bool > theFakePixels
const int theClusterThreshold
SiPixelGainCalibrationServiceBase * theSiPixelGainCalibrationService_
def remove(d, key, TELL=False)
const double thePhase2DigiBaseline
Pixel cluster – collection of neighboring pixels above threshold.
const bool doSplitClusters
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
constexpr int row() const
virtual float getGain(const uint32_t &detID, const int &col, const int &row)=0
bool setup(const PixelGeomDetUnit *pixDet)
Private helper methods:
constexpr int col() const
bool add(SiPixelCluster::PixelPos const &p, uint16_t const iadc)
virtual bool isNoisy(const uint32_t &detID, const int &col, const int &row)=0
~PixelThresholdClusterizer() override
int calibrate(int adc, int col, int row)
Log< level::Warning, false > LogWarning
std::vector< SiPixelCluster::PixelPos > theSeeds
const bool dropDuplicates
void copy_to_buffer(DigiIterator begin, DigiIterator end)
Copy adc counts from PixelDigis into the buffer, identify seeds.
uint16_t *__restrict__ uint16_t const *__restrict__ adc
const int theConversionFactor