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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 FastTimerServiceClient (edm::ParameterSet const &)
 
 ~FastTimerServiceClient () override
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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)
 
 ~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
 
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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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 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 doPlotsVsPixelLumi_
 
bool doPlotsVsPU_
 
bool doPlotsVsScalLumi_
 
std::string m_dqm_path
 
MEPSet pixelLumiMEPSet_
 
MEPSet puMEPSet_
 
MEPSet scalLumiMEPSet_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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::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)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 34 of file FastTimerServiceClient.cc.

Constructor & Destructor Documentation

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

Definition at line 67 of file FastTimerServiceClient.cc.

References doPlotsVsPixelLumi_, doPlotsVsPU_, getHistoPSet(), pixelLumiMEPSet_, puMEPSet_, and ~FastTimerServiceClient().

67  :
68  m_dqm_path( config.getUntrackedParameter<std::string>( "dqmPath" ) )
69  , doPlotsVsScalLumi_ ( config.getParameter<bool>( "doPlotsVsScalLumi" ) )
70  , doPlotsVsPixelLumi_( config.getParameter<bool>( "doPlotsVsPixelLumi" ) )
71  , doPlotsVsPU_ ( config.getParameter<bool>( "doPlotsVsPU" ) )
72  , scalLumiMEPSet_ ( doPlotsVsScalLumi_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("scalLumiME") ) : MEPSet{} )
73  , pixelLumiMEPSet_( doPlotsVsPixelLumi_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("pixelLumiME")) : MEPSet{} )
74  , puMEPSet_ ( doPlotsVsPU_ ? getHistoPSet(config.getParameter<edm::ParameterSet>("puME") ) : MEPSet{} )
75 {
76 }
Definition: config.py:1
static MEPSet getHistoPSet(const edm::ParameterSet &pset)
FastTimerServiceClient::~FastTimerServiceClient ( )
overridedefault

Referenced by FastTimerServiceClient().

Member Function Documentation

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

Implements DQMEDHarvester.

Definition at line 81 of file FastTimerServiceClient.cc.

References fillSummaryPlots().

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

Reimplemented from DQMEDHarvester.

Definition at line 87 of file FastTimerServiceClient.cc.

References fillSummaryPlots().

88 {
89  fillSummaryPlots(booker, getter);
90 }
void fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter)
void FastTimerServiceClient::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 477 of file FastTimerServiceClient.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), DEFINE_FWK_MODULE, funct::false, fillLumiMePSetDescription(), fillPUMePSetDescription(), AlCaHLTBitMon_QueryRunRegistry::string, and funct::true.

477  {
478  // The following says we do not know what parameters are allowed so do no validation
479  // Please change this to state exactly what you do use, even if it is no parameters
481  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
482  desc.add<bool>( "doPlotsVsScalLumi", true );
483  desc.add<bool>( "doPlotsVsPixelLumi", false );
484  desc.add<bool>( "doPlotsVsPU", true );
485 
486  edm::ParameterSetDescription scalLumiMEPSet;
487  fillLumiMePSetDescription(scalLumiMEPSet);
488  desc.add<edm::ParameterSetDescription>("scalLumiME", scalLumiMEPSet);
489 
490  edm::ParameterSetDescription pixelLumiMEPSet;
491  fillLumiMePSetDescription(pixelLumiMEPSet);
492  desc.add<edm::ParameterSetDescription>("pixelLumiME", pixelLumiMEPSet);
493 
495  fillPUMePSetDescription(puMEPSet);
496  desc.add<edm::ParameterSetDescription>("puME", puMEPSet);
497 
498  descriptions.add("fastTimerServiceClient", desc);
499 }
static void fillPUMePSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static void fillLumiMePSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void FastTimerServiceClient::fillLumiMePSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 446 of file FastTimerServiceClient.cc.

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

Referenced by fillDescriptions().

