Skip to content

Commit

Permalink
Merge pull request #5305 from fwyzard/FastTimerServiceClient_update_i…
Browse files Browse the repository at this point in the history
…nterface_72x

FastTimerServiceClient: update plots after every lumisection
  • Loading branch information
davidlange6 committed Sep 17, 2014
2 parents a5988fd + e9bb367 commit d62550c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 22 deletions.
78 changes: 61 additions & 17 deletions HLTrigger/Timer/plugins/FastTimerServiceClient.cc
Expand Up @@ -33,10 +33,9 @@ class FastTimerServiceClient : public DQMEDHarvester {
private:
std::string m_dqm_path;

void dqmEndLuminosityBlock(DQMStore::IGetter & getter, edm::LuminosityBlock const & lumi, edm::EventSetup const & setup);
void dqmEndJob(DQMStore::IBooker & booker, DQMStore::IGetter & getter);
void dqmEndLuminosityBlock(DQMStore::IBooker & booker, DQMStore::IGetter & getter, edm::LuminosityBlock const &, edm::EventSetup const&) override;
void dqmEndJob(DQMStore::IBooker & booker, DQMStore::IGetter & getter) override;

private:
void fillSummaryPlots( DQMStore::IBooker & booker, DQMStore::IGetter & getter);
void fillProcessSummaryPlots( DQMStore::IBooker & booker, DQMStore::IGetter & getter, std::string const & path);
void fillPathSummaryPlots( DQMStore::IBooker & booker, DQMStore::IGetter & getter, double events, std::string const & path);
Expand All @@ -59,9 +58,9 @@ FastTimerServiceClient::dqmEndJob(DQMStore::IBooker & booker, DQMStore::IGetter
}

void
FastTimerServiceClient::dqmEndLuminosityBlock(DQMStore::IGetter & getter, edm::LuminosityBlock const & lumi, edm::EventSetup const & setup)
FastTimerServiceClient::dqmEndLuminosityBlock(DQMStore::IBooker & booker, DQMStore::IGetter & getter, edm::LuminosityBlock const & lumi, edm::EventSetup const & setup)
{
// fillSummaryPlots(getter);
fillSummaryPlots(booker, getter);
}

void
Expand Down Expand Up @@ -154,22 +153,67 @@ FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker & booker, DQMStor
uint32_t bins = counter->GetXaxis()->GetNbins();
double min = counter->GetXaxis()->GetXmin();
double max = counter->GetXaxis()->GetXmax();
TH1F * average = booker.book1D(label + "_module_average", label + " module average", bins, min, max)->getTH1F();
average ->SetYTitle("processing time [ms]");
TH1F * running = booker.book1D(label + "_module_running", label + " module running", bins, min, max)->getTH1F();
running ->SetYTitle("processing time [ms]");
TH1F * efficiency = booker.book1D(label + "_module_efficiency", label + " module efficiency", bins, min, max)->getTH1F();
efficiency->SetYTitle("filter efficiency");
efficiency->SetMaximum(1.05);
booker.setCurrentFolder(current_path + "/Paths");

TH1F * average;
TH1F * running;
TH1F * efficiency;
MonitorElement * me;

me = getter.get( current_path + "/Paths/" + label + "_module_average" );
if (me) {
average = me->getTH1F();
assert( me->getTH1F()->GetXaxis()->GetNbins() == (int) bins );
assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
average->Reset();
} else {
average = booker.book1D(label + "_module_average", label + " module average", bins, min, max)->getTH1F();
average->SetYTitle("processing time [ms]");
for (uint32_t i = 1; i <= bins; ++i) {
const char * module = counter->GetXaxis()->GetBinLabel(i);
average->GetXaxis()->SetBinLabel(i, module);
}
}

me = getter.get( current_path + "/Paths/" + label + "_module_running" );
if (me) {
running = me->getTH1F();
assert( me->getTH1F()->GetXaxis()->GetNbins() == (int) bins );
assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
running->Reset();
} else {
running = booker.book1D(label + "_module_running", label + " module running", bins, min, max)->getTH1F();
running->SetYTitle("processing time [ms]");
for (uint32_t i = 1; i <= bins; ++i) {
const char * module = counter->GetXaxis()->GetBinLabel(i);
running->GetXaxis()->SetBinLabel(i, module);
}
}

me = getter.get( current_path + "/Paths/" + label + "_module_efficiency" );
if (me) {
efficiency = me->getTH1F();
assert( me->getTH1F()->GetXaxis()->GetNbins() == (int) bins );
assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
efficiency->Reset();
} else {
efficiency = booker.book1D(label + "_module_efficiency", label + " module efficiency", bins, min, max)->getTH1F();
efficiency->SetYTitle("filter efficiency");
efficiency->SetMaximum(1.05);
for (uint32_t i = 1; i <= bins; ++i) {
const char * module = counter->GetXaxis()->GetBinLabel(i);
efficiency->GetXaxis()->SetBinLabel(i, module);
}
}

for (uint32_t i = 1; i <= bins; ++i) {
const char * module = counter->GetXaxis()->GetBinLabel(i);
average ->GetXaxis()->SetBinLabel(i, module);
running ->GetXaxis()->SetBinLabel(i, module);
efficiency->GetXaxis()->SetBinLabel(i, module);
double t = total ->GetBinContent(i);
double n = counter->GetBinContent(i);
double p = counter->GetBinContent(i+1);
average ->SetBinContent(i, t / events);
average ->SetBinContent(i, t / events);
if (n) {
running ->SetBinContent(i, t / n);
efficiency->SetBinContent(i, p / n);
Expand Down
19 changes: 14 additions & 5 deletions HLTrigger/Timer/plugins/ThroughputServiceClient.cc
Expand Up @@ -33,8 +33,8 @@ class ThroughputServiceClient : public DQMEDHarvester {
private:
std::string m_dqm_path;

void dqmEndLuminosityBlock(DQMStore::IGetter & getter, edm::LuminosityBlock const & lumi, edm::EventSetup const & setup);
void dqmEndJob(DQMStore::IBooker & booker, DQMStore::IGetter & getter);
void dqmEndLuminosityBlock(DQMStore::IBooker & booker, DQMStore::IGetter & getter, edm::LuminosityBlock const &, edm::EventSetup const&) override;
void dqmEndJob(DQMStore::IBooker & booker, DQMStore::IGetter & getter) override;

private:
void fillSummaryPlots( DQMStore::IBooker & booker, DQMStore::IGetter & getter);
Expand All @@ -57,9 +57,9 @@ ThroughputServiceClient::dqmEndJob(DQMStore::IBooker & booker, DQMStore::IGetter
}

void
ThroughputServiceClient::dqmEndLuminosityBlock(DQMStore::IGetter & getter, edm::LuminosityBlock const & lumi, edm::EventSetup const & setup)
ThroughputServiceClient::dqmEndLuminosityBlock(DQMStore::IBooker & booker, DQMStore::IGetter & getter, edm::LuminosityBlock const &, edm::EventSetup const&)
{
// fillSummaryPlots(getter);
fillSummaryPlots(booker, getter);
}

void
Expand All @@ -85,10 +85,19 @@ ThroughputServiceClient::fillSummaryPlots(DQMStore::IBooker & booker, DQMStore::
for (auto const & folder: folders) {
TH1F * sourced = getter.get( folder + "/throughput_sourced" )->getTH1F();
TH1F * retired = getter.get( folder + "/throughput_retired" )->getTH1F();
TH1F * concurrent = nullptr;
booker.setCurrentFolder(folder);
unsigned int nbins = sourced->GetXaxis()->GetNbins();
double range = sourced->GetXaxis()->GetXmax();
TH1F * concurrent = booker.book1D("concurrent", "Concurrent events being processed", nbins, 0., range)->getTH1F();
MonitorElement * me = getter.get( folder + "/concurrent" );
if (me) {
concurrent = me->getTH1F();
assert( concurrent->GetXaxis()->GetNbins() == (int) nbins );
assert( concurrent->GetXaxis()->GetXmax() == range );
concurrent->Reset();
} else {
concurrent = booker.book1D("concurrent", "Concurrent events being processed", nbins, 0., range)->getTH1F();
}
double sum = 0;
// from bin=0 (underflow) to bin=nbins+1 (overflow)
for (unsigned int i = 0; i <= nbins+1; ++i) {
Expand Down

0 comments on commit d62550c

Please sign in to comment.