59 : m_ProbInputs(iConfig.getParameter<
std::
string>(
"probabilities")),
60 m_record(iConfig.getParameter<
std::
string>(
"record")),
61 printdebug_(iConfig.getUntrackedParameter<
bool>(
"printDebug",
false)) {
80 if (myfile.is_open()) {
81 while (getline(myfile,
line)) {
83 edm::LogInfo(
"SiPixelQualityProbabilitiesWriteFromASCII") <<
line << std::endl;
85 std::istringstream iss(
line);
86 int pileupBinId, nEntries;
87 iss >> pileupBinId >> nEntries;
88 edm::LogInfo(
"SiPixelQualityProbabilitiesWriteFromASCII")
89 <<
"PILEUP BIN/ENTRIES: " << pileupBinId <<
" " << nEntries << std::endl;
90 std::vector<std::string> ids(nEntries,
"");
91 std::vector<float> probs(nEntries, 0.0);
92 for (
int i = 0;
i < nEntries; ++
i) {
93 iss >> ids.at(
i) >> probs.at(
i);
95 edm::LogInfo(
"SiPixelQualityProbabilitiesWriteFromASCII") << ids.at(
i) <<
" " << probs.at(
i) << std::endl;
97 auto idAndProb = std::make_pair(ids.at(
i), probs.at(
i));
98 myProbVector.push_back(idAndProb);
103 myProbVector.clear();
109 edm::LogInfo(
"SiPixelQualityProbabilitiesWriteFromASCII") <<
"Content of SiPixelQualityProbabilities " << std::endl;
117 edm::LogInfo(
"SiPixelQualityProbabilitiesWriteFromASCII")
118 <<
"Size of SiPixelQualityProbabilities object " <<
myProbabilities->size() << std::endl
133 desc.setComment(
"Writes payloads of type SiPixelQualityProbabilities");
134 desc.addUntracked<
bool>(
"printDebug",
true);
135 desc.add<
std::string>(
"record",
"SiPixelStatusScenarioProbabilityRcd");
137 descriptions.
add(
"SiPixelQualityProbabilitiesWriteFromASCII",
desc);
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string m_record
std::vector< std::pair< std::string, float > > probabilityVec
unsigned long long Time_t
cond::Time_t currentTime() const
const std::string m_ProbInputs
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Log< level::Info, false > LogInfo
~SiPixelQualityProbabilitiesWriteFromASCII() override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< SiPixelQualityProbabilities > myProbabilities
void analyze(const edm::Event &, const edm::EventSetup &) override
SiPixelQualityProbabilitiesWriteFromASCII(const edm::ParameterSet &)