CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
FastTimerServiceClient Class Reference
Inheritance diagram for FastTimerServiceClient:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 FastTimerServiceClient (edm::ParameterSet const &)
 
 ~FastTimerServiceClient () override=default
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillLumiMePSetDescription (edm::ParameterSetDescription &pset)
 
static void fillPUMePSetDescription (edm::ParameterSetDescription &pset)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
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) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &booker, DQMStore::IGetter &getter, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void fillPathSummaryPlots (DQMStore::IBooker &booker, DQMStore::IGetter &getter, double events, std::string const &path)
 
void fillPlotsVsLumi (DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &current_path, std::string const &suffix, MEPSet const &pset)
 
void fillProcessSummaryPlots (DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &path)
 
void fillSummaryPlots (DQMStore::IBooker &booker, DQMStore::IGetter &getter)
 

Static Private Member Functions

static MEPSet getHistoPSet (const edm::ParameterSet &pset)
 

Private Attributes

bool const doPlotsVsOnlineLumi_
 
bool const doPlotsVsPixelLumi_
 
bool const doPlotsVsPU_
 
std::string const dqm_path_
 
bool const fillEveryLumiSection_
 
MEPSet const onlineLumiMEPSet_
 
MEPSet const pixelLumiMEPSet_
 
MEPSet const puMEPSet_
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 34 of file FastTimerServiceClient.cc.

Constructor & Destructor Documentation

◆ FastTimerServiceClient()

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

Definition at line 77 of file FastTimerServiceClient.cc.

78  : dqm_path_(config.getUntrackedParameter<std::string>("dqmPath")),
79  doPlotsVsOnlineLumi_(config.getParameter<bool>("doPlotsVsOnlineLumi")),
80  doPlotsVsPixelLumi_(config.getParameter<bool>("doPlotsVsPixelLumi")),
81  doPlotsVsPU_(config.getParameter<bool>("doPlotsVsPU")),
83  : MEPSet{}),
85  : MEPSet{}),
86  puMEPSet_(doPlotsVsPU_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("puME")) : MEPSet{}),
87  fillEveryLumiSection_(config.getParameter<bool>("fillEveryLumiSection")) {}
Definition: config.py:1
static MEPSet getHistoPSet(const edm::ParameterSet &pset)

◆ ~FastTimerServiceClient()

FastTimerServiceClient::~FastTimerServiceClient ( )
overridedefault

Member Function Documentation

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 89 of file FastTimerServiceClient.cc.

References fillSummaryPlots().

89  {
90  fillSummaryPlots(booker, getter);
91 }
void fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter)

◆ dqmEndLuminosityBlock()

void FastTimerServiceClient::dqmEndLuminosityBlock ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 93 of file FastTimerServiceClient.cc.

References fillEveryLumiSection_, and fillSummaryPlots().

96  {
98  fillSummaryPlots(booker, getter);
99 }
void fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter)

◆ fillDescriptions()

void FastTimerServiceClient::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 473 of file FastTimerServiceClient.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, fillLumiMePSetDescription(), fillPUMePSetDescription(), and AlCaHLTBitMon_QueryRunRegistry::string.

473  {
474  // The following says we do not know what parameters are allowed so do no validation
475  // Please change this to state exactly what you do use, even if it is no parameters
477  desc.addUntracked<std::string>("dqmPath", "HLT/TimerService");
478  desc.add<bool>("doPlotsVsOnlineLumi", true);
479  desc.add<bool>("doPlotsVsPixelLumi", false);
480  desc.add<bool>("doPlotsVsPU", true);
481 
482  edm::ParameterSetDescription onlineLumiMEPSet;
483  fillLumiMePSetDescription(onlineLumiMEPSet);
484  desc.add<edm::ParameterSetDescription>("onlineLumiME", onlineLumiMEPSet);
485 
486  edm::ParameterSetDescription pixelLumiMEPSet;
487  fillLumiMePSetDescription(pixelLumiMEPSet);
488  desc.add<edm::ParameterSetDescription>("pixelLumiME", pixelLumiMEPSet);
489 
491  fillPUMePSetDescription(puMEPSet);
492  desc.add<edm::ParameterSetDescription>("puME", puMEPSet);
493  desc.add<bool>("fillEveryLumiSection", true);
494  descriptions.add("fastTimerServiceClient", desc);
495 }
static void fillPUMePSetDescription(edm::ParameterSetDescription &pset)
static void fillLumiMePSetDescription(edm::ParameterSetDescription &pset)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ fillLumiMePSetDescription()

