SimCalorimetry
CaloSimAlgos
src
CaloVNoiseSignalGenerator.cc
Go to the documentation of this file.
1
#include "
FWCore/Utilities/interface/Algorithms.h
"
2
#include "
SimCalorimetry/CaloSimAlgos/interface/CaloVNoiseSignalGenerator.h
"
3
#include <iostream>
4
5
CaloVNoiseSignalGenerator::CaloVNoiseSignalGenerator
() : theNoiseSignals(), theDetIds() {}
6
7
void
CaloVNoiseSignalGenerator::fillEvent
(CLHEP::HepRandomEngine *engine) {
8
theDetIds
.clear();
9
fillNoiseSignals
(engine);
10
fillDetIds
();
11
}
12
13
void
CaloVNoiseSignalGenerator::fillEvent
() {
14
theDetIds
.clear();
15
fillNoiseSignals
();
16
fillDetIds
();
17
}
18
19
void
CaloVNoiseSignalGenerator::setNoiseSignals
(
const
std::vector<CaloSamples> &noiseSignals) {
20
theNoiseSignals
= noiseSignals;
21
}
22
23
bool
CaloVNoiseSignalGenerator::contains
(
const
DetId
&detId)
const
{
24
return
edm::binary_search_all
(
theDetIds
, detId.
rawId
());
25
}
26
27
void
CaloVNoiseSignalGenerator::fillDetIds
() {
28
theDetIds
.reserve(
theNoiseSignals
.size());
29
for
(std::vector<CaloSamples>::const_iterator sampleItr =
theNoiseSignals
.begin(); sampleItr !=
theNoiseSignals
.end();
30
++sampleItr) {
31
theDetIds
.push_back(sampleItr->id().rawId());
32
}
33
edm::sort_all
(
theDetIds
);
34
}
edm::sort_all
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition:
Algorithms.h:92
CaloVNoiseSignalGenerator::CaloVNoiseSignalGenerator
CaloVNoiseSignalGenerator()
Definition:
CaloVNoiseSignalGenerator.cc:5
Algorithms.h
CaloVNoiseSignalGenerator::fillDetIds
void fillDetIds()
Definition:
CaloVNoiseSignalGenerator.cc:27
CaloVNoiseSignalGenerator.h
DetId
Definition:
DetId.h:17
CaloVNoiseSignalGenerator::fillNoiseSignals
virtual void fillNoiseSignals()=0
CaloVNoiseSignalGenerator::theNoiseSignals
std::vector< CaloSamples > theNoiseSignals
Definition:
CaloVNoiseSignalGenerator.h:34
edm::binary_search_all
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
Definition:
Algorithms.h:58
CaloVNoiseSignalGenerator::setNoiseSignals
void setNoiseSignals(const std::vector< CaloSamples > &noiseSignals)
Definition:
CaloVNoiseSignalGenerator.cc:19
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition:
DetId.h:57
CaloVNoiseSignalGenerator::fillEvent
void fillEvent()
Definition:
CaloVNoiseSignalGenerator.cc:13
CaloVNoiseSignalGenerator::theDetIds
std::vector< unsigned int > theDetIds
Definition:
CaloVNoiseSignalGenerator.h:38
CaloVNoiseSignalGenerator::contains
bool contains(const DetId &detId) const
Definition:
CaloVNoiseSignalGenerator.cc:23
Generated for CMSSW Reference Manual by
1.8.16