189 using namespace cone;
195 RecoTauConstructor
tau(
jet,
204 typedef std::vector<CandidatePtr>
CandPtrs;
218 std::sort(pfchs.begin(), pfchs.end(), SortPFCandsDescendingPt());
240 CandPtrs::iterator leadPFCH_iter = std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
242 if (leadPFCH_iter != pfchs.end()) {
243 leadPFCH = *leadPFCH_iter;
245 tau.setleadChargedHadrCand(leadPFCH);
254 CandPtrs::iterator leadPFGamma_iter = std::find_if(
pfGammas.begin(),
pfGammas.end(), matchingConeFilter);
256 if (leadPFGamma_iter !=
pfGammas.end()) {
257 leadPFGamma = *leadPFGamma_iter;
259 tau.setleadNeutralCand(leadPFGamma);
265 leadPFCand = leadPFCH;
268 leadPFCand = leadPFGamma;
271 leadPFCand = leadPFCH;
274 tau.setleadCand(leadPFCand);
297 typedef xclean::PredicateAND<xclean::FilterCandByAbsPdgId, CandPtrDRFilter> RegionalJunkConeAndIdFilter;
299 xclean::FilterCandByAbsPdgId pfchCandSelector(211);
300 xclean::FilterCandByAbsPdgId pfgammaCandSelector(22);
301 xclean::FilterCandByAbsPdgId pfnhCandSelector(130);
304 RegionalJunkConeAndIdFilter pfChargedJunk(pfchCandSelector,
308 RegionalJunkConeAndIdFilter pfGammaJunk(pfgammaCandSelector,
312 RegionalJunkConeAndIdFilter pfNeutralJunk(pfnhCandSelector,
317 CandPtrDRFilterIter signalPFCHCands_begin(signalConePFCHFilter, pfchs.begin(), pfchs.end());
320 int numSignalPFCHs = 0;
322 for (
CandPtrDRFilterIter iter = signalPFCHCands_begin; iter != signalPFCHCands_end; ++iter) {
325 signalPFCHs.push_back(*iter);
329 isolationPFCHs.push_back(*iter);
332 CandPtrs::const_iterator signalPFCHs_begin = signalPFCHs.begin();
333 CandPtrs::const_iterator signalPFCHs_end = signalPFCHs.end();
336 xclean::CrossCleanPiZeros<CandPtrDRFilterIter> piZeroXCleaner(signalPFCHCands_begin, signalPFCHCands_end);
337 std::vector<reco::RecoTauPiZero> cleanPiZeros = piZeroXCleaner(piZeros);
341 xclean::CrossCleanPtrs<PiZeroList::const_iterator> pfCandXCleaner(cleanPiZeros.begin(), cleanPiZeros.end());
343 auto isolationPFCHCands_begin(boost::make_filter_iterator(
345 auto isolationPFCHCands_end(boost::make_filter_iterator(
347 for (
auto iter = isolationPFCHCands_begin; iter != isolationPFCHCands_end; ++iter) {
348 isolationPFCHs.push_back(*iter);
350 CandPtrs::const_iterator isolationPFCHs_begin = isolationPFCHs.begin();
351 CandPtrs::const_iterator isolationPFCHs_end = isolationPFCHs.end();
359 boost::make_filter_iterator(
361 boost::make_filter_iterator(
376 boost::make_filter_iterator(pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
377 boost::make_filter_iterator(pfChargedJunk, regionalJunk.end(), regionalJunk.end()));
382 boost::make_filter_iterator(
384 boost::make_filter_iterator(
390 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
391 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.end(), regionalJunk.end()));
401 boost::make_filter_iterator(pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
402 boost::make_filter_iterator(pfGammaJunk, regionalJunk.end(), regionalJunk.end()));
407 std::unique_ptr<reco::PFTau> tauPtr =
tau.get(
false);
412 tauPtr->setVertex(primaryVertexRef->position());
std::vector< CandidatePtr > pfCandidatesByPdgId(const Jet &jet, int pdgId, bool sort=true)
void setTauQuantities(reco::PFTau &aTau, double minAbsPhotonSumPt_insideSignalCone=2.5, double minRelPhotonSumPt_insideSignalCone=0., double minAbsPhotonSumPt_outsideSignalCone=1.e+9, double minRelPhotonSumPt_outsideSignalCone=1.e+9) const
std::unique_ptr< RecoTauQualityCuts > qcuts_
std::vector< std::unique_ptr< reco::PFTau > > output_type
bool usePFLeptonsAsChargedHadrons_
JetFunc isoConeChargedHadrons_
const edm::Handle< edm::View< reco::Candidate > > & getPFCands() const
Hack to be able to convert Ptrs to Refs.
int maxSignalConeChargedHadrons_
bool isNonnull() const
Checks for non-null.
std::vector< CandidatePtr > pfChargedCands(const Jet &jet, bool sort=true)
Extract all non-neutral candidates from a PFJet.
JetFunc isoConeNeutralHadrons_
StringObjectFunction< reco::PFTau > signalConeSizeToStore_
reco::VertexRef primaryVertex(const reco::JetBaseRef &jet) const
Get primary vertex associated to this jet.
std::vector< reco::CandidatePtr > CandPtrs
boost::filter_iterator< CandPtrDRFilter, std::vector< CandidatePtr >::const_iterator > CandPtrDRFilterIter
boost::filter_iterator< PiZeroDRFilter, std::vector< RecoTauPiZero >::const_iterator > PiZeroDRFilterIter
double leadObjecPtThreshold_
double minRelPhotonSumPt_insideSignalCone_
double minAbsPhotonSumPt_insideSignalCone_
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
JetFunc signalConePiZeros_
DeltaRPtrFilter< CandidatePtr > CandPtrDRFilter
DeltaRFilter< RecoTauPiZero > PiZeroDRFilter
math::XYZTLorentzVector LorentzVector
Lorentz vector.
JetFunc signalConeChargedHadrons_
JetFunc signalConeNeutralHadrons_
std::vector< CandidatePtr > pfGammas(const Jet &jet, bool sort=true)
Extract all pfGammas from a PFJet.
PredicateAND< P1, P2 > makePredicateAND(const P1 &p1, const P2 &p2)