CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
SiStripFedZeroSuppression Class Reference

#include <SiStripFedZeroSuppression.h>

Public Member Functions

void init (const edm::EventSetup &es)
 
 SiStripFedZeroSuppression (uint16_t fedalgo, bool trunc=true, bool trunc10bits=false)
 
void suppress (const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId, edm::ESHandle< SiStripNoises > &, edm::ESHandle< 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)
 
uint16_t truncate (int16_t adc) const
 
 ~SiStripFedZeroSuppression ()
 

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_
 
uint32_t noise_cache_id
 
edm::ESHandle< SiStripNoisesnoiseHandle
 
std::vector< float > noises_
 
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
 
uint32_t threshold_cache_id
 
edm::ESHandle< SiStripThresholdthresholdHandle
 

Friends

class SiStripRawProcessingFactory
 

Detailed Description

Definition at line 16 of file SiStripFedZeroSuppression.h.

Constructor & Destructor Documentation

SiStripFedZeroSuppression::SiStripFedZeroSuppression ( uint16_t  fedalgo,
bool  trunc = true,
bool  trunc10bits = false 
)
inline
SiStripFedZeroSuppression::~SiStripFedZeroSuppression ( )
inline

Definition at line 26 of file SiStripFedZeroSuppression.h.

References recoMuon::in, init(), MillePedeFileConverter_cfg::out, and suppress().

26 {};

Member Function Documentation

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

Definition at line 238 of file SiStripFedZeroSuppression.cc.

References MillePedeFileConverter_cfg::e, hgcalDigitizer_cfi::noise, findQualityFiles::size, and digitizers_cfi::strip.

238  {
239  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detID);
240  SiStripThreshold::Range detThRange = thresholdHandle->getRange(detID);
241 
242  if (highThr_.size() != size) {
243  highThr_.resize(size);
244  lowThr_.resize(size);
245  noises_.resize(size);
246  highThrSN_.resize(size);
247  lowThrSN_.resize(size);
248  }
249 
250  noiseHandle->allNoises(noises_, detNoiseRange);
251  thresholdHandle->allThresholds(lowThrSN_, highThrSN_, detThRange); // thresholds as S/N
252  for (size_t strip = 0; strip < size; ++strip) {
253  float noise = noises_[strip];
254  // uncomment line below to check bluk noise decoding
255  //assert( noise == noiseHandle->getNoiseFast(strip,detNoiseRange) );
256  highThr_[strip] = static_cast<int16_t>(highThrSN_[strip] * noise + 0.5 + 1e-6);
257  lowThr_[strip] = static_cast<int16_t>(lowThrSN_[strip] * noise + 0.5 + 1e-6);
258  // Note: it's a bit wierd, but there are some cases for which 'highThrSN_[strip]*noise' is an exact integer
259  // but due to roundoffs it gets rounded to the integer below if.
260  // Apparently the optimized code inlines differently and this changes the roundoff.
261  // The +1e-6 fixes the problem. [GPetruc]
262  }
263 }
size
Write out results.
void allThresholds(std::vector< float > &lowThs, std::vector< float > &highThs, const Range &range) const
edm::ESHandle< SiStripNoises > noiseHandle
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
edm::ESHandle< SiStripThreshold > thresholdHandle
void SiStripFedZeroSuppression::init ( const edm::EventSetup es)

Definition at line 12 of file SiStripFedZeroSuppression.cc.

References edm::EventSetup::get().

Referenced by ~SiStripFedZeroSuppression().

12  {
13  uint32_t n_cache_id = es.get<SiStripNoisesRcd>().cacheIdentifier();
14  uint32_t t_cache_id = es.get<SiStripThresholdRcd>().cacheIdentifier();
15 
16  if (n_cache_id != noise_cache_id) {
17  es.get<SiStripNoisesRcd>().get(noiseHandle);
18  noise_cache_id = n_cache_id;
19  }
20  if (t_cache_id != threshold_cache_id) {
22  threshold_cache_id = t_cache_id;
23  }
24 }
edm::ESHandle< SiStripNoises > noiseHandle
T get() const
Definition: EventSetup.h:73
edm::ESHandle< SiStripThreshold > thresholdHandle
bool SiStripFedZeroSuppression::isAValidDigi ( )
private

Definition at line 374 of file SiStripFedZeroSuppression.cc.

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

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

Definition at line 32 of file SiStripFedZeroSuppression.cc.

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

Referenced by DigiSimLinkAlgorithm::run(), and ~SiStripFedZeroSuppression().

