188 using namespace cone;
194 RecoTauConstructor
tau(
jet,
203 typedef std::vector<CandidatePtr>
CandPtrs;
217 std::sort(pfchs.begin(), pfchs.end(), SortPFCandsDescendingPt());
239 CandPtrs::iterator leadPFCH_iter = std::find_if(pfchs.begin(), pfchs.end(), matchingConeFilter);
241 if (leadPFCH_iter != pfchs.end()) {
242 leadPFCH = *leadPFCH_iter;
244 tau.setleadChargedHadrCand(leadPFCH);
253 CandPtrs::iterator leadPFGamma_iter = std::find_if(
pfGammas.begin(),
pfGammas.end(), matchingConeFilter);
255 if (leadPFGamma_iter !=
pfGammas.end()) {
256 leadPFGamma = *leadPFGamma_iter;
258 tau.setleadNeutralCand(leadPFGamma);
264 leadPFCand = leadPFCH;
267 leadPFCand = leadPFGamma;
270 leadPFCand = leadPFCH;
273 tau.setleadCand(leadPFCand);
296 typedef xclean::PredicateAND<xclean::FilterCandByAbsPdgId, CandPtrDRFilter> RegionalJunkConeAndIdFilter;
298 xclean::FilterCandByAbsPdgId pfchCandSelector(211);
299 xclean::FilterCandByAbsPdgId pfgammaCandSelector(22);
300 xclean::FilterCandByAbsPdgId pfnhCandSelector(130);
303 RegionalJunkConeAndIdFilter pfChargedJunk(pfchCandSelector,
307 RegionalJunkConeAndIdFilter pfGammaJunk(pfgammaCandSelector,
311 RegionalJunkConeAndIdFilter pfNeutralJunk(pfnhCandSelector,
316 CandPtrDRFilterIter signalPFCHCands_begin(signalConePFCHFilter, pfchs.begin(), pfchs.end());
319 int numSignalPFCHs = 0;
321 int numIsolationPFCHs = 0;
322 for (
CandPtrDRFilterIter iter = signalPFCHCands_begin; iter != signalPFCHCands_end; ++iter) {
325 signalPFCHs.push_back(*iter);
330 isolationPFCHs.push_back(*iter);
334 CandPtrs::const_iterator signalPFCHs_begin = signalPFCHs.begin();
335 CandPtrs::const_iterator signalPFCHs_end = signalPFCHs.end();
338 xclean::CrossCleanPiZeros<CandPtrDRFilterIter> piZeroXCleaner(signalPFCHCands_begin, signalPFCHCands_end);
339 std::vector<reco::RecoTauPiZero> cleanPiZeros = piZeroXCleaner(piZeros);
343 xclean::CrossCleanPtrs<PiZeroList::const_iterator> pfCandXCleaner(cleanPiZeros.begin(), cleanPiZeros.end());
345 auto isolationPFCHCands_begin(boost::make_filter_iterator(
347 auto isolationPFCHCands_end(boost::make_filter_iterator(
349 for (
auto iter = isolationPFCHCands_begin; iter != isolationPFCHCands_end; ++iter) {
351 isolationPFCHs.push_back(*iter);
354 CandPtrs::const_iterator isolationPFCHs_begin = isolationPFCHs.begin();
355 CandPtrs::const_iterator isolationPFCHs_end = isolationPFCHs.end();
363 boost::make_filter_iterator(
365 boost::make_filter_iterator(
380 boost::make_filter_iterator(pfChargedJunk, regionalJunk.begin(), regionalJunk.end()),
381 boost::make_filter_iterator(pfChargedJunk, regionalJunk.end(), regionalJunk.end()));
386 boost::make_filter_iterator(
388 boost::make_filter_iterator(
394 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.begin(), regionalJunk.end()),
395 boost::make_filter_iterator(pfNeutralJunk, regionalJunk.end(), regionalJunk.end()));
405 boost::make_filter_iterator(pfGammaJunk, regionalJunk.begin(), regionalJunk.end()),
406 boost::make_filter_iterator(pfGammaJunk, regionalJunk.end(), regionalJunk.end()));
411 std::unique_ptr<reco::PFTau> tauPtr =
tau.get(
false);
416 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)