60 : m_ProbInputs(iConfig.getParameter<
std::
string>(
"probabilities")),
61 m_SnapshotInputs(iConfig.getParameter<
std::
string>(
"snapshots")),
62 m_record(iConfig.getParameter<
std::
string>(
"record")),
63 printdebug_(iConfig.getUntrackedParameter<
bool>(
"printDebug",
false)) {
80 std::map<int, std::string> snapshotIdToString;
82 if (mysnapshots.is_open()) {
83 while (getline(mysnapshots, line1)) {
85 std::istringstream iss(line1);
87 iss >>
id >>
run >>
ls;
94 if (myfile.is_open()) {
95 while (getline(myfile, line2)) {
96 edm::LogInfo(
"SiPixelQualityProbabilitiesTestWriter") << line2 << std::endl;
97 std::istringstream iss(line2);
98 int pileupBinId, nEntries;
99 iss >> pileupBinId >> nEntries;
101 <<
"PILEUP BIN/ENTRIES: " << pileupBinId <<
" " << nEntries << std::endl;
102 std::vector<int> ids(nEntries, 0);
103 std::vector<float> probs(nEntries, 0.0);
104 for (
int i = 0;
i < nEntries; ++
i) {
105 iss >> ids.at(
i) >> probs.at(
i);
107 auto idAndProb = std::make_pair(snapshotIdToString.at(ids.at(
i)), probs.at(
i));
108 myProbVector.push_back(idAndProb);
112 myProbVector.clear();
118 edm::LogInfo(
"SiPixelQualityProbabilitiesTestWriter") <<
"Content of SiPixelQualityProbabilities " << std::endl;
127 <<
"Size of SiPixelQualityProbabilities object " <<
myProbabilities->size() << std::endl
142 desc.setComment(
"Writes payloads of type SiPixelQualityProbabilities");
143 desc.addUntracked<
bool>(
"printDebug",
true);
144 desc.add<
std::string>(
"record",
"SiPixelStatusScenarioProbabilityRcd");
147 descriptions.
add(
"SiPixelQualityProbabilitiesTestWriter",
desc);
static std::string to_string(const XMLCh *ch)
const std::string m_record
std::vector< std::pair< std::string, float > > probabilityVec
unsigned long long Time_t
cond::Time_t currentTime() const
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
#define DEFINE_FWK_MODULE(type)
const std::string m_ProbInputs
~SiPixelQualityProbabilitiesTestWriter() override
Log< level::Info, false > LogInfo
SiPixelQualityProbabilitiesTestWriter(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::string m_SnapshotInputs
void analyze(const edm::Event &, const edm::EventSetup &) override
std::unique_ptr< SiPixelQualityProbabilities > myProbabilities