36  {
37  int i;
38  int inSize = in.size();
39  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detID);
40  SiStripThreshold::Range detThRange = thresholdHandle->getRange(detID);
41 
42  // reserving more than needed, but quicker than one at a time
43  selectedSignal.clear();
44  selectedSignal.reserve(inSize);
45  for (i = 0; i < inSize; i++) {
46  //Find adc values for neighbouring strips
47  const uint32_t strip = (uint32_t)in[i].strip();
48 
49  adc = in[i].adc();
50 
51  SiStripThreshold::Data thresholds = thresholdHandle->getData(strip, detThRange);
52  theFEDlowThresh = static_cast<int16_t>(thresholds.getLth() * noiseHandle->getNoiseFast(strip, detNoiseRange) + 0.5);
54  static_cast<int16_t>(thresholds.getHth() * noiseHandle->getNoiseFast(strip, detNoiseRange) + 0.5);
55 
56  adcPrev = -9999;
57  adcNext = -9999;
58  adcPrev2 = -9999;
59  adcNext2 = -9999;
60 
61  /*
62  Since we are not running on
63  Raw data we need to initialize
64  all the FED threshold
65  */
66 
72 
76 
77  if (((strip) % 128) == 127) {
78  adcNext = 0;
79  theNextFEDlowThresh = 9999;
80  theNextFEDhighThresh = 9999;
81  } else if (i + 1 < inSize && in[i + 1].strip() == strip + 1) {
82  adcNext = in[i + 1].adc();
83  SiStripThreshold::Data thresholds_1 = thresholdHandle->getData(strip + 1, detThRange);
85  static_cast<int16_t>(thresholds_1.getLth() * noiseHandle->getNoiseFast(strip + 1, detNoiseRange) + 0.5);
87  static_cast<int16_t>(thresholds_1.getHth() * noiseHandle->getNoiseFast(strip + 1, detNoiseRange) + 0.5);
88  if (((strip) % 128) == 126) {
89  adcNext2 = 0;
90  theNext2FEDlowThresh = 9999;
91  } else if (i + 2 < inSize && in[i + 2].strip() == strip + 2) {
92  adcNext2 = in[i + 2].adc();
93  theNext2FEDlowThresh = static_cast<int16_t>(thresholdHandle->getData(strip + 2, detThRange).getLth() *
94  noiseHandle->getNoiseFast(strip + 2, detNoiseRange) +
95  0.5);
96  }
97  }
98 
99  if (((strip) % 128) == 0) {
100  adcPrev = 0;
101  thePrevFEDlowThresh = 9999;
102  thePrevFEDhighThresh = 9999;
103  } else if (i - 1 >= 0 && in[i - 1].strip() == strip - 1) {
104  adcPrev = in[i - 1].adc();
105  SiStripThreshold::Data thresholds_1 = thresholdHandle->getData(strip - 1, detThRange);
107  static_cast<int16_t>(thresholds_1.getLth() * noiseHandle->getNoiseFast(strip - 1, detNoiseRange) + 0.5);
109  static_cast<int16_t>(thresholds_1.getHth() * noiseHandle->getNoiseFast(strip - 1, detNoiseRange) + 0.5);
110  if (((strip) % 128) == 1) {
111  adcPrev2 = 0;
112  thePrev2FEDlowThresh = 9999;
113  } else if (i - 2 >= 0 && in[i - 2].strip() == strip - 2) {
114  adcPrev2 = in[i - 2].adc();
115  thePrev2FEDlowThresh = static_cast<int16_t>(thresholdHandle->getData(strip - 2, detThRange).getLth() *
116  noiseHandle->getNoiseFast(strip - 2, detNoiseRange) +
117  0.5);
118  }
119  }
120 
121  if (adcNext <= adcPrev) {
125  } else {
129  }
130 
131  if (isAValidDigi()) {
132  selectedSignal.push_back(SiStripDigi(strip, adc));
133  }
134  }
135 }
static float getNoiseFast(const uint16_t &strip, const Range &range)
Definition: SiStripNoises.h:66
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 26 of file SiStripFedZeroSuppression.cc.

References suppress.

28  {
29  suppress(in, selectedSignal, detID, noiseHandle, thresholdHandle);
30 }
void suppress(const std::vector< SiStripDigi > &in, std::vector< SiStripDigi > &selectedSignal, uint32_t detId, edm::ESHandle< SiStripNoises > &, edm::ESHandle< SiStripThreshold > &)
edm::ESHandle< SiStripNoises > noiseHandle
edm::ESHandle< SiStripThreshold > thresholdHandle
void SiStripFedZeroSuppression::suppress ( const edm::DetSet< SiStripRawDigi > &  in,
edm::DetSet< SiStripDigi > &  out 
)

