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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DQMExample_Step2 (const edm::ParameterSet &ps)
 
virtual ~DQMExample_Step2 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 
void beginJob ()
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
void endJob ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
- 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

DQMStoredbe_
 
std::string denMonitorName_
 
MonitorElementh_ptRatio
 
std::string numMonitorName_
 

Additional Inherited Members

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

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 dbe_, denMonitorName_, edm::ParameterSet::getParameter(), numMonitorName_, cppFunctionSkipper::operator, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Definition at line 31 of file DQMExample_Step2.cc.

32 {
33  edm::LogInfo("DQMExample_Step2") << "Destructor DQMExample_Step2::~DQMExample_Step2 " << std::endl;
34 }

Member Function Documentation

void DQMExample_Step2::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 65 of file DQMExample_Step2.cc.

66 {
67  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::analyze" << std::endl;
68 
69 
70 
71 }
void DQMExample_Step2::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file DQMExample_Step2.cc.

40 {
41  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::beginJob " << std::endl;
42 }
void DQMExample_Step2::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 55 of file DQMExample_Step2.cc.

57 {
58  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::beginLuminosityBlock" << std::endl;
59 }
void DQMExample_Step2::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 46 of file DQMExample_Step2.cc.

47 {
48  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::beginRun" << std::endl;
49 
50  //book at beginRun
51 }
void DQMExample_Step2::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 118 of file DQMExample_Step2.cc.

119 {
120  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::endJob" << std::endl;
121 }
void DQMExample_Step2::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file DQMExample_Step2.cc.

76 {
77  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::endLuminosityBlock" << std::endl;
78 }
void DQMExample_Step2::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file DQMExample_Step2.cc.

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

85 {
86  edm::LogInfo("DQMExample_Step2") << "DQMExample_Step2::endRun" << std::endl;
87 
88  // create and cd into new folder
89  dbe_->setCurrentFolder("What_I_do_in_the_client/Ratio");
90 
91  //get available histograms
94 
95  if (!numerator || !denominator)
96  {
97  edm::LogError("DQMExample_Step2") << "MEs not found!" << std::endl;
98  return;
99  }
100 
101 
102  //book new histogram
103  h_ptRatio = dbe_->book1D("ptRatio","pt ratio pf matched objects",50,0.,100.);
104  h_ptRatio->setAxisTitle("pt [GeV]");
105 
106  for (int iBin=1; iBin<numerator->getNbinsX(); ++iBin)
107  {
108  if(denominator->getBinContent(iBin) == 0)
109  h_ptRatio->setBinContent(iBin, 0.);
110  else
111  h_ptRatio->setBinContent(iBin, numerator->getBinContent(iBin) / denominator->getBinContent(iBin));
112  }
113 }
void setBinContent(int binx, double content)
set content of bin (1-D)
list numerator
Definition: cuy.py:483
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * h_ptRatio
list denominator
Definition: cuy.py:484
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
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 setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584

Member Data Documentation

DQMStore* DQMExample_Step2::dbe_
private

Definition at line 34 of file DQMExample_Step2.h.

Referenced by DQMExample_Step2(), and endRun().

std::string DQMExample_Step2::denMonitorName_
private

Definition at line 38 of file DQMExample_Step2.h.

Referenced by DQMExample_Step2(), and endRun().

MonitorElement* DQMExample_Step2::h_ptRatio
private

Definition at line 41 of file DQMExample_Step2.h.

Referenced by endRun().

std::string DQMExample_Step2::numMonitorName_
private

Definition at line 37 of file DQMExample_Step2.h.

Referenced by DQMExample_Step2(), and endRun().