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;
70 usePFLeptonsAsChargedHadrons_(pset.getParameter<bool>(
"usePFLeptons")),
71 leadObjecPtThreshold_(pset.getParameter<double>(
"leadObjectPt")),
72 matchingCone_(pset.getParameter<std::
string>(
"matchingCone")),
73 signalConeChargedHadrons_(pset.getParameter<std::
string>(
74 "signalConeChargedHadrons")),
75 isoConeChargedHadrons_(
76 pset.getParameter<std::
string>(
"isoConeChargedHadrons")),
78 pset.getParameter<std::
string>(
"signalConePiZeros")),
80 pset.getParameter<std::
string>(
"isoConePiZeros")),
81 signalConeNeutralHadrons_(
82 pset.getParameter<std::
string>(
"signalConeNeutralHadrons")),
83 isoConeNeutralHadrons_(
84 pset.getParameter<std::
string>(
"isoConeNeutralHadrons")),
85 maxSignalConeChargedHadrons_(
86 pset.getParameter<int>(
"maxSignalConeChargedHadrons"))
112 const std::vector<reco::PFRecoTauChargedHadron>& chargedHadrons,
113 const std::vector<RecoTauPiZero>& piZeros,
114 const std::vector<PFCandidatePtr>& regionalExtras)
const {
119 using namespace cone;
129 typedef std::vector<PFCandidatePtr>
PFCandPtrs;
167 PFCandPtrs::iterator leadPFCH_iter =
168 std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
170 if (leadPFCH_iter != pfchs.end()) {
171 leadPFCH = *leadPFCH_iter;
182 PFCandPtrs::iterator leadPFGamma_iter =
185 if (leadPFGamma_iter !=
pfGammas.end()) {
186 leadPFGamma = *leadPFGamma_iter;
195 }
else if (leadPFGamma.isNonnull() &&
241 RegionalJunkConeAndIdFilter pfChargedJunk(
246 RegionalJunkConeAndIdFilter pfGammaJunk(
251 RegionalJunkConeAndIdFilter pfNeutralJunk(
258 signalConePFCHFilter, pfchs.begin(), pfchs.end());
260 signalConePFCHFilter, pfchs.end(), pfchs.end());
262 int numSignalPFCHs = 0;
264 int numIsolationPFCHs = 0;
268 signalPFCHs.push_back(*iter);
273 isolationPFCHs.push_back(*iter);
277 PFCandPtrs::const_iterator signalPFCHs_begin = signalPFCHs.begin();
278 PFCandPtrs::const_iterator signalPFCHs_end = signalPFCHs.end();
282 signalPFCHCands_begin, signalPFCHCands_end);
283 std::vector<reco::RecoTauPiZero> cleanPiZeros = piZeroXCleaner(piZeros);
289 auto isolationPFCHCands_begin(
290 boost::make_filter_iterator(
292 pfchs.begin(), pfchs.end()));
293 auto isolationPFCHCands_end(
294 boost::make_filter_iterator(
296 pfchs.end(), pfchs.end()));
297 for (
auto iter = isolationPFCHCands_begin; iter != isolationPFCHCands_end; ++iter ) {
299 isolationPFCHs.push_back(*iter);
302 PFCandPtrs::const_iterator isolationPFCHs_begin = isolationPFCHs.begin();
303 PFCandPtrs::const_iterator isolationPFCHs_end = isolationPFCHs.end();
308 signalPFCHs_begin, signalPFCHs_end);
312 boost::make_filter_iterator(
314 pfnhs.begin(), pfnhs.end()),
315 boost::make_filter_iterator(
317 pfnhs.end(), pfnhs.end()));
322 cleanPiZeros.begin(), cleanPiZeros.end()),
324 cleanPiZeros.end(), cleanPiZeros.end()));
329 isolationPFCHs_begin, isolationPFCHs_end);
334 boost::make_filter_iterator(
335 pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
336 boost::make_filter_iterator(
337 pfChargedJunk, regionalJunk.end(), regionalJunk.end())
343 boost::make_filter_iterator(
345 pfnhs.begin(), pfnhs.end()),
346 boost::make_filter_iterator(
348 pfnhs.end(), pfnhs.end()));
353 boost::make_filter_iterator(
354 pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
355 boost::make_filter_iterator(
356 pfNeutralJunk, regionalJunk.end(), regionalJunk.end())
364 cleanPiZeros.end()));
369 boost::make_filter_iterator(
370 pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
371 boost::make_filter_iterator(
372 pfGammaJunk, regionalJunk.end(), regionalJunk.end())
378 std::auto_ptr<reco::PFTau> tauPtr = tau.
get(
false);
382 if ( primaryVertexRef.isNonnull() )
383 tauPtr->setVertex(primaryVertexRef->position());
393 "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.
int maxSignalConeChargedHadrons_
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)