Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
PatCandidates
src
PackedTriggerPrescales.cc
Go to the documentation of this file.
1
#include "
DataFormats/PatCandidates/interface/PackedTriggerPrescales.h
"
2
#include "
DataFormats/Common/interface/RefProd.h
"
3
4
pat::PackedTriggerPrescales::PackedTriggerPrescales
(
const
edm::Handle<edm::TriggerResults>
&
handle
) :
5
prescaleValues_(),
6
triggerResults_(edm::
RefProd
<edm::
TriggerResults
>(handle).refCore()),
7
triggerNames_(0)
8
{
9
prescaleValues_
.resize(handle->size(),0);
10
}
11
12
int
pat::PackedTriggerPrescales::getPrescaleForIndex
(
int
index
)
const
{
13
if
(
unsigned
(index) >=
triggerResults
().
size
())
throw
cms::Exception
(
"InvalidReference"
,
"Index out of bounds"
);
14
return
prescaleValues_[
index
];
15
}
16
17
int
pat::PackedTriggerPrescales::getPrescaleForName
(
const
std::string
&
name
,
bool
prefixOnly)
const
{
18
if
(triggerNames_ == 0)
throw
cms::Exception
(
"LogicError"
,
"getPrescaleForName called without having called setTriggerNames first"
);
19
if
(prefixOnly) {
20
const
std::vector<std::string> &
names
= triggerNames_->triggerNames();
21
size_t
siz = name.length()-1;
22
while
(siz > 0 && (name[siz] ==
'*'
|| name[siz] ==
'\0'
)) siz--;
23
for
(
unsigned
int
i
= 0,
n
= names.size();
i
<
n
; ++
i
) {
24
if
(strncmp(name.c_str(), names[
i
].c_str(), siz) == 0) {
25
return
getPrescaleForIndex(
i
);
26
}
27
}
28
throw
cms::Exception
(
"InvalidReference"
,
"Index out of bounds"
);
29
}
else
{
30
int
index
= triggerNames_->triggerIndex(name);
31
return
getPrescaleForIndex(index);
32
}
33
}
34
35
void
pat::PackedTriggerPrescales::addPrescaledTrigger
(
int
index
,
int
prescale) {
36
if
(
unsigned
(index) >=
triggerResults
().
size
())
throw
cms::Exception
(
"InvalidReference"
,
"Index out of bounds"
);
37
prescaleValues_[
index
] = prescale;
38
}
39
i
int i
Definition:
DBlmapReader.cc:9
PackedTriggerPrescales.h
pat::PackedTriggerPrescales::getPrescaleForName
int getPrescaleForName(const std::string &name, bool prefixOnly=false) const
Definition:
PackedTriggerPrescales.cc:17
cscdqm::h::names
static const HistoName names[]
Definition:
CSCDQM_HistoDef.h:828
edm::Handle< edm::TriggerResults >
pat::PackedTriggerPrescales::prescaleValues_
std::vector< int > prescaleValues_
Definition:
PackedTriggerPrescales.h:34
pat::PackedTriggerPrescales::PackedTriggerPrescales
PackedTriggerPrescales()
Definition:
PackedTriggerPrescales.h:12
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
cmsHarvester.index
string index
Definition:
cmsHarvester.py:4378
RefProd.h
old-fu_pass.TriggerResults
tuple TriggerResults
Definition:
old-fu_pass.py:28
pat::PackedTriggerPrescales::addPrescaledTrigger
void addPrescaledTrigger(int index, int prescale)
Definition:
PackedTriggerPrescales.cc:35
patZpeak.handle
tuple handle
Definition:
patZpeak.py:22
triggerResults
static std::string const triggerResults
Definition:
EdmProvDump.cc:41
edm::hlt::Exception
error
Definition:
HLTenums.h:21
reco::JetExtendedAssociation::RefProd
edm::RefProd< Container > RefProd
Definition:
JetExtendedAssociation.h:33
n
int n
Definition:
DTDataIntegrityTask.cc:30
pat::PackedTriggerPrescales::getPrescaleForIndex
int getPrescaleForIndex(int index) const
Definition:
PackedTriggerPrescales.cc:12
findQualityFiles.size
tuple size
Write out results.
Definition:
findQualityFiles.py:442
Generated for CMSSW Reference Manual by
1.8.5