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_;
59  unsigned short SeedADCThreshold_;
60  unsigned short ADCThreshold_;
66  std::vector<RPixCalibDigi> SeedVector_;
67 };
68 
70 public:
72  isize = 0;
73  curr = 0;
74  }
76 
77  static constexpr unsigned short MAXSIZE = 256;
78  unsigned short adc[MAXSIZE];
79  uint8_t row[MAXSIZE];
80  uint8_t col[MAXSIZE];
81  unsigned short isize;
82  unsigned short curr;
83 
84  // stack interface (unsafe ok for use below)
85  unsigned short top() const { return curr; }
86  void pop() { ++curr; }
87  bool empty() { return curr == isize; }
88 
89  bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc) {
90  if (isize == MAXSIZE)
91  return false;
92  adc[isize] = iadc;
93  row[isize] = myrow;
94  col[isize++] = mycol;
95  return true;
96  }
97 };
98 
99 #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)
const edm::ParameterSet & params_
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