446  {
447  pset.add<std::string>("folder", "HLT/LumiMonitoring");
448  pset.add<std::string>("name" , "lumiVsLS");
449  pset.add<int> ("nbins", 440 );
450  pset.add<double>("xmin", 0.);
451  pset.add<double>("xmax", 22000.);
452 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void FastTimerServiceClient::fillPathSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
double  events,
std::string const &  path 
)
private

Definition at line 169 of file FastTimerServiceClient.cc.

References create_public_pileup_plots::bins, DQMStore::IBooker::book1D(), doPlotsVsPixelLumi_, doPlotsVsPU_, doPlotsVsScalLumi_, PostProcessor_cff::efficiency, fillPlotsVsLumi(), DQMStore::IGetter::get(), MonitorElement::getMean(), DQMStore::IGetter::getMEs(), DQMStore::IGetter::getSubdirs(), MonitorElement::getTH1D(), MonitorElement::getTH1F(), mps_fire::i, SiStripPI::max, SiStripPI::mean, min(), gen::n, or, AlCaHLTBitMon_ParallelJobs::p, callgraph::path, pixelLumiMEPSet_, tablePrinter::prefix, puMEPSet_, scalLumiMEPSet_, DQMStore::IBooker::setCurrentFolder(), DQMStore::IGetter::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and lumiQTWidget::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 = booker.book1D("paths_time_real", "Total (real) time spent in each path", npaths, -0.5, double(npaths)-0.5);
177  MonitorElement* paths_thread = booker.book1D("paths_time_thread","Total (thread) time spent in each path", npaths, -0.5, double(npaths)-0.5);
178  MonitorElement* paths_allocated = booker.book1D("paths_allocated", "Total allocated memory in each path", npaths, -0.5, double(npaths)-0.5);
179  MonitorElement* paths_deallocated = booker.book1D("paths_deallocated","Total deallocated in each path", npaths, -0.5, double(npaths)-0.5);
180 
181  MonitorElement * me;
182  double mean = -1.;
183 
184  // extract the list of Paths and EndPaths from the summary plots
185  int ibin = 1;
186  for (auto const & subsubdir: subsubdirs) {
187 
188  std::string test = "/path ";
189  if ( subsubdir.find(test)==std::string::npos ) continue;
190 
191  static const boost::regex prefix(current_path + "/path ");
192  std::string path = boost::regex_replace(subsubdir,prefix,"");
193 
194  paths_time ->getTH1F()->GetXaxis()->SetBinLabel(ibin,path.c_str());
195  paths_thread ->getTH1F()->GetXaxis()->SetBinLabel(ibin,path.c_str());
196  paths_allocated ->getTH1F()->GetXaxis()->SetBinLabel(ibin,path.c_str());
197  paths_deallocated->getTH1F()->GetXaxis()->SetBinLabel(ibin,path.c_str());
198 
199 
200  if ( (me = getter.get(subsubdir + "/path time_real")) ) {
201  mean = me->getMean();
202  paths_time->getTH1F()->SetBinContent(ibin,mean);
203  }
204  if ( (me = getter.get(subsubdir + "/path time_thread")) ) {
205  mean = me->getMean();
206  paths_thread->getTH1F()->SetBinContent(ibin,mean);
207  }
208  if ( (me = getter.get(subsubdir + "/path allocated")) ) {
209  mean = me->getMean();
210  paths_allocated->getTH1F()->SetBinContent(ibin,mean);
211  }
212 
213  if ( (me = getter.get(subsubdir + "/path deallocated")) ) {
214  mean = me->getMean();
215  paths_deallocated->getTH1F()->SetBinContent(ibin,mean);
216  }
217 
218  ibin++;
219  }
220 
221 
222  for (auto const & subsubdir: subsubdirs) {
223  // for each path, fill histograms with
224  // - the average time spent in each module (total time spent in that module, averaged over all events)
225  // - the running time spent in each module (total time spent in that module, averaged over the events where that module actually ran)
226  // - the "efficiency" of each module (number of time a module succeded divided by the number of times the has run)
227 
228  getter.setCurrentFolder(subsubdir);
229  std::vector<std::string> allmenames = getter.getMEs();
230  if ( allmenames.empty() ) continue;
231 
232  MonitorElement * me_counter = getter.get( subsubdir + "/module_counter" );
233  MonitorElement * me_real_total = getter.get( subsubdir + "/module_time_real_total" );
234  MonitorElement * me_thread_total = getter.get( subsubdir + "/module_time_thread_total" );
235 
236  if (me_counter == nullptr or me_real_total == nullptr)
237  continue;
238 
239  TH1D * counter = me_counter ->getTH1D();
240  TH1D * real_total = me_real_total->getTH1D();
241  TH1D * thread_total = me_thread_total->getTH1D();
242  uint32_t bins = counter->GetXaxis()->GetNbins() - 1;
243  double min = counter->GetXaxis()->GetXmin();
244  double max = counter->GetXaxis()->GetXmax() - 1;
245 
246  TH1F * real_average;
247  TH1F * real_running;
248  TH1F * thread_average;
249  TH1F * thread_running;
250  TH1F * efficiency;
251  MonitorElement * me;
252 
253  booker.setCurrentFolder(subsubdir);
254  me = getter.get( "module_time_real_average" );
255  if (me) {
256  real_average = me->getTH1F();
257  assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
258  assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
259  real_average->Reset();
260  } else {
261  real_average = booker.book1D("module_time_real_average", "module real average timing", bins, min, max)->getTH1F();
262  real_average->SetYTitle("average processing (real) time [ms]");
263  for (uint32_t i = 1; i <= bins; ++i) {
264  const char * module = counter->GetXaxis()->GetBinLabel(i);
265  real_average->GetXaxis()->SetBinLabel(i, module);
266  }
267  }
268 
269  me = getter.get( "module_time_thread_average" );
270  if (me) {
271  thread_average = me->getTH1F();
272  assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
273  assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
274  thread_average->Reset();
275  } else {
276  thread_average = booker.book1D("module_time_thread_average", "module thread average timing", bins, min, max)->getTH1F();
277  thread_average->SetYTitle("average processing (thread) time [ms]");
278  for (uint32_t i = 1; i <= bins; ++i) {
279  const char * module = counter->GetXaxis()->GetBinLabel(i);
280  thread_average->GetXaxis()->SetBinLabel(i, module);
281  }
282  }
283 
284  me = getter.get( "module_time_real_running" );
285  if (me) {
286  real_running = me->getTH1F();
287  assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
288  assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
289  real_running->Reset();
290  } else {
291  real_running = booker.book1D("module_time_real_running", "module real running timing", bins, min, max)->getTH1F();
292  real_running->SetYTitle("running processing (real) time [ms]");
293  for (uint32_t i = 1; i <= bins; ++i) {
294  const char * module = counter->GetXaxis()->GetBinLabel(i);
295  real_running->GetXaxis()->SetBinLabel(i, module);
296  }
297  }
298 
299  me = getter.get( "module_time_thread_running" );
300  if (me) {
301  thread_running = me->getTH1F();
302  assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
303  assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
304  thread_running->Reset();
305  } else {
306  thread_running = booker.book1D("module_time_thread_running", "module thread running timing", bins, min, max)->getTH1F();
307  thread_running->SetYTitle("running processing (thread) time [ms]");
308  for (uint32_t i = 1; i <= bins; ++i) {
309  const char * module = counter->GetXaxis()->GetBinLabel(i);
310  thread_running->GetXaxis()->SetBinLabel(i, module);
311  }
312  }
313 
314  me = getter.get( "module_efficiency" );
315  if (me) {
316  efficiency = me->getTH1F();
317  assert( me->getTH1F()->GetXaxis()->GetXmin() == min );
318  assert( me->getTH1F()->GetXaxis()->GetXmax() == max );
319  efficiency->Reset();
320  } else {
321  efficiency = booker.book1D("module_efficiency", "module efficiency", bins, min, max)->getTH1F();
322  efficiency->SetYTitle("filter efficiency");
323  efficiency->SetMaximum(1.05);
324  for (uint32_t i = 1; i <= bins; ++i) {
325  const char * module = counter->GetXaxis()->GetBinLabel(i);
326  efficiency->GetXaxis()->SetBinLabel(i, module);
327  }
328  }
329 
330 
331  for (uint32_t i = 1; i <= bins; ++i) {
332  double n = counter ->GetBinContent(i);
333  double p = counter ->GetBinContent(i+1);
334  if (n)
335  efficiency->SetBinContent(i, p / n);
336 
337  // real timing
338  double t = real_total->GetBinContent(i);
339  real_average->SetBinContent(i, t / events);
340  if (n)
341  real_running->SetBinContent(i, t / n);
342 
343  // thread timing
344  t = thread_total->GetBinContent(i);
345  thread_average->SetBinContent(i, t / events);
346  if (n)
347  thread_running->SetBinContent(i, t / n);
348  }
349 
350  // vs lumi
351  if ( doPlotsVsScalLumi_ )
352  fillPlotsVsLumi( booker,getter, subsubdir, "VsScalLumi", scalLumiMEPSet_ );
353  if ( doPlotsVsPixelLumi_ )
354  fillPlotsVsLumi( booker,getter, subsubdir, "VsPixelLumi", pixelLumiMEPSet_ );
355  if ( doPlotsVsPU_ )
356  fillPlotsVsLumi( booker,getter, subsubdir, "VsPU", puMEPSet_ );
357 
358  }
359 
360 }
TH1F * getTH1F() const
void fillPlotsVsLumi(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &current_path, std::string const &suffix, MEPSet pset)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
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
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
T min(T a, T b)
Definition: MathUtil.h:58
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:344
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:320
TH1D * getTH1D() const
std::vector< std::string > getMEs()
Definition: DQMStore.cc:324
Definition: vlib.h:208
void FastTimerServiceClient::fillPlotsVsLumi ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
std::string const &  current_path,
std::string const &  suffix,
MEPSet  pset 
)
private

