Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
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
(
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
ReturnType
container(
new
Calibration::MVAComputerContainer
);
48
49
for
(LabelFileMap::const_iterator iter =
mvaCalibrations
.begin();
50
iter !=
mvaCalibrations
.end(); iter++) {
51
std::auto_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
MVAComputerESSourceBase.h
edm::ParameterSet::retrieve
Entry const & retrieve(char const *) const
Definition:
ParameterSet.cc:255
edm::Entry
Definition:
Entry.h:41
MVAComputer.h
Entry.h
cscdqm::h::names
static const HistoName names[]
Definition:
CSCDQM_HistoDef.h:831
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
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
ParameterSet.h
PhysicsTools::MVAComputerESSourceBase::ReturnType
std::shared_ptr< Calibration::MVAComputerContainer > ReturnType
Definition:
MVAComputerESSourceBase.h:19
PhysicsTools::MVAComputerESSourceBase::MVAComputerESSourceBase
MVAComputerESSourceBase(const edm::ParameterSet ¶ms)
Definition:
MVAComputerESSourceBase.cc:19
FileInPath.h
edm::ParameterSet::getParameterNames
std::vector< std::string > getParameterNames() const
Definition:
ParameterSet.cc:748
Exception.h
edm::Entry::getFileInPath
FileInPath getFileInPath() const
Definition:
Entry.cc:787
fed_dqm_sourceclient-live_cfg.path
string path
Definition:
fed_dqm_sourceclient-live_cfg.py:33
ESProducer.h
Calibration.h
PhysicsTools::MVAComputerESSourceBase::mvaCalibrations
LabelFileMap mvaCalibrations
Definition:
MVAComputerESSourceBase.h:29
PhysicsTools::Calibration::MVAComputerContainer
Definition:
MVAComputer.h:247
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase
virtual ~MVAComputerESSourceBase()
Definition:
MVAComputerESSourceBase.cc:40
mps_splice.entry
list entry
Definition:
mps_splice.py:62
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Entry::typeCode
char typeCode() const
Definition:
Entry.h:175
edm::FileInPath::fullPath
std::string fullPath() const
Definition:
FileInPath.cc:184
edm::Entry::getString
std::string getString() const
Definition:
Entry.cc:764
Generated for CMSSW Reference Manual by
1.8.5