CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloVNoiseSignalGenerator.cc
Go to the documentation of this file.
3 
4 
6 : theNoiseSignals(),
7  theDetIds()
8 {
9 }
10 
11 
13 {
14  theDetIds.clear();
16  fillDetIds();
17 }
18 
19 void CaloVNoiseSignalGenerator::setNoiseSignals(const std::vector<CaloSamples> & noiseSignals)
20 {
21  theNoiseSignals = noiseSignals;
22 }
23 
24 
25 bool CaloVNoiseSignalGenerator::contains(const DetId & detId) const
26 {
27  return edm::binary_search_all(theDetIds, detId.rawId());
28 }
29 
30 
32 {
33  theDetIds.reserve(theNoiseSignals.size());
34  for(std::vector<CaloSamples>::const_iterator sampleItr = theNoiseSignals.begin();
35  sampleItr != theNoiseSignals.end(); ++sampleItr)
36  {
37  theDetIds.push_back(sampleItr->id().rawId());
38  }
40 }
41 
42 
43 
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::vector< CaloSamples > theNoiseSignals
void setNoiseSignals(const std::vector< CaloSamples > &noiseSignals)
bool contains(const DetId &detId) const
Definition: DetId.h:18
std::vector< unsigned int > theDetIds
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:120
void fillEvent()
fill theNoiseSignals with one event&#39;s worth of noise, in units of pe
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition: Algorithms.h:76