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 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 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::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)
 

Private Attributes

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

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

Detailed Description

Definition at line 18 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 {
11  edm::LogInfo("TriggerRatesMonitorClient") << "Constructor TriggerRatesMonitorClient::TriggerRatesMonitorClient " << std::endl;
12 
13 }
TriggerRatesMonitorClient::~TriggerRatesMonitorClient ( )
overridedefault

Member Function Documentation

void TriggerRatesMonitorClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 18 of file TriggerRatesMonitorClient.cc.

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

Implements DQMEDHarvester.

Definition at line 26 of file TriggerRatesMonitorClient.cc.

References DQMStore::IBooker::book2D(), dir, DQMStore::IGetter::get(), DQMStore::IGetter::getMEs(), DQMStore::IGetter::getSubdirs(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), trackerHits::histo, mps_fire::i, m_dqm_path, m_hltXpd_counts, RPCpg::rate(), DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

Reimplemented from DQMEDHarvester.

Definition at line 85 of file TriggerRatesMonitorClient.cc.

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

Definition at line 90 of file TriggerRatesMonitorClient.cc.

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

91 {
92 
94  desc.addUntracked<std::string>("dqmPath","HLT/Datasets");
95  descriptions.add("triggerRatesMonitorClient", desc);
96 
97 }
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 35 of file TriggerRatesMonitorClient.h.

Referenced by dqmEndJob().

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

Definition at line 38 of file TriggerRatesMonitorClient.h.

Referenced by dqmEndJob().