17 #include "boost/bind.hpp"
62 typedef std::vector<reco::CandidatePtr>
CandPtrs;
100 edm::ParameterSet qcuts_pset =
pset.getParameterSet(
"qualityCuts").getParameterSet(
"signalQualityCuts");
107 qcuts_pset.addParameter<
double>(
"maxTrackChi2", 1.e+9);
108 qcuts_pset.addParameter<
double>(
"maxTransverseImpactParameter", 1.e+9);
109 qcuts_pset.addParameter<
double>(
"maxDeltaZ", 1.e+9);
110 qcuts_pset.addParameter<
double>(
"minTrackVertexWeight", -1.);
111 qcuts_pset.addParameter<
unsigned>(
"minTrackPixelHits", 0);
112 qcuts_pset.addParameter<
unsigned>(
"minTrackHits", 0);
141 const std::vector<bool>& candFlags,
142 std::set<size_t>& candIdsCurrentStrip,
143 bool& isCandAdded)
const {
145 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"<RecoTauPiZeroStripPlugin2::addCandsToStrip>:";
147 size_t numCands =
cands.size();
148 for (
size_t candId = 0; candId < numCands; ++candId) {
149 if ((!candFlags[candId]) &&
150 candIdsCurrentStrip.find(candId) == candIdsCurrentStrip.end()) {
157 <<
"--> adding PFCand #" << candId <<
" (" <<
cand.id() <<
":" <<
cand.key()
158 <<
"): Et = " <<
cand->et() <<
", eta = " <<
cand->eta() <<
", phi = " <<
cand->phi();
164 candIdsCurrentStrip.insert(candId);
171 void markCandsInStrip(std::vector<bool>& candFlags,
const std::set<size_t>& candIds) {
172 for (std::set<size_t>::const_iterator candId = candIds.begin(); candId != candIds.end(); ++candId) {
173 candFlags[*candId] =
true;
178 const PFCandidate* pfCandPtr = dynamic_cast<const PFCandidate*>(&
cand);
180 if (pfCandPtr->trackRef().isNonnull())
182 else if (pfCandPtr->gsfTrackRef().isNonnull())
194 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"<RecoTauPiZeroStripPlugin2::operator()>:";
210 for (CandPtrs::iterator
cand = candsVector.begin();
cand != candsVector.end(); ++
cand) {
213 <<
"PFGamma #" <<
idx <<
" (" <<
cand->id() <<
":" <<
cand->key() <<
"): Et = " << (*cand)->et()
214 <<
", eta = " << (*cand)->eta() <<
", phi = " << (*cand)->phi();
218 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"--> assigning seedCandId = " << seedCands.size();
222 <<
"track: Pt = " << candTrack->
pt() <<
" eta = " << candTrack->
eta()
223 <<
", phi = " << candTrack->
phi() <<
", charge = " << candTrack->
charge();
230 <<
", dPt/Pt = " << (candTrack->
ptError() / candTrack->
pt()) <<
")";
233 seedCands.push_back(*
cand);
236 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"--> assigning addCandId = " << addCands.size();
238 addCands.push_back(*
cand);
243 std::vector<bool> seedCandFlags(seedCands.size());
244 std::vector<bool> addCandFlags(addCands.size());
246 std::set<size_t> seedCandIdsCurrentStrip;
247 std::set<size_t> addCandIdsCurrentStrip;
250 while (idxSeed < seedCands.size()) {
252 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"processing seed #" << idxSeed;
254 seedCandIdsCurrentStrip.clear();
255 addCandIdsCurrentStrip.clear();
258 strip->addDaughter(seedCands[idxSeed]);
259 seedCandIdsCurrentStrip.insert(idxSeed);
262 int stripBuildIteration = 0;
274 ++stripBuildIteration;
280 <<
"Building strip: Et = " <<
strip->et() <<
", eta = " <<
strip->eta() <<
", phi = " <<
strip->phi();
283 if (
strip->daughterPtr(0).isNonnull())
284 strip->setVertex(
strip->daughterPtr(0)->vertex());
288 markCandsInStrip(seedCandFlags, seedCandIdsCurrentStrip);
289 markCandsInStrip(addCandFlags, addCandIdsCurrentStrip);
293 <<
"Discarding strip: Et = " <<
strip->et() <<
", eta = " <<
strip->eta() <<
", phi = " <<
strip->phi();
297 while (idxSeed < seedCands.size() && seedCandFlags[idxSeed]) {
321 std::unique_ptr<RecoTauPiZero> combinedStrips(
332 for (
auto const&
gamma :
first->daughterPtrVector()) {
333 combinedStrips->addDaughter(
gamma);
335 for (
auto const&
gamma :
second->daughterPtrVector()) {
336 combinedStrips->addDaughter(
gamma);
339 if (combinedStrips->daughterPtr(0).isNonnull())
340 combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex());
342 stripCombinations.push_back(
std::move(combinedStrips));