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());