void FastTimerServiceClient::fillLumiMePSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 447 of file FastTimerServiceClient.cc.

References muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillDescriptions().

447  {
448  pset.add<std::string>("folder", "HLT/LumiMonitoring");
449  pset.add<std::string>("name", "lumiVsLS");
450  pset.add<int>("nbins", 440);
451  pset.add<double>("xmin", 0.);
452  pset.add<double>("xmax", 22000.);
453 }

◆ fillPathSummaryPlots()

void FastTimerServiceClient::fillPathSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
double  events,
std::string const &  path 
)
private

Definition at line 166 of file FastTimerServiceClient.cc.

References cms::cuda::assert(), trigObjTnPSource_cfi::bins, dqm::implementation::IBooker::book1D(), doPlotsVsOnlineLumi_, doPlotsVsPixelLumi_, doPlotsVsPU_, L1TObjectsTimingClient_cff::efficiency, events, fillPlotsVsLumi(), dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getMEs(), dqm::implementation::IGetter::getSubdirs(), dqm::legacy::MonitorElement::getTH1D(), dqm::legacy::MonitorElement::getTH1F(), mps_fire::i, SiStripPI::max, hlt_dqm_clientPB-live_cfg::me, SiStripPI::mean, SiStripPI::min, dqmiodumpmetadata::n, onlineLumiMEPSet_, or, AlCaHLTBitMon_ParallelJobs::p, castor_dqm_sourceclient_file_cfg::path, pixelLumiMEPSet_, hcallasereventfilter2012_cfi::prefix, puMEPSet_, dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and submitPVValidationJobs::t.

Referenced by fillProcessSummaryPlots().

