CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes
TriggerRatesMonitorClient Class Reference

#include <TriggerRatesMonitorClient.h>

Inheritance diagram for TriggerRatesMonitorClient:
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

 TriggerRatesMonitorClient (const edm::ParameterSet &ps)
 
 ~TriggerRatesMonitorClient () override=default
 
- 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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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
 
ESProxyIndex const * esGetTokenIndices (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::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)
 
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)
 

Protected Member Functions

void beginJob () override
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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)
 

Private Attributes

std::string m_dqm_path
 
std::vector< TH2F * > m_hltXpd_counts
 

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
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 Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 17 of file TriggerRatesMonitorClient.h.

Constructor & Destructor Documentation

TriggerRatesMonitorClient::TriggerRatesMonitorClient ( const edm::ParameterSet ps)

Definition at line 8 of file TriggerRatesMonitorClient.cc.

9  : m_dqm_path(iConfig.getUntrackedParameter<std::string>("dqmPath")) {
10  edm::LogInfo("TriggerRatesMonitorClient")
11  << "Constructor TriggerRatesMonitorClient::TriggerRatesMonitorClient " << std::endl;
12 }
TriggerRatesMonitorClient::~TriggerRatesMonitorClient ( )
overridedefault

Member Function Documentation

void TriggerRatesMonitorClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 17 of file TriggerRatesMonitorClient.cc.

17  {
18  edm::LogInfo("TriggerRatesMonitorClient") << "TriggerRatesMonitorClient::beginJob " << std::endl;
19 }
void TriggerRatesMonitorClient::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 24 of file TriggerRatesMonitorClient.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), DeadROC_duringRun::dir, dqm::dqmstoreimpl::DQMStore::IGetter::get(), dqm::dqmstoreimpl::DQMStore::IGetter::getMEs(), dqm::dqmstoreimpl::DQMStore::IGetter::getSubdirs(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTH2F(), timingPdfMaker::histo, mps_fire::i, m_dqm_path, m_hltXpd_counts, hlt_dqm_clientPB-live_cfg::me, hlt_dqm_clientPB-live_cfg::nbinsX, hlt_dqm_clientPB-live_cfg::nbinsY, RPCpg::rate(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, hlt_dqm_clientPB-live_cfg::xmaxX, hlt_dqm_clientPB-live_cfg::xmaxY, hlt_dqm_clientPB-live_cfg::xminX, and hlt_dqm_clientPB-live_cfg::xminY.

24  {
25  // create and cd into new folder
26  ibooker_.setCurrentFolder(m_dqm_path);
27 
28  //get available histograms
29  std::vector<std::string> directories = igetter_.getSubdirs();
30  m_hltXpd_counts.resize(directories.size());
31 
32  int i = 0;
33  for (auto const& dir : directories) {
34  // std::cout << "dir: " << dir << std::endl;
35  ibooker_.setCurrentFolder(m_dqm_path + "/" + dir);
36 
37  std::vector<std::string> const& all_mes = igetter_.getMEs();
38  std::vector<std::string> mes;
39  for (auto const& me : all_mes)
40  if (me.find("accept") != std::string::npos)
41  mes.push_back(me);
42 
43  int nbinsY = mes.size();
44  double xminY = 0.;
45  double xmaxY = xminY + 1. * nbinsY;
46  int nbinsX = 0;
47  int ibinY = 1;
48  for (auto const& me : mes) {
49  // std::cout << "me: " << me << std::endl;
50  ibooker_.setCurrentFolder(m_dqm_path + "/" + dir);
51  TH1F* histo = igetter_.get(me)->getTH1F();
52 
53  if (m_hltXpd_counts[i] == nullptr) {
54  // get range and binning for new MEs
55  nbinsX = histo->GetNbinsX();
56  double xminX = histo->GetXaxis()->GetXmin();
57  double xmaxX = histo->GetXaxis()->GetXmax();
58 
59  //book new histogram
60  std::string hname = dir + "_summary";
61  ibooker_.setCurrentFolder(m_dqm_path);
62  m_hltXpd_counts[i] = ibooker_.book2D(hname, hname, nbinsX, xminX, xmaxX, nbinsY, xminY, xmaxY)->getTH2F();
63  } else {
64  m_hltXpd_counts[i]->GetYaxis()->SetBinLabel(ibinY, me.c_str());
65  }
66 
67  // handle mes
68  for (int ibinX = 1; ibinX <= nbinsX; ++ibinX) {
69  float rate = histo->GetBinContent(ibinX);
70  m_hltXpd_counts[i]->SetBinContent(ibinX, ibinY, rate);
71  }
72  ibinY++;
73  }
74 
75  i++;
76  }
77 }
std::vector< TH2F * > m_hltXpd_counts
double rate(double x)
Definition: Constants.cc:3
void TriggerRatesMonitorClient::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 82 of file TriggerRatesMonitorClient.cc.

85  {
86  edm::LogInfo("TriggerRatesMonitorClient") << "TriggerRatesMonitorClient::endLumi " << std::endl;
87 }
void TriggerRatesMonitorClient::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 89 of file TriggerRatesMonitorClient.cc.

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

89  {
91  desc.addUntracked<std::string>("dqmPath", "HLT/Datasets");
92  descriptions.add("triggerRatesMonitorClient", desc);
93 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

std::string TriggerRatesMonitorClient::m_dqm_path
private

Definition at line 33 of file TriggerRatesMonitorClient.h.

Referenced by dqmEndJob().

std::vector<TH2F *> TriggerRatesMonitorClient::m_hltXpd_counts
private

Definition at line 36 of file TriggerRatesMonitorClient.h.

Referenced by dqmEndJob().