6 #include <boost/regex.hpp>
65 m_dqm_path( config.getUntrackedParameter<std::
string>(
"dqmPath" ) )
66 , doPlotsVsScalLumi_ ( config.getParameter<bool>(
"doPlotsVsScalLumi" ) )
67 , doPlotsVsPixelLumi_( config.getParameter<bool>(
"doPlotsVsPixelLumi" ) )
68 , scalLumiMEPSet_ ( doPlotsVsScalLumi_ ? getHistoPSet(config.getParameter<edm::
ParameterSet>(
"scalLumiME")) :
MEPSet{} )
96 static const boost::regex running_n_processes(
".*/Running [0-9]+ processes");
98 std::vector<std::string> subdirs = getter.
getSubdirs();
99 for (
auto const & subdir: subdirs) {
100 if (boost::regex_match(subdir, running_n_processes)) {
102 if (getter.
get(subdir +
"/event"))
131 static const boost::regex
process_name(
".*/process .*");
133 std::vector<std::string> subdirs = getter.
getSubdirs();
134 for (
auto const & subdir: subdirs) {
135 if (boost::regex_match(subdir, process_name)) {
143 if (getter.
dirExists(current_path +
"/Paths"))
152 TProfile
const *
paths =
nullptr;
156 if (( me = getter.
get(current_path +
"/paths_active_time") )) {
158 size = paths->GetXaxis()->GetNbins();
160 if (( me = getter.
get(current_path +
"/paths_total_time") )) {
162 size = paths->GetXaxis()->GetNbins();
164 if (( me = getter.
get(current_path +
"/paths_exclusive_time") )) {
166 size = paths->GetXaxis()->GetNbins();
168 if (paths ==
nullptr)
176 for (uint32_t
p = 1;
p <=
size; ++
p) {
179 MonitorElement * me_counter = getter.
get( current_path +
"/Paths/" + label +
"_module_counter" );
180 MonitorElement * me_total = getter.
get( current_path +
"/Paths/" + label +
"_module_total" );
181 if (me_counter == 0
or me_total == 0)
185 uint32_t bins = counter->GetXaxis()->GetNbins() - 1;
186 double min = counter->GetXaxis()->GetXmin();
187 double max = counter->GetXaxis()->GetXmax() - 1;
195 me = getter.
get( current_path +
"/Paths/" + label +
"_module_average" );
203 average = booker.
book1D(label +
"_module_average", label +
" module average", bins, min, max)->
getTH1F();
204 average->SetYTitle(
"processing time [ms]");
205 for (uint32_t
i = 1;
i <= bins; ++
i) {
206 const char *
module = counter->GetXaxis()->GetBinLabel(
i);
207 average->GetXaxis()->SetBinLabel(
i, module);
211 me = getter.
get( current_path +
"/Paths/" + label +
"_module_running" );
219 running = booker.
book1D(label +
"_module_running", label +
" module running", bins, min, max)->
getTH1F();
220 running->SetYTitle(
"processing time [ms]");
221 for (uint32_t
i = 1;
i <= bins; ++
i) {
222 const char *
module = counter->GetXaxis()->GetBinLabel(
i);
223 running->GetXaxis()->SetBinLabel(
i, module);
227 me = getter.
get( current_path +
"/Paths/" + label +
"_module_efficiency" );
235 efficiency = booker.
book1D(label +
"_module_efficiency", label +
" module efficiency", bins, min, max)->
getTH1F();
236 efficiency->SetYTitle(
"filter efficiency");
237 efficiency->SetMaximum(1.05);
238 for (uint32_t
i = 1;
i <= bins; ++
i) {
239 const char *
module = counter->GetXaxis()->GetBinLabel(
i);
240 efficiency->GetXaxis()->SetBinLabel(
i, module);
244 for (uint32_t
i = 1;
i <= bins; ++
i) {
245 double t = total ->GetBinContent(
i);
246 double n = counter->GetBinContent(
i);
247 double p = counter->GetBinContent(
i+1);
248 average ->SetBinContent(
i, t / events);
250 running ->SetBinContent(
i, t / n);
251 efficiency->SetBinContent(
i, p / n);
262 std::vector<std::string> menames;
264 static const boost::regex byls(
".*byls");
265 static const boost::regex
test(suffix);
268 std::vector<std::string> allmenames = getter.
getMEs();
269 for (
auto m : allmenames )
271 if (boost::regex_match(
m, byls))
272 menames.push_back(
m);
275 if ( menames.size() == 0 )
291 edm::LogWarning(
"FastTimerServiceClient") <<
"no " << name <<
" ME is available in " << folder << std::endl;
299 std::vector<double>
lumi;
301 for (
size_t ibin=1; ibin <=
size; ++ibin ) {
303 if ( lumiVsLS->
getTProfile()->GetBinContent(ibin) == 0. )
continue;
305 lumi.push_back( lumiVsLS->
getTProfile()->GetBinContent(ibin) );
306 LS.push_back ( lumiVsLS->
getTProfile()->GetXaxis()->GetBinCenter(ibin) );
311 for (
auto m : menames ) {
313 label.erase(label.find(
"_byls"));
320 MonitorElement* meVsLumi = getter.
get( current_path +
"/" + label +
"_" + suffix );
326 meVsLumi = booker.
bookProfile(label +
"_" + suffix, label +
"_" + suffix, nbins, xmin, xmax, ymin, ymax);
328 meVsLumi->
getTProfile()->GetXaxis()->SetTitle(xtitle.c_str());
329 meVsLumi->
getTProfile()->GetYaxis()->SetTitle(ytitle.c_str());
331 for (
size_t ils=0; ils < LS.size(); ++ils ) {
332 int ibin = me->
getTProfile()->GetXaxis()->FindBin(LS[ils]);
335 meVsLumi->
Fill(lumi[ils],y);
346 pset.
add<
int> (
"nbins", 6500 );
347 pset.
add<
double>(
"xmin", 0.);
348 pset.
add<
double>(
"xmax", 13000.);
369 desc.
add<
bool>(
"doPlotsVsScalLumi",
true );
370 desc.
add<
bool>(
"doPlotsVsPixelLumi",
false );
380 descriptions.
add(
"fastTimerServiceClient", desc);
T getParameter(std::string const &) const
static MEPSet getHistoPSet(edm::ParameterSet pset)
void dqmEndLuminosityBlock(DQMStore::IBooker &booker, DQMStore::IGetter &getter, edm::LuminosityBlock const &, edm::EventSetup const &) override
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
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
MonitorElement * bookProfile(Args &&...args)
void fillPlotsVsLumi(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const ¤t_path, std::string const &suffix, MEPSet pset)
MonitorElement * get(const std::string &path)
#define DEFINE_FWK_MODULE(type)
void fillProcessSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &path)
void dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) override
void fillPathSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, double events, std::string const &path)
MonitorElement * book1D(Args &&...args)
static void fillLumiMePSetDescription(edm::ParameterSetDescription &pset)
~FastTimerServiceClient()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< std::string > getMEs(void)
FastTimerServiceClient(edm::ParameterSet const &)
void fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter)
bool dirExists(const std::string &path)
void setCurrentFolder(const std::string &fullpath)
TH1F * getTH1F(void) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
static std::atomic< unsigned int > counter
TProfile * getTProfile(void) const
volatile std::atomic< bool > shutdown_flag false
void Reset(void)
reset ME (ie. contents, errors, etc)
tuple size
Write out results.
tuple folder
Histograms Source for live online DQM in P5