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,
48  const CTPPSPixelAnalysisMask *mask);
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 
69 class RPixTempCluster {
70 public:
71  RPixTempCluster() {
72  isize = 0;
73  curr = 0;
74  }
75  ~RPixTempCluster() {}
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
RPixDetClusterizer::ADCThreshold_
unsigned short ADCThreshold_
Definition: RPixDetClusterizer.h:59
RPixDetClusterizer::params_
const edm::ParameterSet & params_
Definition: RPixDetClusterizer.h:56
RPixDetClusterizer
Definition: RPixDetClusterizer.h:39
RPixTempCluster::RPixTempCluster
RPixTempCluster()
Definition: RPixDetClusterizer.h:70
cuy.col
col
Definition: cuy.py:1010
RPixTempCluster::curr
unsigned short curr
Definition: RPixDetClusterizer.h:81
RPixDetClusterizer::buildClusters
void buildClusters(unsigned int detId, const std::vector< CTPPSPixelDigi > &digi, std::vector< CTPPSPixelCluster > &clusters, const CTPPSPixelGainCalibrations *pcalibration, const CTPPSPixelAnalysisMask *mask)
Definition: RPixDetClusterizer.cc:25
RPixTempCluster::empty
bool empty()
Definition: RPixDetClusterizer.h:86
RPixTempCluster
Definition: RPixDetClusterizer.h:68
RPixTempCluster::~RPixTempCluster
~RPixTempCluster()
Definition: RPixDetClusterizer.h:74
RPixTempCluster::col
uint8_t col[MAXSIZE]
Definition: RPixDetClusterizer.h:79
RPixDetClusterizer::verbosity_
int verbosity_
Definition: RPixDetClusterizer.h:57
RPixDetClusterizer::rpix_digi_set_
std::set< CTPPSPixelDigi > rpix_digi_set_
Definition: RPixDetClusterizer.h:54
RPixCalibDigi::set_electrons
void set_electrons(int a)
Definition: RPixDetClusterizer.h:37
RPixTempCluster::row
uint8_t row[MAXSIZE]
Definition: RPixDetClusterizer.h:78
CTPPSPixelGainCalibrations.h
RPixTempCluster::MAXSIZE
static constexpr unsigned short MAXSIZE
Definition: RPixDetClusterizer.h:76
CTPPSPixelAnalysisMask
Channel-mask mapping.
Definition: CTPPSPixelAnalysisMask.h:34
CTPPSPixelDigi::row
int row() const
Access to digi information.
Definition: CTPPSPixelDigi.h:24
RPixTempCluster::adc
unsigned short adc[MAXSIZE]
Definition: RPixDetClusterizer.h:77
RPixDetClusterizer::make_cluster
void make_cluster(RPixCalibDigi const &aSeed, std::vector< CTPPSPixelCluster > &clusters)
Definition: RPixDetClusterizer.cc:80
RPixTempCluster::pop
void pop()
Definition: RPixDetClusterizer.h:85
CTPPSPixelDigi::adc
unsigned short adc() const
Definition: CTPPSPixelDigi.h:26
RPixTempCluster::isize
unsigned short isize
Definition: RPixDetClusterizer.h:80
RPixDetClusterizer::doSingleCalibration_
bool doSingleCalibration_
Definition: RPixDetClusterizer.h:63
RPixTempCluster::top
unsigned short top() const
Definition: RPixDetClusterizer.h:84
RPixDetClusterizer::SeedADCThreshold_
unsigned short SeedADCThreshold_
Definition: RPixDetClusterizer.h:58
RPixDetClusterizer::RPixDetClusterizer
RPixDetClusterizer(edm::ParameterSet const &conf)
Definition: RPixDetClusterizer.cc:13
RPixDetClusterizer::SeedVector_
std::vector< RPixCalibDigi > SeedVector_
Definition: RPixDetClusterizer.h:65
RPixCalibDigi::RPixCalibDigi
RPixCalibDigi()
Definition: RPixDetClusterizer.h:34
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CTPPSPixelAnalysisMask.h
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
CTPPSPixelDigi
Definition: CTPPSPixelDigi.h:10
RPixCalibDigi
Definition: RPixDetClusterizer.h:23
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
CTPPSPixelCluster.h
CTPPSPixelGainCalibrations
Definition: CTPPSPixelGainCalibrations.h:8
RPixTempCluster::addPixel
bool addPixel(unsigned char myrow, unsigned char mycol, unsigned short const iadc)
Definition: RPixDetClusterizer.h:88
RPixDetClusterizer::~RPixDetClusterizer
~RPixDetClusterizer()
Definition: RPixDetClusterizer.cc:23
RPixDetClusterizer::CalibrationFile_
std::string CalibrationFile_
Definition: RPixDetClusterizer.h:64
DetSetVector.h
RPixCalibDigi::electrons_
int electrons_
Definition: RPixDetClusterizer.h:40
CTPPSPixelDigi.h
RPixCalibDigi::electrons
int electrons() const
Definition: RPixDetClusterizer.h:36
CTPPSPixelDigi::CTPPSPixelDigi
CTPPSPixelDigi()
Definition: CTPPSPixelDigi.h:21
RPixDetClusterizer::ElectronADCGain_
double ElectronADCGain_
Definition: RPixDetClusterizer.h:60
RPixDetClusterizer::VcaltoElectronOffset_
int VcaltoElectronOffset_
Definition: RPixDetClusterizer.h:62
RPixDetClusterizer::calib_rpix_digi_map_
std::map< unsigned int, RPixCalibDigi > calib_rpix_digi_map_
Definition: RPixDetClusterizer.h:55
ParameterSet.h
RPixDetClusterizer::calibrate
int calibrate(unsigned int, int, int, int, const CTPPSPixelGainCalibrations *pcalibration)
Definition: RPixDetClusterizer.cc:119
CTPPSPixelDigiCollection.h
RPixDetClusterizer::VcaltoElectronGain_
int VcaltoElectronGain_
Definition: RPixDetClusterizer.h:61