169  {
170  // note: the following checks need to be kept separate, as any of these histograms might be missing
171 
172  booker.setCurrentFolder(current_path);
173  std::vector<std::string> subsubdirs = getter.getSubdirs();
174  size_t npaths = subsubdirs.size();
175 
176  MonitorElement* paths_time =
177  booker.book1D("paths_time_real", "Total (real) time spent in each path", npaths, -0.5, double(npaths) - 0.5);
178  MonitorElement* paths_thread =
179  booker.book1D("paths_time_thread", "Total (thread) time spent in each path", npaths, -0.5, double(npaths) - 0.5);
180  MonitorElement* paths_allocated =
181  booker.book1D("paths_allocated", "Total allocated memory in each path", npaths, -0.5, double(npaths) - 0.5);
182  MonitorElement* paths_deallocated =
183  booker.book1D("paths_deallocated", "Total deallocated in each path", npaths, -0.5, double(npaths) - 0.5);
184 
186  double mean = -1.;
187 
188  // extract the list of Paths and EndPaths from the summary plots
189  int ibin = 1;
190  for (auto const& subsubdir : subsubdirs) {
191  std::string test = "/path ";
192  if (subsubdir.find(test) == std::string::npos)
193  continue;
194 
195  static const boost::regex prefix(current_path + "/path ");
196  std::string path = boost::regex_replace(subsubdir, prefix, "");
197 
198  paths_time->setBinLabel(ibin, path);
199  paths_thread->setBinLabel(ibin, path);
200  paths_allocated->setBinLabel(ibin, path);
201  paths_deallocated->setBinLabel(ibin, path);
202 
203  if ((me = getter.get(subsubdir + "/path time_real"))) {
204  mean = me->getMean();
205  paths_time->setBinContent(ibin, mean);
206  }
207  if ((me = getter.get(subsubdir + "/path time_thread"))) {
208  mean = me->getMean();
209  paths_thread->setBinContent(ibin, mean);
210  }
211  if ((me = getter.get(subsubdir + "/path allocated"))) {
212  mean = me->getMean();
213  paths_allocated->setBinContent(ibin, mean);
214  }
215 
216  if ((me = getter.get(subsubdir + "/path deallocated"))) {
217  mean = me->getMean();
218  paths_deallocated->setBinContent(ibin, mean);
219  }
220 
221  ibin++;
222  }
223 
224  for (auto const& subsubdir : subsubdirs) {
225  // for each path, fill histograms with
226  // - the average time spent in each module (total time spent in that module, averaged over all events)
227  // - the running time spent in each module (total time spent in that module, averaged over the events where that module actually ran)
228  // - the "efficiency" of each module (number of time a module succeded divided by the number of times the has run)
229 
230  getter.setCurrentFolder(subsubdir);
231  std::vector<std::string> allmenames = getter.getMEs();
232  if (allmenames.empty())
233  continue;
234 
235  MonitorElement* me_counter = getter.get(subsubdir + "/module_counter");
236  MonitorElement* me_real_total = getter.get(subsubdir + "/module_time_real_total");
237  MonitorElement* me_thread_total = getter.get(subsubdir + "/module_time_thread_total");
238 
239  if (me_counter == nullptr or me_real_total == nullptr)
240  continue;
241 
242  TH1D* counter = me_counter->getTH1D();
243  TH1D* real_total = me_real_total->getTH1D();
244  TH1D* thread_total = me_thread_total->getTH1D();
245  uint32_t bins = counter->GetXaxis()->GetNbins() - 1;
246  double min = counter->GetXaxis()->GetXmin();
247  double max = counter->GetXaxis()->GetXmax() - 1;
248 
249  TH1F* real_average;
250  TH1F* real_running;
251  TH1F* thread_average;
252  TH1F* thread_running;
253  TH1F* efficiency;
255 
256  booker.setCurrentFolder(subsubdir);
257  me = getter.get(subsubdir + "/module_time_real_average");
258  if (me) {
259  real_average = me->getTH1F();
260  assert(me->getTH1F()->GetXaxis()->GetXmin() == min);
261  assert(me->getTH1F()->GetXaxis()->GetXmax() == max);
262  real_average->Reset();
263  } else {
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) {
267  const char* module = counter->GetXaxis()->GetBinLabel(i);
268  real_average->GetXaxis()->SetBinLabel(i, module);
269  }
270  }
271 
272  me = getter.get(subsubdir + "/module_time_thread_average");
273  if (me) {
274  thread_average = me->getTH1F();
275  assert(me->getTH1F()->GetXaxis()->GetXmin() == min);
276  assert(me->getTH1F()->GetXaxis()->GetXmax() == max);
277  thread_average->Reset();
278  } else {
279  thread_average =
280  booker.book1D("module_time_thread_average", "module thread average timing", bins, min, max)->getTH1F();
281  thread_average->SetYTitle("average processing (thread) time [ms]");
282  for (uint32_t i = 1; i <= bins; ++i) {
283  const char* module = counter->GetXaxis()->GetBinLabel(i);
284  thread_average->GetXaxis()->SetBinLabel(i, module);
285  }
286  }
287 
288  me = getter.get(subsubdir + "/module_time_real_running");
289  if (me) {
290  real_running = me->getTH1F();
291  assert(me->getTH1F()->GetXaxis()->GetXmin() == min);
292  assert(me->getTH1F()->GetXaxis()->GetXmax() == max);
293  real_running->Reset();
294  } else {
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) {
298  const char* module = counter->GetXaxis()->GetBinLabel(i);
299  real_running->GetXaxis()->SetBinLabel(i, module);
300  }
301  }
302 
303  me = getter.get(subsubdir + "/module_time_thread_running");
304  if (me) {
305  thread_running = me->getTH1F();
306  assert(me->getTH1F()->GetXaxis()->GetXmin() == min);
307  assert(me->getTH1F()->GetXaxis()->GetXmax() == max);
308  thread_running->Reset();
309  } else {
310  thread_running =
311  booker.book1D("module_time_thread_running", "module thread running timing", bins, min, max)->getTH1F();
312  thread_running->SetYTitle("running processing (thread) time [ms]");
313  for (uint32_t i = 1; i <= bins; ++i) {
314  const char* module = counter->GetXaxis()->GetBinLabel(i);
315  thread_running->GetXaxis()->SetBinLabel(i, module);
316  }
317  }
318 
319  me = getter.get(subsubdir + "/module_efficiency");
320  if (me) {
321  efficiency = me->getTH1F();
322  assert(me->getTH1F()->GetXaxis()->GetXmin() == min);
323  assert(me->getTH1F()->GetXaxis()->GetXmax() == max);
324  efficiency->Reset();
325  } else {
326  efficiency = booker.book1D("module_efficiency", "module efficiency", bins, min, max)->getTH1F();
327  efficiency->SetYTitle("filter efficiency");
328  efficiency->SetMaximum(1.05);
329  for (uint32_t i = 1; i <= bins; ++i) {
330  const char* module = counter->GetXaxis()->GetBinLabel(i);
331  efficiency->GetXaxis()->SetBinLabel(i, module);
332  }
333  }
334 
335  for (uint32_t i = 1; i <= bins; ++i) {
336  double n = counter->GetBinContent(i);
337  double p = counter->GetBinContent(i + 1);
338  if (n)
339  efficiency->SetBinContent(i, p / n);
340 
341  // real timing
342  double t = real_total->GetBinContent(i);
343  real_average->SetBinContent(i, t / events);
344  if (n)
345  real_running->SetBinContent(i, t / n);
346 
347  // thread timing
348  t = thread_total->GetBinContent(i);
349  thread_average->SetBinContent(i, t / events);
350  if (n)
351  thread_running->SetBinContent(i, t / n);
352  }
353 
354  // vs lumi
356  fillPlotsVsLumi(booker, getter, subsubdir, "vs_lumi", onlineLumiMEPSet_);
358  fillPlotsVsLumi(booker, getter, subsubdir, "vs_pixelLumi", pixelLumiMEPSet_);
359  if (doPlotsVsPU_)
360  fillPlotsVsLumi(booker, getter, subsubdir, "vs_pileup", puMEPSet_);
361  }
362 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void fillPlotsVsLumi(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &current_path, std::string const &suffix, MEPSet const &pset)
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:759
assert(be >=bs)
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
Definition: Activities.doc:12
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)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual TH1F * getTH1F() const
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
int events
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:739

