10 #include "CLHEP/Random/RandFlat.h"
11 #include "CLHEP/Random/RandGauss.h"
30 : fp_(iConfig.getUntrackedParameter<edm::FileInPath>(
"file",
31 edm::FileInPath(SiStripDetInfoFileReader::
kDefaultFile))),
32 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug", 3)) {}
38 <<
"... creating dummy SiStripThreshold Data for Run " << run <<
"\n " << std::endl;
43 const auto& DetInfos =
reader.getAllData();
46 for (
const auto& it : DetInfos) {
51 while (strip < 128 * it.second.nApvs) {
52 float lTh = (CLHEP::RandFlat::shoot(1.) * 64) / 5;
53 float hTh = (CLHEP::RandFlat::shoot(1.) * 64) / 5;
59 float cTh = (CLHEP::RandFlat::shoot(1.) * 30.);
61 obj.
setData(strip, lTh, hTh, cTh, theSiStripVector);
64 theSiStripVector.back().print(ss);
66 <<
"detid: " << it.first <<
" \n"
67 <<
"firstStrip: " << strip <<
" \t"
68 <<
"lTh: " << lTh <<
" \t"
69 <<
"hTh: " << hTh <<
" \t"
70 <<
"cTh: " << cTh <<
" \t"
71 <<
"FirstStrip_and_Hth: " << theSiStripVector.back().FirstStrip_and_Hth <<
" \n"
72 << ss.str() << std::endl;
74 obj.
setData(strip + 1, lTh, hTh, theSiStripVector);
75 strip = (uint16_t)(CLHEP::RandFlat::shoot(strip + 2, 128 * it.second.nApvs));
77 if (!obj.
put(it.first, theSiStripVector))
79 <<
"[SiStripThresholdBuilder::analyze] detid already exists" << std::endl;
92 edm::LogError(
"SiStripThresholdBuilder") <<
"Service is unavailable" << std::endl;
bool put(const uint32_t &detID, const InputVector &vect)
#define DEFINE_FWK_MODULE(type)
Log< level::Error, false > LogError
void createOneIOV(const T &payload, cond::Time_t firstSinceTime, const std::string &recordName)
void appendOneIOV(const T &payload, cond::Time_t sinceTime, const std::string &recordName)
std::vector< Data > Container
bool isNewTagRequest(const std::string &recordName)
cond::Time_t beginOfTime() const
SiStripDetInfo read(std::string filePath)
Log< level::Info, false > LogInfo
SiStripThresholdBuilder(const edm::ParameterSet &iConfig)
~SiStripThresholdBuilder() override=default
void setData(const uint16_t &strip, const float &lTh, const float &hTh, Container &vthr)
cond::Time_t currentTime() const
std::string fullPath() const
static constexpr char const *const kDefaultFile
void analyze(const edm::Event &, const edm::EventSetup &) override