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 
28 public:
29 
30 RPixCalibDigi(unsigned char row, unsigned char col, unsigned short adc, unsigned short ele) : CTPPSPixelDigi(row,col,adc){
31  electrons_ = ele;
32  }
33 
35  electrons_ = 0;
36 }
37 
38  int electrons() const {
39  return electrons_;
40  }
41  void set_electrons(int a) {
42  electrons_=a;
43  }
44 
45 private:
46 
48 
49 };
50 
51 
53 
54 public:
55 
57 
58  void buildClusters(unsigned int detId, const std::vector<CTPPSPixelDigi> &digi, std::vector<CTPPSPixelCluster> &clusters, const CTPPSPixelGainCalibrations * pcalibration, const CTPPSPixelAnalysisMask* mask);
59  int calibrate(unsigned int, int, int, int ,const CTPPSPixelGainCalibrations * pcalibration);
60 
61  void make_cluster( RPixCalibDigi const &aSeed, std::vector<CTPPSPixelCluster> &clusters );
63 
64 
65 private:
66 
67  std::set<CTPPSPixelDigi> rpix_digi_set_;
68  std::map<unsigned int,RPixCalibDigi> calib_rpix_digi_map_;
71  unsigned short SeedADCThreshold_;
72  unsigned short ADCThreshold_;
78  std::vector<RPixCalibDigi> SeedVector_;
79 };
80 
81 
82 
84 
85 public:
86 
88  {
89  isize=0;
90  curr=0;
91  }
93 
94  static constexpr unsigned short MAXSIZE = 256;
95  unsigned short adc[MAXSIZE];
96  uint8_t row[MAXSIZE];
97  uint8_t col[MAXSIZE];
98  unsigned short isize;
99  unsigned short curr;
100 
101  // stack interface (unsafe ok for use below)
102  unsigned short top() const { return curr;}
103  void pop() { ++curr;}
104  bool empty() { return curr==isize;}
105 
106  bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc) {
107  if (isize==MAXSIZE) return false;
108  adc[isize]=iadc;
109  row[isize]=myrow;
110  col[isize++]=mycol;
111  return true;
112  }
113 
114 
115 };
116 
117 
118 #endif
void set_electrons(int a)
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_
std::map< unsigned int, RPixCalibDigi > calib_rpix_digi_map_
unsigned short ADCThreshold_
bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc)
double a
Definition: hdecay.h:121
col
Definition: cuy.py:1010
unsigned short top() const
unsigned short adc() const
int electrons() const
#define constexpr