CMS 3D CMS Logo

SiStripFedZeroSuppression.h
Go to the documentation of this file.
1 #ifndef RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPZEROSUPPRESSOR_H
2 #define RECOLOCALTRACKER_SISTRIPZEROSUPPRESSION_SISTRIPZEROSUPPRESSOR_H
3 
8 
12 
15 
16 #include <vector>
17 class SiStripNoises;
18 class SiStripThreshold;
19 
22 
23 public:
24  SiStripFedZeroSuppression(uint16_t fedalgo,
25  edm::ConsumesCollector* iC = nullptr,
26  bool trunc = true,
27  bool trunc10bits = false)
28  : noiseToken_{iC ? decltype(noiseToken_){iC->esConsumes<SiStripNoises, SiStripNoisesRcd>()}
29  : decltype(noiseToken_){}},
30  thresholdToken_{iC ? decltype(thresholdToken_){iC->esConsumes<SiStripThreshold, SiStripThresholdRcd>()}
31  : decltype(thresholdToken_){}},
32  theFEDalgorithm(fedalgo),
34  doTruncate10bits(trunc10bits) {}
36  void init(const edm::EventSetup& es);
37  void suppress(const std::vector<SiStripDigi>& in,
38  std::vector<SiStripDigi>& selectedSignal,
39  uint32_t detId,
40  const SiStripNoises&,
41  const SiStripThreshold&);
42  void suppress(const std::vector<SiStripDigi>& in, std::vector<SiStripDigi>& selectedSignal, uint32_t detId);
44  void suppress(const std::vector<int16_t>& in, uint16_t firstAPV, edm::DetSet<SiStripDigi>& out);
45 
46  uint16_t truncate(int16_t adc) const {
47  if (adc > 253 && doTruncate && !doTruncate10bits)
48  return ((adc == 1023) ? 255 : 254);
49  return adc;
50  };
51 
52 private:
59 
60  uint16_t theFEDalgorithm;
61  bool isAValidDigi();
62 
63  bool doTruncate;
65  int16_t theFEDlowThresh;
67 
68  int16_t adc;
69  int16_t adcPrev;
70  int16_t adcNext;
71  int16_t adcMaxNeigh;
72  int16_t adcPrev2;
73  int16_t adcNext2;
74 
79 
82 
85 
86  // working caches
87  std::vector<int16_t> highThr_, lowThr_; // thresholds in adc counts
88  std::vector<float> highThrSN_, lowThrSN_; // thresholds as S/N
89  std::vector<float> noises_;
90 
91  void fillThresholds_(const uint32_t detID, size_t size);
92 };
93 #endif
size
Write out results.
void init(const edm::EventSetup &es)
edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > thresholdToken_
edm::ESWatcher< SiStripNoisesRcd > noiseWatcher_
const SiStripThreshold * threshold_
uint16_t truncate(int16_t adc) const
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
void suppress(const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId, const SiStripNoises &, const SiStripThreshold &)
SiStripFedZeroSuppression(uint16_t fedalgo, edm::ConsumesCollector *iC=nullptr, bool trunc=true, bool trunc10bits=false)
edm::ESWatcher< SiStripThresholdRcd > thresholdWatcher_
void fillThresholds_(const uint32_t detID, size_t size)