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 RecoPPS_Local_RPixDetClusterizer_H
8 #define RecoPPS_Local_RPixDetClusterizer_H
9 
11 
13 
17 
20 
21 #include <vector>
22 #include <set>
23 
24 class RPixCalibDigi : public CTPPSPixelDigi {
25 public:
26  RPixCalibDigi(unsigned char row, unsigned char col, unsigned short adc, unsigned short ele)
27  : CTPPSPixelDigi(row, col, adc) {
28  electrons_ = ele;
29  }
30 
32 
33  int electrons() const { return electrons_; }
34  void set_electrons(int a) { electrons_ = a; }
35 
36 private:
38 };
39 
41 public:
43 
44  void buildClusters(unsigned int detId,
45  const std::vector<CTPPSPixelDigi> &digi,
46  std::vector<CTPPSPixelCluster> &clusters,
47  const CTPPSPixelGainCalibrations *pcalibration,
49  int calibrate(unsigned int, int, int, int, const CTPPSPixelGainCalibrations *pcalibration);
50 
51  void make_cluster(RPixCalibDigi const &aSeed, std::vector<CTPPSPixelCluster> &clusters);
53 
54 private:
55  std::set<CTPPSPixelDigi> rpix_digi_set_;
56  std::map<unsigned int, RPixCalibDigi> calib_rpix_digi_map_;
58  unsigned short SeedADCThreshold_;
59  unsigned short ADCThreshold_;
65  std::vector<RPixCalibDigi> SeedVector_;
66 };
67 
69 public:
71  isize = 0;
72  curr = 0;
73  }
75 
76  static constexpr unsigned short MAXSIZE = 256;
77  unsigned short adc[MAXSIZE];
78  uint8_t row[MAXSIZE];
79  uint8_t col[MAXSIZE];
80  unsigned short isize;
81  unsigned short curr;
82 
83  // stack interface (unsafe ok for use below)
84  unsigned short top() const { return curr; }
85  void pop() { ++curr; }
86  bool empty() { return curr == isize; }
87 
88  bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc) {
89  if (isize == MAXSIZE)
90  return false;
91  adc[isize] = iadc;
92  row[isize] = myrow;
93  col[isize++] = mycol;
94  return true;
95  }
96 };
97 
98 #endif
void set_electrons(int a)
unsigned short adc[MAXSIZE]
std::map< unsigned int, RPixCalibDigi > calib_rpix_digi_map_
unsigned short isize
static constexpr unsigned short MAXSIZE
RPixDetClusterizer(edm::ParameterSet const &conf)
unsigned short curr
constexpr uint32_t mask
Definition: gpuClustering.h:26
std::string CalibrationFile_
int electrons() const
std::vector< RPixCalibDigi > SeedVector_
uint8_t row[MAXSIZE]
RPixCalibDigi(unsigned char row, unsigned char col, unsigned short adc, unsigned short ele)
void make_cluster(RPixCalibDigi const &aSeed, std::vector< CTPPSPixelCluster > &clusters)
std::set< CTPPSPixelDigi > rpix_digi_set_
Channel-mask mapping.
unsigned short SeedADCThreshold_
unsigned short adc() const
unsigned short ADCThreshold_
bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc)
uint8_t col[MAXSIZE]
int calibrate(unsigned int, int, int, int, const CTPPSPixelGainCalibrations *pcalibration)
double a
Definition: hdecay.h:121
void buildClusters(unsigned int detId, const std::vector< CTPPSPixelDigi > &digi, std::vector< CTPPSPixelCluster > &clusters, const CTPPSPixelGainCalibrations *pcalibration, const CTPPSPixelAnalysisMask *mask)
col
Definition: cuy.py:1009
int row() const
Access to digi information.
unsigned short top() const