CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends
SiStripFedZeroSuppression Class Reference

#include <SiStripFedZeroSuppression.h>

Public Member Functions

 doTruncate (trunc)
 
 doTruncate10bits (trunc10bits)
 
void init (const edm::EventSetup &es)
 
 SiStripFedZeroSuppression (uint16_t fedalgo, edm::ConsumesCollector *iC=nullptr, bool trunc=true, bool trunc10bits=false)
 
void suppress (const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId, const SiStripNoises &, const SiStripThreshold &)
 
void suppress (const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId)
 
void suppress (const edm::DetSet< SiStripRawDigi > &in, edm::DetSet< SiStripDigi > &out)
 
void suppress (const std::vector< int16_t > &in, uint16_t firstAPV, edm::DetSet< SiStripDigi > &out)
 
 theFEDalgorithm (fedalgo)
 
uint16_t truncate (int16_t adc) const
 
 ~SiStripFedZeroSuppression ()
 

Public Attributes

 __pad0__: decltype(noiseToken_){}}
 
 thresholdToken_
 

Private Member Functions

void fillThresholds_ (const uint32_t detID, size_t size)
 
bool isAValidDigi ()
 

Private Attributes

int16_t adc
 
int16_t adcMaxNeigh
 
int16_t adcNext
 
int16_t adcNext2
 
int16_t adcPrev
 
int16_t adcPrev2
 
bool doTruncate
 
bool doTruncate10bits
 
std::vector< int16_t > highThr_
 
std::vector< float > highThrSN_
 
std::vector< int16_t > lowThr_
 
std::vector< float > lowThrSN_
 
const SiStripNoisesnoise_
 
std::vector< float > noises_
 
edm::ESGetToken< SiStripNoises,
SiStripNoisesRcd
noiseToken_
 
edm::ESWatcher< SiStripNoisesRcdnoiseWatcher_
 
uint16_t theFEDalgorithm
 
int16_t theFEDhighThresh
 
int16_t theFEDlowThresh
 
int16_t theNeighFEDhighThresh
 
int16_t theNeighFEDlowThresh
 
int16_t theNext2FEDlowThresh
 
int16_t theNextFEDhighThresh
 
int16_t theNextFEDlowThresh
 
int16_t thePrev2FEDlowThresh
 
int16_t thePrevFEDhighThresh
 
int16_t thePrevFEDlowThresh
 
const SiStripThresholdthreshold_
 
edm::ESGetToken
< SiStripThreshold,
SiStripThresholdRcd
thresholdToken_
 
edm::ESWatcher
< SiStripThresholdRcd
thresholdWatcher_
 

Friends

class SiStripRawProcessingFactory
 

Detailed Description

Definition at line 20 of file SiStripFedZeroSuppression.h.

Constructor & Destructor Documentation

SiStripFedZeroSuppression::SiStripFedZeroSuppression ( uint16_t  fedalgo,
edm::ConsumesCollector iC = nullptr,
bool  trunc = true,
bool  trunc10bits = false 
)
inline

Definition at line 24 of file SiStripFedZeroSuppression.h.

References noiseToken_.

SiStripFedZeroSuppression::~SiStripFedZeroSuppression ( )
inline

Definition at line 35 of file SiStripFedZeroSuppression.h.

35 {};

Member Function Documentation

SiStripFedZeroSuppression::doTruncate ( trunc  )
SiStripFedZeroSuppression::doTruncate10bits ( trunc10bits  )
inline

Definition at line 34 of file SiStripFedZeroSuppression.h.

34 {}
void SiStripFedZeroSuppression::fillThresholds_ ( const uint32_t  detID,
size_t  size 
)
private

Definition at line 227 of file SiStripFedZeroSuppression.cc.

References alignCSCRings::e, gpuVertexFinder::noise, sistrip::extrainfo::noise_, findQualityFiles::size, and digitizers_cfi::strip.

