PhysicsTools
MVAComputer
interface
MVAComputerCache.h
Go to the documentation of this file.
1
#ifndef PhysicsTools_MVAComputer_MVAComputerCache_h
2
#define PhysicsTools_MVAComputer_MVAComputerCache_h
3
// -*- C++ -*-
4
//
5
// Package: MVAComputerCache
6
// Class : MVAComputerCache
7
//
8
9
//
10
// Author: Christophe Saout <christophe.saout@cern.ch>
11
// Created: Sat Feb 23 15:38 CEST 2007
12
//
13
14
#include <memory>
15
16
#include "
FWCore/Framework/interface/EventSetup.h
"
17
#include "
FWCore/Framework/interface/ESHandle.h
"
18
#include "
PhysicsTools/MVAComputer/interface/Calibration.h
"
19
#include "
PhysicsTools/MVAComputer/interface/MVAComputer.h
"
20
21
namespace
PhysicsTools
{
22
28
class
MVAComputerCache
{
29
public
:
30
MVAComputerCache
();
31
~MVAComputerCache
();
32
33
bool
update
(
const
Calibration::MVAComputer
*
computer
);
34
bool
update
(
const
Calibration::MVAComputerContainer
*container,
const
char
*
calib
);
35
36
template
<
class
T>
37
bool
update
(
const
edm::EventSetup
&es) {
38
edm::ESHandle<Calibration::MVAComputer>
handle
;
39
es.
get
<
T
>().
get
(
handle
);
40
return
update
(
handle
.product());
41
}
42
43
template
<
class
T>
44
bool
update
(
const
edm::EventSetup
&es,
const
char
*
calib
) {
45
edm::ESHandle<Calibration::MVAComputerContainer>
handle
;
46
es.
get
<
T
>().
get
(
handle
);
47
return
update
(
handle
.product(),
calib
);
48
}
49
50
template
<
class
T>
51
bool
update
(
const
char
*
label
,
const
edm::EventSetup
&es) {
52
edm::ESHandle<Calibration::MVAComputer>
handle
;
53
es.
get
<
T
>().
get
(
label
,
handle
);
54
return
update
(
handle
.product());
55
}
56
57
template
<
class
T>
58
bool
update
(
const
char
*
label
,
const
edm::EventSetup
&es,
const
char
*
calib
) {
59
edm::ESHandle<Calibration::MVAComputerContainer>
handle
;
60
es.
get
<
T
>().
get
(
label
,
handle
);
61
return
update
(
handle
.product(),
calib
);
62
}
63
64
operator
bool
()
const
{
return
computer
.get(); }
65
66
MVAComputer
&
operator*
() {
return
*
computer
; }
67
const
MVAComputer
&
operator*
()
const
{
return
*
computer
; }
68
69
MVAComputer
*
operator->
() {
return
computer
.get(); }
70
const
MVAComputer
*
operator->
()
const
{
return
computer
.get(); }
71
72
MVAComputer
*
get
() {
return
computer
.get(); }
73
const
MVAComputer
*
get
()
const
{
return
computer
.get(); }
74
75
std::unique_ptr<MVAComputer>
release
();
76
77
void
reset
() {
computer
.reset(); }
78
79
private
:
80
Calibration::MVAComputerContainer::CacheId
containerCacheId
;
81
Calibration::MVAComputer::CacheId
computerCacheId
;
82
std::unique_ptr<MVAComputer>
computer
;
83
};
84
85
}
// namespace PhysicsTools
86
87
#endif // PhysicsTools_MVAComputer_MVAComputerCache_h
PhysicsTools::MVAComputerCache::get
const MVAComputer * get() const
Definition:
MVAComputerCache.h:73
PhysicsTools::MVAComputerCache::operator*
MVAComputer & operator*()
Definition:
MVAComputerCache.h:66
electrons_cff.bool
bool
Definition:
electrons_cff.py:393
PhysicsTools::MVAComputerCache::get
MVAComputer * get()
Definition:
MVAComputerCache.h:72
PhysicsTools::MVAComputerCache::computer
std::unique_ptr< MVAComputer > computer
Definition:
MVAComputerCache.h:82
PhysicsTools::Calibration::MVAComputerContainer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:262
PhysicsTools::MVAComputerCache::reset
void reset()
Definition:
MVAComputerCache.h:77
ESHandle.h
PhysicsTools::MVAComputerCache::computerCacheId
Calibration::MVAComputer::CacheId computerCacheId
Definition:
MVAComputerCache.h:81
patZpeak.handle
handle
Definition:
patZpeak.py:23
PhysicsTools::MVAComputerCache::release
std::unique_ptr< MVAComputer > release()
Definition:
MVAComputerCache.cc:53
PhysicsTools::MVAComputer
Main interface class to the generic discriminator computer framework.
Definition:
MVAComputer.h:39
PhysicsTools::MVAComputerCache
Creates and and MVAComputer from calibrations via EventSetup.
Definition:
MVAComputerCache.h:28
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:80
PhysicsTools::MVAComputerCache::operator*
const MVAComputer & operator*() const
Definition:
MVAComputerCache.h:67
PhysicsTools::MVAComputerCache::containerCacheId
Calibration::MVAComputerContainer::CacheId containerCacheId
Definition:
MVAComputerCache.h:80
edm::ESHandle
Definition:
DTSurvey.h:22
MVAComputer.h
calib
Definition:
CalibElectron.h:12
PhysicsTools::Calibration::MVAComputer::CacheId
unsigned int CacheId
Definition:
MVAComputer.h:233
PhysicsTools::Calibration::MVAComputer
Definition:
MVAComputer.h:221
PhysicsTools
Definition:
Histogram.h:13
PhysicsTools::MVAComputerCache::operator->
const MVAComputer * operator->() const
Definition:
MVAComputerCache.h:70
edm::EventSetup
Definition:
EventSetup.h:57
PhysicsTools::MVAComputerCache::~MVAComputerCache
~MVAComputerCache()
Definition:
MVAComputerCache.cc:13
L1EGammaCrystalsEmulatorProducer_cfi.calib
calib
Definition:
L1EGammaCrystalsEmulatorProducer_cfi.py:6
PhysicsTools::MVAComputerCache::MVAComputerCache
MVAComputerCache()
Definition:
MVAComputerCache.cc:9
T
long double T
Definition:
Basic3DVectorLD.h:48
PhysicsTools::MVAComputerCache::update
bool update(const Calibration::MVAComputer *computer)
Definition:
MVAComputerCache.cc:15
PhysicsTools::MVAComputerCache::operator->
MVAComputer * operator->()
Definition:
MVAComputerCache.h:69
Calibration.h
EventSetup.h
PhysicsTools::Calibration::MVAComputerContainer
Definition:
MVAComputer.h:250
PhysicsTools::MVAComputerCache::update
bool update(const edm::EventSetup &es)
Definition:
MVAComputerCache.h:37
PhysicsTools::MVAComputerCache::update
bool update(const edm::EventSetup &es, const char *calib)
Definition:
MVAComputerCache.h:44
PhysicsTools::MVAComputerCache::update
bool update(const char *label, const edm::EventSetup &es, const char *calib)
Definition:
MVAComputerCache.h:58
label
const char * label
Definition:
PFTauDecayModeTools.cc:11
PhysicsTools::MVAComputerCache::update
bool update(const char *label, const edm::EventSetup &es)
Definition:
MVAComputerCache.h:51
Generated for CMSSW Reference Manual by
1.8.16