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_;
118 template<
typename CandCompatiblePtrType>
120 return std::abs(ptr->pdgId()) == id_;
127 template<
typename P1,
typename P2>
133 template<
typename AnyPtr>
135 return (p1_(ptr) && p2_(ptr));
143 template<
typename P1,
typename P2>
std::vector< RecoTauPiZero > PiZeroList
AddFourMomenta p4Builder_
FilterCandByAbsPdgId(int pdgId)
PiZeroList operator()(const std::vector< RecoTauPiZero > &input) const
static std::string const input
size_t numberOfDaughters() const override
number of daughters
bool operator()(const CandCompatiblePtrType &ptr) const
CrossCleanPtrs(const PtrIter &particlesBegin, const PtrIter &particlesEnd)
Abs< T >::type abs(const T &t)
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)