Main Page
Namespaces
Classes
Package Documentation
CVS Directory
WorkBook
Offline Guide
Release schedule
•
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
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.reset(
new
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:162
MVAComputer.h
PhysicsTools::MVAComputerCache::computerCacheId
Calibration::MVAComputer::CacheId computerCacheId
Definition:
MVAComputerCache.h:81
mps_fire.result
result
Definition:
mps_fire.py:294
PhysicsTools::MVAComputerCache::MVAComputerCache
MVAComputerCache()
Definition:
MVAComputerCache.cc:9
PhysicsTools::Calibration::MVAComputer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:233
PhysicsTools::MVAComputerCache::containerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
Definition:
MVAComputerCache.h:80
MVAComputerCache.h
PhysicsTools::MVAComputerCache::release
std::unique_ptr< MVAComputer > release()
Definition:
MVAComputerCache.cc:53
PhysicsTools::Calibration::MVAComputerContainer::changed
bool changed(CacheId old) const
Definition:
MVAComputer.h:264
PhysicsTools::Calibration::MVAComputerContainer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:262
PhysicsTools::Calibration::MVAComputer
Definition:
MVAComputer.h:221
PhysicsTools::Calibration::MVAComputerContainer::getCacheId
CacheId getCacheId() const
Definition:
MVAComputer.h:263
calib
Definition:
CalibElectron.h:12
PhysicsTools::MVAComputer
Main interface class to the generic discriminator computer framework.
Definition:
MVAComputer.h:39
HLT_2018_cff.Calibration
Calibration
Definition:
HLT_2018_cff.py:3579
PhysicsTools
Definition:
Histogram.h:13
PhysicsTools::Calibration::MVAComputer::changed
bool changed(CacheId old) const
Definition:
MVAComputer.h:235
PhysicsTools::MVAComputerCache::computer
std::unique_ptr< MVAComputer > computer
Definition:
MVAComputerCache.h:82
PhysicsTools::MVAComputerCache::update
bool update(const Calibration::MVAComputer *computer)
Definition:
MVAComputerCache.cc:15
PhysicsTools::MVAComputerCache::~MVAComputerCache
~MVAComputerCache()
Definition:
MVAComputerCache.cc:13
Calibration.h
PhysicsTools::Calibration::MVAComputerContainer
Definition:
MVAComputer.h:250
PhysicsTools::Calibration::MVAComputer::getCacheId
CacheId getCacheId() const
Definition:
MVAComputer.h:234
eostools.move
def move(src, dest)
Definition:
eostools.py:511
Generated for CMSSW Reference Manual by
1.8.11