CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
SiStripNoises Class Reference

#include <SiStripNoises.h>

Classes

struct  DetRegistry
 
struct  ratioData
 
class  StrictWeakOrdering
 

Public Types

typedef std::vector< unsigned char > Container
 
typedef std::vector< unsigned char >::const_iterator ContainerIterator
 
typedef std::vector< uint16_t > InputVector
 
typedef std::pair< ContainerIterator, ContainerIteratorRange
 
typedef std::vector< DetRegistryRegistry
 
typedef Registry::const_iterator RegistryIterator
 

Public Member Functions

void allNoises (std::vector< float > &noises, const Range &range) const
 
ContainerIterator getDataVectorBegin () const
 
ContainerIterator getDataVectorEnd () const
 
void getDetIds (std::vector< uint32_t > &DetIds_) const
 
const Range getRange (const uint32_t detID) const
 
Range getRangeByPos (unsigned short pos) const
 
RegistryIterator getRegistryVectorBegin () const
 
RegistryIterator getRegistryVectorEnd () const
 
std::vector< ratioDataoperator/ (const SiStripNoises &d)
 
void printDebug (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 
void printSummary (std::stringstream &ss, const TrackerTopology *trackerTopo) const
 
bool put (const uint32_t &detID, const InputVector &input)
 
void setData (float noise_, InputVector &vped)
 
 SiStripNoises ()
 
 ~SiStripNoises ()
 

Static Public Member Functions

static float getNoise (uint16_t strip, const Range &range)
 
static float getNoiseFast (const uint16_t &strip, const Range &range)
 
static float getRawNoise (const uint16_t &strip, const Range &range)
 
static void verify (uint16_t strip, const Range &range)
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Static Private Member Functions

static uint16_t decode (uint16_t strip, const Range &range)
 
static void encode (const InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
 
static uint16_t get9bits (const uint8_t *&ptr, int8_t skip)
 

Private Attributes

Registry indexes
 
Container v_noises
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Stores the noise value for all the strips.
The values are encoded from a vector<uint16_t> to a vector<unsigned char>

The printSummary method prints: Nstrips, mean, rms, min and max noise for each detId. The print Debug method prints the noise for every strip.

Definition at line 25 of file SiStripNoises.h.

Member Typedef Documentation

◆ Container

typedef std::vector<unsigned char> SiStripNoises::Container

Definition at line 45 of file SiStripNoises.h.

◆ ContainerIterator

typedef std::vector<unsigned char>::const_iterator SiStripNoises::ContainerIterator

Definition at line 46 of file SiStripNoises.h.

◆ InputVector

typedef std::vector<uint16_t> SiStripNoises::InputVector

Definition at line 50 of file SiStripNoises.h.

◆ Range

Definition at line 47 of file SiStripNoises.h.

◆ Registry

typedef std::vector<DetRegistry> SiStripNoises::Registry

Definition at line 48 of file SiStripNoises.h.

◆ RegistryIterator

typedef Registry::const_iterator SiStripNoises::RegistryIterator

Definition at line 49 of file SiStripNoises.h.

Constructor & Destructor Documentation

◆ SiStripNoises()

SiStripNoises::SiStripNoises ( )
inline

Definition at line 52 of file SiStripNoises.h.

52 {}

◆ ~SiStripNoises()

SiStripNoises::~SiStripNoises ( )
inline

Definition at line 53 of file SiStripNoises.h.

53 {}

Member Function Documentation

◆ allNoises()

void SiStripNoises::allNoises ( std::vector< float > &  noises,
const Range range 
) const

Definition at line 115 of file SiStripNoises.cc.

References Exception, get9bits(), hltHgcalLayerClustersEE_cfi::noises, MillePedeFileConverter_cfg::out, isotrackApplyRegressor::range, and findQualityFiles::size.

Referenced by SiStripNoisesGetAllChecker::checkModuleNoise(), printDebug(), printSummary(), and sistrip::FEDEmulator::retrieveNoises().

115  {
116  size_t mysize = ((range.second - range.first) << 3) / 9;
117  size_t size = noises.size();
118  if (mysize < size)
119  throw cms::Exception("CorruptedData") << "[SiStripNoises::allNoises] Requested noise for " << noises.size()
120  << " strips, I have it only for " << mysize << " strips\n";
121  size_t size8 = size & (~0x7), carry = size & 0x7; // we have an optimized way of unpacking 8 strips
122  const uint8_t* ptr = (&*range.second) - 1;
123  std::vector<float>::iterator out = noises.begin(), end8 = noises.begin() + size8;
124  // we do it this baroque way instead of just loopin on all the strips because it's faster
125  // as the value of 'skip' is a constant, so the compiler can compute the masks directly
126  while (out < end8) {
127  *out = static_cast<float>(get9bits(ptr, 0) / 10.0f);
128  ++out;
129  *out = static_cast<float>(get9bits(ptr, 1) / 10.0f);
130  ++out;
131  *out = static_cast<float>(get9bits(ptr, 2) / 10.0f);
132  ++out;
133  *out = static_cast<float>(get9bits(ptr, 3) / 10.0f);
134  ++out;
135  *out = static_cast<float>(get9bits(ptr, 4) / 10.0f);
136  ++out;
137  *out = static_cast<float>(get9bits(ptr, 5) / 10.0f);
138  ++out;
139  *out = static_cast<float>(get9bits(ptr, 6) / 10.0f);
140  ++out;
141  *out = static_cast<float>(get9bits(ptr, 7) / 10.0f);
142  ++out;
143  --ptr; // every 8 strips we have to skip one more bit
144  }
145  for (size_t rem = 0; rem < carry; ++rem) {
146  *out = static_cast<float>(get9bits(ptr, rem) / 10.0f);
147  ++out;
148  }
149 }
size
Write out results.
static uint16_t get9bits(const uint8_t *&ptr, int8_t skip)

◆ decode()

uint16_t SiStripNoises::decode ( uint16_t  strip,
const Range range 
)
inlinestaticprivate

Definition at line 118 of file SiStripNoises.h.

References data, isotrackApplyRegressor::range, and nano_mu_digi_cff::strip.

Referenced by ztail.Decoder::follow(), getNoiseFast(), getRawNoise(), and ztail.Decoder::initial_synchronize().

118  {
119  const unsigned char* data = &*(range.second - 1); // pointer to the last byte of data
120  static const uint16_t BITS_PER_STRIP = 9;
121 
122  uint32_t lowBit = strip * BITS_PER_STRIP;
123  uint8_t firstByteBit = (lowBit & 7); //module 8
124 
125  uint16_t vin = uint16_t(*(data - lowBit / 8)) | (uint16_t(*(data - lowBit / 8 - 1)) << 8);
126  vin = vin >> firstByteBit;
127  vin &= 0x1FF;
128  return vin;
129 
130  /*
131  uint8_t firstByteNBits = 8 - firstByteBit;
132  uint8_t firstByteMask = 0xffu << firstByteBit;
133  uint8_t secondByteMask = ~(0xffu << (BITS_PER_STRIP - firstByteNBits));
134  uint16_t value = ((uint16_t(*(data-lowBit/8 )) & firstByteMask) >> firstByteBit) | ((uint16_t(*(data-lowBit/8-1)) & secondByteMask) << firstByteNBits);
135 
136  if(vin!=value) std::cout << vin << ',' <<value << std::endl;
137  */
138  /*
139  if(strip < 25){
140  std::cout << "***************DECODE*********************"<<"\n"
141  << "strip "<<strip << " "
142  << value
143  <<"\t :"<<print_as_binary(value)
144  <<"\t :"<<print_as_binary( ((uint16_t(*(data-lowBit/8 )) & firstByteMask) >> firstByteBit) )
145  << "-"<<print_as_binary( ((uint16_t(*(data-lowBit/8-1)) & secondByteMask) <<firstByteNBits) )
146  << "\t *(data-lowBit/8) " << print_as_binary( *(data-lowBit/8 ))
147  << "\t *(data-lowBit/8-1) " << print_as_binary( *(data-lowBit/8 -1 ))
148  << "\tlowBit:"<< lowBit
149  << "\tfirstByteMask :"<<print_as_binary(firstByteMask)
150  << "\tsecondByteMask:"<<print_as_binary(secondByteMask)
151  << "\tfirstByteBit:"<<print_as_binary(firstByteBit)
152  << std::endl;
153  }
154  */
155  //return value;
156 }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ encode()

void SiStripNoises::encode ( const InputVector Vi,
std::vector< unsigned char > &  Vo_CHAR 
)
staticprivate

Definition at line 71 of file SiStripNoises.cc.

References data, mps_fire::i, and stripgpu::stripIndex().

Referenced by put().

71  {
72  static const uint16_t BITS_PER_STRIP = 9;
73  const size_t VoSize = (size_t)((Vi.size() * BITS_PER_STRIP) / 8 + .999);
74  Vo.resize(VoSize);
75  for (size_t i = 0; i < VoSize; ++i)
76  Vo[i] &= 0x00u;
77 
78  for (unsigned int stripIndex = 0; stripIndex < Vi.size(); ++stripIndex) {
79  unsigned char* data = &Vo[VoSize - 1];
80  uint32_t lowBit = stripIndex * BITS_PER_STRIP;
81  uint8_t firstByteBit = (lowBit & 0x7);
82  uint8_t firstByteNBits = 8 - firstByteBit;
83  uint8_t firstByteMask = 0xffu << firstByteBit;
84  uint8_t secondByteNbits = (BITS_PER_STRIP - firstByteNBits);
85  uint8_t secondByteMask = ~(0xffu << secondByteNbits);
86 
87  *(data - lowBit / 8) = (*(data - lowBit / 8) & ~(firstByteMask)) | ((Vi[stripIndex] & 0xffu) << firstByteBit);
88  *(data - lowBit / 8 - 1) =
89  (*(data - lowBit / 8 - 1) & ~(secondByteMask)) | ((Vi[stripIndex] >> firstByteNBits) & secondByteMask);
90 
91  /*
92  if(stripIndex < 25 ){
93  std::cout << "***************ENCODE*********************"<<std::endl
94  << "\tdata-lowBit/8 :"<<print_as_binary((*(data-lowBit/8) & ~(firstByteMask)))
95  << "-"<<print_as_binary(((Vi[stripIndex] & 0xffu) <<firstByteBit))
96  << "\tdata-lowBit/8-1 :"<<print_as_binary((*(data-lowBit/8-1) & ~(secondByteMask)))
97  << "-"<<print_as_binary((((Vi[stripIndex]>> firstByteNBits) & secondByteMask)))
98  << std::endl;
99  std::cout << "strip "<<stripIndex<<"\tvi: " << Vi[stripIndex] <<"\t"
100  << print_short_as_binary(Vi[stripIndex])
101  << "\tvo1:"<< print_char_as_binary(*(data-lowBit/8))
102  << "\tvo2:"<< print_char_as_binary(*(data-lowBit/8-1))
103  << "\tlowBit:"<< lowBit
104  << "\tfirstByteMask :"<<print_as_binary(firstByteMask)
105  << "\tsecondByteMask:"<<print_as_binary(secondByteMask)
106  << "\tfirstByteBit:"<<print_as_binary(firstByteBit)
107  << std::endl;
108  }
109  */
110  }
111 }
__host__ __device__ std::uint32_t stripIndex(fedId_t fed, fedCh_t channel, stripId_t strip)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ get9bits()

uint16_t SiStripNoises::get9bits ( const uint8_t *&  ptr,
int8_t  skip 
)
inlinestaticprivate

Get 9 bits from a bit stream, starting from the right, skipping the first 'skip' bits (0 < skip < 8). Ptr must point to the rightmost bit, and is updated by this function

Get 9 bit words from a bit stream, starting from the right, skipping the first 'skip' bits (0 < skip < 8). Ptr must point to the rightmost byte that has some bits of this word, and is updated by this function

Definition at line 110 of file SiStripNoises.h.

References runTheMatrix::ret, and optionsL1T::skip.

Referenced by allNoises().

110  {
111  uint8_t maskThis = (0xFF << skip);
112  uint8_t maskThat = ((2 << skip) - 1);
113  uint16_t ret = (((*ptr) & maskThis) >> skip);
114  --ptr;
115  return ret | (((*ptr) & maskThat) << (8 - skip));
116 }
ret
prodAgent to be discontinued

◆ getDataVectorBegin()

ContainerIterator SiStripNoises::getDataVectorBegin ( ) const
inline

Definition at line 60 of file SiStripNoises.h.

References v_noises.

Referenced by printDebug(), and printSummary().

60 { return v_noises.begin(); }
Container v_noises
Definition: SiStripNoises.h:96

◆ getDataVectorEnd()

ContainerIterator SiStripNoises::getDataVectorEnd ( ) const
inline

Definition at line 61 of file SiStripNoises.h.

References v_noises.

61 { return v_noises.end(); }
Container v_noises
Definition: SiStripNoises.h:96

◆ getDetIds()

void SiStripNoises::getDetIds ( std::vector< uint32_t > &  DetIds_) const

Definition at line 51 of file SiStripNoises.cc.

References SplitLinear::begin, mps_fire::end, indexes, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by SiStripDB2Tree::analyze(), SiStripNoisesDQM::fillMEsForDet(), and SiStripNoisesDQM::getActiveDetIds().

51  {
52  // returns vector of DetIds in map
55  DetIds_.reserve(indexes.size());
56  for (SiStripNoises::RegistryIterator p = begin; p != end; ++p) {
57  DetIds_.push_back(p->detid);
58  }
59 }
Registry indexes
Definition: SiStripNoises.h:97
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:49

◆ getNoise()

static float SiStripNoises::getNoise ( uint16_t  strip,
const Range range 
)
inlinestatic

◆ getNoiseFast()

static float SiStripNoises::getNoiseFast ( const uint16_t &  strip,
const Range range 
)
inlinestatic

◆ getRange()

const SiStripNoises::Range SiStripNoises::getRange ( const uint32_t  detID) const

Definition at line 27 of file SiStripNoises.cc.

References indexes, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, and v_noises.

Referenced by SiStripMonitorCluster::analyze(), SiStripDB2Tree::analyze(), SiStripNoisesGetAllChecker::checkModuleNoise(), SiStripAPVRestorer::cleaner_LocalMinimumAdder(), SiStripCorrelateBadStripAndNoise::correlateWithNoise(), SiStripDigitizerAlgorithm::digitize(), SiStripNoisesDQM::fillMEsForDet(), SiStripNoisesDQM::fillMEsForLayer(), SiStripAPVRestorer::flatRegionsFinder(), operator/(), sistrip::FEDEmulator::retrieveNoises(), DigiSimLinkAlgorithm::run(), SiStripClusterInfo::stripNoises(), SiStripClusterInfo::stripNoisesRescaledByGain(), TT6CMNSubtractor::subtract_(), and IteratedMedianCMNSubtractor::subtract_().

27  {
28  // get SiStripNoises Range of DetId
29 
31  if (p == indexes.end() || p->detid != DetId)
32  return SiStripNoises::Range(v_noises.end(), v_noises.end());
33  else {
34  __builtin_prefetch((&v_noises.front()) + p->ibegin);
35  __builtin_prefetch((&v_noises.front()) + p->ibegin + 96);
36  __builtin_prefetch((&v_noises.front()) + p->iend - 96);
37  return SiStripNoises::Range(v_noises.begin() + p->ibegin, v_noises.begin() + p->iend);
38  }
39 }
Registry indexes
Definition: SiStripNoises.h:97
Container v_noises
Definition: SiStripNoises.h:96
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:49
Definition: DetId.h:17
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47

◆ getRangeByPos()

SiStripNoises::Range SiStripNoises::getRangeByPos ( unsigned short  pos) const

Definition at line 41 of file SiStripNoises.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_noises.

41  {
42  if (pos > indexes.size())
43  return Range(v_noises.end(), v_noises.end());
44  auto p = indexes.begin() + pos;
45  __builtin_prefetch((&v_noises.front()) + p->ibegin);
46  __builtin_prefetch((&v_noises.front()) + p->ibegin + 96);
47  __builtin_prefetch((&v_noises.front()) + p->iend - 96);
48  return Range(v_noises.begin() + p->ibegin, v_noises.begin() + p->iend);
49 }
Registry indexes
Definition: SiStripNoises.h:97
Container v_noises
Definition: SiStripNoises.h:96
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47

◆ getRawNoise()

static float SiStripNoises::getRawNoise ( const uint16_t &  strip,
const Range range 
)
inlinestatic

◆ getRegistryVectorBegin()

RegistryIterator SiStripNoises::getRegistryVectorBegin ( ) const
inline

Definition at line 62 of file SiStripNoises.h.

References indexes.

Referenced by operator/(), printDebug(), and printSummary().

62 { return indexes.begin(); }
Registry indexes
Definition: SiStripNoises.h:97

◆ getRegistryVectorEnd()

RegistryIterator SiStripNoises::getRegistryVectorEnd ( ) const
inline

Definition at line 63 of file SiStripNoises.h.

References indexes.

Referenced by operator/(), printDebug(), and printSummary().

63 { return indexes.end(); }
Registry indexes
Definition: SiStripNoises.h:97

◆ operator/()

std::vector< SiStripNoises::ratioData > SiStripNoises::operator/ ( const SiStripNoises d)

Definition at line 260 of file SiStripNoises.cc.

References ztail::d, SiStripNoises::ratioData::detid, getNoise(), getRange(), getRegistryVectorBegin(), getRegistryVectorEnd(), isotrackApplyRegressor::range, mps_fire::result, nano_mu_digi_cff::strip, v_noises, relativeConstraints::value, and SiStripNoises::ratioData::values.

260  {
261  std::vector<ratioData> result;
262  ratioData aData;
263 
266 
267  //Divide result by d
268  for (; iter != iterE; ++iter) {
269  float value;
270  //get noise from d
271  aData.detid = iter->detid;
272  aData.values.clear();
273  Range d_range = d.getRange(iter->detid);
274  Range range = Range(v_noises.begin() + iter->ibegin, v_noises.begin() + iter->iend);
275 
276  //if denominator is missing, put the ratio value to 0xFFFF (=inf)
277  size_t strip = 0, stripE = (range.second - range.first) * 8 / 9;
278  for (; strip < stripE; ++strip) {
279  if (d_range.first == d_range.second) {
280  value = 0xFFFF;
281  } else {
282  value = getNoise(strip, range) / d.getNoise(strip, d_range);
283  }
284  aData.values.push_back(value);
285  }
286  result.push_back(aData);
287  }
288 
289  iter = d.getRegistryVectorBegin();
290  iterE = d.getRegistryVectorEnd();
291 
292  //Divide result by d
293  for (; iter != iterE; ++iter) {
294  float value;
295  //get noise from d
296  Range range = this->getRange(iter->detid);
297  Range d_range = Range(d.v_noises.begin() + iter->ibegin, d.v_noises.begin() + iter->iend);
298  if (range.first == range.second) {
299  aData.detid = iter->detid;
300  aData.values.clear();
301  size_t strip = 0, stripE = (d_range.second - d_range.first) * 8 / 9;
302  for (; strip < stripE; ++strip) {
303  value = 0.;
304  aData.values.push_back(value);
305  }
306  result.push_back(aData);
307  }
308  }
309 
310  return result;
311 }
RegistryIterator getRegistryVectorBegin() const
Definition: SiStripNoises.h:62
Container v_noises
Definition: SiStripNoises.h:96
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:72
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:49
Definition: value.py:1
d
Definition: ztail.py:151
RegistryIterator getRegistryVectorEnd() const
Definition: SiStripNoises.h:63
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:47

◆ printDebug()

void SiStripNoises::printDebug ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 189 of file SiStripNoises.cc.

References allNoises(), hcalRecHitTable_cff::detId, getDataVectorBegin(), getRegistryVectorBegin(), getRegistryVectorEnd(), mps_fire::i, and contentValuesCheck::ss.

189  {
191  uint16_t Nstrips;
192  std::vector<float> vstripnoise;
193 
194  ss << "detid" << std::setw(15) << "strip" << std::setw(10) << "noise" << std::endl;
195 
196  int detId = 0;
197  int oldDetId = 0;
198  for (; rit != erit; ++rit) {
199  Nstrips = (rit->iend - rit->ibegin) * 8 / 9; //number of strips = number of chars * char size / strip noise size
200  vstripnoise.resize(Nstrips);
201  allNoises(vstripnoise, make_pair(getDataVectorBegin() + rit->ibegin, getDataVectorBegin() + rit->iend));
202 
203  detId = rit->detid;
204  if (detId != oldDetId) {
205  oldDetId = detId;
206  ss << detId;
207  } else
208  ss << " ";
209  for (size_t i = 0; i < Nstrips; ++i) {
210  if (i != 0)
211  ss << " ";
212  ss << std::setw(15) << i << std::setw(10) << vstripnoise[i] << std::endl;
213  }
214  }
215 }
RegistryIterator getRegistryVectorBegin() const
Definition: SiStripNoises.h:62
void allNoises(std::vector< float > &noises, const Range &range) const
ContainerIterator getDataVectorBegin() const
Definition: SiStripNoises.h:60
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:49
RegistryIterator getRegistryVectorEnd() const
Definition: SiStripNoises.h:63

◆ printSummary()

void SiStripNoises::printSummary ( std::stringstream &  ss,
const TrackerTopology trackerTopo 
) const

Definition at line 217 of file SiStripNoises.cc.

References allNoises(), hcalRecHitTable_cff::detId, getDataVectorBegin(), getRegistryVectorBegin(), getRegistryVectorEnd(), mps_fire::i, WZElectronSkims53X_cff::max, SiStripPI::mean, SiStripPI::min, SiStripPI::rms, mathSSE::sqrt(), contentValuesCheck::ss, and edmLumisInFiles::summary.

217  {
218  SiStripDetSummary summary{trackerTopo};
219 
220  std::stringstream tempss;
221 
223  uint16_t Nstrips;
224  std::vector<float> vstripnoise;
225  double mean, rms, min, max;
226  for (; rit != erit; ++rit) {
227  Nstrips = (rit->iend - rit->ibegin) * 8 / 9; //number of strips = number of chars * char size / strip noise size
228  vstripnoise.resize(Nstrips);
229  allNoises(vstripnoise, make_pair(getDataVectorBegin() + rit->ibegin, getDataVectorBegin() + rit->iend));
230  tempss << "\ndetid: " << rit->detid << " \t ";
231  mean = 0;
232  rms = 0;
233  min = 10000;
234  max = 0;
235 
236  DetId detId(rit->detid);
237 
238  for (size_t i = 0; i < Nstrips; ++i) {
239  mean += vstripnoise[i];
240  rms += vstripnoise[i] * vstripnoise[i];
241  if (vstripnoise[i] < min)
242  min = vstripnoise[i];
243  if (vstripnoise[i] > max)
244  max = vstripnoise[i];
245 
246  summary.add(detId, vstripnoise[i]);
247  }
248  mean /= Nstrips;
249  rms = sqrt(rms / Nstrips - mean * mean);
250 
251  tempss << "Nstrips " << Nstrips << " \t; mean " << mean << " \t; rms " << rms << " \t; min " << min << " \t; max "
252  << max << "\t ";
253  }
254  ss << std::endl << "Summary:" << std::endl;
255  summary.print(ss);
256  ss << std::endl;
257  ss << tempss.str();
258 }
RegistryIterator getRegistryVectorBegin() const
Definition: SiStripNoises.h:62
void allNoises(std::vector< float > &noises, const Range &range) const
ContainerIterator getDataVectorBegin() const
Definition: SiStripNoises.h:60
T sqrt(T t)
Definition: SSEVec.h:23
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:49
Definition: DetId.h:17
RegistryIterator getRegistryVectorEnd() const
Definition: SiStripNoises.h:63

◆ put()

bool SiStripNoises::put ( const uint32_t &  detID,
const InputVector input 
)

Definition at line 9 of file SiStripNoises.cc.

References SiStripNoises::DetRegistry::detid, encode(), SiStripNoises::DetRegistry::ibegin, SiStripNoises::DetRegistry::iend, indexes, input, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, AlCaHLTBitMon_ParallelJobs::p, and v_noises.

Referenced by SiStripPopConNoisesHandlerFromDQM::dqmEndJob(), and SiStripCondObjBuilderFromDb::storeNoise().

9  {
10  std::vector<unsigned char> Vo_CHAR;
11  encode(input, Vo_CHAR);
12 
13  Registry::iterator p = std::lower_bound(indexes.begin(), indexes.end(), DetId, SiStripNoises::StrictWeakOrdering());
14  if (p != indexes.end() && p->detid == DetId)
15  return false;
16 
17  size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
18  DetRegistry detregistry;
19  detregistry.detid = DetId;
20  detregistry.ibegin = v_noises.size();
21  detregistry.iend = v_noises.size() + sd;
22  indexes.insert(p, detregistry);
23  v_noises.insert(v_noises.end(), Vo_CHAR.begin(), Vo_CHAR.end());
24  return true;
25 }
Registry indexes
Definition: SiStripNoises.h:97
Container v_noises
Definition: SiStripNoises.h:96
static void encode(const InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
static std::string const input
Definition: EdmProvDump.cc:50
Definition: DetId.h:17

◆ serialize()

template<class Archive >
void SiStripNoises::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setData()

void SiStripNoises::setData ( float  noise_,
InputVector vped 
)

Definition at line 67 of file SiStripNoises.cc.

References sistrip::extrainfo::noise_, and findQualityFiles::v.

Referenced by SiStripPopConNoisesHandlerFromDQM::dqmEndJob(), SiStripCondObjBuilderFromDb::setDefaultValuesCabling(), and SiStripCondObjBuilderFromDb::setValuesCabling().

67  {
68  v.push_back((static_cast<int16_t>(noise_ * 10.0 + 0.5) & 0x01FF));
69 }
static const char noise_[]

◆ verify()

void SiStripNoises::verify ( uint16_t  strip,
const Range range 
)
static

Definition at line 61 of file SiStripNoises.cc.

References Exception, isotrackApplyRegressor::range, and nano_mu_digi_cff::strip.

Referenced by getNoise().

61  {
62  if (9 * strip >= (range.second - range.first) * 8)
63  throw cms::Exception("CorruptedData")
64  << "[SiStripNoises::getNoise] looking for SiStripNoises for a strip out of range: strip " << strip;
65 }

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 105 of file SiStripNoises.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 105 of file SiStripNoises.h.

Member Data Documentation

◆ indexes

Registry SiStripNoises::indexes
private

◆ v_noises

Container SiStripNoises::v_noises
private