◆ fillPlotsVsLumi()

void FastTimerServiceClient::fillPlotsVsLumi ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
std::string const &  current_path,
std::string const &  suffix,
MEPSet const &  pset 
)
private

Definition at line 365 of file FastTimerServiceClient.cc.

References cms::cuda::assert(), dqm::implementation::IBooker::bookProfile(), dqm::impl::MonitorElement::Fill(), printsummarytable::folder, dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getMEs(), dqm::legacy::MonitorElement::getTProfile(), label, BXlumiParameters_cfi::lumi, visualization-live-secondInstance_cfg::m, SiStripPI::max, hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, LaserClient_cfi::nbins, muonDTDigis_cfi::pset, dqm::impl::MonitorElement::Reset(), dqm::implementation::NavigatorBase::setCurrentFolder(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, makePlotsFromDump::suffix, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, compareTotals::xtitle, y, L1TOccupancyClient_cfi::ymax, L1TOccupancyClient_cfi::ymin, and compareTotals::ytitle.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

369  {
370  std::vector<std::string> menames;
371 
372  static const boost::regex byls(".*byls");
373  // get all MEs in the current_path
374  getter.setCurrentFolder(current_path);
375  std::vector<std::string> allmenames = getter.getMEs();
376  for (auto const& m : allmenames) {
377  // get only MEs vs LS
378  if (boost::regex_match(m, byls))
379  menames.push_back(m);
380  }
381  // if no MEs available, return
382  if (menames.empty())
383  return;
384 
385  // get info for getting the lumi VS LS histogram
386  std::string folder = pset.folder;
387  std::string name = pset.name;
388  int nbins = pset.nbins;
389  double xmin = pset.xmin;
390  double xmax = pset.xmax;
391 
392  // get lumi/PU VS LS ME
393  getter.setCurrentFolder(folder);
394  MonitorElement* lumiVsLS = getter.get(folder + "/" + name);
395  // if no ME available, return
396  if (!lumiVsLS) {
397  edm::LogWarning("FastTimerServiceClient") << "no " << name << " ME is available in " << folder << std::endl;
398  return;
399  }
400 
401  // get range and binning for new MEs x-axis
402  size_t size = lumiVsLS->getTProfile()->GetXaxis()->GetNbins();
403  std::string xtitle = lumiVsLS->getTProfile()->GetYaxis()->GetTitle();
404 
405  std::vector<double> lumi;
406  std::vector<int> LS;
407  for (size_t ibin = 1; ibin <= size; ++ibin) {
408  // avoid to store points w/ no info
409  if (lumiVsLS->getTProfile()->GetBinContent(ibin) == 0.)
410  continue;
411 
412  lumi.push_back(lumiVsLS->getTProfile()->GetBinContent(ibin));
413  LS.push_back(lumiVsLS->getTProfile()->GetXaxis()->GetBinCenter(ibin));
414  }
415 
416  booker.setCurrentFolder(current_path);
417  getter.setCurrentFolder(current_path);
418  for (auto const& m : menames) {
419  std::string label = m;
420  label.erase(label.find("_byls"));
421 
422  MonitorElement* me = getter.get(current_path + "/" + m);
423  float ymin = 0.;
425  std::string ytitle = me->getTProfile()->GetYaxis()->GetTitle();
426 
427  MonitorElement* meVsLumi = getter.get(current_path + "/" + label + "_" + suffix);
428  if (meVsLumi) {
429  assert(meVsLumi->getTProfile()->GetXaxis()->GetXmin() == xmin);
430  assert(meVsLumi->getTProfile()->GetXaxis()->GetXmax() == xmax);
431  meVsLumi->Reset(); // do I have to do it ?!?!?
432  } else {
433  meVsLumi = booker.bookProfile(label + "_" + suffix, label + "_" + suffix, nbins, xmin, xmax, ymin, ymax);
434  // TProfile* meVsLumi_p = meVsLumi->getTProfile();
435  meVsLumi->getTProfile()->GetXaxis()->SetTitle(xtitle.c_str());
436  meVsLumi->getTProfile()->GetYaxis()->SetTitle(ytitle.c_str());
437  }
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);
441 
442  meVsLumi->Fill(lumi[ils], y);
443  }
444  }
445 }
size
Write out results.
virtual TProfile * getTProfile() const
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:759
assert(be >=bs)
void Fill(long long x)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
char const * label
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())
Definition: DQMStore.h:399
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
Log< level::Warning, false > LogWarning

