PhysicsTools
PatUtils
src
bJetSelector.cc
Go to the documentation of this file.
1
//
2
// Implementacion of b Jet Selector for PAT
3
// By J.E. Ramirez Jun 18,2008
4
//
5
#include "
PhysicsTools/PatUtils/interface/bJetSelector.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
7
8
bJetSelector::bJetSelector
(
const
edm::ParameterSet
&
cfg
)
9
: discriminantCutsLoose_(
cfg
.getParameter<
std
::vector<double> >(
"discCutLoose"
)),
10
discriminantCutsMedium_(
cfg
.getParameter<
std
::vector<double> >(
"discCutMedium"
)),
11
discriminantCutsTight_(
cfg
.getParameter<
std
::vector<double> >(
"discCutTight"
)),
12
BTagdiscriminator_(
cfg
.getParameter<
std
::vector<
std
::
string
> >(
"bdiscriminators"
)),
13
DefaultOp_(
cfg
.getParameter<
std
::
string
>(
"DefaultOp"
)),
14
DefaultTg_(
cfg
.getParameter<
std
::
string
>(
"DefaultBdisc"
))
15
16
{
17
for
(
unsigned
int
i
= 0;
i
<
BTagdiscriminator_
.size();
i
++) {
18
discCut
[
"Loose"
][
BTagdiscriminator_
[
i
]] =
discriminantCutsLoose_
[
i
];
19
discCut
[
"Medium"
][
BTagdiscriminator_
[
i
]] =
discriminantCutsMedium_
[
i
];
20
discCut
[
"Tight"
][
BTagdiscriminator_
[
i
]] =
discriminantCutsTight_
[
i
];
21
}
22
}
23
24
bool
bJetSelector::IsbTag
(
const
pat::Jet
& JetCand,
const
std::string
& operpoint,
const
std::string
& tagger)
const
{
25
std::map<std::string, std::map<std::string, double> >::const_iterator ioperpoint =
discCut
.find(operpoint);
26
if
(ioperpoint ==
discCut
.end())
27
throw
cms::Exception
(
"UnknownOperatingPoint"
) <<
"Unknown or undefined operative point"
<< std::endl;
28
std::map<std::string, double>::const_iterator itagger = ioperpoint->second.find(tagger);
29
if
(itagger == ioperpoint->second.end())
30
throw
cms::Exception
(
"UnknownTagger"
) <<
"Unknown or undefined tagger"
<< std::endl;
31
32
return
JetCand.
bDiscriminator
(tagger) > itagger->second;
33
}
34
bool
bJetSelector::IsbTag
(
const
pat::Jet
& JetCand,
const
std::string
& operpoint)
const
{
35
return
IsbTag
(JetCand, operpoint,
DefaultTg_
);
36
}
37
bool
bJetSelector::IsbTag
(
const
pat::Jet
& JetCand)
const
{
return
IsbTag
(JetCand,
DefaultOp_
,
DefaultTg_
); }
mps_fire.i
i
Definition:
mps_fire.py:355
bJetSelector::DefaultTg_
std::string DefaultTg_
Definition:
bJetSelector.h:33
pat::Jet::bDiscriminator
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
bJetSelector::discriminantCutsMedium_
std::vector< double > discriminantCutsMedium_
Definition:
bJetSelector.h:29
bJetSelector.h
bJetSelector::bJetSelector
bJetSelector(const edm::ParameterSet &cfg)
Definition:
bJetSelector.cc:8
bJetSelector::BTagdiscriminator_
std::vector< std::string > BTagdiscriminator_
Definition:
bJetSelector.h:31
bJetSelector::discriminantCutsLoose_
std::vector< double > discriminantCutsLoose_
Definition:
bJetSelector.h:28
pat::Jet
Analysis-level calorimeter jet class.
Definition:
Jet.h:77
bJetSelector::discriminantCutsTight_
std::vector< double > discriminantCutsTight_
Definition:
bJetSelector.h:30
bJetSelector::DefaultOp_
std::string DefaultOp_
Definition:
bJetSelector.h:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
looper.cfg
cfg
Definition:
looper.py:297
std
Definition:
JetResolutionObject.h:76
bJetSelector::discCut
std::map< std::string, std::map< std::string, double > > discCut
Definition:
bJetSelector.h:27
cms::Exception
Definition:
Exception.h:70
ParameterSet.h
bJetSelector::IsbTag
bool IsbTag(const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
Definition:
bJetSelector.cc:24
Generated for CMSSW Reference Manual by
1.8.16