Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
CondFormats
BTauObjects
src
BTagCalibrationReader.cc
Go to the documentation of this file.
1
#include "
CondFormats/BTauObjects/interface/BTagCalibrationReader.h
"
2
3
BTagCalibrationReader::BTagCalibrationReader
(
const
BTagCalibration
*
c
,
4
BTagEntry::OperatingPoint
op,
5
std::string
measurementType,
6
std::string
sysType):
7
params(
BTagEntry
::
Parameters
(op, measurementType, sysType)),
8
useAbsEta(
true
)
9
{
10
setupTmpData
(c);
11
}
12
13
double
BTagCalibrationReader::eval
(
BTagEntry::JetFlavor
jf,
14
float
eta
,
15
float
pt
,
16
float
discr
)
const
17
{
18
bool
use_discr = (
params
.
operatingPoint
==
BTagEntry::OP_RESHAPING
);
19
if
(
useAbsEta
[jf] && eta < 0) {
20
eta = -
eta
;
21
}
22
23
// search linearly through eta, pt and discr ranges and eval
24
// future: find some clever data structure based on intervals
25
const
std::vector<TmpEntry> &
entries
=
tmpData_
.at(jf);
26
for
(
unsigned
i
=0;
i
<entries.size(); ++
i
) {
27
const
BTagCalibrationReader::TmpEntry
&
e
= entries.at(
i
);
28
if
(
29
e.
etaMin
<= eta && eta < e.
etaMax
// find eta
30
&& e.
ptMin
<= pt && pt < e.
ptMax
// check pt
31
){
32
if
(use_discr) {
// discr. reshaping?
33
if
(e.
discrMin
<= discr && discr < e.
discrMax
) {
// check discr
34
return
e.
func
.Eval(discr);
35
}
36
}
else
{
37
return
e.
func
.Eval(pt);
38
}
39
}
40
}
41
42
return
0.;
// default value
43
}
44
45
void
BTagCalibrationReader::setupTmpData
(
const
BTagCalibration
*
c
)
46
{
47
useAbsEta
= std::vector<bool>(4,
true
);
48
const
std::vector<BTagEntry> &
entries
= c->
getEntries
(
params
);
49
for
(
unsigned
i
=0;
i
<entries.size(); ++
i
) {
50
const
BTagEntry
&be = entries[
i
];
51
BTagCalibrationReader::TmpEntry
te;
52
te.
etaMin
= be.
params
.
etaMin
;
53
te.
etaMax
= be.
params
.
etaMax
;
54
te.
ptMin
= be.
params
.
ptMin
;
55
te.
ptMax
= be.
params
.
ptMax
;
56
te.
discrMin
= be.
params
.
discrMin
;
57
te.
discrMax
= be.
params
.
discrMax
;
58
59
if
(
params
.
operatingPoint
==
BTagEntry::OP_RESHAPING
) {
60
te.
func
= TF1(
""
, be.
formula
.c_str(),
61
be.
params
.
discrMin
, be.
params
.
discrMax
);
62
}
else
{
63
te.
func
= TF1(
""
, be.
formula
.c_str(),
64
be.
params
.
ptMin
, be.
params
.
ptMax
);
65
}
66
67
tmpData_
[be.
params
.
jetFlavor
].push_back(te);
68
if
(te.
etaMin
< 0) {
69
useAbsEta
[be.
params
.
jetFlavor
] =
false
;
70
}
71
}
72
}
BTagEntry::Parameters::etaMin
float etaMin
Definition:
BTagEntry.h:43
BTagEntry::Parameters::etaMax
float etaMax
Definition:
BTagEntry.h:44
i
int i
Definition:
DBlmapReader.cc:9
BTagEntry::Parameters::jetFlavor
JetFlavor jetFlavor
Definition:
BTagEntry.h:42
BTagCalibrationReader.h
BTagEntry
Definition:
BTagEntry.h:24
EnergyCorrector.c
tuple c
Definition:
EnergyCorrector.py:43
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
python.tagInventory.entries
list entries
Definition:
tagInventory.py:532
BTagCalibration::getEntries
const std::vector< BTagEntry > & getEntries(const BTagEntry::Parameters &par) const
Definition:
BTagCalibration.cc:26
funct::true
true
Definition:
Factorize.h:183
BTagEntry::OP_RESHAPING
Definition:
BTagEntry.h:31
Parameters
vector< ParameterSet > Parameters
Definition:
HLTMuonPlotter.cc:32
BTagEntry::Parameters::operatingPoint
OperatingPoint operatingPoint
Definition:
BTagEntry.h:39
BTagCalibrationReader::useAbsEta
std::vector< bool > useAbsEta
Definition:
BTagCalibrationReader.h:49
BTagEntry::Parameters::ptMax
float ptMax
Definition:
BTagEntry.h:46
BTagCalibrationReader::TmpEntry::discrMax
float discrMax
Definition:
BTagCalibrationReader.h:42
BTagCalibrationReader::TmpEntry::func
TF1 func
Definition:
BTagCalibrationReader.h:43
BTagEntry::Parameters::discrMax
float discrMax
Definition:
BTagEntry.h:48
BTagEntry::formula
std::string formula
Definition:
BTagEntry.h:78
BTagCalibrationReader::TmpEntry::etaMin
float etaMin
Definition:
BTagCalibrationReader.h:37
BTagCalibrationReader::BTagCalibrationReader
BTagCalibrationReader()
Definition:
BTagCalibrationReader.h:23
BTagCalibrationReader::TmpEntry
Definition:
BTagCalibrationReader.h:36
BTagEntry::OperatingPoint
OperatingPoint
Definition:
BTagEntry.h:27
eta
Definition:
HIMultiTrackSelector.h:42
EnergyCorrector.pt
int pt
Definition:
EnergyCorrector.py:45
BTagCalibrationReader::eval
double eval(BTagEntry::JetFlavor jf, float eta, float pt, float discr=0.) const
Definition:
BTagCalibrationReader.cc:13
BTagCalibrationReader::TmpEntry::etaMax
float etaMax
Definition:
BTagCalibrationReader.h:38
BTagEntry::params
Parameters params
Definition:
BTagEntry.h:79
BTagCalibrationReader::tmpData_
std::map< BTagEntry::JetFlavor, std::vector< TmpEntry > > tmpData_
Definition:
BTagCalibrationReader.h:48
alignCSCRings.e
list e
Definition:
alignCSCRings.py:90
BTagCalibrationReader::setupTmpData
void setupTmpData(const BTagCalibration *c)
Definition:
BTagCalibrationReader.cc:45
BTagCalibrationReader::TmpEntry::ptMax
float ptMax
Definition:
BTagCalibrationReader.h:40
BTagCalibrationReader::TmpEntry::ptMin
float ptMin
Definition:
BTagCalibrationReader.h:39
BTagCalibrationReader::TmpEntry::discrMin
float discrMin
Definition:
BTagCalibrationReader.h:41
listHistos.discr
tuple discr
Definition:
listHistos.py:51
BTagCalibrationReader::params
BTagEntry::Parameters params
Definition:
BTagCalibrationReader.h:47
BTagEntry::JetFlavor
JetFlavor
Definition:
BTagEntry.h:33
BTagEntry::Parameters::ptMin
float ptMin
Definition:
BTagEntry.h:45
BTagCalibration
Definition:
BTagCalibration.h:27
BTagEntry::Parameters::discrMin
float discrMin
Definition:
BTagEntry.h:47
Generated for CMSSW Reference Manual by
1.8.5