RecoEgamma
ElectronIdentification
interface
ElectronMVAEstimatorRun2.h
Go to the documentation of this file.
1
#ifndef RecoEgamma_ElectronIdentification_ElectronMVAEstimatorRun2_H
2
#define RecoEgamma_ElectronIdentification_ElectronMVAEstimatorRun2_H
3
4
#include "
DataFormats/PatCandidates/interface/Electron.h
"
5
#include "
RecoEgamma/EgammaTools/interface/AnyMVAEstimatorRun2Base.h
"
6
#include "
CommonTools/MVAUtils/interface/GBRForestTools.h
"
7
#include "
RecoEgamma/EgammaTools/interface/MVAVariableManager.h
"
8
#include "
RecoEgamma/EgammaTools/interface/ThreadSafeStringCut.h
"
9
10
#include "
DataFormats/EgammaCandidates/interface/Conversion.h
"
11
#include "
RecoEgamma/EgammaTools/interface/ConversionTools.h
"
12
#include "
DataFormats/VertexReco/interface/Vertex.h
"
13
14
#include <TMath.h>
15
16
class
ElectronMVAEstimatorRun2
:
public
AnyMVAEstimatorRun2Base
{
17
public
:
18
// Constructor and destructor
19
ElectronMVAEstimatorRun2
(
const
edm::ParameterSet
& conf);
20
~ElectronMVAEstimatorRun2
()
override
{};
21
// For use with FWLite/Python
22
ElectronMVAEstimatorRun2
(
const
std::string
&
mvaTag
,
23
const
std::string
&
mvaName
,
24
int
nCategories
,
25
const
std::string
&
variableDefinition
,
26
const
std::vector<std::string>& categoryCutStrings,
27
const
std::vector<std::string>&
weightFileNames
,
28
bool
debug
=
false
);
29
30
// Calculation of the MVA value
31
float
mvaValue
(
const
reco::Candidate
* candidate,
32
std::vector<float>
const
& auxVariables,
33
int
& iCategory)
const override
;
34
35
// for FWLite just passing rho
36
float
mvaValue
(
const
reco::Candidate
* candidate,
float
rho
,
int
& iCategory)
const
{
37
return
mvaValue
(candidate, std::vector<float>{
rho
}, iCategory);
38
}
39
40
int
findCategory
(
const
reco::Candidate
* candidate)
const override
;
41
42
private
:
43
void
init
(
const
std::vector<std::string>&
weightFileNames
);
44
45
int
findCategory
(
reco::GsfElectron
const
&
electron
)
const
;
46
47
std::vector<ThreadSafeStringCut<StringCutObjectSelector<reco::GsfElectron>,
reco::GsfElectron
>>
categoryFunctions_
;
48
std::vector<int>
nVariables_
;
49
50
// Data members
51
std::vector<std::unique_ptr<const GBRForest>>
gbrForests_
;
52
53
// There might be different variables for each category, so the variables
54
// names vector is itself a vector of length nCategories
55
std::vector<std::vector<int>>
variables_
;
56
57
MVAVariableManager<reco::GsfElectron>
mvaVarMngr_
;
58
};
59
60
#endif
AnyMVAEstimatorRun2Base.h
mvaElectronID_Fall17_iso_V1_cff.mvaTag
mvaTag
Definition:
mvaElectronID_Fall17_iso_V1_cff.py:16
mvaElectronID_Fall17_iso_V1_cff.variableDefinition
variableDefinition
Definition:
mvaElectronID_Fall17_iso_V1_cff.py:90
ConversionTools.h
AnyMVAEstimatorRun2Base
Definition:
AnyMVAEstimatorRun2Base.h:11
GBRForestTools.h
ElectronMVAEstimatorRun2::nVariables_
std::vector< int > nVariables_
Definition:
ElectronMVAEstimatorRun2.h:48
ThreadSafeStringCut.h
ElectronMVAEstimatorRun2::mvaValue
float mvaValue(const reco::Candidate *candidate, std::vector< float > const &auxVariables, int &iCategory) const override
Definition:
ElectronMVAEstimatorRun2.cc:79
debug
#define debug
Definition:
HDRShower.cc:19
MVAVariableManager.h
ElectronMVAEstimatorRun2::~ElectronMVAEstimatorRun2
~ElectronMVAEstimatorRun2() override
Definition:
ElectronMVAEstimatorRun2.h:20
ElectronMVAEstimatorRun2::variables_
std::vector< std::vector< int > > variables_
Definition:
ElectronMVAEstimatorRun2.h:55
reco::GsfElectron
Definition:
GsfElectron.h:35
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
ElectronMVAEstimatorRun2::ElectronMVAEstimatorRun2
ElectronMVAEstimatorRun2(const edm::ParameterSet &conf)
Definition:
ElectronMVAEstimatorRun2.cc:3
edm::ParameterSet
Definition:
ParameterSet.h:36
ElectronMVAEstimatorRun2::gbrForests_
std::vector< std::unique_ptr< const GBRForest > > gbrForests_
Definition:
ElectronMVAEstimatorRun2.h:51
ElectronMVAEstimatorRun2
Definition:
ElectronMVAEstimatorRun2.h:16
ElectronMVAEstimatorRun2::findCategory
int findCategory(const reco::Candidate *candidate) const override
Definition:
ElectronMVAEstimatorRun2.cc:117
ElectronMVAEstimatorRun2::init
void init(const std::vector< std::string > &weightFileNames)
Definition:
ElectronMVAEstimatorRun2.cc:37
HPSPFTauProducerPuppi_cfi.electron
electron
Definition:
HPSPFTauProducerPuppi_cfi.py:13
mvaElectronID_Fall17_iso_V1_cff.nCategories
nCategories
Definition:
mvaElectronID_Fall17_iso_V1_cff.py:86
reco::Candidate
Definition:
Candidate.h:27
ElectronMVAEstimatorRun2::mvaVarMngr_
MVAVariableManager< reco::GsfElectron > mvaVarMngr_
Definition:
ElectronMVAEstimatorRun2.h:57
ElectronMVAEstimatorRun2::mvaValue
float mvaValue(const reco::Candidate *candidate, float rho, int &iCategory) const
Definition:
ElectronMVAEstimatorRun2.h:36
MVAVariableManager< reco::GsfElectron >
mvaElectronID_Fall17_iso_V1_cff.weightFileNames
weightFileNames
Definition:
mvaElectronID_Fall17_iso_V1_cff.py:89
Electron.h
ElectronMVAEstimatorRun2::categoryFunctions_
std::vector< ThreadSafeStringCut< StringCutObjectSelector< reco::GsfElectron >, reco::GsfElectron > > categoryFunctions_
Definition:
ElectronMVAEstimatorRun2.h:47
candidateCombinedMVAV2Computer_cfi.mvaName
mvaName
Definition:
candidateCombinedMVAV2Computer_cfi.py:12
Conversion.h
Generated for CMSSW Reference Manual by
1.8.16