CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DQMExample_Step2 Class Reference

#include <DQMExample_Step2.h>

Inheritance diagram for DQMExample_Step2:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DQMExample_Step2 (const edm::ParameterSet &ps)
 
virtual ~DQMExample_Step2 ()
 
- 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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void beginJob ()
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
- 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 denMonitorName_
 
MonitorElementh_ptRatio
 
std::string numMonitorName_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 14 of file DQMExample_Step2.h.

Constructor & Destructor Documentation

DQMExample_Step2::DQMExample_Step2 ( const edm::ParameterSet ps)

Definition at line 15 of file DQMExample_Step2.cc.

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

16 {
17  edm::LogInfo("DQMExample_Step2") << "Constructor DQMExample_Step2::DQMExample_Step2 " << std::endl;
18 
19  // Get parameters from configuration file
20  numMonitorName_ = ps.getParameter<std::string>("numMonitorName");
21  denMonitorName_ = ps.getParameter<std::string>("denMonitorName");
22 
23 }
T getParameter(std::string const &) const
std::string denMonitorName_
std::string numMonitorName_
DQMExample_Step2::~DQMExample_Step2 ( )
virtual

Definition at line 28 of file DQMExample_Step2.cc.

29 {
30  edm::LogInfo("DQMExample_Step2") << "Destructor DQMExample_Step2::~DQMExample_Step2 " << std::endl;
31 }

Member Function Documentation

void DQMExample_Step2::beginJob ( void  )
protectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 36 of file DQMExample_Step2.cc.

37 {
38  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::beginJob " << std::endl;
39 }
void DQMExample_Step2::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 43 of file DQMExample_Step2.cc.

References DQMStore::IBooker::book1D(), denMonitorName_, cuy::denominator, DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), h_ptRatio, cuy::numerator, numMonitorName_, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), and DQMStore::IBooker::setCurrentFolder().

44 {
45  // create and cd into new folder
46  ibooker_.setCurrentFolder("What_I_do_in_the_client/Ratio");
47 
48  //get available histograms
51 
52  if (!numerator || !denominator)
53  {
54  edm::LogError("DQMExample_Step2") << "MEs not found!" << std::endl;
55  return;
56  }
57 
58 
59  //book new histogram
60  h_ptRatio = ibooker_.book1D("ptRatio","pt ratio pf matched objects",50,0.,100.);
61  h_ptRatio->setAxisTitle("pt [GeV]");
62 
63  for (int iBin=1; iBin<numerator->getNbinsX(); ++iBin)
64  {
65  if(denominator->getBinContent(iBin) == 0)
66  h_ptRatio->setBinContent(iBin, 0.);
67  else
68  h_ptRatio->setBinContent(iBin, numerator->getBinContent(iBin) / denominator->getBinContent(iBin));
69  }
70 }
void setBinContent(int binx, double content)
set content of bin (1-D)
list numerator
Definition: cuy.py:483
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:304
MonitorElement * h_ptRatio
list denominator
Definition: cuy.py:484
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
std::string denMonitorName_
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
std::string numMonitorName_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void DQMExample_Step2::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  iSetup 
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 75 of file DQMExample_Step2.cc.

76 {
77  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::endLumi " << std::endl;
78 }

Member Data Documentation

std::string DQMExample_Step2::denMonitorName_
private

Definition at line 33 of file DQMExample_Step2.h.

Referenced by dqmEndJob(), and DQMExample_Step2().

MonitorElement* DQMExample_Step2::h_ptRatio
private

Definition at line 36 of file DQMExample_Step2.h.

Referenced by dqmEndJob().

std::string DQMExample_Step2::numMonitorName_
private

Definition at line 32 of file DQMExample_Step2.h.

Referenced by dqmEndJob(), and DQMExample_Step2().