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
SiStripFedZeroSuppression::theNextFEDlowThresh
int16_t theNextFEDlowThresh
Definition: SiStripFedZeroSuppression.h:77
MessageLogger.h
SiStripFedZeroSuppression::thresholdToken_
edm::ESGetToken< SiStripThreshold, SiStripThresholdRcd > thresholdToken_
Definition: SiStripFedZeroSuppression.h:54
SiStripFedZeroSuppression::doTruncate10bits
bool doTruncate10bits
Definition: SiStripFedZeroSuppression.h:64
edm::ESWatcher< SiStripNoisesRcd >
SiStripNoises
Definition: SiStripNoises.h:25
SiStripFedZeroSuppression::thresholdWatcher_
edm::ESWatcher< SiStripThresholdRcd > thresholdWatcher_
Definition: SiStripFedZeroSuppression.h:58
edm::DetSet
Definition: DetSet.h:23
SiStripFedZeroSuppression::theFEDlowThresh
int16_t theFEDlowThresh
Definition: SiStripFedZeroSuppression.h:65
SiStripRawProcessingFactory
Definition: SiStripRawProcessingFactory.h:15
SiStripFedZeroSuppression::doTruncate
bool doTruncate
Definition: SiStripFedZeroSuppression.h:63
SiStripFedZeroSuppression::highThr_
std::vector< int16_t > highThr_
Definition: SiStripFedZeroSuppression.h:87
SiStripFedZeroSuppression::theFEDalgorithm
uint16_t theFEDalgorithm
Definition: SiStripFedZeroSuppression.h:60
SiStripRawDigi.h
SiStripFedZeroSuppression::theNext2FEDlowThresh
int16_t theNext2FEDlowThresh
Definition: SiStripFedZeroSuppression.h:84
SiStripFedZeroSuppression::adcPrev2
int16_t adcPrev2
Definition: SiStripFedZeroSuppression.h:72
SiStripFedZeroSuppression::threshold_
const SiStripThreshold * threshold_
Definition: SiStripFedZeroSuppression.h:56
SiStripFedZeroSuppression::theNeighFEDlowThresh
int16_t theNeighFEDlowThresh
Definition: SiStripFedZeroSuppression.h:80
SiStripNoisesRcd
Definition: SiStripCondDataRecords.h:40
SiStripFedZeroSuppression::lowThrSN_
std::vector< float > lowThrSN_
Definition: SiStripFedZeroSuppression.h:88
SiStripFedZeroSuppression::noise_
const SiStripNoises * noise_
Definition: SiStripFedZeroSuppression.h:55
SiStripFedZeroSuppression::adcMaxNeigh
int16_t adcMaxNeigh
Definition: SiStripFedZeroSuppression.h:71
SiStripFedZeroSuppression::~SiStripFedZeroSuppression
~SiStripFedZeroSuppression()
Definition: SiStripFedZeroSuppression.h:35
SiStripFedZeroSuppression::adcPrev
int16_t adcPrev
Definition: SiStripFedZeroSuppression.h:69
SiStripFedZeroSuppression::isAValidDigi
bool isAValidDigi()
Definition: SiStripFedZeroSuppression.cc:363
SiStripDigi.h
SiStripFedZeroSuppression
Definition: SiStripFedZeroSuppression.h:20
SiStripFedZeroSuppression::noises_
std::vector< float > noises_
Definition: SiStripFedZeroSuppression.h:89
SiStripFedZeroSuppression::highThrSN_
std::vector< float > highThrSN_
Definition: SiStripFedZeroSuppression.h:88
SiStripFedZeroSuppression::adc
int16_t adc
Definition: SiStripFedZeroSuppression.h:68
SiStripThresholdRcd
Definition: SiStripCondDataRecords.h:50
SiStripFedZeroSuppression::noiseWatcher_
edm::ESWatcher< SiStripNoisesRcd > noiseWatcher_
Definition: SiStripFedZeroSuppression.h:57
SiStripFedZeroSuppression::thePrevFEDhighThresh
int16_t thePrevFEDhighThresh
Definition: SiStripFedZeroSuppression.h:76
SiStripFedZeroSuppression::adcNext2
int16_t adcNext2
Definition: SiStripFedZeroSuppression.h:73
recoMuon::in
Definition: RecoMuonEnumerators.h:6
SiStripThresholdRcd.h
edm::EventSetup
Definition: EventSetup.h:58
DetSetVector.h
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd >
SiStripFedZeroSuppression::lowThr_
std::vector< int16_t > lowThr_
Definition: SiStripFedZeroSuppression.h:87
SiStripThreshold
Definition: __init__.py:1
SiStripFedZeroSuppression::thePrev2FEDlowThresh
int16_t thePrev2FEDlowThresh
Definition: SiStripFedZeroSuppression.h:83
SiStripFedZeroSuppression::theFEDhighThresh
int16_t theFEDhighThresh
Definition: SiStripFedZeroSuppression.h:66
SiStripFedZeroSuppression::init
void init(const edm::EventSetup &es)
Definition: SiStripFedZeroSuppression.cc:12
SiStripFedZeroSuppression::fillThresholds_
void fillThresholds_(const uint32_t detID, size_t size)
Definition: SiStripFedZeroSuppression.cc:227
ESWatcher.h
SiStripFedZeroSuppression::theNeighFEDhighThresh
int16_t theNeighFEDhighThresh
Definition: SiStripFedZeroSuppression.h:81
EventSetup.h
SiStripFedZeroSuppression::theNextFEDhighThresh
int16_t theNextFEDhighThresh
Definition: SiStripFedZeroSuppression.h:78
SiStripFedZeroSuppression::noiseToken_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
Definition: SiStripFedZeroSuppression.h:50
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
SiStripFedZeroSuppression::suppress
void suppress(const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId, const SiStripNoises &, const SiStripThreshold &)
Definition: SiStripFedZeroSuppression.cc:27
SiStripNoisesRcd.h
ConsumesCollector.h
SiStripFedZeroSuppression::thePrevFEDlowThresh
int16_t thePrevFEDlowThresh
Definition: SiStripFedZeroSuppression.h:75
pileupReCalc_HLTpaths.trunc
trunc
Definition: pileupReCalc_HLTpaths.py:143
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
SiStripFedZeroSuppression::SiStripFedZeroSuppression
SiStripFedZeroSuppression(uint16_t fedalgo, edm::ConsumesCollector *iC=nullptr, bool trunc=true, bool trunc10bits=false)
Definition: SiStripFedZeroSuppression.h:24
SiStripFedZeroSuppression::adcNext
int16_t adcNext
Definition: SiStripFedZeroSuppression.h:70
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
SiStripFedZeroSuppression::truncate
uint16_t truncate(int16_t adc) const
Definition: SiStripFedZeroSuppression.h:46