CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
ThroughputServiceClient Class Reference
Inheritance diagram for ThroughputServiceClient:
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

 ThroughputServiceClient (edm::ParameterSet const &)
 
 ~ThroughputServiceClient () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 fillSummaryPlots (DQMStore::IBooker &booker, DQMStore::IGetter &getter)
 

Private Attributes

const bool m_dqm_merge
 
const std::string m_dqm_path
 
const bool m_fillEveryLumiSection
 

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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 25 of file ThroughputServiceClient.cc.

Constructor & Destructor Documentation

◆ ThroughputServiceClient()

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

Definition at line 47 of file ThroughputServiceClient.cc.

48  : m_dqm_path(config.getUntrackedParameter<std::string>("dqmPath")),
49  m_dqm_merge(config.getUntrackedParameter<bool>("createSummary")),
50  m_fillEveryLumiSection(config.getParameter<bool>("fillEveryLumiSection")) {}
Definition: config.py:1

◆ ~ThroughputServiceClient()

ThroughputServiceClient::~ThroughputServiceClient ( )
overridedefault

Member Function Documentation

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 52 of file ThroughputServiceClient.cc.

References fillSummaryPlots().

52  {
53  fillSummaryPlots(booker, getter);
54 }
void fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter)

◆ dqmEndLuminosityBlock()

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

Reimplemented from DQMEDHarvester.

Definition at line 56 of file ThroughputServiceClient.cc.

References fillSummaryPlots(), and m_fillEveryLumiSection.

59  {
61  fillSummaryPlots(booker, getter);
62  }
63 }
void fillSummaryPlots(DQMStore::IBooker &booker, DQMStore::IGetter &getter)

◆ fillDescriptions()

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

Definition at line 150 of file ThroughputServiceClient.cc.

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

