Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
RecoBTag
SoftLepton
src
MvaSoftMuonEstimator.cc
Go to the documentation of this file.
1
// * Author: Alberto Zucchetta
2
// * Mail: a.zucchetta@cern.ch
3
// * January 16, 2015
4
5
#include <limits>
6
7
#include "
DataFormats/BTauReco/interface/SoftLeptonTagInfo.h
"
8
#include "
RecoBTag/SoftLepton/interface/LeptonSelector.h
"
9
#include "
RecoBTag/SoftLepton/interface/MvaSoftMuonEstimator.h
"
10
#include "
CommonTools/Utils/interface/TMVAZipReader.h
"
11
12
MvaSoftMuonEstimator::MvaSoftMuonEstimator
(
std::string
weightFile) {
13
TMVAReader
=
new
TMVA::Reader(
"Color:Silent:Error"
);
14
TMVAReader
->SetVerbose(
false
);
15
TMVAReader
->AddVariable(
"TagInfo1.sip3d"
, &
mva_sip3d
);
16
TMVAReader
->AddVariable(
"TagInfo1.sip2d"
, &
mva_sip2d
);
17
TMVAReader
->AddVariable(
"TagInfo1.ptRel"
, &
mva_ptRel
);
18
TMVAReader
->AddVariable(
"TagInfo1.deltaR"
, &
mva_deltaR
);
19
TMVAReader
->AddVariable(
"TagInfo1.ratio"
, &
mva_ratio
);
20
reco::details::loadTMVAWeights
(
TMVAReader
,
"BDT"
, weightFile.c_str());
21
}
22
23
MvaSoftMuonEstimator::~MvaSoftMuonEstimator
() {
24
delete
TMVAReader
;
25
}
26
27
28
// b-tag a jet based on track-to-jet parameters in the extened info collection
29
float
MvaSoftMuonEstimator::mvaValue
(
float
sip3d,
float
sip2d,
float
ptRel,
float
deltaR
,
float
ratio) {
30
mva_sip3d
= sip3d;
31
mva_sip2d
= sip2d;
32
mva_ptRel
= ptRel;
33
mva_deltaR
=
deltaR
;
34
mva_ratio
= ratio;
35
// Evaluate tagger
36
float
tag
=
TMVAReader
->EvaluateMVA(
"BDT"
);
37
// Transform output between approximately 0 and 1
38
tag = (tag+1.)/2.;
39
40
return
tag
;
41
}
42
MvaSoftMuonEstimator.h
MvaSoftMuonEstimator::mva_deltaR
float mva_deltaR
Definition:
MvaSoftMuonEstimator.h:30
SoftLeptonTagInfo.h
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
LeptonSelector.h
GlobalPosition_Frontier_DevDB_cff.tag
tuple tag
Definition:
GlobalPosition_Frontier_DevDB_cff.py:11
MvaSoftMuonEstimator::mva_sip3d
float mva_sip3d
Definition:
MvaSoftMuonEstimator.h:30
MvaSoftMuonEstimator::mva_sip2d
float mva_sip2d
Definition:
MvaSoftMuonEstimator.h:30
TMVAZipReader.h
MvaSoftMuonEstimator::MvaSoftMuonEstimator
MvaSoftMuonEstimator(std::string)
Definition:
MvaSoftMuonEstimator.cc:12
deltaR
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition:
TreeUtility.cc:17
MvaSoftMuonEstimator::~MvaSoftMuonEstimator
~MvaSoftMuonEstimator()
Definition:
MvaSoftMuonEstimator.cc:23
MvaSoftMuonEstimator::mvaValue
float mvaValue(float, float, float, float, float)
Definition:
MvaSoftMuonEstimator.cc:29
MvaSoftMuonEstimator::TMVAReader
TMVA::Reader * TMVAReader
Definition:
MvaSoftMuonEstimator.h:27
MvaSoftMuonEstimator::mva_ratio
float mva_ratio
Definition:
MvaSoftMuonEstimator.h:30
MvaSoftMuonEstimator::mva_ptRel
float mva_ptRel
Definition:
MvaSoftMuonEstimator.h:30
reco::details::loadTMVAWeights
void loadTMVAWeights(TMVA::Reader *reader, const std::string &method, const std::string &weightFile, bool verbose=false)
Definition:
TMVAZipReader.cc:57
Generated for CMSSW Reference Manual by
1.8.5