CMS 3D CMS Logo

RPixDetClusterizer.h
Go to the documentation of this file.
1 /**********************************************************************
2  *
3  * Author: F.Ferro - INFN Genova
4  * September 2016
5  *
6  **********************************************************************/
7 #ifndef RecoCTPPS_PixelLocal_RPixDetClusterizer_H
8 #define RecoCTPPS_PixelLocal_RPixDetClusterizer_H
9 
11 
13 
17 
20 
22 
23 #include <vector>
24 #include <set>
25 
26 class RPixCalibDigi : public CTPPSPixelDigi {
27 public:
28  RPixCalibDigi(unsigned char row, unsigned char col, unsigned short adc, unsigned short ele)
29  : CTPPSPixelDigi(row, col, adc) {
30  electrons_ = ele;
31  }
32 
34 
35  int electrons() const { return electrons_; }
36  void set_electrons(int a) { electrons_ = a; }
37 
38 private:
40 };
41 
43 public:
45 
46  void buildClusters(unsigned int detId,
47  const std::vector<CTPPSPixelDigi> &digi,
48  std::vector<CTPPSPixelCluster> &clusters,
49  const CTPPSPixelGainCalibrations *pcalibration,
50  const CTPPSPixelAnalysisMask *mask);
51  int calibrate(unsigned int, int, int, int, const CTPPSPixelGainCalibrations *pcalibration);
52 
53  void make_cluster(RPixCalibDigi const &aSeed, std::vector<CTPPSPixelCluster> &clusters);
55 
56 private:
57  std::set<CTPPSPixelDigi> rpix_digi_set_;
58  std::map<unsigned int, RPixCalibDigi> calib_rpix_digi_map_;
61  unsigned short SeedADCThreshold_;
62  unsigned short ADCThreshold_;
68  std::vector<RPixCalibDigi> SeedVector_;
69 };
70 
72 public:
74  isize = 0;
75  curr = 0;
76  }
78 
79  static constexpr unsigned short MAXSIZE = 256;
80  unsigned short adc[MAXSIZE];
81  uint8_t row[MAXSIZE];
82  uint8_t col[MAXSIZE];
83  unsigned short isize;
84  unsigned short curr;
85 
86  // stack interface (unsafe ok for use below)
87  unsigned short top() const { return curr; }
88  void pop() { ++curr; }
89  bool empty() { return curr == isize; }
90 
91  bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc) {
92  if (isize == MAXSIZE)
93  return false;
94  adc[isize] = iadc;
95  row[isize] = myrow;
96  col[isize++] = mycol;
97  return true;
98  }
99 };
100 
101 #endif
void set_electrons(int a)
std::map< unsigned int, RPixCalibDigi > calib_rpix_digi_map_
unsigned short isize
unsigned short curr
std::string CalibrationFile_
int row() const
Access to digi information.
std::vector< RPixCalibDigi > SeedVector_
RPixCalibDigi(unsigned char row, unsigned char col, unsigned short adc, unsigned short ele)
const edm::ParameterSet & params_
std::set< CTPPSPixelDigi > rpix_digi_set_
Channel-mask mapping.
unsigned short SeedADCThreshold_
unsigned short ADCThreshold_
bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc)
double a
Definition: hdecay.h:119
col
Definition: cuy.py:1010
unsigned short top() const
unsigned short adc() const
int electrons() const
#define constexpr