|
|
Go to the documentation of this file.
45 thePixelThreshold(conf.getParameter<
int>(
"ChannelThreshold")),
46 theSeedThreshold(conf.getParameter<
int>(
"SeedThreshold")),
47 theClusterThreshold(conf.getParameter<
int>(
"ClusterThreshold")),
48 theClusterThreshold_L1(conf.getParameter<
int>(
"ClusterThreshold_L1")),
49 theConversionFactor(conf.getParameter<
int>(
"VCaltoElectronGain")),
50 theConversionFactor_L1(conf.getParameter<
int>(
"VCaltoElectronGain_L1")),
51 theOffset(conf.getParameter<
int>(
"VCaltoElectronOffset")),
52 theOffset_L1(conf.getParameter<
int>(
"VCaltoElectronOffset_L1")),
53 theElectronPerADCGain(conf.getParameter<double>(
"ElectronPerADCGain")),
54 doPhase2Calibration(conf.getParameter<
bool>(
"Phase2Calibration")),
55 thePhase2ReadoutMode(conf.getParameter<
int>(
"Phase2ReadoutMode")),
56 thePhase2DigiBaseline(conf.getParameter<double>(
"Phase2DigiBaseline")),
57 thePhase2KinkADC(conf.getParameter<
int>(
"Phase2KinkADC")),
62 doMissCalibrate(conf.getParameter<
bool>(
"MissCalibrate")),
63 doSplitClusters(conf.getParameter<
bool>(
"SplitClusters")) {
72 desc.add<
int>(
"ChannelThreshold", 1000);
73 desc.add<
bool>(
"MissCalibrate",
true);
74 desc.add<
bool>(
"SplitClusters",
false);
75 desc.add<
int>(
"VCaltoElectronGain", 65);
76 desc.add<
int>(
"VCaltoElectronGain_L1", 65);
77 desc.add<
int>(
"VCaltoElectronOffset", -414);
78 desc.add<
int>(
"VCaltoElectronOffset_L1", -414);
79 desc.add<
int>(
"SeedThreshold", 1000);
80 desc.add<
int>(
"ClusterThreshold_L1", 4000);
81 desc.add<
int>(
"ClusterThreshold", 4000);
82 desc.add<
double>(
"ElectronPerADCGain", 135.);
83 desc.add<
bool>(
"Phase2Calibration",
false);
84 desc.add<
int>(
"Phase2ReadoutMode", -1);
85 desc.add<
double>(
"Phase2DigiBaseline", 1200.);
86 desc.add<
int>(
"Phase2KinkADC", 8);
98 int nrows = topol.
nrows();
125 template <
typename T>
129 const std::vector<short>& badChannels,
131 typename T::const_iterator begin =
input.begin();
132 typename T::const_iterator
end =
input.end();
156 for (
unsigned int i = 0;
i <
theSeeds.size();
i++) {
206 for (
int i = 0;
i < ci->size(); ++
i) {
218 #ifdef PIXELREGRESSION
219 static std::atomic<int> s_ic = 0;
240 (*theSiPixelGainCalibrationService_)
249 auto adc = di->adc();
259 #ifdef PIXELREGRESSION
260 static std::atomic<int> eqD = 0;
264 int col = di->column();
266 int adc = (di->flag() != 0) ? di->adc() * 10 :
electron[
i];
269 #ifdef PIXELREGRESSION
273 std::cout <<
"VI " << eqD <<
' ' << ic <<
' ' <<
end - begin <<
' ' <<
i <<
' ' << di->adc() <<
' ' <<
adc <<
' '
274 << adcOld << std::endl;
301 for (
int i = 0;
i < ci->size(); ++
i) {
333 const int dualslope =
int(dualslopeparam <= 1 ? 1. :
pow(2, dualslopeparam - 1));
360 float DBpedestal =
pedestal * DBgain;
366 float vcal =
adc * DBgain - DBpedestal;
404 stack<SiPixelCluster::PixelPos, vector<SiPixelCluster::PixelPos> > dead_pixel_stack;
428 acluster.
add(pix, seed_adc);
429 cldata.
add(pix, seed_adc);
432 bool dead_flag =
false;
433 while (!acluster.
empty()) {
435 auto curInd = acluster.
top();
437 for (
auto c =
std::max(0,
int(acluster.
y[curInd]) - 1);
440 for (
auto r =
std::max(0,
int(acluster.
x[curInd]) - 1);
493 bool have_second_cluster =
false;
494 while (!dead_pixel_stack.empty()) {
497 dead_pixel_stack.pop();
505 output.push_back(second_cluster);
506 have_second_cluster =
true;
511 const std::vector<SiPixelCluster::Pixel>& branch_pixels = second_cluster.
pixels();
512 for (
unsigned int i = 0;
i < branch_pixels.size();
i++) {
513 int temp_x = branch_pixels[
i].x;
514 int temp_y = branch_pixels[
i].y;
515 int temp_adc = branch_pixels[
i].adc;
517 cluster.
add(newpix, temp_adc);
523 output.push_back(first_cluster);
edm::DetSet< PixelDigi >::const_iterator DigiIterator
static const std::string input
edmNew::DetSet< SiPixelCluster >::const_iterator ClusterIterator
bool setup(const PixelGeomDetUnit *pixDet)
Private helper methods:
void set_adc(int row, int col, int adc)
int theNumOfRows
Geometry-related information.
virtual bool isDead(const uint32_t &detID, const int &col, const int &row)=0
uint16_t *__restrict__ uint16_t const *__restrict__ adc
virtual float getGain(const uint32_t &detID, const int &col, const int &row)=0
const int theClusterThreshold_L1
SiPixelGainCalibrationServiceBase * theSiPixelGainCalibrationService_
const int theClusterThreshold
std::vector< SiPixelCluster::PixelPos > theSeeds
SiPixelCluster make_cluster(const SiPixelCluster::PixelPos &pix, edmNew::DetSetVector< SiPixelCluster >::FastFiller &output)
The actual clustering algorithm: group the neighboring pixels around the seed.
const int thePhase2KinkADC
Pixel cluster – collection of neighboring pixels above threshold.
void copy_to_buffer(DigiIterator begin, DigiIterator end)
Copy adc counts from PixelDigis into the buffer, identify seeds.
unsigned int pxbLayer(const DetId &id) const
~PixelThresholdClusterizer() override
void add(const PixelPos &pix, int adc)
virtual int ncolumns() const =0
PixelThresholdClusterizer(edm::ParameterSet const &conf)
const double thePhase2DigiBaseline
const int thePhase2ReadoutMode
void clusterizeDetUnitT(const T &input, const PixelGeomDetUnit *pixDet, const TrackerTopology *tTopo, const std::vector< short > &badChannels, edmNew::DetSetVector< SiPixelCluster >::FastFiller &output)
Cluster pixels. This method operates on a matrix of pixels and finds the largest contiguous cluster a...
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
const int thePixelThreshold
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
void clear_buffer(DigiIterator begin, DigiIterator end)
Clear the internal buffer array.
std::vector< bool > theFakePixels
void add_adc(int row, int col, int adc)
const int theConversionFactor
const int theConversionFactor_L1
const bool doSplitClusters
bool add(SiPixelCluster::PixelPos const &p, uint16_t const iadc)
constexpr int row() const
const bool doPhase2Calibration
Power< A, B >::type pow(const A &a, const B &b)
const std::vector< Pixel > pixels() const
virtual float getPedestal(const uint32_t &detID, const int &col, const int &row)=0
void setSize(int rows, int cols)
const bool doMissCalibrate
const int theSeedThreshold
virtual int nrows() const =0
SiPixelArrayBuffer theBuffer
Data storage.
int calibrate(int adc, int col, int row)
static void fillPSetDescription(edm::ParameterSetDescription &desc)
const double theElectronPerADCGain
constexpr int col() const
virtual bool isNoisy(const uint32_t &detID, const int &col, const int &row)=0