1 #ifndef RecoTauTag_RecoTau_RecoTauCrossCleaning_h
2 #define RecoTauTag_RecoTau_RecoTauCrossCleaning_h
4 #include <boost/foreach.hpp>
9 namespace reco {
namespace tau {
namespace xclean {
12 template<
typename PtrIter>
19 for (PtrIter
i = signalTracksBegin;
i != signalTracksEnd; ++
i) {
29 output.reserve(input.size());
32 std::set<reco::CandidatePtr> toCheck(daughters.begin(), daughters.end());
33 std::vector<reco::CandidatePtr> cleanDaughters;
34 std::set_difference(toCheck.begin(), toCheck.end(),
36 if (cleanDaughters.size() == daughters.size()) {
38 output.push_back(piZero);
51 output.push_back(newPiZero);
69 template<
typename PFCandCompatiblePtrType>
70 bool operator()(
const PFCandCompatiblePtrType& ptr)
const {
72 return ptr->particleId() ==
id_;
87 template<
typename AnyPtr>
99 template<
typename P1,
typename P2>
105 template<
typename AnyPtr>
107 return p1_(ptr) &&
p2_(ptr);
115 template<
typename P1,
typename P2>
std::vector< RecoTauPiZero > PiZeroList
std::vector< PFCandidatePtr > flattenPiZeros(const std::vector< RecoTauPiZero > &)
Flatten a list of pi zeros into a list of there constituent PFCandidates.
AddFourMomenta p4Builder_
bool operator()(const AnyPtr &ptr) const
CrossCleanPtrs(const std::vector< reco::RecoTauPiZero > &piZeros)
PiZeroList operator()(const std::vector< RecoTauPiZero > &input) const
virtual size_t numberOfDaughters() const
number of daughters
std::vector< CandidatePtr > daughters
collection of references to daughters
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
CrossCleanPiZeros(PtrIter signalTracksBegin, PtrIter signalTracksEnd)
bool operator()(const AnyPtr &ptr) const
void clearDaughters()
clear daughter references
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
std::set< CandidatePtr > toRemove_
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)