Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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:226
edm::Entry
Definition:
Entry.h:40
MVAComputer.h
Entry.h
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase
~MVAComputerESSourceBase() override
Definition:
MVAComputerESSourceBase.cc:37
PhysicsTools::MVAComputerESSourceBase::produce
ReturnType produce() const
Definition:
MVAComputerESSourceBase.cc:39
submitPVValidationJobs.params
list params
Definition:
submitPVValidationJobs.py:487
PhysicsTools::MVAComputer::readCalibration
static Calibration::MVAComputer * readCalibration(const char *filename)
read calibration object from plain file
Definition:
MVAComputer.cc:195
names
const std::string names[nVars_]
Definition:
PhotonIDValueMapProducer.cc:124
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
FileInPath.h
ParameterSet.h
PhysicsTools::MVAComputerESSourceBase::MVAComputerESSourceBase
MVAComputerESSourceBase(const edm::ParameterSet ¶ms)
Definition:
MVAComputerESSourceBase.cc:19
Phase1L1TJetCalibrator_9x9Jets_cfi.calibration
tuple calibration
Definition:
Phase1L1TJetCalibrator_9x9Jets_cfi.py:2
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition:
ParameterSet.cc:663
Exception.h
edm::Entry::getFileInPath
FileInPath getFileInPath() const
Definition:
Entry.cc:938
fed_dqm_sourceclient-live_cfg.path
string path
Definition:
fed_dqm_sourceclient-live_cfg.py:47
ESProducer.h
Calibration.h
PhysicsTools::MVAComputerESSourceBase::mvaCalibrations
LabelFileMap mvaCalibrations
Definition:
MVAComputerESSourceBase.h:29
mps_splice.entry
list entry
Definition:
mps_splice.py:68
edm::FileInPath::fullPath
std::string fullPath() const
Definition:
FileInPath.cc:161
edm::ParameterSet
Definition:
ParameterSet.h:47
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.5