Definition at line 137 of file SiStripFedZeroSuppression.cc.

References ecalMGPA::adc(), edm::DetSet< T >::data, SiStripThreshold::Data::getHth(), SiStripThreshold::Data::getLth(), edm::DetSet< T >::id, edm::isDebugEnabled(), LogTrace, digitizers_cfi::strip, and particleFlowZeroSuppressionECAL_cff::thresholds.

137  {
138  const uint32_t detID = out.id;
139  SiStripNoises::Range detNoiseRange = noiseHandle->getRange(detID);
140  SiStripThreshold::Range detThRange = thresholdHandle->getRange(detID);
141 #ifdef DEBUG_SiStripZeroSuppression_
142  if (edm::isDebugEnabled())
143  LogTrace("SiStripZeroSuppression")
144  << "[SiStripFedZeroSuppression::suppress] Zero suppression on edm::DetSet<SiStripRawDigi>: detID " << detID
145  << " size = " << in.data.size();
146 #endif
148  for (; in_iter != in.data.end(); in_iter++) {
149  const uint32_t strip = (uint32_t)(in_iter - in.data.begin());
150 
151 #ifdef DEBUG_SiStripZeroSuppression_
152  if (edm::isDebugEnabled())
153  LogTrace("SiStripZeroSuppression") << "[SiStripFedZeroSuppression::suppress] detID= " << detID
154  << " strip= " << strip << " adc= " << in_iter->adc();
155 #endif
156  adc = in_iter->adc();
157 
159  theFEDlowThresh = static_cast<int16_t>(thresholds.getLth() * noiseHandle->getNoiseFast(strip, detNoiseRange) + 0.5);
161  static_cast<int16_t>(thresholds.getHth() * noiseHandle->getNoiseFast(strip, detNoiseRange) + 0.5);
162 
163  adcPrev = -9999;
164  adcNext = -9999;
165  /*
166  If a strip is the last one on the chip
167  set its next neighbor's thresholds to infinity
168  because the FED does not merge clusters across
169  chip boundaries right now
170  */
171  if (strip % 128 == 127) {
172  adcNext = 0;
173  theNextFEDlowThresh = 9999;
174  theNextFEDhighThresh = 9999;
175  } else {
176  adcNext = (in_iter + 1)->adc();
177  SiStripThreshold::Data thresholds_1 = thresholdHandle->getData(strip + 1, detThRange);
179  static_cast<int16_t>(thresholds_1.getLth() * noiseHandle->getNoiseFast(strip + 1, detNoiseRange) + 0.5);
181  static_cast<int16_t>(thresholds_1.getHth() * noiseHandle->getNoiseFast(strip + 1, detNoiseRange) + 0.5);
182  }
183  /*
184  Similarily, for the first strip
185  on a chip
186  */
187  if (strip % 128 == 0) {
188  adcPrev = 0;
189  thePrevFEDlowThresh = 9999;
190  thePrevFEDhighThresh = 9999;
191  } else {
192  adcPrev = (in_iter - 1)->adc();
193  SiStripThreshold::Data thresholds_1 = thresholdHandle->getData(strip - 1, detThRange);
195  static_cast<int16_t>(thresholds_1.getLth() * noiseHandle->getNoiseFast(strip - 1, detNoiseRange) + 0.5);
197  static_cast<int16_t>(thresholds_1.getHth() * noiseHandle->getNoiseFast(strip - 1, detNoiseRange) + 0.5);
198  }
199  if (adcNext < adcPrev) {
203  } else {
207  }
208 
209  //Find adc values for next neighbouring strips
210  adcPrev2 = -9999;
211  adcNext2 = -9999;
214  if (strip % 128 >= 126) {
215  adcNext2 = 0;
216  theNext2FEDlowThresh = 9999;
217  } else if (strip % 128 < 126) {
218  adcNext2 = (in_iter + 2)->adc();
219  theNext2FEDlowThresh = static_cast<int16_t>(thresholdHandle->getData(strip + 2, detThRange).getLth() *
220  noiseHandle->getNoiseFast(strip + 2, detNoiseRange) +
221  0.5);
222  }
223  if (strip % 128 <= 1) {
224  adcPrev2 = 0;
225  thePrev2FEDlowThresh = 9999;
226  } else if (strip % 128 > 1) {
227  adcPrev2 = (in_iter - 2)->adc();
228  thePrev2FEDlowThresh = static_cast<int16_t>(thresholdHandle->getData(strip - 2, detThRange).getLth() *
229  noiseHandle->getNoiseFast(strip - 2, detNoiseRange) +
230  0.5);
231  }
232  //GB 23/6/08: truncation should be done at the very beginning
233  if (isAValidDigi())
234  out.data.push_back(SiStripDigi(strip, truncate(in_iter->adc())));
235  }
236 }
bool isDebugEnabled()
uint16_t truncate(int16_t adc) const
static float getNoiseFast(const uint16_t &strip, const Range &range)
Definition: SiStripNoises.h:66
edm::ESHandle< SiStripNoises > noiseHandle
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
#define LogTrace(id)
std::pair< ContainerIterator, ContainerIterator > Range
collection_type data
Definition: DetSet.h:81
const Range getRange(const uint32_t detID) const
det_id_type id
Definition: DetSet.h:80
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
const Range getRange(const uint32_t &detID) const
edm::ESHandle< SiStripThreshold > thresholdHandle
void SiStripFedZeroSuppression::suppress ( const std::vector< int16_t > &  in,
uint16_t  firstAPV,
edm::DetSet< SiStripDigi > &  out 
)

