6 #include <boost/regex.hpp>
76 doPlotsVsScalLumi_(
config.getParameter<
bool>(
"doPlotsVsScalLumi")),
77 doPlotsVsPixelLumi_(
config.getParameter<
bool>(
"doPlotsVsPixelLumi")),
78 doPlotsVsPU_(
config.getParameter<
bool>(
"doPlotsVsPU")),
79 scalLumiMEPSet_(doPlotsVsScalLumi_ ? getHistoPSet(
config.getParameter<
edm::
ParameterSet>(
"scalLumiME"))
103 static const boost::regex running_n_processes(
".*/Running .*");
106 std::vector<std::string> subdirs = getter.
getSubdirs();
107 for (
auto const& subdir : subdirs) {
109 if (boost::regex_match(subdir, running_n_processes)) {
111 if (getter.
get(subdir +
"/event time_real"))
114 std::vector<std::string> subsubdirs = getter.
getSubdirs();
115 for (
auto const& subsubdir : subsubdirs) {
116 if (getter.
get(subsubdir +
"/event time_real"))
141 double events =
me->getTH1F()->GetEntries();
144 static const boost::regex process_name(
".*/process .*");
147 std::vector<std::string> subdirs = getter.
getSubdirs();
148 for (
auto const& subdir : subdirs) {
149 if (boost::regex_match(subdir, process_name)) {
152 std::vector<std::string> subsubdirs = getter.
getSubdirs();
153 for (
auto const& subsubdir : subsubdirs) {
154 if (getter.
get(subsubdir +
"/path time_real")) {
170 std::vector<std::string> subsubdirs = getter.
getSubdirs();
171 size_t npaths = subsubdirs.size();
174 booker.
book1D(
"paths_time_real",
"Total (real) time spent in each path", npaths, -0.5,
double(npaths) - 0.5);
176 booker.
book1D(
"paths_time_thread",
"Total (thread) time spent in each path", npaths, -0.5,
double(npaths) - 0.5);
178 booker.
book1D(
"paths_allocated",
"Total allocated memory in each path", npaths, -0.5,
double(npaths) - 0.5);
180 booker.
book1D(
"paths_deallocated",
"Total deallocated in each path", npaths, -0.5,
double(npaths) - 0.5);
187 for (
auto const& subsubdir : subsubdirs) {
189 if (subsubdir.find(
test) == std::string::npos)
192 static const boost::regex
prefix(current_path +
"/path ");
200 if ((
me = getter.
get(subsubdir +
"/path time_real"))) {
204 if ((
me = getter.
get(subsubdir +
"/path time_thread"))) {
208 if ((
me = getter.
get(subsubdir +
"/path allocated"))) {
213 if ((
me = getter.
get(subsubdir +
"/path deallocated"))) {
221 for (
auto const& subsubdir : subsubdirs) {
228 std::vector<std::string> allmenames = getter.
getMEs();
229 if (allmenames.empty())
233 MonitorElement* me_real_total = getter.
get(subsubdir +
"/module_time_real_total");
234 MonitorElement* me_thread_total = getter.
get(subsubdir +
"/module_time_thread_total");
236 if (me_counter ==
nullptr or me_real_total ==
nullptr)
240 TH1D* real_total = me_real_total->
getTH1D();
241 TH1D* thread_total = me_thread_total->
getTH1D();
242 uint32_t
bins =
counter->GetXaxis()->GetNbins() - 1;
244 double max =
counter->GetXaxis()->GetXmax() - 1;
248 TH1F* thread_average;
249 TH1F* thread_running;
254 me = getter.
get(
"module_time_real_average");
256 real_average =
me->getTH1F();
257 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
258 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
259 real_average->Reset();
261 real_average = booker.
book1D(
"module_time_real_average",
"module real average timing",
bins,
min,
max)->
getTH1F();
262 real_average->SetYTitle(
"average processing (real) time [ms]");
263 for (uint32_t
i = 1;
i <=
bins; ++
i) {
264 const char* module =
counter->GetXaxis()->GetBinLabel(
i);
265 real_average->GetXaxis()->SetBinLabel(
i, module);
269 me = getter.
get(
"module_time_thread_average");
271 thread_average =
me->getTH1F();
272 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
273 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
274 thread_average->Reset();
278 thread_average->SetYTitle(
"average processing (thread) time [ms]");
279 for (uint32_t
i = 1;
i <=
bins; ++
i) {
280 const char* module =
counter->GetXaxis()->GetBinLabel(
i);
281 thread_average->GetXaxis()->SetBinLabel(
i, module);
285 me = getter.
get(
"module_time_real_running");
287 real_running =
me->getTH1F();
288 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
289 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
290 real_running->Reset();
292 real_running = booker.
book1D(
"module_time_real_running",
"module real running timing",
bins,
min,
max)->
getTH1F();
293 real_running->SetYTitle(
"running processing (real) time [ms]");
294 for (uint32_t
i = 1;
i <=
bins; ++
i) {
295 const char* module =
counter->GetXaxis()->GetBinLabel(
i);
296 real_running->GetXaxis()->SetBinLabel(
i, module);
300 me = getter.
get(
"module_time_thread_running");
302 thread_running =
me->getTH1F();
303 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
304 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
305 thread_running->Reset();
309 thread_running->SetYTitle(
"running processing (thread) time [ms]");
310 for (uint32_t
i = 1;
i <=
bins; ++
i) {
311 const char* module =
counter->GetXaxis()->GetBinLabel(
i);
312 thread_running->GetXaxis()->SetBinLabel(
i, module);
316 me = getter.
get(
"module_efficiency");
319 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
320 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
326 for (uint32_t
i = 1;
i <=
bins; ++
i) {
327 const char* module =
counter->GetXaxis()->GetBinLabel(
i);
332 for (uint32_t
i = 1;
i <=
bins; ++
i) {
334 double p =
counter->GetBinContent(
i + 1);
339 double t = real_total->GetBinContent(
i);
340 real_average->SetBinContent(
i,
t /
events);
342 real_running->SetBinContent(
i,
t /
n);
345 t = thread_total->GetBinContent(
i);
346 thread_average->SetBinContent(
i,
t /
events);
348 thread_running->SetBinContent(
i,
t /
n);
367 std::vector<std::string> menames;
369 static const boost::regex byls(
".*byls");
373 std::vector<std::string> allmenames = getter.
getMEs();
374 for (
auto const&
m : allmenames) {
376 if (boost::regex_match(
m, byls))
377 menames.push_back(
m);
403 std::vector<double>
lumi;
405 for (
size_t ibin = 1; ibin <=
size; ++ibin) {
407 if (lumiVsLS->
getTProfile()->GetBinContent(ibin) == 0.)
411 LS.push_back(lumiVsLS->
getTProfile()->GetXaxis()->GetBinCenter(ibin));
416 for (
auto const&
m : menames) {
436 for (
size_t ils = 0; ils < LS.size(); ++ils) {
437 int ibin =
me->getTProfile()->GetXaxis()->FindBin(LS[ils]);
438 double y =
me->getTProfile()->GetBinContent(ibin);
448 pset.add<
int>(
"nbins", 440);
449 pset.add<
double>(
"xmin", 0.);
450 pset.add<
double>(
"xmax", 22000.);
456 pset.add<
int>(
"nbins", 260);
457 pset.add<
double>(
"xmin", 0.);
458 pset.add<
double>(
"xmax", 130.);
465 pset.getParameter<
int>(
"nbins"),
466 pset.getParameter<
double>(
"xmin"),
467 pset.getParameter<
double>(
"xmax"),
476 desc.add<
bool>(
"doPlotsVsScalLumi",
true);
477 desc.add<
bool>(
"doPlotsVsPixelLumi",
false);
478 desc.add<
bool>(
"doPlotsVsPU",
true);
492 descriptions.
add(
"fastTimerServiceClient",
desc);