RecoEgamma
EgammaTools
interface
MVAVariableHelper.h
Go to the documentation of this file.
1
#ifndef RecoEgamma_EgammaTools_MVAVariableHelper_H
2
#define RecoEgamma_EgammaTools_MVAVariableHelper_H
3
4
#include "
DataFormats/Common/interface/ValueMap.h
"
5
#include "
FWCore/Framework/interface/ConsumesCollector.h
"
6
#include "
FWCore/Utilities/interface/EDGetToken.h
"
7
#include "
FWCore/Framework/interface/Event.h
"
8
9
#include <unordered_map>
10
#include <vector>
11
#include <string>
12
13
class
MVAVariableIndexMap
{
14
public
:
15
MVAVariableIndexMap
();
16
17
int
getIndex
(
std::string
const
&
name
)
const
{
return
indexMap_
.at(
name
); }
18
19
private
:
20
const
std::unordered_map<std::string, int>
indexMap_
;
21
};
22
23
class
MVAVariableHelper
{
24
public
:
25
MVAVariableHelper
(
edm::ConsumesCollector
&&
cc
);
26
27
const
std::vector<float>
getAuxVariables
(
const
edm::Event
&
iEvent
)
const
;
28
29
private
:
30
static
float
getVariableFromDoubleToken
(
edm::EDGetToken
const
&
token
,
const
edm::Event
&
iEvent
) {
31
edm::Handle<double>
handle
;
32
iEvent
.getByToken(
token
,
handle
);
33
return
*
handle
;
34
}
35
36
const
std::vector<edm::EDGetToken>
tokens_
;
37
};
38
39
#endif
patZpeak.handle
handle
Definition:
patZpeak.py:23
MVAVariableIndexMap::MVAVariableIndexMap
MVAVariableIndexMap()
Definition:
MVAVariableHelper.cc:12
edm::Handle< double >
MVAVariableIndexMap
Definition:
MVAVariableHelper.h:13
MVAVariableHelper::getAuxVariables
const std::vector< float > getAuxVariables(const edm::Event &iEvent) const
Definition:
MVAVariableHelper.cc:7
MVAVariableHelper::MVAVariableHelper
MVAVariableHelper(edm::ConsumesCollector &&cc)
Definition:
MVAVariableHelper.cc:3
EDGetToken.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
MVAVariableIndexMap::indexMap_
const std::unordered_map< std::string, int > indexMap_
Definition:
MVAVariableHelper.h:20
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EDGetToken
Definition:
EDGetToken.h:35
cc
ValueMap.h
MVAVariableHelper::tokens_
const std::vector< edm::EDGetToken > tokens_
Definition:
MVAVariableHelper.h:36
MVAVariableIndexMap::getIndex
int getIndex(std::string const &name) const
Definition:
MVAVariableHelper.h:17
Skims_PA_cff.name
name
Definition:
Skims_PA_cff.py:17
ConsumesCollector.h
MVAVariableHelper::getVariableFromDoubleToken
static float getVariableFromDoubleToken(edm::EDGetToken const &token, const edm::Event &iEvent)
Definition:
MVAVariableHelper.h:30
edm::Event
Definition:
Event.h:73
MVAVariableHelper
Definition:
MVAVariableHelper.h:23
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
unpackBuffers-CaloStage2.token
token
Definition:
unpackBuffers-CaloStage2.py:316
Generated for CMSSW Reference Manual by
1.8.16