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 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

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

Definition at line 48 of file SiStripNoises.h.

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

Definition at line 49 of file SiStripNoises.h.

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

Definition at line 53 of file SiStripNoises.h.

Definition at line 50 of file SiStripNoises.h.

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

Definition at line 51 of file SiStripNoises.h.

typedef Registry::const_iterator SiStripNoises::RegistryIterator

Definition at line 52 of file SiStripNoises.h.

Constructor & Destructor Documentation

SiStripNoises::SiStripNoises ( const SiStripNoises input)

Definition at line 9 of file SiStripNoises.cc.

References indexes, 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
Container v_noises
Definition: SiStripNoises.h:99
SiStripNoises::SiStripNoises ( )
inline

Definition at line 56 of file SiStripNoises.h.

56 {}
SiStripNoises::~SiStripNoises ( )
inline

Definition at line 57 of file SiStripNoises.h.

References getDetIds(), getRange(), getRangeByPos(), input, and put().

57 {}

Member Function Documentation

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

Definition at line 126 of file SiStripNoises.cc.

References Exception, get9bits(), MillePedeFileConverter_cfg::out, and findQualityFiles::size.

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

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

Definition at line 122 of file SiStripNoises.h.

References data.

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

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

Definition at line 80 of file SiStripNoises.cc.

References data, and mps_fire::i.

Referenced by getNoise(), and put().

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

References createPayload::skip.

Referenced by allNoises(), and getNoise().

114  {
115  uint8_t maskThis = (0xFF << skip);
116  uint8_t maskThat = ((2 << skip) - 1);
117  uint16_t ret = ( ((*ptr) & maskThis) >> skip );
118  --ptr;
119  return ret | ( ((*ptr) & maskThat) << (8 - skip) );
120 }
ContainerIterator SiStripNoises::getDataVectorBegin ( ) const
inline

Definition at line 64 of file SiStripNoises.h.

References v_noises.

Referenced by printDebug(), and printSummary().

64 {return v_noises.begin();}
Container v_noises
Definition: SiStripNoises.h:99
ContainerIterator SiStripNoises::getDataVectorEnd ( ) const
inline

Definition at line 65 of file SiStripNoises.h.

References v_noises.

65 {return v_noises.end();}
Container v_noises
Definition: SiStripNoises.h:99
void SiStripNoises::getDetIds ( std::vector< uint32_t > &  DetIds_) const

Definition at line 59 of file SiStripNoises.cc.

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

Referenced by SiStripNoisesReader::analyze(), SiStripNoisesDQM::fillMEsForDet(), SiStripNoisesDQM::getActiveDetIds(), StripClusterizerAlgorithm::initialize(), and ~SiStripNoises().

59  {
60  // returns vector of DetIds in map
63  DetIds_.reserve(indexes.size());
64  for (SiStripNoises::RegistryIterator p=begin; p != end; ++p) {
65  DetIds_.push_back(p->detid);
66  }
67 }
Registry indexes
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:52
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
static float SiStripNoises::getNoise ( uint16_t  strip,
const Range range 
)
inlinestatic
static float SiStripNoises::getNoiseFast ( const uint16_t &  strip,
const Range range 
)
inlinestatic
const SiStripNoises::Range SiStripNoises::getRange ( const uint32_t  detID) const

Definition at line 34 of file SiStripNoises.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_noises.

Referenced by SiStripNoisesReader::analyze(), SiStripMonitorCluster::analyze(), SiStripAPVRestorer::Cleaner_LocalMinimumAdder(), SiStripCorrelateBadStripAndNoise::correlateWithNoise(), SiStripDigitizerAlgorithm::digitize(), SiStripMonitorPedestals::fillCondDBMEs(), SiStripNoisesDQM::fillMEsForDet(), SiStripNoisesDQM::fillMEsForLayer(), StripClusterizerAlgorithm::findDetId(), SiStripAPVRestorer::FlatRegionsFinder(), operator/(), SiStripFineDelayHit::produceNoTracking(), edm::DataMixingSiStripMCDigiWorker::putSiStrip(), ShallowDigisProducer::recordDigis(), sistrip::FEDEmulator::retrieveNoises(), DigiSimLinkAlgorithm::run(), SiStripClusterInfo::stripNoises(), SiStripClusterInfo::stripNoisesRescaledByGain(), TT6CMNSubtractor::subtract_(), IteratedMedianCMNSubtractor::subtract_(), SiStripFedZeroSuppression::suppress(), and ~SiStripNoises().

34  {
35  // get SiStripNoises Range of DetId
36 
37  RegistryIterator p = std::lower_bound(indexes.begin(),indexes.end(),DetId,SiStripNoises::StrictWeakOrdering());
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  }
47 }
Registry indexes
Container v_noises
Definition: SiStripNoises.h:99
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:52
Definition: DetId.h:18
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:50
SiStripNoises::Range SiStripNoises::getRangeByPos ( unsigned short  pos) const

Definition at line 49 of file SiStripNoises.cc.

References indexes, AlCaHLTBitMon_ParallelJobs::p, and v_noises.

Referenced by StripClusterizerAlgorithm::findDetId(), and ~SiStripNoises().

49  {
50  if (pos>indexes.size()) 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
Container v_noises
Definition: SiStripNoises.h:99
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripNoises.h:50
RegistryIterator SiStripNoises::getRegistryVectorBegin ( ) const
inline

Definition at line 66 of file SiStripNoises.h.

References indexes.

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

66 {return indexes.begin();}
Registry indexes
RegistryIterator SiStripNoises::getRegistryVectorEnd ( ) const
inline

Definition at line 67 of file SiStripNoises.h.

References indexes.

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

67 {return indexes.end();}
Registry indexes
std::vector< SiStripNoises::ratioData > SiStripNoises::operator/ ( const SiStripNoises d)

Definition at line 257 of file SiStripNoises.cc.

References SiStripNoises::ratioData::detid, getNoise(), getRange(), getRegistryVectorBegin(), getRegistryVectorEnd(), mps_fire::result, digi_MixPreMix_cfi::strip, v_noises, relativeConstraints::value, and SiStripNoises::ratioData::values.

Referenced by getNoise().

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

Definition at line 191 of file SiStripNoises.cc.

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

Referenced by getNoise().

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

Definition at line 218 of file SiStripNoises.cc.

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

Referenced by getNoise().

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

Referenced by SiStripNoisesBuilder::analyze(), SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripPopConNoisesHandlerFromDQM::dqmEndJob(), SiStripCondObjBuilderFromDb::storeNoise(), and ~SiStripNoises().

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
Container v_noises
Definition: SiStripNoises.h:99
static void encode(const InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
static std::string const input
Definition: EdmProvDump.cc:44
Definition: DetId.h:18
double sd
template<class Archive >
void SiStripNoises::serialize ( Archive &  ar,
const unsigned int  version 
)
private
void SiStripNoises::setData ( float  noise_,
InputVector vped 
)
void SiStripNoises::verify ( uint16_t  strip,
const Range range 
)
static

Definition at line 69 of file SiStripNoises.cc.

References Exception, and digi_MixPreMix_cfi::strip.

Referenced by getNoise(), and getNoiseFast().

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

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 109 of file SiStripNoises.h.

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

Definition at line 109 of file SiStripNoises.h.

Member Data Documentation

Registry SiStripNoises::indexes
private
Container SiStripNoises::v_noises
private