13 #include "CLHEP/Random/RandFlat.h" 14 #include "CLHEP/Random/RandGauss.h" 33 : fp_(iConfig.getUntrackedParameter<
edm::FileInPath>(
"file",
35 printdebug_(iConfig.getUntrackedParameter<uint32_t>(
"printDebug", 3)) {}
41 <<
"... creating dummy SiStripThreshold Data for Run " <<
run <<
"\n " << std::endl;
46 const auto& DetInfos =
reader.getAllData();
49 for (
const auto&
it : DetInfos) {
54 while (
strip < 128 *
it.second.nApvs) {
55 float lTh = (CLHEP::RandFlat::shoot(1.) * 64) / 5;
56 float hTh = (CLHEP::RandFlat::shoot(1.) * 64) / 5;
62 float cTh = (CLHEP::RandFlat::shoot(1.) * 30.);
64 obj.setData(
strip, lTh, hTh, cTh, theSiStripVector);
67 theSiStripVector.back().print(
ss);
69 <<
"detid: " <<
it.first <<
" \n" 70 <<
"firstStrip: " <<
strip <<
" \t" 71 <<
"lTh: " << lTh <<
" \t" 72 <<
"hTh: " << hTh <<
" \t" 73 <<
"cTh: " << cTh <<
" \t" 74 <<
"FirstStrip_and_Hth: " << theSiStripVector.back().FirstStrip_and_Hth <<
" \n" 75 <<
ss.str() << std::endl;
77 obj.setData(
strip + 1, lTh, hTh, theSiStripVector);
78 strip = (uint16_t)(CLHEP::RandFlat::shoot(
strip + 2, 128 *
it.second.nApvs));
80 if (!
obj.put(
it.first, theSiStripVector))
82 <<
"[SiStripThresholdBuilder::analyze] detid already exists" << std::endl;
95 edm::LogError(
"SiStripThresholdBuilder") <<
"Service is unavailable" << std::endl;
cond::Time_t beginOfTime() const
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 currentTime() const
#define DEFINE_FWK_MODULE(type)
SiStripDetInfo read(std::string filePath)
Log< level::Info, false > LogInfo
SiStripThresholdBuilder(const edm::ParameterSet &iConfig)
~SiStripThresholdBuilder() override=default
static constexpr char const *const kDefaultFile
const std::string & fullPath() const
void analyze(const edm::Event &, const edm::EventSetup &) override