1 #ifndef RecoTauTag_RecoTau_RecoTauCrossCleaning_h 2 #define RecoTauTag_RecoTau_RecoTauCrossCleaning_h 13 template<
typename PtrIter>
22 initialize(chargedHadronsBegin, chargedHadronsEnd);
25 void initialize(
const PtrIter& chargedHadronsBegin,
const PtrIter& chargedHadronsEnd)
37 output.reserve(input.size());
38 for(
auto const& piZero : input ) {
40 std::set<reco::CandidatePtr> toCheck(daughters.begin(), daughters.end());
41 std::vector<reco::CandidatePtr> cleanDaughters;
42 std::set_difference(toCheck.begin(), toCheck.end(),
toRemove_.begin(),
toRemove_.end(), std::back_inserter(cleanDaughters));
43 if ( cleanDaughters.size() == daughters.size() ) {
45 output.push_back(piZero);
51 for(
auto const& ptr : cleanDaughters ) {
58 output.push_back(newPiZero);
74 template<
typename PtrIter>
83 void initialize(
const PtrIter& particlesBegin,
const PtrIter& particlesEnd)
89 template<
typename AnyPtr>
105 template<
typename PFCandCompatiblePtrType>
107 return ptr->particleId() == id_;
114 template<
typename P1,
typename P2>
120 template<
typename AnyPtr>
122 return (p1_(ptr) && p2_(ptr));
130 template<
typename P1,
typename P2>
std::vector< RecoTauPiZero > PiZeroList
AddFourMomenta p4Builder_
PiZeroList operator()(const std::vector< RecoTauPiZero > &input) const
static std::string const input
size_t numberOfDaughters() const override
number of daughters
CrossCleanPtrs(const PtrIter &particlesBegin, const PtrIter &particlesEnd)
std::set< CandidatePtr > toRemove_
virtual void clearDaughters()
clear daughter references
void initialize(const PtrIter &chargedHadronsBegin, const PtrIter &chargedHadronsEnd)
std::vector< CandidatePtr > daughters
collection of references to daughters
CrossCleanPiZeros(const PtrIter &chargedHadronsBegin, const PtrIter &chargedHadronsEnd, int mode=kRemoveChargedAndNeutralDaughterOverlaps)
void addDaughter(const CandidatePtr &)
add a daughter via a reference
PredicateAND(const P1 &p1, const P2 &p2)
void set(reco::Candidate &c) const
set up a candidate
bool operator()(const PFCandCompatiblePtrType &ptr) const
void initialize(const PtrIter &particlesBegin, const PtrIter &particlesEnd)
std::set< reco::CandidatePtr > toRemove_
Transform a pizero to remove given candidates.
FilterPFCandByParticleId(int particleId)
PredicateAND< P1, P2 > makePredicateAND(const P1 &p1, const P2 &p2)