CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
FastTimerServiceClient Class Reference
Inheritance diagram for FastTimerServiceClient:
edm::EDAnalyzer

Public Member Functions

 FastTimerServiceClient (edm::ParameterSet const &)
 
 ~FastTimerServiceClient ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
void beginJob ()
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup)
 
void endJob ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
void endRun (edm::Run const &run, edm::EventSetup const &setup)
 
void fillSummaryPlots ()
 

Private Attributes

std::string m_dqm_path
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 23 of file FastTimerServiceClient.cc.

Constructor & Destructor Documentation

FastTimerServiceClient::FastTimerServiceClient ( edm::ParameterSet const &  config)
explicit

Definition at line 45 of file FastTimerServiceClient.cc.

45  :
46  m_dqm_path( config.getUntrackedParameter<std::string>( "dqmPath" ) )
47 {
48 }
FastTimerServiceClient::~FastTimerServiceClient ( )

Definition at line 50 of file FastTimerServiceClient.cc.

51 {
52 }

Member Function Documentation

void FastTimerServiceClient::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 55 of file FastTimerServiceClient.cc.

56 {
57 }
void FastTimerServiceClient::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file FastTimerServiceClient.cc.

61 {
62 }
void FastTimerServiceClient::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 81 of file FastTimerServiceClient.cc.

82 {
83 }
void FastTimerServiceClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file FastTimerServiceClient.cc.

71 {
72 }
void FastTimerServiceClient::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 65 of file FastTimerServiceClient.cc.

66 {
67 }
void FastTimerServiceClient::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 86 of file FastTimerServiceClient.cc.

References fillSummaryPlots().

87 {
89 }
void FastTimerServiceClient::endRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file FastTimerServiceClient.cc.

References fillSummaryPlots().

76 {
78 }
void FastTimerServiceClient::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 170 of file FastTimerServiceClient.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::addUntracked().

170  {
171  // The following says we do not know what parameters are allowed so do no validation
172  // Please change this to state exactly what you do use, even if it is no parameters
174  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
175  descriptions.add("fastTimerServiceClient", desc);
176 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void FastTimerServiceClient::fillSummaryPlots ( void  )
private

Definition at line 92 of file FastTimerServiceClient.cc.

References PDRates::average, combineCards::bins, DQMStore::book1D(), postValidation_cfi::efficiency, patZpeak::events, DQMStore::get(), MonitorElement::getTH1F(), MonitorElement::getTProfile(), i, diffTwoXMLs::label, m_dqm_path, max(), min, n, cppFunctionSkipper::operator, or, AlCaHLTBitMon_ParallelJobs::p, EgammaValidation_cff::paths, DQMStore::setCurrentFolder(), findQualityFiles::size, lumiQTWidget::t, and pileupDistInMC::total.

Referenced by endLuminosityBlock(), and endRun().

93 {
95  if (dqm == 0)
96  // cannot access the DQM store
97  return;
98 
99  MonitorElement * me;
100  me = dqm->get(m_dqm_path + "/event");
101  if (me == 0)
102  // no FastTimerService DQM information
103  return;
104  double events = me->getTH1F()->GetEntries();
105 
106  // note: the following (identical) loops need to be kept separate, as any of these group of histograms might be missing
107  // if any of them is filled, size will have the total number of paths, and "paths" can be used to extract the list of labels
108  dqm->setCurrentFolder(m_dqm_path);
109  TProfile const * paths = nullptr;
110  uint32_t size = 0;
111 
112  // extract the list of Paths and EndPaths from the summary plots
113  if (( me = dqm->get(m_dqm_path + "/paths_active_time") )) {
114  paths = me->getTProfile();
115  size = paths->GetXaxis()->GetNbins();
116  } else
117  if (( me = dqm->get(m_dqm_path + "/paths_total_time") )) {
118  paths = me->getTProfile();
119  size = paths->GetXaxis()->GetNbins();
120  } else
121  if (( me = dqm->get(m_dqm_path + "/paths_exclusive_time") )) {
122  paths = me->getTProfile();
123  size = paths->GetXaxis()->GetNbins();
124  }
125 
126  if (paths == nullptr)
127  return;
128 
129  // for each path, fill histograms with
130  // - the average time spent in each module (total time spent in that module, averaged over all events)
131  // - the running time spent in each module (total time spent in that module, averaged over the events where that module actually ran)
132  // - the "efficiency" of each module (number of time a module succeded divided by the number of times the has run)
133  dqm->setCurrentFolder(m_dqm_path + "/Paths");
134  for (uint32_t p = 1; p <= size; ++p) {
135  // extract the list of Paths and EndPaths from the bin labels of one of the summary plots
136  std::string label = paths->GetXaxis()->GetBinLabel(p);
137  MonitorElement * me_counter = dqm->get( m_dqm_path + "/Paths/" + label + "_module_counter" );
138  MonitorElement * me_total = dqm->get( m_dqm_path + "/Paths/" + label + "_module_total" );
139  if (me_counter == 0 or me_total == 0)
140  continue;
141  TH1F * counter = me_counter->getTH1F();
142  TH1F * total = me_total ->getTH1F();
143  uint32_t bins = counter->GetXaxis()->GetNbins();
144  double min = counter->GetXaxis()->GetXmin();
145  double max = counter->GetXaxis()->GetXmax();
146  TH1F * average = dqm->book1D(label + "_module_average", label + " module average", bins, min, max)->getTH1F();
147  TH1F * running = dqm->book1D(label + "_module_running", label + " module running", bins, min, max)->getTH1F();
148  TH1F * efficiency = dqm->book1D(label + "_module_efficiency", label + " module efficiency", bins, min, max)->getTH1F();
149  for (uint32_t i = 1; i <= bins; ++i) {
150  const char * module = counter->GetXaxis()->GetBinLabel(i);
151  average ->GetXaxis()->SetBinLabel(i, module);
152  running ->GetXaxis()->SetBinLabel(i, module);
153  efficiency->GetXaxis()->SetBinLabel(i, module);
154  double t = total ->GetBinContent(i);
155  double n = counter->GetBinContent(i);
156  double p = counter->GetBinContent(i+1);
157  average ->SetBinContent(i, t / events);
158  if (n) {
159  running ->SetBinContent(i, t / n);
160  efficiency->SetBinContent(i, p / n);
161  }
162  }
163  average->SetYTitle("processing time [ms]");
164  running->SetYTitle("processing time [ms]");
165  }
166 
167 }
int i
Definition: DBlmapReader.cc:9
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
Definition: Activities.doc:12
#define min(a, b)
Definition: mlp_lapack.h:161
const T & max(const T &a, const T &b)
TH1F * getTH1F(void) const
int average
Definition: PDRates.py:137
tuple events
Definition: patZpeak.py:19
TProfile * getTProfile(void) const
Definition: vlib.h:209
tuple size
Write out results.

Member Data Documentation

std::string FastTimerServiceClient::m_dqm_path
private

Definition at line 31 of file FastTimerServiceClient.cc.

Referenced by fillSummaryPlots().