◆ fillProcessSummaryPlots()

void FastTimerServiceClient::fillProcessSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
std::string const &  path 
)
private

Definition at line 127 of file FastTimerServiceClient.cc.

References doPlotsVsOnlineLumi_, doPlotsVsPixelLumi_, doPlotsVsPU_, events, fillPathSummaryPlots(), fillPlotsVsLumi(), dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getSubdirs(), hlt_dqm_clientPB-live_cfg::me, onlineLumiMEPSet_, pixelLumiMEPSet_, puMEPSet_, dqm::implementation::NavigatorBase::setCurrentFolder(), mkLumiAveragedPlots::subdir, and compareTotals::subdirs.

Referenced by fillSummaryPlots().

129  {
130  MonitorElement* me = getter.get(current_path + "/event time_real");
131  if (me == nullptr)
132  // no FastTimerService DQM information
133  return;
134 
136  fillPlotsVsLumi(booker, getter, current_path, "vs_lumi", onlineLumiMEPSet_);
138  fillPlotsVsLumi(booker, getter, current_path, "vs_pixelLumi", pixelLumiMEPSet_);
139  if (doPlotsVsPU_)
140  fillPlotsVsLumi(booker, getter, current_path, "vs_pileup", puMEPSet_);
141 
142  // getter.setCurrentFolder(current_path);
143 
144  double events = me->getTH1F()->GetEntries();
145 
146  // look for per-process directories
147  static const boost::regex process_name(".*/process .*");
148 
149  booker.setCurrentFolder(current_path); // ?!?!?
150  std::vector<std::string> subdirs = getter.getSubdirs();
151  for (auto const& subdir : subdirs) {
152  if (boost::regex_match(subdir, process_name)) {
153  getter.setCurrentFolder(subdir);
154  // look for per-path plots inside each per-process directory
155  std::vector<std::string> subsubdirs = getter.getSubdirs();
156  for (auto const& subsubdir : subsubdirs) {
157  if (getter.get(subsubdir + "/path time_real")) {
158  fillPathSummaryPlots(booker, getter, events, subdir);
159  break;
160  }
161  }
162  }
163  } // loop on subdir
164 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void fillPlotsVsLumi(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &current_path, std::string const &suffix, MEPSet const &pset)
void fillPathSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, double events, std::string const &path)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
int events
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:739

