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 
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 
71 class RPixTempCluster {
72 public:
73  RPixTempCluster() {
74  isize = 0;
75  curr = 0;
76  }
77  ~RPixTempCluster() {}
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
RPixDetClusterizer::ADCThreshold_
unsigned short ADCThreshold_
Definition: RPixDetClusterizer.h:61
RPixDetClusterizer::params_
const edm::ParameterSet & params_
Definition: RPixDetClusterizer.h:58
RPixDetClusterizer
Definition: RPixDetClusterizer.h:41
RPixTempCluster::RPixTempCluster
RPixTempCluster()
Definition: RPixDetClusterizer.h:72
cuy.col
col
Definition: cuy.py:1010
RPixTempCluster::curr
unsigned short curr
Definition: RPixDetClusterizer.h:83
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:88
RPixTempCluster
Definition: RPixDetClusterizer.h:70
RPixTempCluster::~RPixTempCluster
~RPixTempCluster()
Definition: RPixDetClusterizer.h:76
RPixTempCluster::col
uint8_t col[MAXSIZE]
Definition: RPixDetClusterizer.h:81
RPixDetClusterizer::verbosity_
int verbosity_
Definition: RPixDetClusterizer.h:59
RPixDetClusterizer::rpix_digi_set_
std::set< CTPPSPixelDigi > rpix_digi_set_
Definition: RPixDetClusterizer.h:56
RPixCalibDigi::set_electrons
void set_electrons(int a)
Definition: RPixDetClusterizer.h:39
RPixTempCluster::row
uint8_t row[MAXSIZE]
Definition: RPixDetClusterizer.h:80
CTPPSPixelGainCalibrations.h
RPixTempCluster::MAXSIZE
static constexpr unsigned short MAXSIZE
Definition: RPixDetClusterizer.h:78
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:79
RPixDetClusterizer::make_cluster
void make_cluster(RPixCalibDigi const &aSeed, std::vector< CTPPSPixelCluster > &clusters)
Definition: RPixDetClusterizer.cc:80
RPixTempCluster::pop
void pop()
Definition: RPixDetClusterizer.h:87
CTPPSPixelDigi::adc
unsigned short adc() const
Definition: CTPPSPixelDigi.h:26
RPixTempCluster::isize
unsigned short isize
Definition: RPixDetClusterizer.h:82
RPixDetClusterizer::doSingleCalibration_
bool doSingleCalibration_
Definition: RPixDetClusterizer.h:65
RPixTempCluster::top
unsigned short top() const
Definition: RPixDetClusterizer.h:86
RPixDetClusterizer::SeedADCThreshold_
unsigned short SeedADCThreshold_
Definition: RPixDetClusterizer.h:60
RPixDetClusterizer::RPixDetClusterizer
RPixDetClusterizer(edm::ParameterSet const &conf)
Definition: RPixDetClusterizer.cc:13
RPixDetClusterizer::SeedVector_
std::vector< RPixCalibDigi > SeedVector_
Definition: RPixDetClusterizer.h:67
RPixCalibDigi::RPixCalibDigi
RPixCalibDigi()
Definition: RPixDetClusterizer.h:36
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:25
edm::ParameterSet
Definition: ParameterSet.h:36
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:90
RPixDetClusterizer::~RPixDetClusterizer
~RPixDetClusterizer()
Definition: RPixDetClusterizer.cc:23
RPixDetClusterizer::CalibrationFile_
std::string CalibrationFile_
Definition: RPixDetClusterizer.h:66
DetSetVector.h
RPixCalibDigi::electrons_
int electrons_
Definition: RPixDetClusterizer.h:42
CTPPSPixelDigi.h
RPixCalibDigi::electrons
int electrons() const
Definition: RPixDetClusterizer.h:38
CTPPSPixelDigi::CTPPSPixelDigi
CTPPSPixelDigi()
Definition: CTPPSPixelDigi.h:21
RPixDetClusterizer::ElectronADCGain_
double ElectronADCGain_
Definition: RPixDetClusterizer.h:62
RPixDetClusterizer::VcaltoElectronOffset_
int VcaltoElectronOffset_
Definition: RPixDetClusterizer.h:64
RPixDetClusterizer::calib_rpix_digi_map_
std::map< unsigned int, RPixCalibDigi > calib_rpix_digi_map_
Definition: RPixDetClusterizer.h:57
ParameterSet.h
RPixDetClusterizer::calibrate
int calibrate(unsigned int, int, int, int, const CTPPSPixelGainCalibrations *pcalibration)
Definition: RPixDetClusterizer.cc:121
CTPPSPixelGainCalibrationDBService.h
CTPPSPixelDigiCollection.h
RPixDetClusterizer::VcaltoElectronGain_
int VcaltoElectronGain_
Definition: RPixDetClusterizer.h:63