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:253
edm::Entry
Definition:
Entry.h:41
MVAComputer.h
Entry.h
cscdqm::h::names
static const HistoName names[]
Definition:
CSCDQM_HistoDef.h:828
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:230
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
ParameterSet.h
cmsHarvester.path
tuple path
else: Piece not in the list, fine.
Definition:
cmsHarvester.py:1591
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:746
Exception.h
edm::Entry::getFileInPath
FileInPath getFileInPath() const
Definition:
Entry.cc:787
ESProducer.h
Calibration.h
PhysicsTools::MVAComputerESSourceBase::mvaCalibrations
LabelFileMap mvaCalibrations
Definition:
MVAComputerESSourceBase.h:29
getDQMSummary.iter
tuple iter
Definition:
getDQMSummary.py:36
PhysicsTools::Calibration::MVAComputerContainer
Definition:
MVAComputer.h:277
PhysicsTools::MVAComputerESSourceBase::~MVAComputerESSourceBase
virtual ~MVAComputerESSourceBase()
Definition:
MVAComputerESSourceBase.cc:42
edm::ParameterSet
Definition:
ParameterSet.h:35
edm::Entry::typeCode
char typeCode() const
Definition:
Entry.h:175
edm::FileInPath::fullPath
std::string fullPath() const
Definition:
FileInPath.cc:165
edm::Entry::getString
std::string getString() const
Definition:
Entry.cc:764
Generated for CMSSW Reference Manual by
1.8.5