Main Page
Namespaces
Classes
Package Documentation
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
PhysicsTools::MVAComputerESSourceBase::ReturnType
std::unique_ptr< Calibration::MVAComputerContainer > ReturnType
Definition:
MVAComputerESSourceBase.h:19
MVAComputerESSourceBase.h
edm::ParameterSet::retrieve
Entry const & retrieve(char const *) const
Definition:
ParameterSet.cc:219
edm::Entry
Definition:
Entry.h:40
MVAComputer.h
Entry.h
castor_dqm_sourceclient_file_cfg.path
path
Definition:
castor_dqm_sourceclient_file_cfg.py:37
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase
~MVAComputerESSourceBase() override
Definition:
MVAComputerESSourceBase.cc:37
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
PhysicsTools::MVAComputerESSourceBase::produce
ReturnType produce() const
Definition:
MVAComputerESSourceBase.cc:39
PhysicsTools::MVAComputer::readCalibration
static Calibration::MVAComputer * readCalibration(const char *filename)
read calibration object from plain file
Definition:
MVAComputer.cc:196
names
const std::string names[nVars_]
Definition:
PhotonIDValueMapProducer.cc:122
ParameterSet.h
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
mps_splice.entry
entry
Definition:
mps_splice.py:68
PhysicsTools::MVAComputerESSourceBase::MVAComputerESSourceBase
MVAComputerESSourceBase(const edm::ParameterSet ¶ms)
Definition:
MVAComputerESSourceBase.cc:19
FileInPath.h
PhysicsTools
Definition:
Histogram.h:13
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition:
ParameterSet.cc:656
Exception.h
edm::Entry::getFileInPath
FileInPath getFileInPath() const
Definition:
Entry.cc:938
ESProducer.h
Calibration.h
PhysicsTools::MVAComputerESSourceBase::mvaCalibrations
LabelFileMap mvaCalibrations
Definition:
MVAComputerESSourceBase.h:29
edm::FileInPath::fullPath
std::string fullPath() const
Definition:
FileInPath.cc:163
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Entry::typeCode
char typeCode() const
Definition:
Entry.h:176
edm::Entry::getString
std::string getString() const
Definition:
Entry.cc:914
Generated for CMSSW Reference Manual by
1.8.11