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::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DQMScaleToClient (const edm::ParameterSet &ps)
 
 ~DQMScaleToClient () override=default
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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
 
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)
 
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::EDProducerBase
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::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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)
DQMScaleToClient::~DQMScaleToClient ( )
overridedefault

Member Function Documentation

void DQMScaleToClient::beginJob ( void  )
overrideprotectedvirtual

Reimplemented from edm::one::EDProducerBase.

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);
53 
54  //get available histograms
55  hname = inputmepset_.folder + "/" + inputmepset_.name;
56  MonitorElement* inputme = igetter_.get( hname );
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);
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_
std::string folder
TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::string folder
MonitorElement * scaled_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:69
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
std::string name
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().