src
TopQuarkAnalysis
TopJetCombination
src
TtSemiLRJetCombCalc.cc
Go to the documentation of this file.
1
//
2
// Author: Jan Heyninck
3
// Created: Tue Apr 3 17:33:23 PDT 2007
4
//
5
//
6
#include "
TopQuarkAnalysis/TopJetCombination/interface/TtSemiLRJetCombCalc.h
"
7
8
// constructor with path; default should not be used
9
TtSemiLRJetCombCalc::TtSemiLRJetCombCalc
(
const
TString& fitInputPath,
const
std::vector<int>&
observables
) {
10
std::cout
<<
"=== Constructing a TtSemiLRJetCombCalc... "
<< std::endl;
11
myLR
=
new
LRHelpFunctions
();
12
addPurity
=
false
;
13
if
(
observables
[0] == -1)
14
addPurity
=
true
;
15
myLR
->
readObsHistsAndFits
(fitInputPath,
observables
,
addPurity
);
16
std::cout
<<
"=== done."
<< std::endl;
17
}
18
19
// destructor
20
TtSemiLRJetCombCalc::~TtSemiLRJetCombCalc
() {
delete
myLR
; }
21
22
void
TtSemiLRJetCombCalc::operator()
(
TtSemiEvtSolution
&
sol
) {
23
// find the used observables
24
std::vector<double> obsVals;
25
for
(
unsigned
int
o
= 0;
o
< 100;
o
++) {
26
if
(
myLR
->
obsFitIncluded
(
o
)) {
27
obsVals.push_back(
sol
.getLRJetCombObsVal(
o
));
28
};
29
}
30
31
// calculate the logLR and the purity
32
double
logLR =
myLR
->
calcLRval
(obsVals);
33
double
prob
= -999.;
34
if
(
addPurity
)
35
prob
=
myLR
->
calcProb
(logLR);
36
37
// fill these values to the members in the TtSemiEvtSolution
38
sol
.setLRJetCombLRval(logLR);
39
sol
.setLRJetCombProb(
prob
);
40
}
LRHelpFunctions::calcLRval
double calcLRval(const std::vector< double > &)
Definition:
LRHelpFunctions.cc:378
TtSemiLRJetCombCalc::addPurity
bool addPurity
Definition:
TtSemiLRJetCombCalc.h:41
TtSemiEvtSolution
Definition:
TtSemiEvtSolution.h:31
LRHelpFunctions::calcProb
double calcProb(double)
Definition:
LRHelpFunctions.cc:486
LRHelpFunctions
Help functionalities to implement and evaluate LR ratio method.
Definition:
LRHelpFunctions.h:35
TtSemiLRJetCombCalc::TtSemiLRJetCombCalc
TtSemiLRJetCombCalc()
LRHelpFunctions::obsFitIncluded
bool obsFitIncluded(int)
Definition:
LRHelpFunctions.cc:489
TtFullHadEvtBuilder_cfi.prob
prob
Definition:
TtFullHadEvtBuilder_cfi.py:33
EcalTangentSkim_cfg.o
o
Definition:
EcalTangentSkim_cfg.py:42
LRHelpFunctions::readObsHistsAndFits
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
Definition:
LRHelpFunctions.cc:212
mkfit::Const::sol
constexpr float sol
Definition:
Config.h:13
runBasic_cfi.observables
observables
Definition:
runBasic_cfi.py:26
TtSemiLRJetCombCalc::~TtSemiLRJetCombCalc
~TtSemiLRJetCombCalc()
Definition:
TtSemiLRJetCombCalc.cc:20
TtSemiLRJetCombCalc::operator()
void operator()(TtSemiEvtSolution &)
Definition:
TtSemiLRJetCombCalc.cc:22
TtSemiLRJetCombCalc::myLR
LRHelpFunctions * myLR
Definition:
TtSemiLRJetCombCalc.h:40
TtSemiLRJetCombCalc.h
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
Generated for CMSSW Reference Manual by
1.8.14