227  {
228  SiStripNoises::Range detNoiseRange = noise_->getRange(detID);
229  SiStripThreshold::Range detThRange = threshold_->getRange(detID);
230 
231  if (highThr_.size() != size) {
232  highThr_.resize(size);
233  lowThr_.resize(size);
234  noises_.resize(size);
235  highThrSN_.resize(size);
236  lowThrSN_.resize(size);
237  }
238 
239  noise_->allNoises(noises_, detNoiseRange);
240  threshold_->allThresholds(lowThrSN_, highThrSN_, detThRange); // thresholds as S/N
241  for (size_t strip = 0; strip < size; ++strip) {
242  float noise = noises_[strip];
243  // uncomment line below to check bluk noise decoding
244  //assert( noise == noiseHandle->getNoiseFast(strip,detNoiseRange) );
245  highThr_[strip] = static_cast<int16_t>(highThrSN_[strip] * noise + 0.5 + 1e-6);
246  lowThr_[strip] = static_cast<int16_t>(lowThrSN_[strip] * noise + 0.5 + 1e-6);
247  // Note: it's a bit wierd, but there are some cases for which 'highThrSN_[strip]*noise' is an exact integer
248  // but due to roundoffs it gets rounded to the integer below if.
249  // Apparently the optimized code inlines differently and this changes the roundoff.
250  // The +1e-6 fixes the problem. [GPetruc]
251  }
252 }
void allThresholds(std::vector< float > &lowThs, std::vector< float > &highThs, const Range &range) const
const SiStripThreshold * threshold_
__shared__ int noise
std::pair< ContainerIterator, ContainerIterator > Range
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
const Range getRange(const uint32_t &detID) const
void allNoises(std::vector< float > &noises, const Range &range) const
tuple size
Write out results.
void SiStripFedZeroSuppression::init ( const edm::EventSetup es)

Definition at line 12 of file SiStripFedZeroSuppression.cc.

References edm::EventSetup::getData(), and sistrip::extrainfo::noise_.

12  {
13  if (noiseWatcher_.check(es)) {
14  noise_ = &es.getData(noiseToken_);
15  }
16  if (thresholdWatcher_.check(es)) {
18  }
19 }
bool getData(T &iHolder) const
Definition: EventSetup.h:128
edm::ESWatcher< SiStripNoisesRcd > noiseWatcher_
const SiStripThreshold * threshold_
edm::ESGetToken< SiStripNoises, SiStripNoisesRcd > noiseToken_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::ESWatcher< SiStripThresholdRcd > thresholdWatcher_
bool SiStripFedZeroSuppression::isAValidDigi ( )
private

Definition at line 363 of file SiStripFedZeroSuppression.cc.

References accept(), gpuClustering::adc, edm::isDebugEnabled(), and LogTrace.

