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::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 TriggerRatesMonitorClient (const edm::ParameterSet &ps)
 
virtual ~TriggerRatesMonitorClient ()=default
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & itemsToGetFromEvent () 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
 
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::EDAnalyzerBase
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::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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 }
virtual TriggerRatesMonitorClient::~TriggerRatesMonitorClient ( )
virtualdefault

Member Function Documentation

void TriggerRatesMonitorClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

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 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
std::vector< std::string > getMEs(void)
Definition: DQMStore.cc:327
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
TH1F * getTH1F(void) const
std::vector< TH2F * > m_hltXpd_counts
std::vector< std::string > getSubdirs(void)
Definition: DQMStore.cc:323
double rate(double x)
Definition: Constants.cc:3
dbl *** dir
Definition: mlp_gen.cc:35
TH2F * getTH2F(void) const
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().