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:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 FastTimerServiceClient (edm::ParameterSet const &)
 
 ~FastTimerServiceClient ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

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

Private Member Functions

void dqmEndJob (DQMStore::IBooker &booker, DQMStore::IGetter &getter)
 
void dqmEndLuminosityBlock (DQMStore::IGetter &getter, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
void fillPathSummaryPlots (DQMStore::IBooker &booker, DQMStore::IGetter &getter, double events, std::string const &path)
 
void fillProcessSummaryPlots (DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &path)
 
void fillSummaryPlots (DQMStore::IBooker &booker, DQMStore::IGetter &getter)
 

Private Attributes

std::string m_dqm_path
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 26 of file FastTimerServiceClient.cc.

Constructor & Destructor Documentation

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

Definition at line 46 of file FastTimerServiceClient.cc.

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

Definition at line 51 of file FastTimerServiceClient.cc.

52 {
53 }

Member Function Documentation

void FastTimerServiceClient::dqmEndJob ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
privatevirtual

Implements DQMEDHarvester.

Definition at line 56 of file FastTimerServiceClient.cc.

References fillSummaryPlots().

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

Definition at line 62 of file FastTimerServiceClient.cc.

63 {
64  // fillSummaryPlots(getter);
65 }
void FastTimerServiceClient::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 183 of file FastTimerServiceClient.cc.

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

183  {
184  // The following says we do not know what parameters are allowed so do no validation
185  // Please change this to state exactly what you do use, even if it is no parameters
187  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
188  descriptions.add("fastTimerServiceClient", desc);
189 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void FastTimerServiceClient::fillPathSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
double  events,
std::string const &  path 
)
private

Definition at line 116 of file FastTimerServiceClient.cc.

References PDRates::average, DQMStore::IBooker::book1D(), counter, postValidation_cfi::efficiency, DQMStore::IGetter::get(), MonitorElement::getTH1F(), MonitorElement::getTProfile(), i, diffTwoXMLs::label, max(), bookConverter::min, n, or, AlCaHLTBitMon_ParallelJobs::p, hlt_relval-layouts::paths, DQMStore::IBooker::setCurrentFolder(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, edmStreamStallGrapher::t, and pileupDistInMC::total.

Referenced by fillProcessSummaryPlots().

116  {
117  // note: the following checks need to be kept separate, as any of these histograms might be missing
118  // 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
119  MonitorElement * me;
120  TProfile const * paths = nullptr;
121  uint32_t size = 0;
122 
123  // extract the list of Paths and EndPaths from the summary plots
124  if (( me = getter.get(current_path + "/paths_active_time") )) {
125  paths = me->getTProfile();
126  size = paths->GetXaxis()->GetNbins();
127  } else
128  if (( me = getter.get(current_path + "/paths_total_time") )) {
129  paths = me->getTProfile();
130  size = paths->GetXaxis()->GetNbins();
131  } else
132  if (( me = getter.get(current_path + "/paths_exclusive_time") )) {
133  paths = me->getTProfile();
134  size = paths->GetXaxis()->GetNbins();
135  }
136 
137  if (paths == nullptr)
138  return;
139 
140  // for each path, fill histograms with
141  // - the average time spent in each module (total time spent in that module, averaged over all events)
142  // - the running time spent in each module (total time spent in that module, averaged over the events where that module actually ran)
143  // - the "efficiency" of each module (number of time a module succeded divided by the number of times the has run)
144  booker.setCurrentFolder(current_path + "/Paths");
145  for (uint32_t p = 1; p <= size; ++p) {
146  // extract the list of Paths and EndPaths from the bin labels of one of the summary plots
147  std::string label = paths->GetXaxis()->GetBinLabel(p);
148  MonitorElement * me_counter = getter.get( current_path + "/Paths/" + label + "_module_counter" );
149  MonitorElement * me_total = getter.get( current_path + "/Paths/" + label + "_module_total" );
150  if (me_counter == 0 or me_total == 0)
151  continue;
152  TH1F * counter = me_counter->getTH1F();
153  TH1F * total = me_total ->getTH1F();
154  uint32_t bins = counter->GetXaxis()->GetNbins();
155  double min = counter->GetXaxis()->GetXmin();
156  double max = counter->GetXaxis()->GetXmax();
157  TH1F * average = booker.book1D(label + "_module_average", label + " module average", bins, min, max)->getTH1F();
158  average ->SetYTitle("processing time [ms]");
159  TH1F * running = booker.book1D(label + "_module_running", label + " module running", bins, min, max)->getTH1F();
160  running ->SetYTitle("processing time [ms]");
161  TH1F * efficiency = booker.book1D(label + "_module_efficiency", label + " module efficiency", bins, min, max)->getTH1F();
162  efficiency->SetYTitle("filter efficiency");
163  efficiency->SetMaximum(1.05);
164  for (uint32_t i = 1; i <= bins; ++i) {
165  const char * module = counter->GetXaxis()->GetBinLabel(i);
166  average ->GetXaxis()->SetBinLabel(i, module);
167  running ->GetXaxis()->SetBinLabel(i, module);
168  efficiency->GetXaxis()->SetBinLabel(i, module);
169  double t = total ->GetBinContent(i);
170  double n = counter->GetBinContent(i);
171  double p = counter->GetBinContent(i+1);
172  average ->SetBinContent(i, t / events);
173  if (n) {
174  running ->SetBinContent(i, t / n);
175  efficiency->SetBinContent(i, p / n);
176  }
177  }
178  }
179 
180 }
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
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:291
const T & max(const T &a, const T &b)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
TH1F * getTH1F(void) const
int average
Definition: PDRates.py:137
tuple events
Definition: patZpeak.py:19
static std::atomic< unsigned int > counter
TProfile * getTProfile(void) const
Definition: vlib.h:208
tuple size
Write out results.
void FastTimerServiceClient::fillProcessSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
std::string const &  path 
)
private

Definition at line 90 of file FastTimerServiceClient.cc.

References DQMStore::IGetter::dirExists(), patZpeak::events, fillPathSummaryPlots(), DQMStore::IGetter::get(), DQMStore::IGetter::getSubdirs(), MonitorElement::getTH1F(), relval_parameters_module::process_name, and DQMStore::IBooker::setCurrentFolder().

Referenced by fillSummaryPlots().

90  {
91  MonitorElement * me = getter.get(current_path + "/event");
92  if (me == 0)
93  // no FastTimerService DQM information
94  return;
95 
96  double events = me->getTH1F()->GetEntries();
97 
98  // look for per-process directories
99  static const boost::regex process_name(".*/process .*");
100  booker.setCurrentFolder(current_path);
101  std::vector<std::string> subdirs = getter.getSubdirs();
102  for (auto const & subdir: subdirs) {
103  if (boost::regex_match(subdir, process_name)) {
104  // look for per-path plots inside each per-process directory
105  if (getter.dirExists(subdir + "/Paths"))
106  fillPathSummaryPlots(booker, getter, events, subdir);
107  }
108  }
109 
110  // look for per-path plots inside the current directory
111  if (getter.dirExists(current_path + "/Paths"))
112  fillPathSummaryPlots(booker, getter, events, current_path);
113 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:291
void fillPathSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, double events, std::string const &path)
bool dirExists(const std::string &path)
Definition: DQMStore.cc:307
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
TH1F * getTH1F(void) const
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:295
tuple events
Definition: patZpeak.py:19
void FastTimerServiceClient::fillSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
private

Definition at line 68 of file FastTimerServiceClient.cc.

References fillProcessSummaryPlots(), DQMStore::IGetter::get(), DQMStore::IGetter::getSubdirs(), m_dqm_path, and DQMStore::IBooker::setCurrentFolder().

Referenced by dqmEndJob().

69 {
70  if (getter.get(m_dqm_path + "/event")) {
71  // the plots are directly in the configured folder
72  fillProcessSummaryPlots(booker, getter, m_dqm_path);
73  } else {
74  static const boost::regex running_n_processes(".*/Running [0-9]+ processes");
76  std::vector<std::string> subdirs = getter.getSubdirs();
77  for (auto const & subdir: subdirs) {
78  if (boost::regex_match(subdir, running_n_processes)) {
79  // the plots are in a per-number-of-processes folder
80  if (getter.get(subdir + "/event"))
81  fillProcessSummaryPlots(booker, getter, subdir);
82  }
83  }
84  }
85 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:291
void fillProcessSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &path)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:295

Member Data Documentation

std::string FastTimerServiceClient::m_dqm_path
private

Definition at line 34 of file FastTimerServiceClient.cc.

Referenced by fillSummaryPlots().