Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
BTauReco
src
TemplatedSoftLeptonTagInfo.cc
Go to the documentation of this file.
1
#include <vector>
2
#include <cstring>
3
4
#include "
FWCore/Utilities/interface/EDMException.h
"
5
6
#include "
DataFormats/BTauReco/interface/TemplatedSoftLeptonTagInfo.h
"
7
8
namespace
reco
{
9
10
using namespace
btau;
11
12
const
float
SoftLeptonProperties::Quality::undef
= -999.0;
13
14
unsigned
int
SoftLeptonProperties::Quality::internalByName
(
const
char
*
name
)
15
{
16
if
(std::strcmp(name,
""
) == 0)
17
return
0;
18
19
if
(std::strcmp(name,
"leptonId"
) == 0)
20
return
leptonId
;
21
else
if
(std::strcmp(name,
"btagLeptonCands"
) == 0)
22
return
btagLeptonCands;
23
24
if
(std::strcmp(name,
"pfElectronId"
) == 0)
25
return
pfElectronId;
26
else
if
(std::strcmp(name,
"btagElectronCands"
) == 0)
27
return
btagElectronCands;
28
29
if
(std::strcmp(name,
"muonId"
) == 0)
30
return
muonId;
31
else
if
(std::strcmp(name,
"btagMuonCands"
) == 0)
32
return
btagMuonCands;
33
34
throw
edm::Exception
(
edm::errors::Configuration
)
35
<<
"Requested lepton quality \""
<< name
36
<<
"\" not found in SoftLeptonProperties::Quality::byName"
37
<< std::endl;
38
}
39
40
float
SoftLeptonProperties::quality
(
unsigned
int
index
,
bool
throwIfUndefined)
const
41
{
42
float
qual =
Quality::undef
;
43
if
(index < qualities_.size())
44
qual = qualities_[index];
45
46
if
(qual ==
Quality::undef
&& throwIfUndefined)
47
throw
edm::Exception
(
edm::errors::InvalidReference
)
48
<<
"Requested lepton quality not found in SoftLeptonProperties::Quality"
49
<< std::endl;
50
51
return
qual;
52
}
53
54
void
SoftLeptonProperties::setQuality
(
unsigned
int
index
,
float
qual)
55
{
56
if
(qualities_.size() <=
index
)
57
qualities_.resize(index + 1,
Quality::undef
);
58
59
qualities_[
index
] = qual;
60
}
61
62
}
63
trackerHitRTTI::undef
Definition:
BaseTrackerRecHit.h:18
Exception
Definition:
hltDiff.cc:318
HLT_25ns14e33_v1_cff.leptonId
tuple leptonId
Definition:
HLT_25ns14e33_v1_cff.py:33007
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:106
reco::SoftLeptonProperties::quality
float quality() const
Definition:
TemplatedSoftLeptonTagInfo.h:95
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
reco::SoftLeptonProperties::Quality::undef
static const float undef
Definition:
TemplatedSoftLeptonTagInfo.h:46
cmsHarvester.index
string index
Definition:
cmsHarvester.py:4378
reco::SoftLeptonProperties::setQuality
void setQuality(Quality::Generic qual, float value)
Definition:
TemplatedSoftLeptonTagInfo.h:99
edm::errors::Configuration
Definition:
EDMException.h:37
EDMException.h
edm::errors::InvalidReference
Definition:
EDMException.h:40
reco::SoftLeptonProperties::Quality::internalByName
static unsigned int internalByName(const char *name)
Definition:
TemplatedSoftLeptonTagInfo.cc:14
TemplatedSoftLeptonTagInfo.h
Generated for CMSSW Reference Manual by
1.8.5