test
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 <boost/shared_ptr.hpp>
8
9
#include "
FWCore/Utilities/interface/Exception.h
"
10
#include "
FWCore/Framework/interface/ESProducer.h
"
11
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
12
#include "
FWCore/ParameterSet/interface/Entry.h
"
13
#include "
FWCore/ParameterSet/interface/FileInPath.h
"
14
15
#include "
PhysicsTools/MVAComputer/interface/Calibration.h
"
16
#include "
PhysicsTools/MVAComputer/interface/MVAComputer.h
"
17
#include "
PhysicsTools/MVAComputer/interface/MVAComputerESSourceBase.h
"
18
19
namespace
PhysicsTools {
20
21
MVAComputerESSourceBase::MVAComputerESSourceBase
(
22
const
edm::ParameterSet
¶ms)
23
{
24
std::vector<std::string>
names
= params.
getParameterNames
();
25
for
(std::vector<std::string>::const_iterator iter = names.begin();
26
iter != names.end(); iter++) {
27
if
(iter->c_str()[0] ==
'@'
)
28
continue
;
29
30
const
edm::Entry
&
entry
= params.
retrieve
(*iter);
31
32
std::string
path
;
33
if
(entry.
typeCode
() ==
'F'
)
34
path = entry.
getFileInPath
().
fullPath
();
35
else
36
path = entry.
getString
();
37
38
mvaCalibrations
[*iter] =
path
;
39
}
40
}
41
42
MVAComputerESSourceBase::~MVAComputerESSourceBase
()
43
{
44
}
45
46
MVAComputerESSourceBase::ReturnType
47
MVAComputerESSourceBase::produce
()
const
48
{
49
ReturnType
container(
new
Calibration::MVAComputerContainer
);
50
51
for
(LabelFileMap::const_iterator iter =
mvaCalibrations
.begin();
52
iter !=
mvaCalibrations
.end(); iter++) {
53
std::auto_ptr<Calibration::MVAComputer> calibration(
54
MVAComputer::readCalibration
(iter->second.c_str()));
55
56
container->add(iter->first) = *calibration;
57
}
58
59
return
container;
60
}
61
62
}
// 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:47
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::MVAComputerESSourceBase
MVAComputerESSourceBase(const edm::ParameterSet ¶ms)
Definition:
MVAComputerESSourceBase.cc:21
PhysicsTools::MVAComputerESSourceBase::ReturnType
boost::shared_ptr< Calibration::MVAComputerContainer > ReturnType
Definition:
MVAComputerESSourceBase.h: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:42
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