PhysicsTools
PatAlgos
src
EfficiencyLoader.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/PatAlgos/interface/EfficiencyLoader.h
"
2
3
#include <algorithm>
4
5
using
pat::helper::EfficiencyLoader
;
6
7
EfficiencyLoader::EfficiencyLoader(
const
edm::ParameterSet
&iConfig,
edm::ConsumesCollector
&&iC) {
8
// Get the names (sorted)
9
names_
= iConfig.
getParameterNamesForType
<
edm::InputTag
>();
10
std::sort(
names_
.begin(),
names_
.end());
11
12
// get the InputTags
13
for
(std::vector<std::string>::const_iterator it =
names_
.begin(), ed =
names_
.end(); it != ed; ++it) {
14
tokens_
.push_back(iC.consumes<
edm::ValueMap<pat::LookupTableRecord>
>(iConfig.
getParameter
<
edm::InputTag
>(*it)));
15
}
16
17
// prepare the Handles
18
handles_
.resize(
names_
.size());
19
}
20
21
void
EfficiencyLoader::newEvent
(
const
edm::Event
&
iEvent
) {
22
for
(
size_t
i
= 0,
n
=
names_
.size();
i
<
n
; ++
i
) {
23
iEvent
.getByToken(
tokens_
[
i
],
handles_
[
i
]);
24
}
25
}
mps_fire.i
i
Definition:
mps_fire.py:355
dqmiodumpmetadata.n
n
Definition:
dqmiodumpmetadata.py:28
pat::helper::EfficiencyLoader
Definition:
EfficiencyLoader.h:16
EfficiencyLoader.h
pat::helper::EfficiencyLoader::newEvent
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
Definition:
EfficiencyLoader.cc:21
edm::ParameterSet
Definition:
ParameterSet.h:36
pat::helper::EfficiencyLoader::handles_
std::vector< edm::Handle< edm::ValueMap< pat::LookupTableRecord > > > handles_
Definition:
EfficiencyLoader.h:37
edm::ParameterSet::getParameterNamesForType
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition:
ParameterSet.h:168
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
pat::helper::EfficiencyLoader::names_
std::vector< std::string > names_
Definition:
EfficiencyLoader.h:35
edm::ValueMap
Definition:
ValueMap.h:107
pat::helper::EfficiencyLoader::tokens_
std::vector< edm::EDGetTokenT< edm::ValueMap< pat::LookupTableRecord > > > tokens_
Definition:
EfficiencyLoader.h:36
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
Generated for CMSSW Reference Manual by
1.8.16