30 namespace reco {
namespace tau {
38 const std::vector<RecoTauPiZero>& piZeros,
39 const std::vector<PFCandidatePtr>& regionalExtras)
const;
61 usePFLeptonsAsChargedHadrons_(pset.getParameter<bool>(
"usePFLeptons")),
62 leadObjecPtThreshold_(pset.getParameter<double>(
"leadObjectPt")),
63 matchingCone_(pset.getParameter<std::string>(
"matchingCone")),
64 signalConeChargedHadrons_(pset.getParameter<std::string>(
65 "signalConeChargedHadrons")),
66 isoConeChargedHadrons_(
67 pset.getParameter<std::string>(
"isoConeChargedHadrons")),
69 pset.getParameter<std::string>(
"signalConePiZeros")),
71 pset.getParameter<std::string>(
"isoConePiZeros")),
72 signalConeNeutralHadrons_(
73 pset.getParameter<std::string>(
"signalConeNeutralHadrons")),
74 isoConeNeutralHadrons_(
75 pset.getParameter<std::string>(
"isoConeNeutralHadrons")) {}
79 const std::vector<RecoTauPiZero>& piZeros,
80 const std::vector<PFCandidatePtr>& regionalExtras)
const {
92 typedef std::vector<PFCandidatePtr>
PFCandPtrs;
127 PFCandPtrs::iterator leadPFCH_iter =
128 std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
130 if (leadPFCH_iter != pfchs.end()) {
131 leadPFCH = *leadPFCH_iter;
142 PFCandPtrs::iterator leadPFGamma_iter =
145 if (leadPFGamma_iter !=
pfGammas.end()) {
146 leadPFGamma = *leadPFGamma_iter;
155 }
else if (leadPFGamma.isNonnull() &&
205 RegionalJunkConeAndIdFilter pfChargedJunk(
210 RegionalJunkConeAndIdFilter pfGammaJunk(
215 RegionalJunkConeAndIdFilter pfNeutralJunk(
222 signalConePFCHFilter, pfchs.begin(), pfchs.end());
224 signalConePFCHFilter, pfchs.end(), pfchs.end());
228 signalPFCHs_begin, signalPFCHs_end);
229 std::vector<reco::RecoTauPiZero> cleanPiZeros = xCleaner(piZeros);
238 signalPFCHs_begin, signalPFCHs_end);
242 boost::make_filter_iterator(
244 pfnhs.begin(), pfnhs.end()),
245 boost::make_filter_iterator(
247 pfnhs.end(), pfnhs.end()));
252 cleanPiZeros.begin(), cleanPiZeros.end()),
254 cleanPiZeros.end(), cleanPiZeros.end()));
259 boost::make_filter_iterator(
261 pfchs.begin(), pfchs.end()),
262 boost::make_filter_iterator(
264 pfchs.end(), pfchs.end()));
269 boost::make_filter_iterator(
270 pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
271 boost::make_filter_iterator(
272 pfChargedJunk, regionalJunk.end(), regionalJunk.end())
278 boost::make_filter_iterator(
280 pfnhs.begin(), pfnhs.end()),
281 boost::make_filter_iterator(
283 pfnhs.end(), pfnhs.end()));
288 boost::make_filter_iterator(
289 pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
290 boost::make_filter_iterator(
291 pfNeutralJunk, regionalJunk.end(), regionalJunk.end())
299 cleanPiZeros.end()));
304 boost::make_filter_iterator(
305 pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
306 boost::make_filter_iterator(
307 pfGammaJunk, regionalJunk.end(), regionalJunk.end())
313 std::auto_ptr<reco::PFTau> tauPtr = tau.
get(
false);
317 if ( primaryVertexRef.isNonnull() )
318 tauPtr->setVertex(primaryVertexRef->position());
328 "RecoTauBuilderConePlugin");
const edm::Handle< PFCandidateCollection > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
return_type operator()(const reco::PFJetRef &jet, const std::vector< RecoTauPiZero > &piZeros, const std::vector< PFCandidatePtr > ®ionalExtras) const
std::auto_ptr< reco::PFTau > get(bool setupLeadingCandidates=true)
Coll filterRefs(const Coll &refcoll, bool invert=false) const
Filter a ref vector of PFCandidates.
bool usePFLeptonsAsChargedHadrons_
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
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 pi zeros 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)
StringObjectFunction< reco::PFJet > JetFunc
RecoTauBuilderConePlugin(const edm::ParameterSet &pset)
JetFunc signalConePiZeros_
~RecoTauBuilderConePlugin()
DeltaRFilter< RecoTauPiZero > PiZeroDRFilter
math::XYZTLorentzVector LorentzVector
Lorentz vector.
void setleadPFChargedHadrCand(const T &cand)
Set leading PFChargedHadron candidate.
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_
DeltaRPtrFilter< PFCandidatePtr > PFCandPtrDRFilter
Transform a pizero to remove given candidates.
PredicateAND< P1, P2 > makePredicateAND(const P1 &p1, const P2 &p2)