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
(
20
const
edm::ParameterSet
¶ms)
21
{
22
std::vector<std::string>
names
= params.
getParameterNames
();
23
for
(std::vector<std::string>::const_iterator iter = names.begin();
24
iter != names.end(); iter++) {
25
if
(iter->c_str()[0] ==
'@'
)
26
continue
;
27
28
const
edm::Entry
&
entry
= params.
retrieve
(*iter);
29
30
std::string
path
;
31
if
(entry.
typeCode
() ==
'F'
)
32
path = entry.
getFileInPath
().
fullPath
();
33
else
34
path = entry.
getString
();
35
36
mvaCalibrations
[*iter] =
path
;
37
}
38
}
39
40
MVAComputerESSourceBase::~MVAComputerESSourceBase
()
41
{
42
}
43
44
MVAComputerESSourceBase::ReturnType
45
MVAComputerESSourceBase::produce
()
const
46
{
47
auto
container = std::make_unique<Calibration::MVAComputerContainer>();
48
49
for
(LabelFileMap::const_iterator iter =
mvaCalibrations
.begin();
50
iter !=
mvaCalibrations
.end(); iter++) {
51
std::unique_ptr<Calibration::MVAComputer> calibration(
52
MVAComputer::readCalibration
(iter->second.c_str()));
53
54
container->add(iter->first) = *calibration;
55
}
56
57
return
container;
58
}
59
60
}
// 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
callgraph.path
path
Definition:
callgraph.py:39
edm::Entry
Definition:
Entry.h:40
MVAComputer.h
Entry.h
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase
~MVAComputerESSourceBase() override
Definition:
MVAComputerESSourceBase.cc:40
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
PhysicsTools::MVAComputerESSourceBase::produce
ReturnType produce() const
Definition:
MVAComputerESSourceBase.cc:45
PhysicsTools::MVAComputer::readCalibration
static Calibration::MVAComputer * readCalibration(const char *filename)
read calibration object from plain file
Definition:
MVAComputer.cc:232
names
const std::string names[nVars_]
Definition:
PhotonIDValueMapProducer.cc:121
ParameterSet.h
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:817
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:793
Generated for CMSSW Reference Manual by
1.8.11