323 LogDebug(
"discriminate") <<
" tau: Pt = " << pfTau->pt() <<
", eta = " << pfTau->eta() <<
", phi = " << pfTau->phi();
324 LogDebug(
"discriminate") << *pfTau ;
327 std::vector<CandidatePtr> isoCharged_;
328 std::vector<CandidatePtr> isoNeutral_;
329 std::vector<CandidatePtr> isoPU_;
331 std::vector<CandidatePtr> chPV_;
332 isoCharged_.
reserve(pfTau->isolationChargedHadrCands().size());
333 isoNeutral_.reserve(pfTau->isolationGammaCands().size());
335 isoNeutralWeight_.
reserve(pfTau->isolationGammaCands().size());
345 LogTrace(
"discriminate") <<
"pv: x = " << pv->position().x() <<
", y = " << pv->position().y() <<
", z = " << pv->position().z() ;
347 LogTrace(
"discriminate") <<
"pv: N/A" ;
349 if ( pfTau->leadChargedHadrCand().
isNonnull() ) {
350 LogTrace(
"discriminate") <<
"leadPFChargedHadron:" 351 <<
" Pt = " << pfTau->leadChargedHadrCand()->pt() <<
"," 352 <<
" eta = " << pfTau->leadChargedHadrCand()->eta() <<
"," 353 <<
" phi = " << pfTau->leadChargedHadrCand()->phi() ;
355 LogTrace(
"discriminate") <<
"leadPFChargedHadron: N/A" ;
363 qcuts_->setLeadTrack(*pfTau->leadChargedHadrCand());
374 for(
auto const &
cand : pfTau->isolationChargedHadrCands() ) {
376 LogTrace(
"discriminate") <<
"adding charged iso cand with pt " <<
cand->pt() ;
377 isoCharged_.push_back(
cand);
382 for(
auto const &
cand : pfTau->isolationGammaCands() ) {
384 LogTrace(
"discriminate") <<
"adding neutral iso cand with pt " <<
cand->pt() ;
385 isoNeutral_.push_back(
cand);
400 std::vector<CandidatePtr> allPU =
404 std::vector<CandidatePtr> allNPU =
407 LogTrace(
"discriminate") <<
"After track cuts: " << allPU.size() ;
411 std::vector<CandidatePtr> cleanPU =
414 std::vector<CandidatePtr> cleanNPU =
417 LogTrace(
"discriminate") <<
"After cleaning cuts: " << cleanPU.size() ;
421 for (
auto const &
cand : cleanPU ) {
422 if ( deltaBetaFilter(
cand) ) isoPU_.push_back(
cand);
425 for (
auto const &
cand : cleanNPU ) {
426 if ( deltaBetaFilter(
cand) ) chPV_.push_back(
cand);
428 LogTrace(
"discriminate") <<
"After cone cuts: " << isoPU_.size() <<
" " << chPV_.size() ;
436 for (
auto const & isoObject : isoNeutral_ ) {
437 if ( isoObject->charge() != 0 ) {
443 double eta = isoObject->eta();
444 double phi = isoObject->phi();
449 if ( (sumNPU + sumPU) > 0 ) neutral.setP4(((sumNPU)/(sumNPU + sumPU))*neutral.p4());
459 std::vector<CandidatePtr> isoCharged_filter;
460 std::vector<CandidatePtr> isoNeutral_filter;
463 for(
auto const & isoObject : isoCharged_ ) {
467 for(
auto const & isoObject : isoNeutral_ ) {
468 if (
filter(isoObject) ) isoNeutral_filter.push_back(isoObject);
470 isoNeutral_ = isoNeutral_filter;
472 for(
auto const & isoObject : isoNeutralWeight_){
473 if ( filter2(isoObject) ) isoNeutralWeight_filter.
push_back(isoObject);
475 isoNeutralWeight_ = isoNeutralWeight_filter;
477 isoCharged_ = isoCharged_filter;
480 bool failsOccupancyCut =
false;
481 bool failsSumPtCut =
false;
482 bool failsRelativeSumPtCut =
false;
485 int neutrals = isoNeutral_.
size();
490 if ( neutrals < 0 ) {
494 size_t nOccupants = isoCharged_.size() + neutrals;
498 double footprintCorrection_value = 0.;
502 if ( (*footprintCorrection)->selection_(*pfTau) ) {
503 footprintCorrection_value = (*footprintCorrection)->offset_(*pfTau);
512 double chargedPt = 0.;
513 double neutralPt = 0.;
514 double weightedNeutralPt = 0.;
515 for (
auto const & isoObject : isoCharged_ ) {
516 chargedPt += isoObject->pt();
519 for (
auto const & isoObject : isoNeutral_ ) {
520 neutralPt += isoObject->pt();
523 for (
auto const & isoObject : isoNeutralWeight_ ) {
524 weightedNeutralPt += isoObject.pt();
527 for (
auto const & isoObject : isoPU_ ) {
528 puPt += isoObject->pt();
530 LogTrace(
"discriminate") <<
"chargedPt = " << chargedPt ;
531 LogTrace(
"discriminate") <<
"neutralPt = " << neutralPt ;
532 LogTrace(
"discriminate") <<
"weighted neutral Pt = " << weightedNeutralPt ;
536 neutralPt = weightedNeutralPt;
544 neutralPt -= footprintCorrection_value;
551 if ( neutralPt < 0. ) {
564 bool failsPhotonPtSumOutsideSignalConeCut =
false;
565 double photonSumPt_outsideSignalCone = 0.;
567 const std::vector<reco::CandidatePtr>& signalGammas = pfTau->signalGammaCands();
568 for ( std::vector<reco::CandidatePtr>::const_iterator signalGamma = signalGammas.begin();
569 signalGamma != signalGammas.end(); ++signalGamma ) {
570 double dR =
deltaR(pfTau->eta(), pfTau->phi(), (*signalGamma)->eta(), (*signalGamma)->phi());
571 if ( dR > pfTau->signalConeSize() ) photonSumPt_outsideSignalCone += (*signalGamma)->pt();
574 failsPhotonPtSumOutsideSignalConeCut =
true;
599 return footprintCorrection_value;
601 return photonSumPt_outsideSignalCone;
603 return (fails ? 0. : 1.);
bool isNonnull() const
Checks for non-null.
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsGeneralQCuts_
bool applyPhotonPtSumOutsideSignalConeCut_
double maximumRelativeSumPt_
bool applyRelativeSumPtCut_
double deltaBetaFactorThisEvent_
bool applyFootprintCorrection_
double offsetRelativeSumPt_
std::vector< std::unique_ptr< FootprintCorrection > > footprintCorrections_
bool storeRawFootprintCorrection_
double weightedSum(const std::vector< CandidatePtr > &inColl_, double eta, double phi) const
std::auto_ptr< tau::RecoTauQualityCuts > qcuts_
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsPUTrackSelection_
double deltaBetaCollectionCone_
std::vector< reco::CandidatePtr > chargedPFCandidatesInEvent_
uint32_t maximumOccupancy_
double maxRelPhotonSumPt_outsideSignalCone_
std::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
double maxAbsPhotonSumPt_outsideSignalCone_
bool storeRawPhotonSumPt_outsideSignalCone_