Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
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
MVAComputerCache::~MVAComputerCache
() {}
14
15
bool
MVAComputerCache::update
(
const
Calibration::MVAComputer
*
computer
) {
16
if
(!computer && !*
this
)
17
return
false
;
18
if
(computer && !computer->
changed
(
computerCacheId
))
19
return
false
;
20
21
if
(computer) {
22
this->computer = std::make_unique<MVAComputer>(
computer
);
23
computerCacheId
= computer->
getCacheId
();
24
}
else
{
25
this->computer.reset();
26
computerCacheId
=
Calibration::MVAComputer::CacheId
();
27
}
28
29
containerCacheId
=
Calibration::MVAComputerContainer::CacheId
();
30
return
true
;
31
}
32
33
bool
MVAComputerCache::update
(
const
Calibration::MVAComputerContainer
*container,
const
char
*calib) {
34
if
(!container && !*
this
)
35
return
false
;
36
if
(container && !container->
changed
(
containerCacheId
))
37
return
false
;
38
39
if
(container) {
40
const
Calibration::MVAComputer
*
computer
= &container->
find
(calib);
41
bool
result
=
update
(computer);
42
containerCacheId
= container->
getCacheId
();
43
return
result
;
44
}
45
46
this->
computer
.reset();
47
48
computerCacheId
=
Calibration::MVAComputer::CacheId
();
49
containerCacheId
=
Calibration::MVAComputerContainer::CacheId
();
50
return
true
;
51
}
52
53
std::unique_ptr<MVAComputer>
MVAComputerCache::release
() {
54
computerCacheId
=
Calibration::MVAComputer::CacheId
();
55
containerCacheId
=
Calibration::MVAComputerContainer::CacheId
();
56
return
std::move
(
computer
);
57
}
58
59
}
// namespace PhysicsTools
PhysicsTools::Calibration::MVAComputerContainer::find
virtual const MVAComputer & find(const std::string &label) const
Definition:
MVAComputer.cc:168
MVAComputer.h
PhysicsTools::MVAComputerCache::computerCacheId
Calibration::MVAComputer::CacheId computerCacheId
Definition:
MVAComputerCache.h:51
PhysicsTools::MVAComputerCache::MVAComputerCache
MVAComputerCache()
Definition:
MVAComputerCache.cc:9
PhysicsTools::Calibration::MVAComputer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:234
PhysicsTools::MVAComputerCache::containerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
Definition:
MVAComputerCache.h:50
MVAComputerCache.h
PhysicsTools::MVAComputerCache::release
std::unique_ptr< MVAComputer > release()
Definition:
MVAComputerCache.cc:53
mps_fire.result
tuple result
Definition:
mps_fire.py:311
PhysicsTools::Calibration::MVAComputerContainer::changed
bool changed(CacheId old) const
Definition:
MVAComputer.h:265
PhysicsTools::Calibration::MVAComputerContainer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:263
PhysicsTools::Calibration::MVAComputer
Definition:
MVAComputer.h:221
PhysicsTools::Calibration::MVAComputerContainer::getCacheId
CacheId getCacheId() const
Definition:
MVAComputer.h:264
PhysicsTools::MVAComputer
Main interface class to the generic discriminator computer framework.
Definition:
MVAComputer.h:39
HLT_FULL_cff.computer
tuple computer
Definition:
HLT_FULL_cff.py:38913
eostools.move
def move
Definition:
eostools.py:511
PhysicsTools::Calibration::MVAComputer::changed
bool changed(CacheId old) const
Definition:
MVAComputer.h:236
PhysicsTools::MVAComputerCache::computer
std::unique_ptr< MVAComputer > computer
Definition:
MVAComputerCache.h:52
PhysicsTools::MVAComputerCache::update
bool update(const Calibration::MVAComputer *computer)
Definition:
MVAComputerCache.cc:15
messageLoggerDebug_cff.Calibration
tuple Calibration
Definition:
messageLoggerDebug_cff.py:14
PhysicsTools::MVAComputerCache::~MVAComputerCache
~MVAComputerCache()
Definition:
MVAComputerCache.cc:13
Calibration.h
PhysicsTools::Calibration::MVAComputerContainer
Definition:
MVAComputer.h:251
PhysicsTools::Calibration::MVAComputer::getCacheId
CacheId getCacheId() const
Definition:
MVAComputer.h:235
Generated for CMSSW Reference Manual by
1.8.5