196 using namespace cone;
209 typedef std::vector<PFCandidatePtr>
PFCandPtrs;
223 std::sort(pfchs.begin(), pfchs.end(), SortPFCandsDescendingPt());
247 PFCandPtrs::iterator leadPFCH_iter =
248 std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
250 if (leadPFCH_iter != pfchs.end()) {
251 leadPFCH = *leadPFCH_iter;
253 tau.setleadPFChargedHadrCand(leadPFCH);
257 return output.release();
262 PFCandPtrs::iterator leadPFGamma_iter =
263 std::find_if(pfGammas.begin(), pfGammas.end(), matchingConeFilter);
265 if (leadPFGamma_iter != pfGammas.end()) {
266 leadPFGamma = *leadPFGamma_iter;
268 tau.setleadPFNeutralCand(leadPFGamma);
274 leadPFCand = leadPFCH;
275 }
else if (leadPFGamma.isNonnull() &&
278 leadPFCand = leadPFGamma;
281 leadPFCand = leadPFCH;
284 tau.setleadPFCand(leadPFCand);
314 typedef xclean::PredicateAND<xclean::FilterPFCandByParticleId, PFCandPtrDRFilter> RegionalJunkConeAndIdFilter;
321 RegionalJunkConeAndIdFilter pfChargedJunk(
326 RegionalJunkConeAndIdFilter pfGammaJunk(
331 RegionalJunkConeAndIdFilter pfNeutralJunk(
338 signalConePFCHFilter, pfchs.begin(), pfchs.end());
340 signalConePFCHFilter, pfchs.end(), pfchs.end());
341 PFCandPtrs signalPFCHs;
342 int numSignalPFCHs = 0;
343 PFCandPtrs isolationPFCHs;
344 int numIsolationPFCHs = 0;
348 signalPFCHs.push_back(*iter);
353 isolationPFCHs.push_back(*iter);
357 PFCandPtrs::const_iterator signalPFCHs_begin = signalPFCHs.begin();
358 PFCandPtrs::const_iterator signalPFCHs_end = signalPFCHs.end();
361 xclean::CrossCleanPiZeros<PFCandPtrDRFilterIter> piZeroXCleaner(
362 signalPFCHCands_begin, signalPFCHCands_end);
363 std::vector<reco::RecoTauPiZero> cleanPiZeros = piZeroXCleaner(piZeros);
367 xclean::CrossCleanPtrs<PiZeroList::const_iterator> pfCandXCleaner(cleanPiZeros.begin(), cleanPiZeros.end());
369 auto isolationPFCHCands_begin(
370 boost::make_filter_iterator(
372 pfchs.begin(), pfchs.end()));
373 auto isolationPFCHCands_end(
374 boost::make_filter_iterator(
376 pfchs.end(), pfchs.end()));
377 for (
auto iter = isolationPFCHCands_begin; iter != isolationPFCHCands_end; ++iter ) {
379 isolationPFCHs.push_back(*iter);
382 PFCandPtrs::const_iterator isolationPFCHs_begin = isolationPFCHs.begin();
383 PFCandPtrs::const_iterator isolationPFCHs_end = isolationPFCHs.end();
388 signalPFCHs_begin, signalPFCHs_end);
392 boost::make_filter_iterator(
394 pfnhs.begin(), pfnhs.end()),
395 boost::make_filter_iterator(
397 pfnhs.end(), pfnhs.end()));
402 cleanPiZeros.begin(), cleanPiZeros.end()),
404 cleanPiZeros.end(), cleanPiZeros.end()));
409 isolationPFCHs_begin, isolationPFCHs_end);
414 boost::make_filter_iterator(
415 pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
416 boost::make_filter_iterator(
417 pfChargedJunk, regionalJunk.end(), regionalJunk.end())
423 boost::make_filter_iterator(
425 pfnhs.begin(), pfnhs.end()),
426 boost::make_filter_iterator(
428 pfnhs.end(), pfnhs.end()));
433 boost::make_filter_iterator(
434 pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
435 boost::make_filter_iterator(
436 pfNeutralJunk, regionalJunk.end(), regionalJunk.end())
444 cleanPiZeros.end()));
449 boost::make_filter_iterator(
450 pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
451 boost::make_filter_iterator(
452 pfGammaJunk, regionalJunk.end(), regionalJunk.end())
458 std::auto_ptr<reco::PFTau> tauPtr =
tau.get(
false);
463 tauPtr->setVertex(primaryVertexRef->position());
471 output.push_back(tauPtr);
472 return output.release();
const edm::Handle< PFCandidateCollection > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
bool isNonnull() const
Checks for non-null.
bool usePFLeptonsAsChargedHadrons_
Coll filterCandRefs(const Coll &refcoll, bool invert=false) const
Filter a ref vector of PFCandidates.
JetFunc isoConeChargedHadrons_
std::vector< PFCandidatePtr > pfGammas(const PFJet &jet, bool sort=true)
Extract all pfGammas from a PFJet.
int maxSignalConeChargedHadrons_
std::vector< reco::PFCandidatePtr > PFCandPtrs
boost::filter_iterator< PiZeroDRFilter, std::vector< RecoTauPiZero >::const_iterator > PiZeroDRFilterIter
boost::ptr_vector< reco::PFTau > output_type
JetFunc isoConeNeutralHadrons_
StringObjectFunction< reco::PFTau > signalConeSizeToStore_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
reco::VertexRef primaryVertex(const reco::PFJetRef &jet) const
Get primary vertex associated to this jet.
void setPV(const reco::VertexRef &vtx) const
Update the primary vertex.
void setTauQuantities(reco::PFTau &aTau, double minAbsPhotonSumPt_insideSignalCone=2.5, double minRelPhotonSumPt_insideSignalCone=0., double minAbsPhotonSumPt_outsideSignalCone=1.e+9, double minRelPhotonSumPt_outsideSignalCone=1.e+9) const
RecoTauQualityCuts qcuts_
double leadObjecPtThreshold_
InputIterator leadPFCand(InputIterator begin, InputIterator end)
double minRelPhotonSumPt_insideSignalCone_
double minAbsPhotonSumPt_insideSignalCone_
JetFunc signalConePiZeros_
DeltaRFilter< RecoTauPiZero > PiZeroDRFilter
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< PFCandidatePtr > pfChargedCands(const PFJet &jet, bool sort=true)
Extract all non-neutral candidates from a PFJet.
boost::filter_iterator< PFCandPtrDRFilter, std::vector< PFCandidatePtr >::const_iterator > PFCandPtrDRFilterIter
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
JetFunc signalConeChargedHadrons_
JetFunc signalConeNeutralHadrons_
DeltaRPtrFilter< PFCandidatePtr > PFCandPtrDRFilter
PredicateAND< P1, P2 > makePredicateAND(const P1 &p1, const P2 &p2)