65 const std::vector<T>&
values,
76 const std::vector<EleTkIsolFromCands::PIDVeto>& pidVetos,
93 tokens.push_back(
token);
107 template <
typename T>
113 auto tagsAOD = iPara.
getParameter<std::vector<edm::InputTag> >(tagAOD);
114 auto tagsMiniAOD = iPara.
getParameter<std::vector<edm::InputTag> >(tagMiniAOD);
119 for (
size_t tagNr = 0; tagNr < tagsAOD.size(); tagNr++) {
120 setToken(tokens[tagNr].aod, tagsAOD[tagNr]);
123 if (
format.tryMiniAOD()) {
124 for (
size_t tagNr = 0; tagNr < tagsMiniAOD.size(); tagNr++) {
130 template <
typename T>
136 template <
typename T>
139 if (!
token.aod.isUninitialized())
141 if (!
handle.isValid() && !
token.miniAOD.isUninitialized())
146 template <
typename T>
148 std::vector<edm::Handle<T> >
handles(tokens.size());
151 if (!tokens[0].aod.isUninitialized())
157 for (
size_t tokenNr = 1; tokenNr < tokens.size(); tokenNr++) {
158 auto token =
isAOD ? tokens[tokenNr].aod : tokens[tokenNr].miniAOD;
159 if (!
token.isUninitialized())
165 template <
typename T>
168 if (!
token.aod.isUninitialized())
179 std::vector<DualToken<pat::PackedCandidateCollection> >
candTokens_;
199 : trkIsoCalc_(iConfig.getParameter<
edm::
ParameterSet>(
"trkIsoConfig")),
200 trkIso04Calc_(iConfig.getParameter<
edm::
ParameterSet>(
"trkIso04Config")),
201 makeTrkIso04_(iConfig.getParameter<
bool>(
"makeTrkIso04")),
202 dataFormat_(iConfig.getParameter<
int>(
"dataFormat")) {
209 auto fillVetos = [](
const auto&
in,
auto&
out) {
215 throw cms::Exception(
"ConfigError") <<
" Error candVetosAOD should be the same size as candsAOD " << std::endl;
220 throw cms::Exception(
"ConfigError") <<
" Error candVetosMiniAOD should be the same size as candsMiniAOD "
245 std::vector<float> eleTrkPtIso;
246 std::vector<float> eleTrkPtIso04;
247 std::vector<int> eleNrSaturateIn5x5;
248 for (
auto const& ele : *eleHandle) {
253 eleNrSaturateIn5x5.push_back(
nrSaturatedCrysIn5x5(ele, ebRecHitHandle, eeRecHitHandle, caloTopoHandle));
274 const std::vector<EleTkIsolFromCands::PIDVeto>& pidVetos,
280 for (
size_t handleNr = 0; handleNr <
handles.size(); handleNr++) {
283 if (handleNr < pidVetos.size()) {
286 throw cms::Exception(
"LogicError") <<
" somehow the pidVetos and handles do not much, given this is checked "
287 "at construction time, something has gone wrong in the code handle nr "
288 << handleNr <<
" size of vetos " << pidVetos.size();
296 template <
typename T>
299 const std::vector<T>&
values,
313 desc.
add<std::vector<edm::InputTag> >(
"candsAOD", {
edm::InputTag(
"packedCandidates")});
314 desc.
add<std::vector<std::string> >(
"candVetosAOD", {
"none"});
319 desc.
add<std::vector<edm::InputTag> >(
"candsMiniAOD", {
edm::InputTag(
"packedCandidates")});
320 desc.
add<std::vector<std::string> >(
"candVetosMiniAOD", {
"none"});
322 desc.
add<
int>(
"dataFormat", 0);
323 desc.
add<
bool>(
"makeTrkIso04",
false);