14 #include "CLHEP/Random/RandFlat.h"
15 #include "CLHEP/Random/RandGauss.h"
31 : fp_(iConfig.getUntrackedParameter<edm::FileInPath>(
"file",
32 edm::FileInPath(SiStripDetInfoFileReader::
kDefaultFile))),
33 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug", 1)) {}
38 edm::LogInfo(
"SiStripNoisesBuilder") <<
"... creating dummy SiStripNoises Data for Run " << run <<
"\n " << std::endl;
45 const auto& DetInfos =
reader.getAllData();
47 for (
const auto& it : DetInfos) {
48 const auto& nAPVs = it.second.nApvs;
56 float noise = CLHEP::RandGauss::shoot(MeanNoise, RmsNoise);
61 obj.
setData(noise, theSiStripVector);
64 <<
"detid " << it.first <<
" \t"
65 <<
" strip " <<
strip <<
" \t" << noise <<
" \t" << theSiStripVector.back() / 10 <<
" \t" << std::endl;
67 if (!obj.
put(it.first, theSiStripVector))
68 edm::LogError(
"SiStripNoisesBuilder") <<
"[SiStripNoisesBuilder::analyze] detid already exists" << std::endl;
81 edm::LogError(
"SiStripNoisesBuilder") <<
"Service is unavailable" << std::endl;
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
std::vector< uint16_t > InputVector
Log< level::Error, false > LogError
SiStripNoisesBuilder(const edm::ParameterSet &iConfig)
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
const edm::FileInPath fp_
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
bool isNewTagRequest(const std::string &recordName)
cond::Time_t beginOfTime() const
SiStripDetInfo read(std::string filePath)
~SiStripNoisesBuilder() override=default
bool put(const uint32_t &detID, const InputVector &input)
Log< level::Info, false > LogInfo
cond::Time_t currentTime() const
std::string fullPath() const
static constexpr char const *const kDefaultFile
const uint32_t printdebug_
void setData(float noise_, InputVector &vped)