13 : printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug", 1)),
17 stripLengthMode_(
true),
19 tTopoToken_ = esConsumes<TrackerTopology, TrackerTopologyRcd>();
20 tGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
29 std::vector<uint32_t> inputDetIds;
30 inputApvGain.getDetIds(inputDetIds);
49 unsigned int count = 0;
50 for (
const auto det : tGeom.detUnits()) {
52 if (stripDet !=
nullptr) {
65 double linearSlope = noiseStripLengthLinearSlope.get(sl);
66 double linearQuote = noiseStripLengthLinearQuote.get(sl);
68 for (
unsigned short j = 0;
j < nApvs; ++
j) {
69 double gain = inputApvGain.getApvGain(
j,
inputRange);
71 for (
unsigned short stripId = 0; stripId < 128; ++stripId) {
72 noise = ((linearSlope * stripLength + linearQuote) /
electronsPerADC_) * gain;
73 if (count < printDebug_)
74 printLog(detId, stripId + 128 *
j, noise);
75 obj.
setData(noise, theSiStripVector);
80 double meanN = meanNoise.get(sl);
81 double sigmaN = sigmaNoise.get(sl);
82 for (
unsigned short j = 0;
j < nApvs; ++
j) {
83 double gain = inputApvGain.getApvGain(
j,
inputRange);
85 for (
unsigned short stripId = 0; stripId < 128; ++stripId) {
86 noise = (CLHEP::RandGauss::shoot(meanN, sigmaN)) * gain;
89 if (count < printDebug_)
90 printLog(detId, stripId + 128 *
j, noise);
91 obj.
setData(noise, theSiStripVector);
97 if (!obj.
put(detId, theSiStripVector)) {
98 edm::LogError(
"SiStripNoisesFakeESSource::produce ") <<
" detid already exists" << std::endl;
113 edm::LogError(
"SiStripNoiseNormalizedWithApvGainBuilder") <<
"Service is unavailable" << std::endl;
edm::ESGetToken< SiStripApvGain, SiStripApvGainRcd > inputApvGainToken_
virtual int nstrips() const =0
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< uint16_t > InputVector
SiStripNoiseNormalizedWithApvGainBuilder(const edm::ParameterSet &iConfig)
std::pair< int, int > index
static index getIndex(const TrackerTopology *tTopo, DetId id)
Log< level::Error, false > LogError
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
bool getData(T &iHolder) const
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
virtual float stripLength() const =0
bool isNewTagRequest(const std::string &recordName)
cond::Time_t beginOfTime() const
std::pair< ContainerIterator, ContainerIterator > Range
DetId geographicalId() const
The label of this GeomDet.
void printLog(const uint32_t detId, const unsigned short strip, const double &noise) const
bool put(const uint32_t &detID, const InputVector &input)
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
T getParameter(std::string const &) const
cond::Time_t currentTime() const
void setData(float noise_, InputVector &vped)
void analyze(const edm::Event &, const edm::EventSetup &) override