150  {
152  desc.addUntracked<std::string>("dqmPath", "HLT/Throughput");
153  desc.addUntracked<bool>("createSummary", true);
154  desc.add<bool>("fillEveryLumiSection", true);
155  descriptions.add("throughputServiceClient", desc);
156 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ fillSummaryPlots()

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

Definition at line 65 of file ThroughputServiceClient.cc.

References dqm::implementation::IBooker::book1D(), reco::ceil(), dqmdumpme::first, printsummarytable::folder, folders, dqm::implementation::IGetter::get(), dqm::implementation::IGetter::getSubdirs(), dqm::legacy::MonitorElement::getTH1F(), mps_fire::i, dqmdumpme::last, m_dqm_merge, m_dqm_path, SiStripPI::max, SiStripPI::min, eostools::move(), LaserClient_cfi::nbins, FastTimerService_cff::range, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, mkLumiAveragedPlots::subdir, compareTotals::subdirs, and ApeEstimator_cff::width.

Referenced by dqmEndJob(), and dqmEndLuminosityBlock().

65  {
66  // find whether the plots are in the main folder, or in per-number-of-processess subfolders
67  std::vector<std::string> folders;
68  if (getter.get(m_dqm_path + "/throughput_sourced")) {
69  // the plots are in the main folder
70  folders.push_back(m_dqm_path);
71  } else {
72  static const boost::regex running_n_processes(".*/Running .*");
74  std::vector<std::string> subdirs = getter.getSubdirs();
75  for (auto const &subdir : subdirs) {
76  if (boost::regex_match(subdir, running_n_processes)) {
77  if (getter.get(subdir + "/throughput_sourced")) {
78  // the plots are in a per-number-of-processes subfolder
79  folders.push_back(subdir);
80  }
81  }
82  }
83  }
84  // create a summary folder if there are more than one
85  if (m_dqm_merge and folders.size() > 1) {
86  std::string summary_folder = m_dqm_path + "/Summary";
87  booker.setCurrentFolder(summary_folder);
88  // clone the first set of histograms
89  auto folder = folders.begin();
90  TH1F *sourced =
91  booker.book1D("throughput_sourced", getter.get(*folder + "/throughput_sourced")->getTH1F())->getTH1F();
92  TH1F *retired =
93  booker.book1D("throughput_retired", getter.get(*folder + "/throughput_retired")->getTH1F())->getTH1F();
94  // add the other sets of histograms
95  for (++folder; folder != folders.end(); ++folder) {
96  sourced->Add(getter.get(*folder + "/throughput_sourced")->getTH1F());
97  retired->Add(getter.get(*folder + "/throughput_retired")->getTH1F());
98  }
99  // move the summary folder to the list
100  folders.push_back(std::move(summary_folder));
101  }
102  for (auto const &folder : folders) {
103  TH1F *sourced = getter.get(folder + "/throughput_sourced")->getTH1F();
104  TH1F *retired = getter.get(folder + "/throughput_retired")->getTH1F();
105  booker.setCurrentFolder(folder);
106  unsigned int nbins = sourced->GetXaxis()->GetNbins();
107  double range = sourced->GetXaxis()->GetXmax();
108 
109  // (re)book and fill .../concurrent
110  TH1F *concurrent = booker.book1D("concurrent", "Concurrent events being processed", nbins, 0., range)->getTH1F();
111  double sum = 0;
112  // from bin=0 (underflow) to bin=nbins+1 (overflow)
113  for (unsigned int i = 0; i <= nbins + 1; ++i) {
114  sum += sourced->GetBinContent(i) - retired->GetBinContent(i);
115  concurrent->Fill(concurrent->GetXaxis()->GetBinCenter(i), sum);
116  }
117 
118  TH1F *average = nullptr;
119  double avg_min = std::min(sourced->GetMinimum(0.), retired->GetMinimum(0.));
120  double avg_max = std::max(sourced->GetMaximum(), retired->GetMaximum());
121  double width = avg_max - avg_min;
122  avg_min = std::floor(avg_min - width * 0.2);
123  if (avg_min < 0.)
124  avg_min = 0.;
125  avg_max = std::ceil(avg_max + width * 0.2);
126  width = avg_max - avg_min;
127 
128  // define the range for .../average_sourced
129  auto first = sourced->FindFirstBinAbove(0.);
130  auto last = sourced->FindLastBinAbove(0.);
131  booker.setCurrentFolder(folder);
132  // (re)book and fill .../average_sourced
133  average = booker.book1D("average_sourced", "Throughput (sourced events)", (int)width, avg_min, avg_max)->getTH1F();
134  if (first >= 0)
135  for (auto i = first; i <= last; ++i)
136  average->Fill(sourced->GetBinContent(i));
137 
138  // define the range for .../average_retired
139  first = retired->FindFirstBinAbove(0.);
140  last = retired->FindLastBinAbove(0.);
141  booker.setCurrentFolder(folder);
142  // (re)book and fill .../average_retired
143  average = booker.book1D("average_retired", "Throughput (retired events)", (int)width, avg_min, avg_max)->getTH1F();
144  if (first >= 0)
145  for (auto i = first; i <= last; ++i)
146  average->Fill(retired->GetBinContent(i));
147  }
148 }
constexpr int32_t ceil(float num)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle otherwise a larger ***bin number will have no effects or even make the ***precision lower than before *********************************************************************************************************it lies in three folders
Definition: invegas.h:5
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
def move(src, dest)
Definition: eostools.py:511
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:739

Member Data Documentation

◆ m_dqm_merge

const bool ThroughputServiceClient::m_dqm_merge
private

Definition at line 34 of file ThroughputServiceClient.cc.

Referenced by fillSummaryPlots().

◆ m_dqm_path

const std::string ThroughputServiceClient::m_dqm_path
private

Definition at line 33 of file ThroughputServiceClient.cc.

Referenced by fillSummaryPlots().

◆ m_fillEveryLumiSection

const bool ThroughputServiceClient::m_fillEveryLumiSection
private

Definition at line 35 of file ThroughputServiceClient.cc.

Referenced by dqmEndLuminosityBlock().