Definition at line 364 of file FastTimerServiceClient.cc.

References DQMStore::IBooker::bookProfile(), MonitorElement::Fill(), printsummarytable::folder, MEPSet::folder, DQMStore::IGetter::get(), DQMStore::IGetter::getMEs(), MonitorElement::getTProfile(), diffTwoXMLs::label, csvLumiCalc::lumi, funct::m, SiStripPI::max, MEPSet::name, dataset::name, MEPSet::nbins, pileupCalc::nbins, MonitorElement::Reset(), DQMStore::IBooker::setCurrentFolder(), DQMStore::IGetter::setCurrentFolder(), findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, PFTauMVAInputDiscriminatorTranslator_cfi::test, TrackerOfflineValidation_Dqm_cff::xmax, MEPSet::xmax, TrackerOfflineValidation_Dqm_cff::xmin, MEPSet::xmin, trackingPlots::xtitle, y, Phase2TrackerMonitorDigi_cff::ymax, Phase2TrackerMonitorDigi_cff::ymin, and trackingPlots::ytitle.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

364  {
365 
366  std::vector<std::string> menames;
367 
368  static const boost::regex byls(".*byls");
369  static const boost::regex test(suffix);
370  // get all MEs in the current_path
371  getter.setCurrentFolder(current_path);
372  std::vector<std::string> allmenames = getter.getMEs();
373  for (auto const & m : allmenames) {
374  // get only MEs vs LS
375  if (boost::regex_match(m, byls))
376  menames.push_back(m);
377  }
378  // if no MEs available, return
379  if ( menames.empty() )
380  return;
381 
382  // get info for getting the lumi VS LS histogram
383  std::string folder = pset.folder;
384  std::string name = pset.name;
385  int nbins = pset.nbins;
386  double xmin = pset.xmin;
387  double xmax = pset.xmax;
388 
389  // get lumi/PU VS LS ME
390  getter.setCurrentFolder(folder);
391  MonitorElement* lumiVsLS = getter.get(folder+"/"+name);
392  // if no ME available, return
393  if ( !lumiVsLS ) {
394  edm::LogWarning("FastTimerServiceClient") << "no " << name << " ME is available in " << folder << std::endl;
395  return;
396  }
397 
398  // get range and binning for new MEs x-axis
399  size_t size = lumiVsLS->getTProfile()->GetXaxis()->GetNbins();
400  std::string xtitle = lumiVsLS->getTProfile()->GetYaxis()->GetTitle();
401 
402  std::vector<double> lumi;
403  std::vector<int> LS;
404  for ( size_t ibin=1; ibin <= size; ++ibin ) {
405  // avoid to store points w/ no info
406  if ( lumiVsLS->getTProfile()->GetBinContent(ibin) == 0. ) continue;
407 
408  lumi.push_back( lumiVsLS->getTProfile()->GetBinContent(ibin) );
409  LS.push_back ( lumiVsLS->getTProfile()->GetXaxis()->GetBinCenter(ibin) );
410  }
411 
412  booker.setCurrentFolder(current_path);
413  getter.setCurrentFolder(current_path);
414  for (auto const& m : menames) {
415  std::string label = m;
416  label.erase(label.find("_byls"));
417 
418  MonitorElement* me = getter.get(current_path + "/" + m);
419  float ymin = 0.;
421  std::string ytitle = me->getTProfile()->GetYaxis()->GetTitle();
422 
423  MonitorElement* meVsLumi = getter.get( current_path + "/" + label + "_" + suffix );
424  if (meVsLumi) {
425  assert( meVsLumi->getTProfile()->GetXaxis()->GetXmin() == xmin );
426  assert( meVsLumi->getTProfile()->GetXaxis()->GetXmax() == xmax );
427  meVsLumi->Reset(); // do I have to do it ?!?!?
428  } else {
429  meVsLumi = booker.bookProfile(label + "_" + suffix, label + "_" + suffix, nbins, xmin, xmax, ymin, ymax);
430  // TProfile* meVsLumi_p = meVsLumi->getTProfile();
431  meVsLumi->getTProfile()->GetXaxis()->SetTitle(xtitle.c_str());
432  meVsLumi->getTProfile()->GetYaxis()->SetTitle(ytitle.c_str());
433  }
434  for ( size_t ils=0; ils < LS.size(); ++ils ) {
435  int ibin = me->getTProfile()->GetXaxis()->FindBin(LS[ils]);
436  double y = me->getTProfile()->GetBinContent(ibin);
437 
438  meVsLumi->Fill(lumi[ils],y);
439  }
440  }
441 
442 
443 }
size
Write out results.
TProfile * getTProfile() const
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
std::string folder
void Fill(long long x)
void Reset()
reset ME (ie. contents, errors, etc)
std::string name
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:344
std::vector< std::string > getMEs()
Definition: DQMStore.cc:324
void FastTimerServiceClient::fillProcessSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter,
std::string const &  path 
)
private

