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 (const SiStripNoises &)
 
 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() [1/2]

SiStripNoises::SiStripNoises ( const SiStripNoises input)

Definition at line 9 of file SiStripNoises.cc.

References indexes, input, and v_noises.

9  {
10  v_noises.clear();
11  indexes.clear();
12  v_noises.insert(v_noises.end(), input.v_noises.begin(), input.v_noises.end());
13  indexes.insert(indexes.end(), input.indexes.begin(), input.indexes.end());
14 }
Registry indexes
Definition: SiStripNoises.h:98
Container v_noises
Definition: SiStripNoises.h:97
static std::string const input
Definition: EdmProvDump.cc:50

◆ SiStripNoises() [2/2]

SiStripNoises::SiStripNoises ( )
inline

Definition at line 53 of file SiStripNoises.h.

53 {}

◆ ~SiStripNoises()

SiStripNoises::~SiStripNoises ( )
inline

Definition at line 54 of file SiStripNoises.h.

54 {}

Member Function Documentation

◆ allNoises()

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

Definition at line 122 of file SiStripNoises.cc.

References Exception, get9bits(), hgcalLayerClusters_cfi::noises, MillePedeFileConverter_cfg::out, FastTimerService_cff::range, and findQualityFiles::size.

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

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

References data, FastTimerService_cff::range, and digitizers_cfi::strip.

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

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

◆ encode()

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

Definition at line 78 of file SiStripNoises.cc.

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

Referenced by put().

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

◆ 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 111 of file SiStripNoises.h.

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

Referenced by allNoises().

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

◆ getDataVectorBegin()

ContainerIterator SiStripNoises::getDataVectorBegin ( ) const
inline

Definition at line 61 of file SiStripNoises.h.

References v_noises.

Referenced by printDebug(), and printSummary().

61 { return v_noises.begin(); }
Container v_noises
Definition: SiStripNoises.h:97

◆ getDataVectorEnd()

ContainerIterator SiStripNoises::getDataVectorEnd ( ) const
inline

Definition at line 62 of file SiStripNoises.h.

References v_noises.

62 { return v_noises.end(); }
Container v_noises
Definition: SiStripNoises.h:97

◆ getDetIds()

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

Definition at line 58 of file SiStripNoises.cc.

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

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

58  {
59  // returns vector of DetIds in map
62  DetIds_.reserve(indexes.size());
63  for (SiStripNoises::RegistryIterator p = begin; p != end; ++p) {
64  DetIds_.push_back(p->detid);
65  }
66 }
Registry indexes
Definition: SiStripNoises.h:98
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 34 of file SiStripNoises.cc.

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

Referenced by SiStripMonitorCluster::analyze(), SiStripDB2Tree::analyze(), 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_().

34  {
35  // get SiStripNoises Range of DetId
36 
38  if (p == indexes.end() || p->detid != DetId)
39  return SiStripNoises::Range(v_noises.end(), v_noises.end());
40  else {
41  __builtin_prefetch((&v_noises.front()) + p->ibegin);
42  __builtin_prefetch((&v_noises.front()) + p->ibegin + 96);
43  __builtin_prefetch((&v_noises.front()) + p->iend - 96);
44  return SiStripNoises::Range(v_noises.begin() + p->ibegin, v_noises.begin() + p->iend);
45  }
46 }
Registry indexes
Definition: SiStripNoises.h:98
Container v_noises
Definition: SiStripNoises.h:97
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 48 of file SiStripNoises.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_noises.

48  {
49  if (pos > indexes.size())
50  return Range(v_noises.end(), v_noises.end());
51  auto p = indexes.begin() + pos;
52  __builtin_prefetch((&v_noises.front()) + p->ibegin);
53  __builtin_prefetch((&v_noises.front()) + p->ibegin + 96);
54  __builtin_prefetch((&v_noises.front()) + p->iend - 96);
55  return Range(v_noises.begin() + p->ibegin, v_noises.begin() + p->iend);
56 }
Registry indexes
Definition: SiStripNoises.h:98
Container v_noises
Definition: SiStripNoises.h:97
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 63 of file SiStripNoises.h.

References indexes.

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

63 { return indexes.begin(); }
Registry indexes
Definition: SiStripNoises.h:98

◆ getRegistryVectorEnd()

