PhysicsTools
MVAComputer
src
MVAComputerESSourceBase.cc
Go to the documentation of this file.
1
#include <iostream>
2
#include <string>
3
#include <memory>
4
#include <vector>
5
#include <map>
6
7
#include "
FWCore/Utilities/interface/Exception.h
"
8
#include "
FWCore/Framework/interface/ESProducer.h
"
9
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
10
#include "
FWCore/ParameterSet/interface/Entry.h
"
11
#include "
FWCore/ParameterSet/interface/FileInPath.h
"
12
13
#include "
PhysicsTools/MVAComputer/interface/Calibration.h
"
14
#include "
PhysicsTools/MVAComputer/interface/MVAComputer.h
"
15
#include "
PhysicsTools/MVAComputer/interface/MVAComputerESSourceBase.h
"
16
17
namespace
PhysicsTools
{
18
19
MVAComputerESSourceBase::MVAComputerESSourceBase
(
const
edm::ParameterSet
&
params
) {
20
std::vector<std::string>
names
=
params
.getParameterNames();
21
for
(std::vector<std::string>::const_iterator iter =
names
.begin(); iter !=
names
.end(); iter++) {
22
if
(iter->c_str()[0] ==
'@'
)
23
continue
;
24
25
const
edm::Entry
&
entry
=
params
.retrieve(*iter);
26
27
std::string
path
;
28
if
(
entry
.typeCode() ==
'F'
)
29
path
=
entry
.getFileInPath().fullPath();
30
else
31
path
=
entry
.getString();
32
33
mvaCalibrations
[*iter] =
path
;
34
}
35
}
36
37
MVAComputerESSourceBase::~MVAComputerESSourceBase
() {}
38
39
MVAComputerESSourceBase::ReturnType
MVAComputerESSourceBase::produce
()
const
{
40
auto
container = std::make_unique<Calibration::MVAComputerContainer>();
41
42
for
(LabelFileMap::const_iterator iter =
mvaCalibrations
.begin(); iter !=
mvaCalibrations
.end(); iter++) {
43
std::unique_ptr<Calibration::MVAComputer>
calibration
(
MVAComputer::readCalibration
(iter->second.c_str()));
44
45
container->add(iter->first) = *
calibration
;
46
}
47
48
return
container;
49
}
50
51
}
// namespace PhysicsTools
MVAComputerESSourceBase.h
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
mps_splice.entry
entry
Definition:
mps_splice.py:68
PhysicsTools::MVAComputer::readCalibration
static Calibration::MVAComputer * readCalibration(const char *filename)
read calibration object from plain file
Definition:
MVAComputer.cc:196
ESProducer.h
PhysicsTools::MVAComputerESSourceBase::mvaCalibrations
LabelFileMap mvaCalibrations
Definition:
MVAComputerESSourceBase.h:29
FileInPath.h
Entry.h
l1tSlwPFPuppiJetsCorrected_cfi.calibration
calibration
Definition:
l1tSlwPFPuppiJetsCorrected_cfi.py:10
names
const std::string names[nVars_]
Definition:
PhotonIDValueMapProducer.cc:122
MVAComputer.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
PhysicsTools
Definition:
Histogram.h:13
Calibration.h
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase
~MVAComputerESSourceBase() override
Definition:
MVAComputerESSourceBase.cc:37
Exception.h
castor_dqm_sourceclient_file_cfg.path
path
Definition:
castor_dqm_sourceclient_file_cfg.py:37
ParameterSet.h
PhysicsTools::MVAComputerESSourceBase::produce
ReturnType produce() const
Definition:
MVAComputerESSourceBase.cc:39
PhysicsTools::MVAComputerESSourceBase::ReturnType
std::unique_ptr< Calibration::MVAComputerContainer > ReturnType
Definition:
MVAComputerESSourceBase.h:19
PhysicsTools::MVAComputerESSourceBase::MVAComputerESSourceBase
MVAComputerESSourceBase(const edm::ParameterSet ¶ms)
Definition:
MVAComputerESSourceBase.cc:19
edm::Entry
Definition:
Entry.h:40
Generated for CMSSW Reference Manual by
1.8.16