Definition at line 126 of file FastTimerServiceClient.cc.

References doPlotsVsPixelLumi_, doPlotsVsPU_, doPlotsVsScalLumi_, PatBasicFWLiteAnalyzer::events, fillPathSummaryPlots(), fillPlotsVsLumi(), DQMStore::IGetter::get(), DQMStore::IGetter::getSubdirs(), MonitorElement::getTH1F(), pixelLumiMEPSet_, puMEPSet_, scalLumiMEPSet_, DQMStore::IBooker::setCurrentFolder(), and DQMStore::IGetter::setCurrentFolder().

Referenced by fillSummaryPlots().

126  {
127 
128  MonitorElement * me = getter.get(current_path + "/event time_real");
129  if (me == nullptr)
130  // no FastTimerService DQM information
131  return;
132 
133  if ( doPlotsVsScalLumi_ )
134  fillPlotsVsLumi( booker,getter, current_path, "VsScalLumi", scalLumiMEPSet_ );
135  if ( doPlotsVsPixelLumi_ )
136  fillPlotsVsLumi( booker,getter, current_path, "VsPixelLumi", pixelLumiMEPSet_ );
137  if ( doPlotsVsPU_ )
138  fillPlotsVsLumi( booker,getter, current_path, "VsPU", puMEPSet_ );
139 
140  // getter.setCurrentFolder(current_path);
141 
142  double events = me->getTH1F()->GetEntries();
143 
144  // look for per-process directories
145  static const boost::regex process_name(".*/process .*");
146 
147  booker.setCurrentFolder(current_path); // ?!?!?
148  std::vector<std::string> subdirs = getter.getSubdirs();
149  for (auto const & subdir: subdirs) {
150 
151  if (boost::regex_match(subdir, process_name)) {
152 
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  }
164  } // loop on subdir
165 
166 }
TH1F * getTH1F() const
void fillPlotsVsLumi(DQMStore::IBooker &booker, DQMStore::IGetter &getter, std::string const &current_path, std::string const &suffix, MEPSet pset)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
void fillPathSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter, double events, std::string const &path)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:344
std::vector< std::string > getSubdirs()
Definition: DQMStore.cc:320
void FastTimerServiceClient::fillPUMePSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 456 of file FastTimerServiceClient.cc.

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