RegistryIterator SiStripNoises::getRegistryVectorEnd ( ) const
inline

Definition at line 64 of file SiStripNoises.h.

References indexes.

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

64 { return indexes.end(); }
Registry indexes
Definition: SiStripNoises.h:98

◆ operator/()

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

Definition at line 267 of file SiStripNoises.cc.

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

267  {
268  std::vector<ratioData> result;
269  ratioData aData;
270 
273 
274  //Divide result by d
275  for (; iter != iterE; ++iter) {
276  float value;
277  //get noise from d
278  aData.detid = iter->detid;
279  aData.values.clear();
280  Range d_range = d.getRange(iter->detid);
281  Range range = Range(v_noises.begin() + iter->ibegin, v_noises.begin() + iter->iend);
282 
283  //if denominator is missing, put the ratio value to 0xFFFF (=inf)
284  size_t strip = 0, stripE = (range.second - range.first) * 8 / 9;
285  for (; strip < stripE; ++strip) {
286  if (d_range.first == d_range.second) {
287  value = 0xFFFF;
288  } else {
289  value = getNoise(strip, range) / d.getNoise(strip, d_range);
290  }
291  aData.values.push_back(value);
292  }
293  result.push_back(aData);
294  }
295 
296  iter = d.getRegistryVectorBegin();
297  iterE = d.getRegistryVectorEnd();
298 
299  //Divide result by d
300  for (; iter != iterE; ++iter) {
301  float value;
302  //get noise from d
303  Range range = this->getRange(iter->detid);
304  Range d_range = Range(d.v_noises.begin() + iter->ibegin, d.v_noises.begin() + iter->iend);
305  if (range.first == range.second) {
306  aData.detid = iter->detid;
307  aData.values.clear();
308  size_t strip = 0, stripE = (d_range.second - d_range.first) * 8 / 9;
309  for (; strip < stripE; ++strip) {
310  value = 0.;
311  aData.values.push_back(value);
312  }
313  result.push_back(aData);
314  }
315  }
316 
317  return result;
318 }
RegistryIterator getRegistryVectorBegin() const
Definition: SiStripNoises.h:63
Container v_noises
Definition: SiStripNoises.h:97
static float getNoise(uint16_t strip, const Range &range)
Definition: SiStripNoises.h:73
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:49
Definition: value.py:1
d
Definition: ztail.py:151
RegistryIterator getRegistryVectorEnd() const
Definition: SiStripNoises.h:64
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 196 of file SiStripNoises.cc.

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

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

◆ printSummary()

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

Definition at line 224 of file SiStripNoises.cc.

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

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

◆ put()

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

Definition at line 16 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().

16  {
17  std::vector<unsigned char> Vo_CHAR;
18  encode(input, Vo_CHAR);
19 
20  Registry::iterator p = std::lower_bound(indexes.begin(), indexes.end(), DetId, SiStripNoises::StrictWeakOrdering());
21  if (p != indexes.end() && p->detid == DetId)
22  return false;
23 
24  size_t sd = Vo_CHAR.end() - Vo_CHAR.begin();
25  DetRegistry detregistry;
26  detregistry.detid = DetId;
27  detregistry.ibegin = v_noises.size();
28  detregistry.iend = v_noises.size() + sd;
29  indexes.insert(p, detregistry);
30  v_noises.insert(v_noises.end(), Vo_CHAR.begin(), Vo_CHAR.end());
31  return true;
32 }
Registry indexes
Definition: SiStripNoises.h:98
Container v_noises
Definition: SiStripNoises.h:97
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 74 of file SiStripNoises.cc.

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

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

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

◆ verify()

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

Definition at line 68 of file SiStripNoises.cc.

References Exception, FastTimerService_cff::range, and digitizers_cfi::strip.

Referenced by getNoise().

68  {
69  if (9 * strip >= (range.second - range.first) * 8)
70  throw cms::Exception("CorruptedData")
71  << "[SiStripNoises::getNoise] looking for SiStripNoises for a strip out of range: strip " << strip;
72 }

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 106 of file SiStripNoises.h.

◆ cond::serialization::access

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

Definition at line 106 of file SiStripNoises.h.

Member Data Documentation

◆ indexes

Registry SiStripNoises::indexes
private

◆ v_noises

Container SiStripNoises::v_noises
private