◆ fillPUMePSetDescription()

void FastTimerServiceClient::fillPUMePSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 455 of file FastTimerServiceClient.cc.

References muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillDescriptions().

455  {
456  pset.add<std::string>("folder", "HLT/LumiMonitoring");
457  pset.add<std::string>("name", "puVsLS");
458  pset.add<int>("nbins", 260);
459  pset.add<double>("xmin", 0.);
460  pset.add<double>("xmax", 130.);
461 }

◆ fillSummaryPlots()

void FastTimerServiceClient::fillSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
private

Definition at line 101 of file FastTimerServiceClient.cc.

References dqm_path_, fillProcessSummaryPlots(), dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getSubdirs(), dqm::implementation::NavigatorBase::setCurrentFolder(), mkLumiAveragedPlots::subdir, and compareTotals::subdirs.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

101  {
102  if (getter.get(dqm_path_ + "/event time_real")) {
103  // the plots are directly in the configured folder
104  fillProcessSummaryPlots(booker, getter, dqm_path_);
105  } else {
106  static const boost::regex running_n_processes(".*/Running .*");
107 
108  booker.setCurrentFolder(dqm_path_);
109  std::vector<std::string> subdirs = getter.getSubdirs();
110  for (auto const& subdir : subdirs) {
111  // the plots are in a per-number-of-processes folder
112  if (boost::regex_match(subdir, running_n_processes)) {
113  booker.setCurrentFolder(subdir);
114  if (getter.get(subdir + "/event time_real"))
115  fillProcessSummaryPlots(booker, getter, subdir);
116 
117  std::vector<std::string> subsubdirs = getter.getSubdirs();
118  for (auto const& subsubdir : subsubdirs) {
119  if (getter.get(subsubdir + "/event time_real"))
120  fillProcessSummaryPlots(booker, getter, subsubdir);
121  }
122  }
123  } // loop on subdirs
124  }
125 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void fillProcessSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &path)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:739

◆ getHistoPSet()

MEPSet FastTimerServiceClient::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 463 of file FastTimerServiceClient.cc.

References muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

463  {
464  return MEPSet{
465  pset.getParameter<std::string>("folder"),
466  pset.getParameter<std::string>("name"),
467  pset.getParameter<int>("nbins"),
468  pset.getParameter<double>("xmin"),
469  pset.getParameter<double>("xmax"),
470  };
471 }

Member Data Documentation

◆ doPlotsVsOnlineLumi_

bool const FastTimerServiceClient::doPlotsVsOnlineLumi_
private

Definition at line 66 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

◆ doPlotsVsPixelLumi_

bool const FastTimerServiceClient::doPlotsVsPixelLumi_
private

Definition at line 67 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

◆ doPlotsVsPU_

bool const FastTimerServiceClient::doPlotsVsPU_
private

Definition at line 68 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

◆ dqm_path_

std::string const FastTimerServiceClient::dqm_path_
private

Definition at line 64 of file FastTimerServiceClient.cc.

Referenced by fillSummaryPlots().

◆ fillEveryLumiSection_

bool const FastTimerServiceClient::fillEveryLumiSection_
private

Definition at line 74 of file FastTimerServiceClient.cc.

Referenced by dqmEndLuminosityBlock().

◆ onlineLumiMEPSet_

MEPSet const FastTimerServiceClient::onlineLumiMEPSet_
private

Definition at line 70 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

◆ pixelLumiMEPSet_

MEPSet const FastTimerServiceClient::pixelLumiMEPSet_
private

Definition at line 71 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

◆ puMEPSet_

MEPSet const FastTimerServiceClient::puMEPSet_
private

Definition at line 72 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().