Referenced by fillDescriptions().

456  {
457  pset.add<std::string>("folder", "HLT/LumiMonitoring");
458  pset.add<std::string>("name" , "puVsLS");
459  pset.add<int> ("nbins", 260 );
460  pset.add<double>("xmin", 0.);
461  pset.add<double>("xmax", 130.);
462 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void FastTimerServiceClient::fillSummaryPlots ( DQMStore::IBooker booker,
DQMStore::IGetter getter 
)
private

Definition at line 93 of file FastTimerServiceClient.cc.

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

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

94 {
95  if (getter.get(m_dqm_path + "/event time_real")) {
96  // the plots are directly in the configured folder
97  fillProcessSummaryPlots(booker, getter, m_dqm_path);
98  } else {
99  static const boost::regex running_n_processes(".*/Running .*");
100 
102  std::vector<std::string> subdirs = getter.getSubdirs();
103  for (auto const & subdir: subdirs) {
104 
105  // the plots are in a per-number-of-processes folder
106  if (boost::regex_match(subdir, running_n_processes)) {
107 
108  booker.setCurrentFolder(subdir);
109  if ( getter.get(subdir + "/event time_real") )
110  fillProcessSummaryPlots(booker, getter, subdir);
111 
112  std::vector<std::string> subsubdirs = getter.getSubdirs();
113  for (auto const & subsubdir: subsubdirs) {
114  if ( getter.get(subsubdir + "/event time_real") )
115  fillProcessSummaryPlots(booker, getter, subsubdir);
116  }
117 
118  }
119  } // loop on subdirs
120  }
121 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
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()
Definition: DQMStore.cc:320
MEPSet FastTimerServiceClient::getHistoPSet ( const edm::ParameterSet pset)
staticprivate

Definition at line 465 of file FastTimerServiceClient.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FastTimerServiceClient().

466 {
467  return MEPSet{
468  pset.getParameter<std::string>("folder"),
469  pset.getParameter<std::string>("name"),
470  pset.getParameter<int>("nbins"),
471  pset.getParameter<double>("xmin"),
472  pset.getParameter<double>("xmax"),
473  };
474 }
T getParameter(std::string const &) const

Member Data Documentation

bool FastTimerServiceClient::doPlotsVsPixelLumi_
private
bool FastTimerServiceClient::doPlotsVsPU_
private
bool FastTimerServiceClient::doPlotsVsScalLumi_
private

Definition at line 56 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().

std::string FastTimerServiceClient::m_dqm_path
private

Definition at line 44 of file FastTimerServiceClient.cc.

Referenced by fillSummaryPlots().

MEPSet FastTimerServiceClient::pixelLumiMEPSet_
private
MEPSet FastTimerServiceClient::puMEPSet_
private
MEPSet FastTimerServiceClient::scalLumiMEPSet_
private

Definition at line 60 of file FastTimerServiceClient.cc.

Referenced by fillPathSummaryPlots(), and fillProcessSummaryPlots().