CMS 3D CMS Logo

DQMScaleToClient.cc
Go to the documentation of this file.
2 
4 
5 //
6 // -------------------------------------- Constructor --------------------------------------------
7 //
9  : inputmepset_(getHistoPSet(iConfig.getParameter<edm::ParameterSet>("inputme"))),
10  outputmepset_(getOutputHistoPSet(iConfig.getParameter<edm::ParameterSet>("outputme"))) {
11  edm::LogInfo("DQMScaleToClient") << "Constructor DQMScaleToClient::DQMScaleToClient " << std::endl;
12 
13  scaled_ = nullptr;
14 }
15 
17  return MEPSet{
18  pset.getParameter<std::string>("name"),
19  pset.getParameter<std::string>("folder"),
20  };
21 }
22 
24  return OutputMEPSet{
25  pset.getParameter<std::string>("name"),
26  pset.getParameter<std::string>("folder"),
27  pset.getParameter<double>("factor"),
28  };
29 }
30 
31 //
32 // -------------------------------------- beginJob --------------------------------------------
33 //
34 void DQMScaleToClient::beginJob() { edm::LogInfo("DQMScaleToClient") << "DQMScaleToClient::beginJob " << std::endl; }
35 
36 //
37 // -------------------------------------- get and book in the endJob --------------------------------------------
38 //
40  std::string hname = "";
41 
42  // create and cd into new folder
43  std::string currentFolder = outputmepset_.folder;
44  ibooker_.setCurrentFolder(currentFolder);
45 
46  //get available histograms
47  hname = inputmepset_.folder + "/" + inputmepset_.name;
48  MonitorElement* inputme = igetter_.get(hname);
49 
50  if (!inputme) {
51  edm::LogError("DQMScaleToClient") << "MEs not found! "
52  << inputmepset_.folder + "/" + inputmepset_.name + " not found " << std::endl;
53  return;
54  }
55 
56  //book new histogram
57  ibooker_.setCurrentFolder(currentFolder);
58  hname = outputmepset_.name;
59  scaled_ = ibooker_.book1D(hname, (TH1F*)inputme->getTH1()->Clone(hname.c_str()));
60 
61  // handle mes
62  double integral = (scaled_->getTH1()->Integral() > 0. ? scaled_->getTH1()->Integral() : 1.);
64 }
65 
66 //
67 // -------------------------------------- get in the endLumi if needed --------------------------------------------
68 //
70  DQMStore::IGetter& igetter_,
71  edm::LuminosityBlock const& iLumi,
72  edm::EventSetup const& iSetup) {
73  edm::LogInfo("DQMScaleToClient") << "DQMScaleToClient::endLumi " << std::endl;
74 }
75 
77  pset.add<std::string>("folder", "");
78  pset.add<std::string>("name", "");
79 }
80 
82  pset.add<std::string>("folder", "");
83  pset.add<std::string>("name", "");
84  pset.add<double>("factor", 1.);
85 }
86 
89  edm::ParameterSetDescription outputmePSet;
90  fillOutputMePSetDescription(outputmePSet);
91  desc.add<edm::ParameterSetDescription>("outputme", outputmePSet);
92 
93  edm::ParameterSetDescription inputmePSet;
94  fillMePSetDescription(inputmePSet);
95  desc.add<edm::ParameterSetDescription>("inputme", inputmePSet);
96 
97  descriptions.add("dqmScaleToClient", desc);
98 }
99 
100 // Define this as a plug-in
DQMScaleToClient::beginJob
void beginJob() override
Definition: DQMScaleToClient.cc:34
MEPSet::folder
std::string folder
Definition: DQMCorrelationClient.h:19
MessageLogger.h
DQMScaleToClient
Definition: DQMScaleToClient.h:28
DQMScaleToClient::fillOutputMePSetDescription
static void fillOutputMePSetDescription(edm::ParameterSetDescription &pset)
Definition: DQMScaleToClient.cc:81
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
DQMScaleToClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: DQMScaleToClient.cc:39
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
OutputMEPSet::folder
std::string folder
Definition: DQMCorrelationClient.h:25
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
DQMScaleToClient::getOutputHistoPSet
static OutputMEPSet getOutputHistoPSet(edm::ParameterSet pset)
Definition: DQMScaleToClient.cc:23
OutputMEPSet
Definition: DQMCorrelationClient.h:23
DQMScaleToClient::getHistoPSet
static MEPSet getHistoPSet(edm::ParameterSet pset)
Definition: DQMScaleToClient.cc:16
MakerMacros.h
DQMScaleToClient::DQMScaleToClient
DQMScaleToClient(const edm::ParameterSet &ps)
Definition: DQMScaleToClient.cc:8
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
OutputMEPSet::name
std::string name
Definition: DQMCorrelationClient.h:24
funct::integral
Integral< F, X >::type integral(const F &f)
Definition: Integral.h:70
DQMScaleToClient::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: DQMScaleToClient.cc:87
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:475
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
DQMScaleToClient_cfi.inputme
inputme
Definition: DQMScaleToClient_cfi.py:10
OutputMEPSet::factor
double factor
Definition: DQMScaleToClient.h:25
DQMScaleToClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: DQMScaleToClient.cc:69
edm::ParameterSet
Definition: ParameterSet.h:47
ParameterSet
Definition: Functions.h:16
edm::EventSetup
Definition: EventSetup.h:58
MEPSet
Definition: DQMCorrelationClient.h:17
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
MEPSet::name
std::string name
Definition: DQMCorrelationClient.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
DQMScaleToClient::outputmepset_
OutputMEPSet outputmepset_
Definition: DQMScaleToClient.h:55
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
DQMScaleToClient.h
dqm::implementation::IBooker
Definition: DQMStore.h:43
DQMScaleToClient::scaled_
MonitorElement * scaled_
Definition: DQMScaleToClient.h:52
DQMScaleToClient::inputmepset_
MEPSet inputmepset_
Definition: DQMScaleToClient.h:54
DQMScaleToClient::fillMePSetDescription
static void fillMePSetDescription(edm::ParameterSetDescription &pset)
Definition: DQMScaleToClient.cc:76
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98