1 #ifndef RecoTauTag_RecoTau_RecoTauCrossCleaning_h
2 #define RecoTauTag_RecoTau_RecoTauCrossCleaning_h
4 #include <boost/foreach.hpp>
12 namespace reco {
namespace tau {
namespace xclean {
15 template<
typename PtrIter>
24 initialize(chargedHadronsBegin, chargedHadronsEnd);
27 void initialize(
const PtrIter& chargedHadronsBegin,
const PtrIter& chargedHadronsEnd)
39 output.reserve(input.size());
42 std::set<reco::CandidatePtr> toCheck(daughters.begin(), daughters.end());
43 std::vector<reco::CandidatePtr> cleanDaughters;
44 std::set_difference(toCheck.begin(), toCheck.end(),
toRemove_.begin(),
toRemove_.end(), std::back_inserter(cleanDaughters));
45 if ( cleanDaughters.size() == daughters.size() ) {
47 output.push_back(piZero);
60 output.push_back(newPiZero);
76 template<
typename PtrIter>
85 void initialize(
const PtrIter& particlesBegin,
const PtrIter& particlesEnd)
91 template<
typename AnyPtr>
107 template<
typename PFCandCompatiblePtrType>
110 return ptr->particleId() ==
id_;
117 template<
typename P1,
typename P2>
123 template<
typename AnyPtr>
125 return (
p1_(ptr) &&
p2_(ptr));
133 template<
typename P1,
typename P2>
std::vector< RecoTauPiZero > PiZeroList
AddFourMomenta p4Builder_
bool operator()(const AnyPtr &ptr) const
PiZeroList operator()(const std::vector< RecoTauPiZero > &input) const
static std::string const input
virtual size_t numberOfDaughters() const
number of daughters
CrossCleanPtrs(const PtrIter &particlesBegin, const PtrIter &particlesEnd)
std::set< CandidatePtr > toRemove_
void initialize(const PtrIter &chargedHadronsBegin, const PtrIter &chargedHadronsEnd)
std::vector< CandidatePtr > daughters
collection of references to daughters
bool operator()(const AnyPtr &ptr) const
void clearDaughters()
clear daughter references
CrossCleanPiZeros(const PtrIter &chargedHadronsBegin, const PtrIter &chargedHadronsEnd, int mode=kRemoveChargedAndNeutralDaughterOverlaps)
const daughters & daughterPtrVector() const
references to daughtes
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)