CMS 3D CMS Logo

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

#include <HarvestingAnalyzer.h>

Inheritance diagram for HarvestingAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
 HarvestingAnalyzer (const edm::ParameterSet &)
 
virtual ~HarvestingAnalyzer ()
 
- 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
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 ()
 

Private Attributes

DQMStoredbe
 
std::string fName
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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)
 

Detailed Description

Class to perform operations on MEs after EDMtoMEConverter

Author
M. Strang SUNY-Buffalo

Definition at line 34 of file HarvestingAnalyzer.h.

Constructor & Destructor Documentation

HarvestingAnalyzer::HarvestingAnalyzer ( const edm::ParameterSet iPSet)
explicit

Definition at line 3 of file HarvestingAnalyzer.cc.

References fName, edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

4 {
5  std::string MsgLoggerCat = "HarvestingAnalyzer_HarvestingAnalyzer";
6 
7  fName = iPSet.getUntrackedParameter<std::string>("Name");
8  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
9 
10  if (verbosity >= 0) {
11  edm::LogInfo(MsgLoggerCat)
12  << "\n===============================\n"
13  << "Initialized as EDAnalyzer with parameter values:\n"
14  << " Name = " << fName << "\n"
15  << " Verbosity = " << verbosity << "\n"
16  << "===============================\n";
17  }
18 }
T getUntrackedParameter(std::string const &, T const &) const
HarvestingAnalyzer::~HarvestingAnalyzer ( )
virtual

Definition at line 20 of file HarvestingAnalyzer.cc.

20 {}

Member Function Documentation

void HarvestingAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 84 of file HarvestingAnalyzer.cc.

86 {
87  return;
88 }
void HarvestingAnalyzer::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 22 of file HarvestingAnalyzer.cc.

23 {
24  return;
25 }
void HarvestingAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file HarvestingAnalyzer.cc.

74 {
75  return;
76 }
void HarvestingAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 27 of file HarvestingAnalyzer.cc.

References DQMStore::book1D(), gather_cfg::cout, dbe, cuy::denominator, DQMStore::get(), MonitorElement::getTH1F(), cuy::numerator, cppFunctionSkipper::operator, and DQMStore::setCurrentFolder().

28 {
29 
30  dbe = 0;
32 
33  if (dbe) {
34 
35  // monitoring element numerator and denominator histogram
36  MonitorElement *meN =
37  dbe->get("ConverterTest/TH1F/Random1DN");
38  MonitorElement *meD =
39  dbe->get("ConverterTest/TH1F/Random1DD");
40 
41  if (meN && meD) {
42 
43  // get the numerator and denominator histogram
44  TH1F *numerator = meN->getTH1F();
45  numerator->Sumw2();
46  TH1F *denominator = meD->getTH1F();
47  denominator->Sumw2();
48 
49  // set the current directory
50  dbe->setCurrentFolder("ConverterTest/TH1F");
51 
52  // booked the new histogram to contain the results
53  MonitorElement *me =
54  dbe->book1D("Divide","Divide calculation",
55  numerator->GetNbinsX(),
56  numerator->GetXaxis()->GetXmin(),
57  numerator->GetXaxis()->GetXmax());
58 
59  // Calculate the efficiency
60  me->getTH1F()->Divide(numerator, denominator, 1., 1., "B");
61 
62  } else {
63  std::cout << "Monitor elements don't exist" << std::endl;
64  }
65  } else {
66  std::cout << "Don't have a valid DQM back end" << std::endl;
67  }
68 
69  return;
70 }
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:1000
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:1754
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:145
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:706
void HarvestingAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file HarvestingAnalyzer.cc.

80 {
81  return;
82 }

Member Data Documentation

DQMStore* HarvestingAnalyzer::dbe
private

Definition at line 51 of file HarvestingAnalyzer.h.

Referenced by endJob().

std::string HarvestingAnalyzer::fName
private

Definition at line 49 of file HarvestingAnalyzer.h.

Referenced by HarvestingAnalyzer().

int HarvestingAnalyzer::verbosity
private

Definition at line 50 of file HarvestingAnalyzer.h.

Referenced by HarvestingAnalyzer().