CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes
DQMScaleToClient Class Reference

#include <DQMScaleToClient.h>

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

Public Member Functions

 DQMScaleToClient (const edm::ParameterSet &ps)
 
virtual ~DQMScaleToClient ()=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 & 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillMePSetDescription (edm::ParameterSetDescription &pset)
 
static void fillOutputMePSetDescription (edm::ParameterSetDescription &pset)
 
- 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)
 

Static Private Member Functions

static MEPSet getHistoPSet (edm::ParameterSet pset)
 
static OutputMEPSet getOutputHistoPSet (edm::ParameterSet pset)
 

Private Attributes

MEPSet inputmepset_
 
OutputMEPSet outputmepset_
 
MonitorElementscaled_
 

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 29 of file DQMScaleToClient.h.

Constructor & Destructor Documentation

DQMScaleToClient::DQMScaleToClient ( const edm::ParameterSet ps)

Definition at line 8 of file DQMScaleToClient.cc.

References scaled_.

8  :
9  inputmepset_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("inputme")) )
10  , outputmepset_ ( getOutputHistoPSet (iConfig.getParameter<edm::ParameterSet>("outputme")) )
11 {
12  edm::LogInfo("DQMScaleToClient") << "Constructor DQMScaleToClient::DQMScaleToClient " << std::endl;
13 
14  scaled_ = nullptr;
15 
16 }
OutputMEPSet outputmepset_
MonitorElement * scaled_
static OutputMEPSet getOutputHistoPSet(edm::ParameterSet pset)
static MEPSet getHistoPSet(edm::ParameterSet pset)
virtual DQMScaleToClient::~DQMScaleToClient ( )
virtualdefault

Member Function Documentation

void DQMScaleToClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 38 of file DQMScaleToClient.cc.

39 {
40  edm::LogInfo("DQMScaleToClient") << "DQMScaleToClient::beginJob " << std::endl;
41 }
void DQMScaleToClient::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 46 of file DQMScaleToClient.cc.

References DQMStore::IBooker::book1D(), OutputMEPSet::factor, MEPSet::folder, OutputMEPSet::folder, DQMStore::IGetter::get(), MonitorElement::getTH1(), inputmepset_, funct::integral(), MEPSet::name, OutputMEPSet::name, outputmepset_, scaled_, DQMStore::IBooker::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

47 {
48  std::string hname = "";
49 
50  // create and cd into new folder
51  std::string currentFolder = outputmepset_.folder;
52  ibooker_.setCurrentFolder(currentFolder.c_str());
53 
54  //get available histograms
55  hname = inputmepset_.folder + "/" + inputmepset_.name;
56  MonitorElement* inputme = igetter_.get( hname.c_str() );
57 
58  if (!inputme) {
59  edm::LogError("DQMScaleToClient") << "MEs not found! "
60  << inputmepset_.folder + "/" + inputmepset_.name + " not found "
61  << std::endl;
62  return;
63  }
64 
65  //book new histogram
66  ibooker_.setCurrentFolder(currentFolder.c_str());
67  hname = outputmepset_.name;
68  scaled_ = ibooker_.book1D(hname,(TH1F*)inputme->getTH1()->Clone(hname.c_str()));
69 
70  // handle mes
71  double integral = (scaled_->getTH1()->Integral() > 0. ? scaled_->getTH1()->Integral() : 1.);
72  scaled_->getTH1()->Scale(outputmepset_.factor/integral);
73 }
OutputMEPSet outputmepset_
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
std::string folder
std::string folder
MonitorElement * scaled_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
TH1 * getTH1(void) const
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:69
std::string name
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
void DQMScaleToClient::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 78 of file DQMScaleToClient.cc.

79 {
80  edm::LogInfo("DQMScaleToClient") << "DQMScaleToClient::endLumi " << std::endl;
81 }
void DQMScaleToClient::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 96 of file DQMScaleToClient.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, fillMePSetDescription(), and fillOutputMePSetDescription().

97 {
98 
100  edm::ParameterSetDescription outputmePSet;
101  fillOutputMePSetDescription(outputmePSet);
102  desc.add<edm::ParameterSetDescription>("outputme", outputmePSet);
103 
104  edm::ParameterSetDescription inputmePSet;
105  fillMePSetDescription(inputmePSet);
106  desc.add<edm::ParameterSetDescription>("inputme", inputmePSet);
107 
108  descriptions.add("dqmScaleToClient", desc);
109 
110 }
static void fillMePSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillOutputMePSetDescription(edm::ParameterSetDescription &pset)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void DQMScaleToClient::fillMePSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 83 of file DQMScaleToClient.cc.

References edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillDescriptions().

84 {
85  pset.add<std::string>("folder","");
86  pset.add<std::string>("name","");
87 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void DQMScaleToClient::fillOutputMePSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 89 of file DQMScaleToClient.cc.

References edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillDescriptions().

90 {
91  pset.add<std::string>("folder","");
92  pset.add<std::string>("name","");
93  pset.add<double>("factor",1.);
94 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MEPSet DQMScaleToClient::getHistoPSet ( edm::ParameterSet  pset)
staticprivate

Definition at line 18 of file DQMScaleToClient.cc.

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

19 {
20  return MEPSet{
21  pset.getParameter<std::string>("name"),
22  pset.getParameter<std::string>("folder"),
23  };
24 }
T getParameter(std::string const &) const
OutputMEPSet DQMScaleToClient::getOutputHistoPSet ( edm::ParameterSet  pset)
staticprivate

Definition at line 26 of file DQMScaleToClient.cc.

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

27 {
28  return OutputMEPSet{
29  pset.getParameter<std::string>("name"),
30  pset.getParameter<std::string>("folder"),
31  pset.getParameter<double>("factor"),
32  };
33 }
T getParameter(std::string const &) const

Member Data Documentation

MEPSet DQMScaleToClient::inputmepset_
private

Definition at line 56 of file DQMScaleToClient.h.

Referenced by dqmEndJob().

OutputMEPSet DQMScaleToClient::outputmepset_
private

Definition at line 57 of file DQMScaleToClient.h.

Referenced by dqmEndJob().

MonitorElement* DQMScaleToClient::scaled_
private

Definition at line 54 of file DQMScaleToClient.h.

Referenced by dqmEndJob(), and DQMScaleToClient().