CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
void init(uint16_t row, uint16_t col, uint16_t npoints)
std::vector< uint32_t > getsum() const
int ii
Definition: cuy.py:589
std::vector< uint8_t > getnentries() const
tuple result
Definition: mps_fire.py:311
uint16_t row() const
uint16_t col() const
void setrowcol(uint16_t row, uint16_t col)
std::pair< uint16_t, uint16_t > m_row_and_column
static const int npoints
std::vector< datacontainer > m_data
std::vector< uint32_t > getsumsquares() const
int col
Definition: cuy.py:1009
void fill(uint32_t ipoint, uint32_t adcval)