363  {
364 #ifdef DEBUG_SiStripZeroSuppression_
365 
366  if (edm::isDebugEnabled()) {
367  LogTrace("SiStripZeroSuppression") << "[SiStripFedZeroSuppression::suppress] "
368  << "\n\t adc " << adc << "\n\t adcPrev " << adcPrev << "\n\t adcNext " << adcNext
369  << "\n\t adcMaxNeigh " << adcMaxNeigh << "\n\t adcPrev2 " << adcPrev2
370  << "\n\t adcNext2 " << adcNext2 << std::endl;
371 
372  LogTrace("SiStripZeroSuppression") << "[SiStripFedZeroSuppression::suppress] "
373  << "\n\t theFEDlowThresh " << theFEDlowThresh << "\n\t theFEDhighThresh "
374  << theFEDhighThresh << "\n\t thePrevFEDlowThresh " << thePrevFEDlowThresh
375  << "\n\t thePrevFEDhighThresh " << thePrevFEDhighThresh
376  << "\n\t theNextFEDlowThresh " << theNextFEDlowThresh
377  << "\n\t theNextFEDhighThresh " << theNextFEDhighThresh
378  << "\n\t theNeighFEDlowThresh " << theNeighFEDlowThresh
379  << "\n\t theNeighFEDhighThresh " << theNeighFEDhighThresh
380  << "\n\t thePrev2FEDlowThresh " << thePrev2FEDlowThresh
381  << "\n\t theNext2FEDlowThresh " << theNext2FEDlowThresh << std::endl;
382  }
383 #endif
384  // Decide if this strip should be accepted.
385  bool accept = false;
386  switch (theFEDalgorithm) {
387  case 1:
388  accept = (adc >= theFEDlowThresh);
389  break;
390  case 2:
392  break;
393  case 3:
394  accept = (adc >= theFEDhighThresh || (adc >= theFEDlowThresh && adcMaxNeigh >= theNeighFEDhighThresh));
395  break;
396  case 4:
397  accept =
398  ((adc >= theFEDhighThresh) //Test for adc>highThresh (same as algorithm 2)
399  || ((adc >= theFEDlowThresh) //Test for adc>lowThresh, with neighbour adc>lowThresh (same as algorithm 2)
400  && (adcMaxNeigh >= theNeighFEDlowThresh)) ||
401  ((adc < theFEDlowThresh) //Test for adc<lowThresh
402  && (((adcPrev >= thePrevFEDhighThresh) //with both neighbours>highThresh
403  && (adcNext >= theNextFEDhighThresh)) ||
404  ((adcPrev >= thePrevFEDhighThresh) //OR with previous neighbour>highThresh and
405  && (adcNext >= theNextFEDlowThresh) //both the next neighbours>lowThresh
406  && (adcNext2 >= theNext2FEDlowThresh)) ||
407  ((adcNext >= theNextFEDhighThresh) //OR with next neighbour>highThresh and
408  && (adcPrev >= thePrevFEDlowThresh) //both the previous neighbours>lowThresh
409  && (adcPrev2 >= thePrev2FEDlowThresh)) ||
410  ((adcNext >= theNextFEDlowThresh) //OR with both next neighbours>lowThresh and
411  && (adcNext2 >= theNext2FEDlowThresh) //both the previous neighbours>lowThresh
413  break;
414  case 5:
415  accept = adc > 0;
416  break;
417  }
418  return accept;
419 }
bool isDebugEnabled()
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
#define LogTrace(id)
void SiStripFedZeroSuppression::suppress ( const std::vector< SiStripDigi > &  in,
std::vector< SiStripDigi > &  selectedSignal,
uint32_t  detId,
const SiStripNoises noise,
const SiStripThreshold threshold 
)

Definition at line 27 of file SiStripFedZeroSuppression.cc.

References gpuClustering::adc, SiStripThreshold::getData(), SiStripThreshold::Data::getHth(), SiStripThreshold::Data::getLth(), SiStripNoises::getNoiseFast(), SiStripNoises::getRange(), SiStripThreshold::getRange(), mps_fire::i, digitizers_cfi::strip, and lowPtGsfElectronSeeds_cfi::thresholds().

Referenced by DigiSimLinkAlgorithm::run().

31  {
32  int i;
33  int inSize = in.size();
34  SiStripNoises::Range detNoiseRange = noise.getRange(detID);
35  SiStripThreshold::Range detThRange = threshold.getRange(detID);
36 
37  // reserving more than needed, but quicker than one at a time
38  selectedSignal.clear();
39  selectedSignal.reserve(inSize);
40  for (i = 0; i < inSize; i++) {
41  //Find adc values for neighbouring strips
42  const uint32_t strip = (uint32_t)in[i].strip();
43 
44  adc = in[i].adc();
45 
46  SiStripThreshold::Data thresholds = threshold.getData(strip, detThRange);
47  theFEDlowThresh = static_cast<int16_t>(thresholds.getLth() * noise.getNoiseFast(strip, detNoiseRange) + 0.5);
48  theFEDhighThresh = static_cast<int16_t>(thresholds.getHth() * noise.getNoiseFast(strip, detNoiseRange) + 0.5);
49 
50  adcPrev = -9999;
51  adcNext = -9999;
52  adcPrev2 = -9999;
53  adcNext2 = -9999;
54 
55  /*
56  Since we are not running on
57  Raw data we need to initialize
58  all the FED threshold
59  */
60 
66 
70 
71  if (((strip) % 128) == 127) {
72  adcNext = 0;
73  theNextFEDlowThresh = 9999;
74  theNextFEDhighThresh = 9999;
75  } else if (i + 1 < inSize && in[i + 1].strip() == strip + 1) {
76  adcNext = in[i + 1].adc();
77  SiStripThreshold::Data thresholds_1 = threshold.getData(strip + 1, detThRange);
79  static_cast<int16_t>(thresholds_1.getLth() * noise.getNoiseFast(strip + 1, detNoiseRange) + 0.5);
81  static_cast<int16_t>(thresholds_1.getHth() * noise.getNoiseFast(strip + 1, detNoiseRange) + 0.5);
82  if (((strip) % 128) == 126) {
83  adcNext2 = 0;
84  theNext2FEDlowThresh = 9999;
85  } else if (i + 2 < inSize && in[i + 2].strip() == strip + 2) {
86  adcNext2 = in[i + 2].adc();
87  theNext2FEDlowThresh = static_cast<int16_t>(
88  threshold.getData(strip + 2, detThRange).getLth() * noise.getNoiseFast(strip + 2, detNoiseRange) + 0.5);
89  }
90  }
91 
92  if (((strip) % 128) == 0) {
93  adcPrev = 0;
94  thePrevFEDlowThresh = 9999;
95  thePrevFEDhighThresh = 9999;
96  } else if (i - 1 >= 0 && in[i - 1].strip() == strip - 1) {
97  adcPrev = in[i - 1].adc();
98  SiStripThreshold::Data thresholds_1 = threshold.getData(strip - 1, detThRange);
100  static_cast<int16_t>(thresholds_1.getLth() * noise.getNoiseFast(strip - 1, detNoiseRange) + 0.5);
102  static_cast<int16_t>(thresholds_1.getHth() * noise.getNoiseFast(strip - 1, detNoiseRange) + 0.5);
103  if (((strip) % 128) == 1) {
104  adcPrev2 = 0;
105  thePrev2FEDlowThresh = 9999;
106  } else if (i - 2 >= 0 && in[i - 2].strip() == strip - 2) {
107  adcPrev2 = in[i - 2].adc();
108  thePrev2FEDlowThresh = static_cast<int16_t>(
109  threshold.getData(strip - 2, detThRange).getLth() * noise.getNoiseFast(strip - 2, detNoiseRange) + 0.5);
110  }
111  }
112 
113  if (adcNext <= adcPrev) {
117  } else {
121  }
122 
123  if (isAValidDigi()) {
124  selectedSignal.push_back(SiStripDigi(strip, adc));
125  }
126  }
127 }
static float getNoiseFast(const uint16_t &strip, const Range &range)
Definition: SiStripNoises.h:68
SiStripThreshold::Data getData(const uint16_t &strip, const Range &range) const
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
std::pair< ContainerIterator, ContainerIterator > Range
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
const Range getRange(const uint32_t &detID) const
void SiStripFedZeroSuppression::suppress ( const std::vector< SiStripDigi > &  in,
std::vector< SiStripDigi > &  selectedSignal,
uint32_t  detId 
)

Definition at line 21 of file SiStripFedZeroSuppression.cc.

References sistrip::extrainfo::noise_, and suppress.

23  {
24  suppress(in, selectedSignal, detID, *noise_, *threshold_);
25 }
const SiStripThreshold * threshold_
void suppress(const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId, const SiStripNoises &, const SiStripThreshold &)
void SiStripFedZeroSuppression::suppress ( const edm::DetSet< SiStripRawDigi > &  in,
edm::DetSet< SiStripDigi > &  out 
)

Definition at line 129 of file SiStripFedZeroSuppression.cc.

References gpuClustering::adc, edm::DetSet< T >::data, SiStripThreshold::Data::getHth(), SiStripThreshold::Data::getLth(), edm::DetSet< T >::id, edm::isDebugEnabled(), LogTrace, sistrip::extrainfo::noise_, digitizers_cfi::strip, and lowPtGsfElectronSeeds_cfi::thresholds().

129  {
130  const uint32_t detID = out.id;
131  SiStripNoises::Range detNoiseRange = noise_->getRange(detID);
132  SiStripThreshold::Range detThRange = threshold_->getRange(detID);
133 #ifdef DEBUG_SiStripZeroSuppression_
134  if (edm::isDebugEnabled())
135  LogTrace("SiStripZeroSuppression")
136  << "[SiStripFedZeroSuppression::suppress] Zero suppression on edm::DetSet<SiStripRawDigi>: detID " << detID
137  << " size = " << in.data.size();
138 #endif
140  for (; in_iter != in.data.end(); in_iter++) {
141  const uint32_t strip = (uint32_t)(in_iter - in.data.begin());
142 
143 #ifdef DEBUG_SiStripZeroSuppression_
144  if (edm::isDebugEnabled())
145  LogTrace("SiStripZeroSuppression") << "[SiStripFedZeroSuppression::suppress] detID= " << detID
146  << " strip= " << strip << " adc= " << in_iter->adc();
147 #endif
148  adc = in_iter->adc();
149 
150  SiStripThreshold::Data thresholds = threshold_->getData(strip, detThRange);
151  theFEDlowThresh = static_cast<int16_t>(thresholds.getLth() * noise_->getNoiseFast(strip, detNoiseRange) + 0.5);
152  theFEDhighThresh = static_cast<int16_t>(thresholds.getHth() * noise_->getNoiseFast(strip, detNoiseRange) + 0.5);
153 
154  adcPrev = -9999;
155  adcNext = -9999;
156  /*
157  If a strip is the last one on the chip
158  set its next neighbor's thresholds to infinity
159  because the FED does not merge clusters across
160  chip boundaries right now
161  */
162  if (strip % 128 == 127) {
163  adcNext = 0;
164  theNextFEDlowThresh = 9999;
165  theNextFEDhighThresh = 9999;
166  } else {
167  adcNext = (in_iter + 1)->adc();
168  SiStripThreshold::Data thresholds_1 = threshold_->getData(strip + 1, detThRange);
170  static_cast<int16_t>(thresholds_1.getLth() * noise_->getNoiseFast(strip + 1, detNoiseRange) + 0.5);
172  static_cast<int16_t>(thresholds_1.getHth() * noise_->getNoiseFast(strip + 1, detNoiseRange) + 0.5);
173  }
174  /*
175  Similarily, for the first strip
176  on a chip
177  */
178  if (strip % 128 == 0) {
179  adcPrev = 0;
180  thePrevFEDlowThresh = 9999;
181  thePrevFEDhighThresh = 9999;
182  } else {
183  adcPrev = (in_iter - 1)->adc();
184  SiStripThreshold::Data thresholds_1 = threshold_->getData(strip - 1, detThRange);
186  static_cast<int16_t>(thresholds_1.getLth() * noise_->getNoiseFast(strip - 1, detNoiseRange) + 0.5);
188  static_cast<int16_t>(thresholds_1.getHth() * noise_->getNoiseFast(strip - 1, detNoiseRange) + 0.5);
189  }
190  if (adcNext < adcPrev) {
194  } else {
198  }
199 
200  //Find adc values for next neighbouring strips
201  adcPrev2 = -9999;
202  adcNext2 = -9999;
205  if (strip % 128 >= 126) {
206  adcNext2 = 0;
207  theNext2FEDlowThresh = 9999;
208  } else if (strip % 128 < 126) {
209  adcNext2 = (in_iter + 2)->adc();
210  theNext2FEDlowThresh = static_cast<int16_t>(
211  threshold_->getData(strip + 2, detThRange).getLth() * noise_->getNoiseFast(strip + 2, detNoiseRange) + 0.5);
212  }
213  if (strip % 128 <= 1) {
214  adcPrev2 = 0;
215  thePrev2FEDlowThresh = 9999;
216  } else if (strip % 128 > 1) {
217  adcPrev2 = (in_iter - 2)->adc();
218  thePrev2FEDlowThresh = static_cast<int16_t>(
219  threshold_->getData(strip - 2, detThRange).getLth() * noise_->getNoiseFast(strip - 2, detNoiseRange) + 0.5);
220  }
221  //GB 23/6/08: truncation should be done at the very beginning
222  if (isAValidDigi())
223  out.data.push_back(SiStripDigi(strip, truncate(in_iter->adc())));
224  }
225 }
bool isDebugEnabled()
uint16_t truncate(int16_t adc) const
#define LogTrace(id)
static float getNoiseFast(const uint16_t &strip, const Range &range)
Definition: SiStripNoises.h:68
const SiStripThreshold * threshold_
SiStripThreshold::Data getData(const uint16_t &strip, const Range &range) const
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
std::pair< ContainerIterator, ContainerIterator > Range
collection_type data
Definition: DetSet.h:80
const Range getRange(const uint32_t detID) const
det_id_type id
Definition: DetSet.h:79
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
const Range getRange(const uint32_t &detID) const
void SiStripFedZeroSuppression::suppress ( const std::vector< int16_t > &  in,
uint16_t  firstAPV,
edm::DetSet< SiStripDigi > &  out 
)

Definition at line 254 of file SiStripFedZeroSuppression.cc.

References gpuClustering::adc, edm::DetSet< T >::data, edm::DetSet< T >::id, edm::isDebugEnabled(), LogTrace, edm::DetSet< T >::push_back(), findQualityFiles::size, and digitizers_cfi::strip.

256  {
257  const uint32_t detID = out.id;
258  size_t size = in.size();
259 #ifdef DEBUG_SiStripZeroSuppression_
260  if (edm::isDebugEnabled())
261  LogTrace("SiStripZeroSuppression")
262  << "[SiStripFedZeroSuppression::suppress] Zero suppression on std::vector<int16_t>: detID " << detID
263  << " size = " << in.size();
264 #endif
265 
266  fillThresholds_(detID, size + firstAPV * 128); // want to decouple this from the other cost
267 
268  std::vector<int16_t>::const_iterator in_iter = in.begin();
269  uint16_t strip = firstAPV * 128;
270  for (; strip < size + firstAPV * 128; ++strip, ++in_iter) {
271  size_t strip_mod_128 = strip & 127;
272 #ifdef DEBUG_SiStripZeroSuppression_
273  if (edm::isDebugEnabled())
274  LogTrace("SiStripZeroSuppression") << "[SiStripFedZeroSuppression::suppress] detID= " << detID
275  << " strip= " << strip << " adc= " << *in_iter;
276 #endif
277  adc = *in_iter;
278 
281 
282  //Find adc values for neighbouring strips
283 
284  /*
285  If a strip is the last one on the chip
286  set its next neighbor's thresholds to infinity
287  because the FED does not merge clusters across
288  chip boundaries right now
289  */
290 
291  //adcPrev = -9999; // useless, they are set
292  //adcNext = -9999; // in the next lines in any case
293  if (strip_mod_128 == 127) {
294  adcNext = 0;
295  theNextFEDlowThresh = 9999;
296  theNextFEDhighThresh = 9999;
297  } else {
298  adcNext = *(in_iter + 1);
299  theNextFEDlowThresh = lowThr_[strip + 1];
300  theNextFEDhighThresh = highThr_[strip + 1];
301  }
302 
303  /*
304  Similarily, for the first strip
305  on a chip
306  */
307  if (strip_mod_128 == 0) {
308  adcPrev = 0;
309  thePrevFEDlowThresh = 9999;
310  thePrevFEDhighThresh = 9999;
311  } else {
312  adcPrev = *(in_iter - 1);
313  thePrevFEDlowThresh = lowThr_[strip - 1];
314  thePrevFEDhighThresh = highThr_[strip - 1];
315  }
316 
317  if (adcNext < adcPrev) {
321  } else {
325  }
326 
327  //Find adc values for next neighbouring strips
328  //adcPrev2 = -9999; //
329  //adcNext2 = -9999; // useless to set them here
330  //thePrev2FEDlowThresh = 1; // they are overwritten always in the next 8 lines
331  //theNext2FEDlowThresh = 1; //
332  if (strip_mod_128 >= 126) {
333  adcNext2 = 0;
334  theNext2FEDlowThresh = 9999;
335  //} else if ( strip_mod_128 < 126 ) { // if it's not >= then is <, no need to "if" again
336  } else {
337  adcNext2 = *(in_iter + 2);
338  theNext2FEDlowThresh = lowThr_[strip + 2];
339  }
340  if (strip_mod_128 <= 1) {
341  adcPrev2 = 0;
342  thePrev2FEDlowThresh = 9999;
343  //} else if ( strip_mod_128 > 1 ) { // same as above
344  } else {
345  adcPrev2 = *(in_iter - 2);
346  thePrev2FEDlowThresh = lowThr_[strip - 2];
347  ;
348  }
349 
350  if (isAValidDigi()) {
351 #ifdef DEBUG_SiStripZeroSuppression_
352  if (edm::isDebugEnabled())
353  LogTrace("SiStripZeroSuppression")
354  << "[SiStripFedZeroSuppression::suppress] DetId " << out.id << " strip " << strip << " adc " << *in_iter
355  << " digiCollection size " << out.data.size();
356 #endif
357  //GB 23/6/08: truncation should be done at the very beginning
358  out.push_back(SiStripDigi(strip, (*in_iter < 0 ? 0 : truncate(*in_iter))));
359  }
360  }
361 }
bool isDebugEnabled()
void push_back(const T &t)
Definition: DetSet.h:66
uint16_t truncate(int16_t adc) const
#define LogTrace(id)
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
collection_type data
Definition: DetSet.h:80
det_id_type id
Definition: DetSet.h:79
void fillThresholds_(const uint32_t detID, size_t size)
tuple size
Write out results.
SiStripFedZeroSuppression::theFEDalgorithm ( fedalgo  )
uint16_t SiStripFedZeroSuppression::truncate ( int16_t  adc) const
inline

Definition at line 46 of file SiStripFedZeroSuppression.h.

References adc, doTruncate, and doTruncate10bits.

46  {
47  if (adc > 253 && doTruncate && !doTruncate10bits)
48  return ((adc == 1023) ? 255 : 254);
49  return adc;
50  };

Friends And Related Function Documentation

friend class SiStripRawProcessingFactory
friend

Definition at line 21 of file SiStripFedZeroSuppression.h.

Member Data Documentation

SiStripFedZeroSuppression::__pad0__

Definition at line 29 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adc
private

Definition at line 68 of file SiStripFedZeroSuppression.h.

Referenced by truncate().

int16_t SiStripFedZeroSuppression::adcMaxNeigh
private

Definition at line 71 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcNext
private

Definition at line 70 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcNext2
private

Definition at line 73 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcPrev
private

Definition at line 69 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcPrev2
private

Definition at line 72 of file SiStripFedZeroSuppression.h.

bool SiStripFedZeroSuppression::doTruncate
private

Definition at line 63 of file SiStripFedZeroSuppression.h.

Referenced by truncate().

bool SiStripFedZeroSuppression::doTruncate10bits
private

Definition at line 64 of file SiStripFedZeroSuppression.h.

Referenced by truncate().

std::vector<int16_t> SiStripFedZeroSuppression::highThr_
private

Definition at line 87 of file SiStripFedZeroSuppression.h.

std::vector<float> SiStripFedZeroSuppression::highThrSN_
private

Definition at line 88 of file SiStripFedZeroSuppression.h.

std::vector<int16_t> SiStripFedZeroSuppression::lowThr_
private

Definition at line 87 of file SiStripFedZeroSuppression.h.

std::vector<float> SiStripFedZeroSuppression::lowThrSN_
private

Definition at line 88 of file SiStripFedZeroSuppression.h.

const SiStripNoises* SiStripFedZeroSuppression::noise_
private

Definition at line 55 of file SiStripFedZeroSuppression.h.

std::vector<float> SiStripFedZeroSuppression::noises_
private

Definition at line 89 of file SiStripFedZeroSuppression.h.

edm::ESGetToken<SiStripNoises, SiStripNoisesRcd> SiStripFedZeroSuppression::noiseToken_
private

Definition at line 50 of file SiStripFedZeroSuppression.h.

Referenced by SiStripFedZeroSuppression().

edm::ESWatcher<SiStripNoisesRcd> SiStripFedZeroSuppression::noiseWatcher_
private

Definition at line 57 of file SiStripFedZeroSuppression.h.

uint16_t SiStripFedZeroSuppression::theFEDalgorithm
private

Definition at line 60 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theFEDhighThresh
private

Definition at line 66 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theFEDlowThresh
private

Definition at line 65 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNeighFEDhighThresh
private

Definition at line 81 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNeighFEDlowThresh
private

Definition at line 80 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNext2FEDlowThresh
private

Definition at line 84 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNextFEDhighThresh
private

Definition at line 78 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNextFEDlowThresh
private

Definition at line 77 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::thePrev2FEDlowThresh
private

Definition at line 83 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::thePrevFEDhighThresh
private

Definition at line 76 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::thePrevFEDlowThresh
private

Definition at line 75 of file SiStripFedZeroSuppression.h.

const SiStripThreshold* SiStripFedZeroSuppression::threshold_
private

Definition at line 56 of file SiStripFedZeroSuppression.h.

SiStripFedZeroSuppression::thresholdToken_
Initial value:
{iC ? decltype(thresholdToken_){iC->esConsumes<SiStripThreshold, SiStripThresholdRcd>()}
: decltype(thresholdToken_){}}

Definition at line 30 of file SiStripFedZeroSuppression.h.

edm::ESGetToken<SiStripThreshold, SiStripThresholdRcd> SiStripFedZeroSuppression::thresholdToken_
private

Definition at line 54 of file SiStripFedZeroSuppression.h.

edm::ESWatcher<SiStripThresholdRcd> SiStripFedZeroSuppression::thresholdWatcher_
private

Definition at line 58 of file SiStripFedZeroSuppression.h.