6 #include <boost/regex.hpp>
77 : m_dqm_path(config.getUntrackedParameter<std::
string>(
"dqmPath")),
78 doPlotsVsScalLumi_(config.getParameter<bool>(
"doPlotsVsScalLumi")),
79 doPlotsVsPixelLumi_(config.getParameter<bool>(
"doPlotsVsPixelLumi")),
80 doPlotsVsPU_(config.getParameter<bool>(
"doPlotsVsPU")),
81 scalLumiMEPSet_(doPlotsVsScalLumi_ ? getHistoPSet(config.getParameter<edm::
ParameterSet>(
"scalLumiME"))
86 fillEveryLumiSection_(
config.getParameter<
bool>(
"fillEveryLumiSection")) {}
107 static const boost::regex running_n_processes(
".*/Running .*");
111 for (
auto const& subdir : subdirs) {
113 if (boost::regex_match(subdir, running_n_processes)) {
115 if (getter.
get(subdir +
"/event time_real"))
118 std::vector<std::string> subsubdirs = getter.
getSubdirs();
119 for (
auto const& subsubdir : subsubdirs) {
120 if (getter.
get(subsubdir +
"/event time_real"))
148 static const boost::regex
process_name(
".*/process .*");
152 for (
auto const& subdir : subdirs) {
153 if (boost::regex_match(subdir, process_name)) {
156 std::vector<std::string> subsubdirs = getter.
getSubdirs();
157 for (
auto const& subsubdir : subsubdirs) {
158 if (getter.
get(subsubdir +
"/path time_real")) {
174 std::vector<std::string> subsubdirs = getter.
getSubdirs();
175 size_t npaths = subsubdirs.size();
178 booker.
book1D(
"paths_time_real",
"Total (real) time spent in each path", npaths, -0.5,
double(npaths) - 0.5);
180 booker.
book1D(
"paths_time_thread",
"Total (thread) time spent in each path", npaths, -0.5,
double(npaths) - 0.5);
182 booker.
book1D(
"paths_allocated",
"Total allocated memory in each path", npaths, -0.5,
double(npaths) - 0.5);
184 booker.
book1D(
"paths_deallocated",
"Total deallocated in each path", npaths, -0.5,
double(npaths) - 0.5);
191 for (
auto const& subsubdir : subsubdirs) {
193 if (subsubdir.find(test) == std::string::npos)
196 static const boost::regex
prefix(current_path +
"/path ");
204 if ((me = getter.
get(subsubdir +
"/path time_real"))) {
208 if ((me = getter.
get(subsubdir +
"/path time_thread"))) {
212 if ((me = getter.
get(subsubdir +
"/path allocated"))) {
217 if ((me = getter.
get(subsubdir +
"/path deallocated"))) {
225 for (
auto const& subsubdir : subsubdirs) {
232 std::vector<std::string> allmenames = getter.
getMEs();
233 if (allmenames.empty())
237 MonitorElement* me_real_total = getter.
get(subsubdir +
"/module_time_real_total");
238 MonitorElement* me_thread_total = getter.
get(subsubdir +
"/module_time_thread_total");
240 if (me_counter ==
nullptr or me_real_total ==
nullptr)
244 TH1D* real_total = me_real_total->
getTH1D();
245 TH1D* thread_total = me_thread_total->
getTH1D();
246 uint32_t bins = counter->GetXaxis()->GetNbins() - 1;
247 double min = counter->GetXaxis()->GetXmin();
248 double max = counter->GetXaxis()->GetXmax() - 1;
252 TH1F* thread_average;
253 TH1F* thread_running;
258 me = getter.
get(subsubdir +
"/module_time_real_average");
263 real_average->Reset();
265 real_average = booker.
book1D(
"module_time_real_average",
"module real average timing", bins, min, max)->
getTH1F();
266 real_average->SetYTitle(
"average processing (real) time [ms]");
267 for (uint32_t
i = 1;
i <= bins; ++
i) {
268 const char*
module = counter->GetXaxis()->GetBinLabel(
i);
269 real_average->GetXaxis()->SetBinLabel(
i, module);
273 me = getter.
get(subsubdir +
"/module_time_thread_average");
275 thread_average = me->
getTH1F();
278 thread_average->Reset();
281 booker.
book1D(
"module_time_thread_average",
"module thread average timing", bins, min, max)->
getTH1F();
282 thread_average->SetYTitle(
"average processing (thread) time [ms]");
283 for (uint32_t
i = 1;
i <= bins; ++
i) {
284 const char*
module = counter->GetXaxis()->GetBinLabel(
i);
285 thread_average->GetXaxis()->SetBinLabel(
i, module);
289 me = getter.
get(subsubdir +
"/module_time_real_running");
294 real_running->Reset();
296 real_running = booker.
book1D(
"module_time_real_running",
"module real running timing", bins, min, max)->
getTH1F();
297 real_running->SetYTitle(
"running processing (real) time [ms]");
298 for (uint32_t
i = 1;
i <= bins; ++
i) {
299 const char*
module = counter->GetXaxis()->GetBinLabel(
i);
300 real_running->GetXaxis()->SetBinLabel(
i, module);
304 me = getter.
get(subsubdir +
"/module_time_thread_running");
306 thread_running = me->
getTH1F();
309 thread_running->Reset();
312 booker.
book1D(
"module_time_thread_running",
"module thread running timing", bins, min, max)->
getTH1F();
313 thread_running->SetYTitle(
"running processing (thread) time [ms]");
314 for (uint32_t
i = 1;
i <= bins; ++
i) {
315 const char*
module = counter->GetXaxis()->GetBinLabel(
i);
316 thread_running->GetXaxis()->SetBinLabel(
i, module);
320 me = getter.
get(subsubdir +
"/module_efficiency");
327 efficiency = booker.
book1D(
"module_efficiency",
"module efficiency", bins, min, max)->
getTH1F();
328 efficiency->SetYTitle(
"filter efficiency");
329 efficiency->SetMaximum(1.05);
330 for (uint32_t
i = 1;
i <= bins; ++
i) {
331 const char*
module = counter->GetXaxis()->GetBinLabel(
i);
332 efficiency->GetXaxis()->SetBinLabel(
i, module);
336 for (uint32_t
i = 1;
i <= bins; ++
i) {
337 double n = counter->GetBinContent(
i);
338 double p = counter->GetBinContent(
i + 1);
340 efficiency->SetBinContent(
i, p / n);
343 double t = real_total->GetBinContent(
i);
344 real_average->SetBinContent(
i, t / events);
346 real_running->SetBinContent(
i, t / n);
349 t = thread_total->GetBinContent(
i);
350 thread_average->SetBinContent(
i, t / events);
352 thread_running->SetBinContent(
i, t / n);
371 std::vector<std::string> menames;
373 static const boost::regex byls(
".*byls");
374 static const boost::regex
test(suffix);
377 std::vector<std::string> allmenames = getter.
getMEs();
378 for (
auto const&
m : allmenames) {
380 if (boost::regex_match(
m, byls))
381 menames.push_back(
m);
399 edm::LogWarning(
"FastTimerServiceClient") <<
"no " << name <<
" ME is available in " << folder << std::endl;
407 std::vector<double>
lumi;
409 for (
size_t ibin = 1; ibin <=
size; ++ibin) {
411 if (lumiVsLS->
getTProfile()->GetBinContent(ibin) == 0.)
414 lumi.push_back(lumiVsLS->
getTProfile()->GetBinContent(ibin));
415 LS.push_back(lumiVsLS->
getTProfile()->GetXaxis()->GetBinCenter(ibin));
420 for (
auto const&
m : menames) {
422 label.erase(label.find(
"_byls"));
429 MonitorElement* meVsLumi = getter.
get(current_path +
"/" + label +
"_" + suffix);
435 meVsLumi = booker.
bookProfile(label +
"_" + suffix, label +
"_" + suffix, nbins, xmin, xmax, ymin, ymax);
437 meVsLumi->
getTProfile()->GetXaxis()->SetTitle(xtitle.c_str());
438 meVsLumi->
getTProfile()->GetYaxis()->SetTitle(ytitle.c_str());
440 for (
size_t ils = 0; ils < LS.size(); ++ils) {
441 int ibin = me->
getTProfile()->GetXaxis()->FindBin(LS[ils]);
444 meVsLumi->
Fill(lumi[ils], y);
452 pset.
add<
int>(
"nbins", 440);
453 pset.
add<
double>(
"xmin", 0.);
454 pset.
add<
double>(
"xmax", 22000.);
460 pset.
add<
int>(
"nbins", 260);
461 pset.
add<
double>(
"xmin", 0.);
462 pset.
add<
double>(
"xmax", 130.);
480 desc.
add<
bool>(
"doPlotsVsScalLumi",
true);
481 desc.
add<
bool>(
"doPlotsVsPixelLumi",
false);
482 desc.
add<
bool>(
"doPlotsVsPU",
true);
495 desc.
add<
bool>(
"fillEveryLumiSection",
true);
496 descriptions.
add(
"fastTimerServiceClient", desc);
static void fillPUMePSetDescription(edm::ParameterSetDescription &pset)
void dqmEndLuminosityBlock(DQMStore::IBooker &booker, DQMStore::IGetter &getter, edm::LuminosityBlock const &, edm::EventSetup const &) override
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool fillEveryLumiSection_
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
virtual void setCurrentFolder(std::string const &fullpath)
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
void fillPlotsVsLumi(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const ¤t_path, std::string const &suffix, MEPSet pset)
#define DEFINE_FWK_MODULE(type)
virtual TH1F * getTH1F() const
void fillProcessSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &path)
~FastTimerServiceClient() override
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) override
static MEPSet getHistoPSet(const edm::ParameterSet &pset)
void fillPathSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, double events, std::string const &path)
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
virtual MonitorElement * get(std::string const &fullpath) const
static void fillLumiMePSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
FastTimerServiceClient(edm::ParameterSet const &)
void fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter)
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual TProfile * getTProfile() const
virtual TH1D * getTH1D() const
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
tuple config
parse the configuration file
virtual std::vector< std::string > getMEs() const
static std::atomic< unsigned int > counter
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
tuple size
Write out results.