Definition at line 265 of file SiStripFedZeroSuppression.cc.

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

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

Definition at line 37 of file SiStripFedZeroSuppression.h.

References adc, doTruncate, and doTruncate10bits.

37  {
38  if (adc > 253 && doTruncate && !doTruncate10bits)
39  return ((adc == 1023) ? 255 : 254);
40  return adc;
41  };

Friends And Related Function Documentation

friend class SiStripRawProcessingFactory
friend

Definition at line 17 of file SiStripFedZeroSuppression.h.

Member Data Documentation

int16_t SiStripFedZeroSuppression::adc
private

Definition at line 56 of file SiStripFedZeroSuppression.h.

Referenced by truncate().

int16_t SiStripFedZeroSuppression::adcMaxNeigh
private

Definition at line 59 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcNext
private

Definition at line 58 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcNext2
private

Definition at line 61 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcPrev
private

Definition at line 57 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::adcPrev2
private

Definition at line 60 of file SiStripFedZeroSuppression.h.

bool SiStripFedZeroSuppression::doTruncate
private

Definition at line 51 of file SiStripFedZeroSuppression.h.

Referenced by truncate().

bool SiStripFedZeroSuppression::doTruncate10bits
private

Definition at line 52 of file SiStripFedZeroSuppression.h.

Referenced by truncate().

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

Definition at line 75 of file SiStripFedZeroSuppression.h.

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

Definition at line 76 of file SiStripFedZeroSuppression.h.

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

Definition at line 75 of file SiStripFedZeroSuppression.h.

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

Definition at line 76 of file SiStripFedZeroSuppression.h.

uint32_t SiStripFedZeroSuppression::noise_cache_id
private

Definition at line 46 of file SiStripFedZeroSuppression.h.

edm::ESHandle<SiStripNoises> SiStripFedZeroSuppression::noiseHandle
private

Definition at line 41 of file SiStripFedZeroSuppression.h.

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

Definition at line 77 of file SiStripFedZeroSuppression.h.

uint16_t SiStripFedZeroSuppression::theFEDalgorithm
private

Definition at line 48 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theFEDhighThresh
private

Definition at line 54 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theFEDlowThresh
private

Definition at line 53 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNeighFEDhighThresh
private

Definition at line 69 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNeighFEDlowThresh
private

Definition at line 68 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNext2FEDlowThresh
private

Definition at line 72 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNextFEDhighThresh
private

Definition at line 66 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::theNextFEDlowThresh
private

Definition at line 65 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::thePrev2FEDlowThresh
private

Definition at line 71 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::thePrevFEDhighThresh
private

Definition at line 64 of file SiStripFedZeroSuppression.h.

int16_t SiStripFedZeroSuppression::thePrevFEDlowThresh
private

Definition at line 63 of file SiStripFedZeroSuppression.h.

uint32_t SiStripFedZeroSuppression::threshold_cache_id
private

Definition at line 46 of file SiStripFedZeroSuppression.h.

edm::ESHandle<SiStripThreshold> SiStripFedZeroSuppression::thresholdHandle
private

Definition at line 45 of file SiStripFedZeroSuppression.h.