9 fPixels(), fActivePixel(), fPixelSizeX(0.), fPixelSizeY(0.), fRows(0.), fCols(0.), fThreshold(0.), fNoise(
10 0.), fQspread(0.), fEnergy(0.), fVerboseLevel(0) {
14 fPixels(), fActivePixel(), fPixelSizeX(digi_par.GetXPitch()), fPixelSizeY(digi_par.GetYPitch()), fRows(
15 digi_par.GetFERows() * digi_par.GetMaxFEperRow()), fCols(
16 digi_par.GetFECols() * digi_par.GetMaxFEperCol()), fThreshold(digi_par.GetThreshold()), fNoise(
17 digi_par.GetNoise()), fQspread(digi_par.GetQCloudSigma()), fEnergy(0.), fVerboseLevel(0) {
27 fThreshold(threshold),
36 std::vector<Double_t>& charges) {
37 std::vector<PndSdsPixel> pixels =
GetPixels(inx, iny, outx, outy, energy);
38 Int_t npix = pixels.size();
39 for (Int_t
i = 0;
i < npix;
i++) {
40 if (
fVerboseLevel > 2) Info(
"PndSdsCalcPixelDif::GetPixelsAlternative()",
41 "pass this pixel: i=%i, c=%i, r=%i, q=%f",
i, pixels[
i].GetCol(), pixels[
i].GetRow(),
42 pixels[
i].GetCharge());
43 cols.push_back(pixels[
i].GetCol());
44 rows.push_back(pixels[
i].GetRow());
45 charges.push_back(pixels[
i].GetCharge());
54 Error(
"PndSdsCalcPixelDif::GetPixels()",
"Invalid Pixel sizes: fPixelSizeX=%g,fPixelSizeY=%g",
60 double max_charge_diffusion_distance(3.0 *
fQspread);
73 min_x -= max_charge_diffusion_distance;
74 min_y -= max_charge_diffusion_distance;
75 max_x += max_charge_diffusion_distance;
76 max_y += max_charge_diffusion_distance;
78 double track_dx = outx - inx;
79 double track_dy = outy - iny;
90 double difx = 0, dify = 0;
93 std::vector<int> hitstorage(cols * rows, 0);
95 unsigned int samples(Q);
97 if (hitstorage.size() == 1) {
101 for (
unsigned int i = 0;
i < samples; ++
i) {
106 if (std::abs(difx) > max_charge_diffusion_distance
107 || std::abs(dify) > max_charge_diffusion_distance)
continue;
110 hitstorage[(row - start_row) * cols + (
col - start_col)]++;
113 for (
unsigned int i = 0;
i < hitstorage.size(); ++
i) {
114 if (hitstorage[
i] > 0) {
115 row =
i / cols + start_row;
116 col =
i % cols + start_col;
127 if (col < 0 || row < 0 || col >
fCols || row >
fRows) {
129 std::stringstream ss;
130 ss <<
" (col=" << col <<
",row=" << row <<
" values exceed sensor boundaries: cols=[0-" <<
fCols
131 <<
"] rows=[0-" <<
fRows <<
"]";
132 Info(
"PndSdsCalcPixelDif::PndSdsCalcPixelDif::InjectPixelCharge:", ss.str().c_str());
136 if (
fVerboseLevel > 3) std::cout <<
" charge = " << charge <<
", smeared = " << smearedCharge
139 if (
fVerboseLevel > 3) Info(
"PndSdsCalcPixelDif::InjectPixelCharge",
"col=%i, row=%i,charge=%f", col,
std::vector< PndSdsPixel > GetPixels(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy)
Main function to calculate the vector
of fired pixel.
Int_t GetPixelsAlternative(Double_t inx, Double_t iny, Double_t outx, Double_t outy, Double_t energy, std::vector< Int_t > &cols, std::vector< Int_t > &rows, std::vector< Double_t > &charges)
Double_t ChargeFromEloss(Double_t eloss) const
void SetCharge(Double_t charge)
friend F32vec4 fabs(const F32vec4 &a)
std::ostream & operator<<(std::ostream &out)
PndSdsCalcPixelDif()
Default constructor.
void InjectPixelCharge(Int_t col, Int_t row, Double_t charge)
std::vector< PndSdsPixel > fPixels
Digitization Parameter Class for SDS-Pixel part.