CMS 3D CMS Logo

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

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
 HarvestingAnalyzer (const edm::ParameterSet &)
 
 ~HarvestingAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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.

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

Definition at line 18 of file HarvestingAnalyzer.cc.

18 {}

Member Function Documentation

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

Definition at line 65 of file HarvestingAnalyzer.cc.

65 { return; }
void HarvestingAnalyzer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 20 of file HarvestingAnalyzer.cc.

20 { return; }
void HarvestingAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 61 of file HarvestingAnalyzer.cc.

61 { return; }
void HarvestingAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 22 of file HarvestingAnalyzer.cc.

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

22  {
23  dbe = nullptr;
25 
26  if (dbe) {
27  // monitoring element numerator and denominator histogram
28  MonitorElement *meN = dbe->get("ConverterTest/TH1F/Random1DN");
29  MonitorElement *meD = dbe->get("ConverterTest/TH1F/Random1DD");
30 
31  if (meN && meD) {
32  // get the numerator and denominator histogram
33  TH1F *numerator = meN->getTH1F();
34  numerator->Sumw2();
35  TH1F *denominator = meD->getTH1F();
36  denominator->Sumw2();
37 
38  // set the current directory
39  dbe->setCurrentFolder("ConverterTest/TH1F");
40 
41  // booked the new histogram to contain the results
42  MonitorElement *me = dbe->book1D("Divide",
43  "Divide calculation",
44  numerator->GetNbinsX(),
45  numerator->GetXaxis()->GetXmin(),
46  numerator->GetXaxis()->GetXmax());
47 
48  // Calculate the efficiency
49  me->getTH1F()->Divide(numerator, denominator, 1., 1., "B");
50 
51  } else {
52  std::cout << "Monitor elements don't exist" << std::endl;
53  }
54  } else {
55  std::cout << "Don't have a valid DQM back end" << std::endl;
56  }
57 
58  return;
59 }
TH1F * getTH1F() const
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
Definition: DQMStore.cc:1098
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1613
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
void HarvestingAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 63 of file HarvestingAnalyzer.cc.

63 { return; }

Member Data Documentation

DQMStore* HarvestingAnalyzer::dbe
private

Definition at line 47 of file HarvestingAnalyzer.h.

Referenced by endJob().

std::string HarvestingAnalyzer::fName
private

Definition at line 45 of file HarvestingAnalyzer.h.

Referenced by HarvestingAnalyzer().

int HarvestingAnalyzer::verbosity
private

Definition at line 46 of file HarvestingAnalyzer.h.

Referenced by HarvestingAnalyzer().