Implements edm::EDAnalyzer.
Definition at line 86 of file SiStripDetVOffTrendPlotter.cc.
93 boost::posix_time::ptime p_start, p_end;
96 p_end = boost::posix_time::second_clock::universal_time();
100 p_start = boost::posix_time::time_from_string(
m_startTime);
101 p_end = boost::posix_time::time_from_string(
m_endTime);
105 if (startIov > endIov)
108 <<
"[SiStripDetVOffTrendPlotter::" << __func__ <<
"] "
109 <<
"Set start IOV " << startIov <<
" (" << boost::posix_time::to_simple_string(p_start) <<
")"
110 <<
"\n ... Set end IOV " << endIov <<
" (" << boost::posix_time::to_simple_string(p_end) <<
")";
113 edm::LogInfo(
"SiStripDetVOffTrendPlotter") <<
"[SiStripDetVOffTrendPlotter::" << __func__ <<
"] "
114 <<
"Query the condition database " <<
m_condDb;
119 std::vector<TGraph *> hvgraphs, lvgraphs;
120 TLegend *leg_hv =
new TLegend(0.6, 0.87, 0.99, 0.99);
121 TLegend *leg_lv =
new TLegend(0.6, 0.87, 0.99, 0.99);
122 for (
unsigned itag = 0; itag <
m_plotTags.size(); ++itag) {
126 std::vector<double> vTime;
127 std::vector<double> vHVOffPercent, vLVOffPercent;
130 edm::LogInfo(
"SiStripDetVOffTrendPlotter") <<
"[SiStripDetVOffTrendPlotter::" << __func__ <<
"] "
131 <<
"Reading IOVs from tag " <<
tag;
134 auto iiov = iovs.
find(startIov);
135 auto eiov = iovs.find(endIov);
137 while (iiov != iovs.end() && (*iiov).since <= (*eiov).since) {
139 if ((*iiov).since < startIov)
144 vHVOffPercent.push_back(1.0 *
payload->getHVoffCounts() / num_modules);
145 vLVOffPercent.push_back(1.0 *
payload->getLVoffCounts() / num_modules);
150 <<
", # HV Off=" << std::setw(6) <<
payload->getHVoffCounts() <<
", # LV Off=" << std::setw(6)
151 <<
payload->getLVoffCounts() << std::endl;
156 <<
"[SiStripDetVOffTrendPlotter::" << __func__ <<
"] "
157 <<
"Read " << niov <<
" IOVs from tag " <<
tag <<
" in the specified interval.";
159 TGraph *hv =
new TGraph(vTime.size(), vTime.data(), vHVOffPercent.data());
160 prepGraph(hv, TString(
"HVOff_") +
tag,
";UTC;Fraction of HV off", color);
161 leg_hv->AddEntry(hv,
tag.data(),
"LP");
163 TGraph *lv =
new TGraph(vTime.size(), vTime.data(), vLVOffPercent.data());
164 prepGraph(lv, TString(
"LVOff_") +
tag,
";UTC;Fraction of LV off", color);
165 leg_lv->AddEntry(lv,
tag.data(),
"LP");
167 hvgraphs.push_back(hv);
168 lvgraphs.push_back(lv);
174 TCanvas
c(
"c",
"c", 1800, 1200);
175 c.SetTopMargin(0.12);
176 c.SetBottomMargin(0.08);
179 for (
const auto hv : hvgraphs) {
180 if (hv == hvgraphs.front())
192 c.Print((
"HVOff_" + plot_postfix).
data());
195 for (
const auto lv : lvgraphs) {
196 if (lv == lvgraphs.front())
206 c.Print((
"LVOff_" + plot_postfix).
data());
References HltBtagPostValidation_cff::c, cond::persistency::Transaction::commit(), gather_cfg::cout, cond::persistency::ConnectionPool::createSession(), data, dumpCSV(), Exception, cond::persistency::Session::fetchPayload(), cond::persistency::IOVArray::find(), dqmdumpme::first, formatIOV(), fout, cond::time::from_boost(), edm::EventSetup::get(), get, TrackerGeometryUtils::getSiStripDetIds(), getRunInfo::hours, iovMap, m_condDb, m_connectionPool, m_endTime, m_interval, m_outputCSV, m_outputPlot, m_plotTags, m_startTime, jets_cff::payload, PLOT_COLORS, prepGraph(), cond::persistency::Session::readIov(), cond::persistency::IOVProxy::selectAll(), cond::persistency::Transaction::start(), AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, cond::time::to_boost(), cond::persistency::Session::transaction(), and cond::time::unpack().