6 #include <boost/regex.hpp> 79 doPlotsVsOnlineLumi_(
config.getParameter<
bool>(
"doPlotsVsOnlineLumi")),
80 doPlotsVsPixelLumi_(
config.getParameter<
bool>(
"doPlotsVsPixelLumi")),
81 doPlotsVsPU_(
config.getParameter<
bool>(
"doPlotsVsPU")),
82 onlineLumiMEPSet_(doPlotsVsOnlineLumi_ ? getHistoPSet(
config.getParameter<
edm::
ParameterSet>(
"onlineLumiME"))
87 fillEveryLumiSection_(
config.getParameter<
bool>(
"fillEveryLumiSection")) {}
106 static const boost::regex running_n_processes(
".*/Running .*");
110 for (
auto const& subdir :
subdirs) {
112 if (boost::regex_match(subdir, running_n_processes)) {
114 if (getter.
get(subdir +
"/event time_real"))
117 std::vector<std::string> subsubdirs = getter.
getSubdirs();
118 for (
auto const& subsubdir : subsubdirs) {
119 if (getter.
get(subsubdir +
"/event time_real"))
144 double events =
me->getTH1F()->GetEntries();
147 static const boost::regex process_name(
".*/process .*");
151 for (
auto const& subdir :
subdirs) {
152 if (boost::regex_match(subdir, process_name)) {
155 std::vector<std::string> subsubdirs = getter.
getSubdirs();
156 for (
auto const& subsubdir : subsubdirs) {
157 if (getter.
get(subsubdir +
"/path time_real")) {
173 std::vector<std::string> subsubdirs = getter.
getSubdirs();
174 size_t npaths = subsubdirs.size();
177 booker.
book1D(
"paths_time_real",
"Total (real) time spent in each path", npaths, -0.5,
double(npaths) - 0.5);
179 booker.
book1D(
"paths_time_thread",
"Total (thread) time spent in each path", npaths, -0.5,
double(npaths) - 0.5);
181 booker.
book1D(
"paths_allocated",
"Total allocated memory in each path", npaths, -0.5,
double(npaths) - 0.5);
183 booker.
book1D(
"paths_deallocated",
"Total deallocated in each path", npaths, -0.5,
double(npaths) - 0.5);
190 for (
auto const& subsubdir : subsubdirs) {
192 if (subsubdir.find(
test) == std::string::npos)
195 static const boost::regex
prefix(current_path +
"/path ");
203 if ((
me = getter.
get(subsubdir +
"/path time_real"))) {
207 if ((
me = getter.
get(subsubdir +
"/path time_thread"))) {
211 if ((
me = getter.
get(subsubdir +
"/path allocated"))) {
216 if ((
me = getter.
get(subsubdir +
"/path deallocated"))) {
224 for (
auto const& subsubdir : subsubdirs) {
231 std::vector<std::string> allmenames = getter.
getMEs();
232 if (allmenames.empty())
236 MonitorElement* me_real_total = getter.
get(subsubdir +
"/module_time_real_total");
237 MonitorElement* me_thread_total = getter.
get(subsubdir +
"/module_time_thread_total");
239 if (me_counter ==
nullptr or me_real_total ==
nullptr)
243 TH1D* real_total = me_real_total->
getTH1D();
244 TH1D* thread_total = me_thread_total->
getTH1D();
245 uint32_t
bins =
counter->GetXaxis()->GetNbins() - 1;
247 double max =
counter->GetXaxis()->GetXmax() - 1;
251 TH1F* thread_average;
252 TH1F* thread_running;
257 me = getter.
get(subsubdir +
"/module_time_real_average");
259 real_average =
me->getTH1F();
260 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
261 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
262 real_average->Reset();
264 real_average = booker.
book1D(
"module_time_real_average",
"module real average timing",
bins,
min,
max)->
getTH1F();
265 real_average->SetYTitle(
"average processing (real) time [ms]");
266 for (uint32_t
i = 1;
i <=
bins; ++
i) {
268 real_average->GetXaxis()->SetBinLabel(
i,
module);
272 me = getter.
get(subsubdir +
"/module_time_thread_average");
274 thread_average =
me->getTH1F();
275 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
276 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
277 thread_average->Reset();
281 thread_average->SetYTitle(
"average processing (thread) time [ms]");
282 for (uint32_t
i = 1;
i <=
bins; ++
i) {
284 thread_average->GetXaxis()->SetBinLabel(
i,
module);
288 me = getter.
get(subsubdir +
"/module_time_real_running");
290 real_running =
me->getTH1F();
291 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
292 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
293 real_running->Reset();
295 real_running = booker.
book1D(
"module_time_real_running",
"module real running timing",
bins,
min,
max)->
getTH1F();
296 real_running->SetYTitle(
"running processing (real) time [ms]");
297 for (uint32_t
i = 1;
i <=
bins; ++
i) {
299 real_running->GetXaxis()->SetBinLabel(
i,
module);
303 me = getter.
get(subsubdir +
"/module_time_thread_running");
305 thread_running =
me->getTH1F();
306 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
307 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
308 thread_running->Reset();
312 thread_running->SetYTitle(
"running processing (thread) time [ms]");
313 for (uint32_t
i = 1;
i <=
bins; ++
i) {
315 thread_running->GetXaxis()->SetBinLabel(
i,
module);
319 me = getter.
get(subsubdir +
"/module_efficiency");
322 assert(
me->getTH1F()->GetXaxis()->GetXmin() ==
min);
323 assert(
me->getTH1F()->GetXaxis()->GetXmax() ==
max);
329 for (uint32_t
i = 1;
i <=
bins; ++
i) {
335 for (uint32_t
i = 1;
i <=
bins; ++
i) {
337 double p =
counter->GetBinContent(
i + 1);
342 double t = real_total->GetBinContent(
i);
343 real_average->SetBinContent(
i,
t /
events);
345 real_running->SetBinContent(
i,
t /
n);
348 t = thread_total->GetBinContent(
i);
349 thread_average->SetBinContent(
i,
t /
events);
351 thread_running->SetBinContent(
i,
t /
n);
370 std::vector<std::string> menames;
372 static const boost::regex byls(
".*byls");
375 std::vector<std::string> allmenames = getter.
getMEs();
376 for (
auto const&
m : allmenames) {
378 if (boost::regex_match(
m, byls))
379 menames.push_back(
m);
405 std::vector<double>
lumi;
407 for (
size_t ibin = 1; ibin <=
size; ++ibin) {
409 if (lumiVsLS->
getTProfile()->GetBinContent(ibin) == 0.)
413 LS.push_back(lumiVsLS->
getTProfile()->GetXaxis()->GetBinCenter(ibin));
418 for (
auto const&
m : menames) {
438 for (
size_t ils = 0; ils < LS.size(); ++ils) {
439 int ibin =
me->getTProfile()->GetXaxis()->FindBin(LS[ils]);
440 double y =
me->getTProfile()->GetBinContent(ibin);
450 pset.add<
int>(
"nbins", 440);
451 pset.add<
double>(
"xmin", 0.);
452 pset.add<
double>(
"xmax", 22000.);
458 pset.add<
int>(
"nbins", 260);
459 pset.add<
double>(
"xmin", 0.);
460 pset.add<
double>(
"xmax", 130.);
467 pset.getParameter<
int>(
"nbins"),
468 pset.getParameter<
double>(
"xmin"),
469 pset.getParameter<
double>(
"xmax"),
478 desc.add<
bool>(
"doPlotsVsOnlineLumi",
true);
479 desc.add<
bool>(
"doPlotsVsPixelLumi",
false);
480 desc.add<
bool>(
"doPlotsVsPU",
true);
493 desc.add<
bool>(
"fillEveryLumiSection",
true);
494 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
MEPSet const pixelLumiMEPSet_
virtual TProfile * getTProfile() const
virtual void setCurrentFolder(std::string const &fullpath)
void fillPlotsVsLumi(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const ¤t_path, std::string const &suffix, MEPSet const &pset)
bool const doPlotsVsPixelLumi_
#define DEFINE_FWK_MODULE(type)
virtual std::vector< std::string > getMEs() const
void fillProcessSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &path)
bool const doPlotsVsOnlineLumi_
~FastTimerServiceClient() override=default
bool const fillEveryLumiSection_
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())
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::string const dqm_path_
static void fillLumiMePSetDescription(edm::ParameterSetDescription &pset)
virtual TH1D * getTH1D() const
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)
MEPSet const onlineLumiMEPSet_
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual TH1F * getTH1F() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual MonitorElement * get(std::string const &fullpath) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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())
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const