FairRoot/PandaRoot
PndSdsCalcFePixel.cxx
Go to the documentation of this file.
1 #include "PndSdsCalcFePixel.h"
2 #include "PndSdsPixelDigiPar.h"
3 
5  fNcols(1), fNrows(1), fMaxFEperCol(1), fMaxFEperRow(1) {
6 }
7 
9  fNcols(digi_par.GetFECols()), fNrows(digi_par.GetFERows()), fMaxFEperCol(digi_par.GetMaxFEperCol()), fMaxFEperRow(
10  digi_par.GetMaxFEperRow()) {
11 }
12 
14 }
15 
16 std::vector<PndSdsPixel> PndSdsCalcFePixel::CalcFEHits(const std::vector<PndSdsPixel>& sensor_hits) {
17  Int_t col, row, fe, fe_row, fe_col;
18  std::vector<PndSdsPixel> result;
19  for (auto const& sensor_hit : sensor_hits) {
20  col = sensor_hit.GetCol();
21  row = sensor_hit.GetRow();
22  fe_col = col / fNcols;
23  if (fMaxFEperCol > fe_col) {
24  col -= fe_col * fNcols;
25  fe = fe_col;
26  }
27  fe_row = row / fNrows;
28  if (fMaxFEperRow > fe_row) {
29  fe += fMaxFEperCol * (fe_row);
30  row -= fe_row * fNrows;
31  }
32  PndSdsPixel myPixel(sensor_hit.GetSensorID(), fe, col, row, sensor_hit.GetCharge());
33  myPixel.SetAddNoise(sensor_hit.GetAddNoise());
34  result.push_back(myPixel);
35  }
36  return result;
37 }
38 
39 void PndSdsCalcFePixel::CalcSensorColRow(Int_t& col, Int_t& row, const Int_t fe) const {
40  Int_t fe_row = fe / fMaxFEperCol;
41  Int_t fe_col = fe % fMaxFEperCol;
42  row = row + fe_row * fNrows;
43  col = col + fe_col * fNcols;
44  return;
45 }
int row
Definition: anaLmdDigi.C:67
int col
Definition: anaLmdDigi.C:67
void CalcSensorColRow(Int_t &col, Int_t &row, const Int_t fe) const
Main function to calculate sensor hits.
Int_t fNrows
number of columns on a front-end chip
Int_t fMaxFEperRow
maximum number of front-end chip per column on a sensor
void SetAddNoise(Double_t addnoise)
Definition: PndSdsPixel.h:39
PndSdsCalcFePixel()
Default constructor.
int fe
Definition: anaLmdDigi.C:67
Int_t fMaxFEperCol
nrows number of rows on a front-end chip
std::vector< PndSdsPixel > CalcFEHits(const std::vector< PndSdsPixel > &sensor_hits)
Main function to calculate front-end hits.
Digitization Parameter Class for SDS-Pixel part.