30 namespace reco {
namespace tau {
40 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons,
41 const std::vector<RecoTauPiZero>& piZeros,
42 const std::vector<PFCandidatePtr>& regionalExtras)
const override;
68 usePFLeptonsAsChargedHadrons_(pset.getParameter<bool>(
"usePFLeptons")),
69 leadObjecPtThreshold_(pset.getParameter<double>(
"leadObjectPt")),
70 matchingCone_(pset.getParameter<std::
string>(
"matchingCone")),
71 signalConeChargedHadrons_(pset.getParameter<std::
string>(
72 "signalConeChargedHadrons")),
73 isoConeChargedHadrons_(
74 pset.getParameter<std::
string>(
"isoConeChargedHadrons")),
76 pset.getParameter<std::
string>(
"signalConePiZeros")),
78 pset.getParameter<std::
string>(
"isoConePiZeros")),
79 signalConeNeutralHadrons_(
80 pset.getParameter<std::
string>(
"signalConeNeutralHadrons")),
81 isoConeNeutralHadrons_(
82 pset.getParameter<std::
string>(
"isoConeNeutralHadrons"))
108 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons,
109 const std::vector<RecoTauPiZero>& piZeros,
110 const std::vector<PFCandidatePtr>& regionalExtras)
const {
112 using namespace cone;
122 typedef std::vector<PFCandidatePtr>
PFCandPtrs;
157 PFCandPtrs::iterator leadPFCH_iter =
158 std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
160 if (leadPFCH_iter != pfchs.end()) {
161 leadPFCH = *leadPFCH_iter;
172 PFCandPtrs::iterator leadPFGamma_iter =
175 if (leadPFGamma_iter !=
pfGammas.end()) {
176 leadPFGamma = *leadPFGamma_iter;
185 }
else if (leadPFGamma.isNonnull() &&
231 RegionalJunkConeAndIdFilter pfChargedJunk(
236 RegionalJunkConeAndIdFilter pfGammaJunk(
241 RegionalJunkConeAndIdFilter pfNeutralJunk(
248 signalConePFCHFilter, pfchs.begin(), pfchs.end());
250 signalConePFCHFilter, pfchs.end(), pfchs.end());
254 signalPFCHs_begin, signalPFCHs_end);
255 std::vector<reco::RecoTauPiZero> cleanPiZeros = piZeroXCleaner(piZeros);
264 signalPFCHs_begin, signalPFCHs_end);
268 boost::make_filter_iterator(
270 pfnhs.begin(), pfnhs.end()),
271 boost::make_filter_iterator(
273 pfnhs.end(), pfnhs.end()));
278 cleanPiZeros.begin(), cleanPiZeros.end()),
280 cleanPiZeros.end(), cleanPiZeros.end()));
285 boost::make_filter_iterator(
287 pfchs.begin(), pfchs.end()),
288 boost::make_filter_iterator(
290 pfchs.end(), pfchs.end()));
295 boost::make_filter_iterator(
296 pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
297 boost::make_filter_iterator(
298 pfChargedJunk, regionalJunk.end(), regionalJunk.end())
304 boost::make_filter_iterator(
306 pfnhs.begin(), pfnhs.end()),
307 boost::make_filter_iterator(
309 pfnhs.end(), pfnhs.end()));
314 boost::make_filter_iterator(
315 pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
316 boost::make_filter_iterator(
317 pfNeutralJunk, regionalJunk.end(), regionalJunk.end())
325 cleanPiZeros.end()));
330 boost::make_filter_iterator(
331 pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
332 boost::make_filter_iterator(
333 pfGammaJunk, regionalJunk.end(), regionalJunk.end())
339 std::auto_ptr<reco::PFTau> tauPtr = tau.
get(
false);
343 if ( primaryVertexRef.isNonnull() )
344 tauPtr->setVertex(primaryVertexRef->position());
354 "RecoTauBuilderConePlugin");
const edm::Handle< PFCandidateCollection > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
std::auto_ptr< reco::PFTau > get(bool setupLeadingCandidates=true)
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.
ParameterSet const & getParameterSet(ParameterSetID const &id)
std::vector< reco::PFCandidatePtr > PFCandPtrs
boost::filter_iterator< PiZeroDRFilter, std::vector< RecoTauPiZero >::const_iterator > PiZeroDRFilterIter
boost::ptr_vector< reco::PFTau > output_type
std::auto_ptr< output_type > return_type
RecoTauBuilderConePlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
JetFunc isoConeNeutralHadrons_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
void addPiZeros(Region region, const InputIterator &begin, const InputIterator &end)
Add a list of pizeros to the input collection.
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.
RecoTauQualityCuts qcuts_
void setleadPFCand(const T &cand)
Set leading PF candidate.
void addPFCands(Region region, ParticleType type, const InputIterator &begin, const InputIterator &end)
double leadObjecPtThreshold_
InputIterator leadPFCand(InputIterator begin, InputIterator end)
void initialize(const PtrIter &chargedHadronsBegin, const PtrIter &chargedHadronsEnd)
StringObjectFunction< reco::PFJet > JetFunc
std::vector< PFCandidatePtr > flattenPiZeros(const std::vector< RecoTauPiZero >::const_iterator &, const std::vector< RecoTauPiZero >::const_iterator &)
Flatten a list of pi zeros into a list of there constituent PFCandidates.
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
JetFunc signalConePiZeros_
~RecoTauBuilderConePlugin()
DeltaRFilter< RecoTauPiZero > PiZeroDRFilter
math::XYZTLorentzVector LorentzVector
Lorentz vector.
void setleadPFChargedHadrCand(const T &cand)
Set leading PFChargedHadron candidate.
return_type operator()(const reco::PFJetRef &jet, const std::vector< reco::PFRecoTauChargedHadron > &chargedHadrons, const std::vector< RecoTauPiZero > &piZeros, const std::vector< PFCandidatePtr > ®ionalExtras) const override
std::vector< PFCandidatePtr > pfChargedCands(const PFJet &jet, bool sort=true)
Extract all non-neutral candidates from a PFJet.
void setleadPFNeutralCand(const T &cand)
Set leading PFGamma candidate.
boost::filter_iterator< PFCandPtrDRFilter, std::vector< PFCandidatePtr >::const_iterator > PFCandPtrDRFilterIter
#define DEFINE_EDM_PLUGIN(factory, type, name)
JetFunc signalConeChargedHadrons_
JetFunc signalConeNeutralHadrons_
void initialize(const PtrIter &particlesBegin, const PtrIter &particlesEnd)
DeltaRPtrFilter< PFCandidatePtr > PFCandPtrDRFilter
std::vector< RecoTauPiZero > PiZeroList
Transform a pizero to remove given candidates.
PredicateAND< P1, P2 > makePredicateAND(const P1 &p1, const P2 &p2)