61 typedef std::vector<reco::CandidatePtr>
CandPtrs;
99 edm::ParameterSet qcuts_pset =
pset.getParameterSet(
"qualityCuts").getParameterSet(
"signalQualityCuts");
106 qcuts_pset.addParameter<
double>(
"maxTrackChi2", 1.e+9);
107 qcuts_pset.addParameter<
double>(
"maxTransverseImpactParameter", 1.e+9);
108 qcuts_pset.addParameter<
double>(
"maxDeltaZ", 1.e+9);
109 qcuts_pset.addParameter<
double>(
"minTrackVertexWeight", -1.);
110 qcuts_pset.addParameter<
unsigned>(
"minTrackPixelHits", 0);
111 qcuts_pset.addParameter<
unsigned>(
"minTrackHits", 0);
140 const std::vector<bool>& candFlags,
141 std::set<size_t>& candIdsCurrentStrip,
142 bool& isCandAdded)
const {
144 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"<RecoTauPiZeroStripPlugin2::addCandsToStrip>:";
146 size_t numCands =
cands.size();
147 for (
size_t candId = 0; candId < numCands; ++candId) {
148 if ((!candFlags[candId]) &&
149 candIdsCurrentStrip.find(candId) == candIdsCurrentStrip.end()) {
156 <<
"--> adding PFCand #" << candId <<
" (" <<
cand.id() <<
":" <<
cand.key()
157 <<
"): Et = " <<
cand->et() <<
", eta = " <<
cand->eta() <<
", phi = " <<
cand->phi();
163 candIdsCurrentStrip.insert(candId);
170 void markCandsInStrip(std::vector<bool>& candFlags,
const std::set<size_t>& candIds) {
171 for (std::set<size_t>::const_iterator candId = candIds.begin(); candId != candIds.end(); ++candId) {
172 candFlags[*candId] =
true;
177 const PFCandidate* pfCandPtr = dynamic_cast<const PFCandidate*>(&
cand);
179 if (pfCandPtr->trackRef().isNonnull())
181 else if (pfCandPtr->gsfTrackRef().isNonnull())
193 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"<RecoTauPiZeroStripPlugin2::operator()>:";
209 for (CandPtrs::iterator
cand = candsVector.begin();
cand != candsVector.end(); ++
cand) {
212 <<
"PFGamma #" <<
idx <<
" (" <<
cand->id() <<
":" <<
cand->key() <<
"): Et = " << (*cand)->et()
213 <<
", eta = " << (*cand)->eta() <<
", phi = " << (*cand)->phi();
217 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"--> assigning seedCandId = " << seedCands.size();
221 <<
"track: Pt = " << candTrack->
pt() <<
" eta = " << candTrack->
eta()
222 <<
", phi = " << candTrack->
phi() <<
", charge = " << candTrack->
charge();
229 <<
", dPt/Pt = " << (candTrack->
ptError() / candTrack->
pt()) <<
")";
232 seedCands.push_back(*
cand);
235 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"--> assigning addCandId = " << addCands.size();
237 addCands.push_back(*
cand);
242 std::vector<bool> seedCandFlags(seedCands.size());
243 std::vector<bool> addCandFlags(addCands.size());
245 std::set<size_t> seedCandIdsCurrentStrip;
246 std::set<size_t> addCandIdsCurrentStrip;
249 while (idxSeed < seedCands.size()) {
251 edm::LogPrint(
"RecoTauPiZeroStripPlugin2") <<
"processing seed #" << idxSeed;
253 seedCandIdsCurrentStrip.clear();
254 addCandIdsCurrentStrip.clear();
257 strip->addDaughter(seedCands[idxSeed]);
258 seedCandIdsCurrentStrip.insert(idxSeed);
261 int stripBuildIteration = 0;
273 ++stripBuildIteration;
279 <<
"Building strip: Et = " <<
strip->et() <<
", eta = " <<
strip->eta() <<
", phi = " <<
strip->phi();
282 if (
strip->daughterPtr(0).isNonnull())
283 strip->setVertex(
strip->daughterPtr(0)->vertex());
287 markCandsInStrip(seedCandFlags, seedCandIdsCurrentStrip);
288 markCandsInStrip(addCandFlags, addCandIdsCurrentStrip);
292 <<
"Discarding strip: Et = " <<
strip->et() <<
", eta = " <<
strip->eta() <<
", phi = " <<
strip->phi();
296 while (idxSeed < seedCands.size() && seedCandFlags[idxSeed]) {
305 output.sort(
output.begin(),
output.end(), [&](
auto& arg1,
auto& arg2) {
return arg1.pt() > arg2.pt(); });
319 std::unique_ptr<RecoTauPiZero> combinedStrips(
330 for (
auto const&
gamma :
first->daughterPtrVector()) {
331 combinedStrips->addDaughter(
gamma);
333 for (
auto const&
gamma :
second->daughterPtrVector()) {
334 combinedStrips->addDaughter(
gamma);
337 if (combinedStrips->daughterPtr(0).isNonnull())
338 combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex());
340 stripCombinations.push_back(
std::move(combinedStrips));