test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
PhysicsTools
MVAComputer
src
MVAComputerCache.cc
Go to the documentation of this file.
1
#include <memory>
2
3
#include "
PhysicsTools/MVAComputer/interface/Calibration.h
"
4
#include "
PhysicsTools/MVAComputer/interface/MVAComputer.h
"
5
#include "
PhysicsTools/MVAComputer/interface/MVAComputerCache.h
"
6
7
namespace
PhysicsTools {
8
9
MVAComputerCache::MVAComputerCache
() :
10
containerCacheId(
Calibration
::MVAComputerContainer::CacheId()),
11
computerCacheId(
Calibration
::
MVAComputer
::CacheId())
12
{
13
}
14
15
MVAComputerCache::~MVAComputerCache
()
16
{
17
}
18
19
bool
MVAComputerCache::update
(
const
Calibration::MVAComputer
*computer)
20
{
21
if
(!computer && !*
this
)
22
return
false
;
23
if
(computer && !computer->
changed
(
computerCacheId
))
24
return
false
;
25
26
if
(computer) {
27
this->computer.reset(
new
MVAComputer
(computer));
28
computerCacheId
= computer->
getCacheId
();
29
}
else
{
30
this->computer.reset();
31
computerCacheId
=
Calibration::MVAComputer::CacheId
();
32
}
33
34
containerCacheId
=
Calibration::MVAComputerContainer::CacheId
();
35
return
true
;
36
}
37
38
bool
MVAComputerCache::update
(
39
const
Calibration::MVAComputerContainer
*container,
40
const
char
*
calib
)
41
{
42
if
(!container && !*
this
)
43
return
false
;
44
if
(container && !container->
changed
(
containerCacheId
))
45
return
false
;
46
47
if
(container) {
48
const
Calibration::MVAComputer
*
computer
=
49
&container->
find
(calib);
50
bool
result
=
update
(computer);
51
containerCacheId
= container->
getCacheId
();
52
return
result
;
53
}
54
55
this->
computer
.reset();
56
57
computerCacheId
=
Calibration::MVAComputer::CacheId
();
58
containerCacheId
=
Calibration::MVAComputerContainer::CacheId
();
59
return
true
;
60
}
61
62
std::auto_ptr<MVAComputer>
MVAComputerCache::release
()
63
{
64
computerCacheId
=
Calibration::MVAComputer::CacheId
();
65
containerCacheId
=
Calibration::MVAComputerContainer::CacheId
();
66
return
computer
;
67
}
68
69
}
// namespace PhysicsTools
PhysicsTools::Calibration::MVAComputerContainer::find
virtual const MVAComputer & find(const std::string &label) const
Definition:
MVAComputer.cc:192
MVAComputer.h
PhysicsTools::MVAComputerCache::release
std::auto_ptr< MVAComputer > release()
Definition:
MVAComputerCache.cc:62
PhysicsTools::MVAComputerCache::computerCacheId
Calibration::MVAComputer::CacheId computerCacheId
Definition:
MVAComputerCache.h:87
PhysicsTools::MVAComputerCache::MVAComputerCache
MVAComputerCache()
Definition:
MVAComputerCache.cc:9
PhysicsTools::Calibration::MVAComputer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:213
PhysicsTools::MVAComputerCache::containerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
Definition:
MVAComputerCache.h:86
MVAComputerCache.h
PhysicsTools::Calibration::MVAComputerContainer::changed
bool changed(CacheId old) const
Definition:
MVAComputer.h:244
PhysicsTools::Calibration::MVAComputerContainer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:242
calib
MVATrainerComputer * calib
Definition:
MVATrainer.cc:64
PhysicsTools::Calibration::MVAComputer
Definition:
MVAComputer.h:201
PhysicsTools::Calibration::MVAComputerContainer::getCacheId
CacheId getCacheId() const
Definition:
MVAComputer.h:243
PhysicsTools::MVAComputer
Main interface class to the generic discriminator computer framework.
Definition:
MVAComputer.h:39
query.result
tuple result
Definition:
query.py:137
PhysicsTools::Calibration::MVAComputer::changed
bool changed(CacheId old) const
Definition:
MVAComputer.h:215
PhysicsTools::MVAComputerCache::update
bool update(const Calibration::MVAComputer *computer)
Definition:
MVAComputerCache.cc:19
messageLoggerDebug_cff.Calibration
tuple Calibration
Definition:
messageLoggerDebug_cff.py:12
PhysicsTools::MVAComputerCache::~MVAComputerCache
~MVAComputerCache()
Definition:
MVAComputerCache.cc:15
Calibration.h
PhysicsTools::Calibration::MVAComputerContainer
Definition:
MVAComputer.h:230
PhysicsTools::Calibration::MVAComputer::getCacheId
CacheId getCacheId() const
Definition:
MVAComputer.h:214
PhysicsTools::MVAComputerCache::computer
std::auto_ptr< MVAComputer > computer
Definition:
MVAComputerCache.h:88
Generated for CMSSW Reference Manual by
1.8.5