56 #include "CLHEP/Random/RandGauss.h"
59 inline void printLog(
const uint32_t detId,
const unsigned short strip,
const double&
noise) {
60 edm::LogInfo(
"SiStripNoisesDummyCalculator") <<
"detid: " << detId <<
" strip: " << strip <<
" noise: " <<
noise;
65 : m_tTopoToken(setWhatProduced(this).consumes()) {
66 findingRecord<SiStripNoisesRcd>();
70 if (!m_stripLengthMode) {
97 using namespace edm::es;
101 auto noises = std::make_unique<SiStripNoises>();
113 const double stripLength{elm.second.stripLength};
114 for (
unsigned short j{0};
j < 128 * elm.second.nApvs; ++
j) {
115 const float noise = (linearSlope * stripLength + linearQuote) /
m_noisePar0;
117 printLog(elm.first,
j, noise);
118 noises->setData(noise, theSiStripVector);
124 for (
unsigned short j{0};
j < 128 * elm.second.nApvs; ++
j) {
127 printLog(elm.first,
j, noise);
128 noises->setData(noise, theSiStripVector);
133 if (!noises->put(elm.first, theSiStripVector)) {
134 edm::LogError(
"SiStripNoisesFakeESSource::produce ") <<
" detid already exists";
T getUntrackedParameter(std::string const &, T const &) const
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
std::vector< uint16_t > InputVector
static const IOVSyncValue & endOfTime()
std::pair< int, int > index
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_tTopoToken
static index getIndex(const TrackerTopology *tTopo, DetId id)
Log< level::Error, false > LogError
std::unique_ptr< SiStripNoises > ReturnType
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
static const IOVSyncValue & beginOfTime()
~SiStripNoisesFakeESSource() override
SiStripDetInfo read(std::string filePath)
double get(const index &idx) const
SiStripNoisesFakeESSource(const edm::ParameterSet &)
Log< level::Info, false > LogInfo
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
ReturnType produce(const SiStripNoisesRcd &)
T getParameter(std::string const &) const
const std::map< uint32_t, DetInfo > & getAllData() const noexcept
SiStripFakeAPVParameters m_noisePar1
std::string fullPath() const
SiStripFakeAPVParameters m_noisePar2