CMS 3D CMS Logo

SiPixelCalibDigi.cc
Go to the documentation of this file.
1 
3 
4 #include <algorithm>
5 
6 // the actual data container is a simply a collection of SiPixelCalibDigi objects
7 
8 // init method, sets array sizes to npoints, fixes number of points
9 void SiPixelCalibDigi::init(uint16_t row, uint16_t col, uint16_t npoints) {
10  setrowcol(row, col);
11  reset();
12  // expand if size of arrays has changed.... not implemented yet...
13 }
14 // reset method, sets all array values to zero, does not change size
16  for (uint32_t iter = 0; iter < m_data.size(); ++iter) {
17  m_data[iter].nentries = 0;
18  m_data[iter].adccountsum = 0;
19  m_data[iter].adccountsumsq = 0;
20  }
21 }
22 // fill method, adds information to the arrays
23 void SiPixelCalibDigi::fill(uint32_t ipoint, uint32_t adcval) {
24  if (ipoint >= m_data.size())
25  return;
26  m_data[ipoint].nentries++;
27  m_data[ipoint].adccountsum += adcval;
28  m_data[ipoint].adccountsumsq += adcval * adcval;
29  return;
30 }
31 // set method to rol row and column number
32 void SiPixelCalibDigi::setrowcol(uint16_t row, uint16_t col) {
33  m_row_and_column.first = row;
34  m_row_and_column.second = col;
35 }
36 // possibility to retrieve vector of entry objects
37 std::vector<uint8_t> SiPixelCalibDigi::getnentries() const {
38  std::vector<uint8_t> result(0);
39  for (uint32_t ii = 0; ii < m_data.size(); ++ii)
40  result.push_back(m_data[ii].nentries);
41  return result;
42 }
43 // possibility to retrieve a vector of sums
44 std::vector<uint32_t> SiPixelCalibDigi::getsum() const {
45  std::vector<uint32_t> result(0);
46  for (uint32_t ii = 0; ii < m_data.size(); ++ii)
47  result.push_back(m_data[ii].adccountsum);
48  return result;
49 }
50 // possibility to retrieve a vector of sumsquares
51 std::vector<uint32_t> SiPixelCalibDigi::getsumsquares() const {
52  std::vector<uint32_t> result(0);
53  for (uint32_t ii = 0; ii < m_data.size(); ++ii)
54  result.push_back(m_data[ii].adccountsumsq);
55  return result;
56 }
npoints
static const int npoints
Definition: NuclearInteractionFTFSimulator.h:38
SiPixelCalibDigi::init
void init(uint16_t row, uint16_t col, uint16_t npoints)
Definition: SiPixelCalibDigi.cc:9
cuy.col
col
Definition: cuy.py:1010
SiPixelCalibDigi::getnentries
std::vector< uint8_t > getnentries() const
Definition: SiPixelCalibDigi.cc:37
SiPixelCalibDigi::getsum
std::vector< uint32_t > getsum() const
Definition: SiPixelCalibDigi.cc:44
plotBeamSpotDB.ipoint
ipoint
Definition: plotBeamSpotDB.py:340
SiPixelCalibDigi::m_row_and_column
std::pair< uint16_t, uint16_t > m_row_and_column
Definition: SiPixelCalibDigi.h:51
SiPixelCalibDigi::reset
void reset()
Definition: SiPixelCalibDigi.cc:15
SiPixelCalibDigi::m_data
std::vector< datacontainer > m_data
Definition: SiPixelCalibDigi.h:50
SiPixelCalibDigi::row
uint16_t row() const
Definition: SiPixelCalibDigi.h:37
SiPixelCalibDigi.h
SiPixelCalibDigi::setrowcol
void setrowcol(uint16_t row, uint16_t col)
Definition: SiPixelCalibDigi.cc:32
mps_fire.result
result
Definition: mps_fire.py:311
SiPixelCalibDigi::fill
void fill(uint32_t ipoint, uint32_t adcval)
Definition: SiPixelCalibDigi.cc:23
SiPixelCalibDigi::col
uint16_t col() const
Definition: SiPixelCalibDigi.h:38
SiPixelCalibDigi::getsumsquares
std::vector< uint32_t > getsumsquares() const
Definition: SiPixelCalibDigi.cc:51
cuy.ii
ii
Definition: cuy.py:590