324 LogDebug(
"discriminate") <<
" tau: Pt = " << pfTau->pt() <<
", eta = " << pfTau->eta() <<
", phi = " << pfTau->phi();
325 LogDebug(
"discriminate") << *pfTau ;
328 std::vector<PFCandidatePtr> isoCharged_;
329 std::vector<PFCandidatePtr> isoNeutral_;
330 std::vector<PFCandidatePtr> isoPU_;
332 std::vector<PFCandidatePtr> chPV_;
333 isoCharged_.reserve(pfTau->isolationPFChargedHadrCands().size());
334 isoNeutral_.reserve(pfTau->isolationPFGammaCands().size());
336 isoNeutralWeight_.reserve(pfTau->isolationPFGammaCands().size());
346 LogTrace(
"discriminate") <<
"pv: x = " << pv->position().x() <<
", y = " << pv->position().y() <<
", z = " << pv->position().z() ;
348 LogTrace(
"discriminate") <<
"pv: N/A" ;
350 if ( pfTau->leadPFChargedHadrCand().
isNonnull() ) {
351 LogTrace(
"discriminate") <<
"leadPFChargedHadron:"
352 <<
" Pt = " << pfTau->leadPFChargedHadrCand()->pt() <<
","
353 <<
" eta = " << pfTau->leadPFChargedHadrCand()->eta() <<
","
354 <<
" phi = " << pfTau->leadPFChargedHadrCand()->phi() ;
356 LogTrace(
"discriminate") <<
"leadPFChargedHadron: N/A" ;
364 qcuts_->setLeadTrack(pfTau->leadPFChargedHadrCand());
375 for(
auto const & cand : pfTau->isolationPFChargedHadrCands() ) {
376 if (
qcuts_->filterCandRef(cand) ) {
377 LogTrace(
"discriminate") <<
"adding charged iso cand with pt " << cand->pt() ;
378 isoCharged_.push_back(cand);
383 for(
auto const & cand : pfTau->isolationPFGammaCands() ) {
384 if (
qcuts_->filterCandRef(cand) ) {
385 LogTrace(
"discriminate") <<
"adding neutral iso cand with pt " << cand->pt() ;
386 isoNeutral_.push_back(cand);
401 std::vector<PFCandidatePtr> allPU =
405 std::vector<PFCandidatePtr> allNPU =
408 LogTrace(
"discriminate") <<
"After track cuts: " << allPU.size() ;
412 std::vector<PFCandidatePtr> cleanPU =
415 std::vector<PFCandidatePtr> cleanNPU =
418 LogTrace(
"discriminate") <<
"After cleaning cuts: " << cleanPU.size() ;
422 for (
auto const & cand : cleanPU ) {
423 if ( deltaBetaFilter(cand) ) isoPU_.push_back(cand);
426 for (
auto const & cand : cleanNPU ) {
427 if ( deltaBetaFilter(cand) ) chPV_.push_back(cand);
429 LogTrace(
"discriminate") <<
"After cone cuts: " << isoPU_.size() <<
" " << chPV_.size() ;
437 for (
auto const & isoObject : isoNeutral_ ) {
438 if ( isoObject->charge() != 0 ) {
440 isoNeutralWeight_.push_back(*isoObject);
444 double eta = isoObject->eta();
445 double phi = isoObject->phi();
450 if ( (sumNPU + sumPU) > 0 ) neutral.
setP4(((sumNPU)/(sumNPU + sumPU))*neutral.
p4());
452 isoNeutralWeight_.push_back(neutral);
460 std::vector<PFCandidatePtr> isoCharged_filter;
461 std::vector<PFCandidatePtr> isoNeutral_filter;
464 for(
auto const & isoObject : isoCharged_ ) {
465 if (
filter(isoObject) ) isoCharged_filter.push_back(isoObject);
468 for(
auto const & isoObject : isoNeutral_ ) {
469 if (
filter(isoObject) ) isoNeutral_filter.push_back(isoObject);
471 isoNeutral_ = isoNeutral_filter;
473 for(
auto const & isoObject : isoNeutralWeight_){
474 if ( filter2(isoObject) ) isoNeutralWeight_filter.push_back(isoObject);
476 isoNeutralWeight_ = isoNeutralWeight_filter;
478 isoCharged_ = isoCharged_filter;
481 bool failsOccupancyCut =
false;
482 bool failsSumPtCut =
false;
483 bool failsRelativeSumPtCut =
false;
486 int neutrals = isoNeutral_.size();
491 if ( neutrals < 0 ) {
495 size_t nOccupants = isoCharged_.size() + neutrals;
499 double footprintCorrection_value = 0.;
501 for ( std::vector<std::unique_ptr<FootprintCorrection> >::const_iterator footprintCorrection =
footprintCorrections_.begin();
503 if ( (*footprintCorrection)->selection_(*pfTau) ) {
504 footprintCorrection_value = (*footprintCorrection)->offset_(*pfTau);
513 double chargedPt = 0.;
514 double neutralPt = 0.;
515 double weightedNeutralPt = 0.;
516 for (
auto const & isoObject : isoCharged_ ) {
517 chargedPt += isoObject->pt();
520 for (
auto const & isoObject : isoNeutral_ ) {
521 neutralPt += isoObject->pt();
524 for (
auto const & isoObject : isoNeutralWeight_ ) {
525 weightedNeutralPt += isoObject.pt();
528 for (
auto const & isoObject : isoPU_ ) {
529 puPt += isoObject->pt();
531 LogTrace(
"discriminate") <<
"chargedPt = " << chargedPt ;
532 LogTrace(
"discriminate") <<
"neutralPt = " << neutralPt ;
533 LogTrace(
"discriminate") <<
"weighted neutral Pt = " << weightedNeutralPt ;
537 neutralPt = weightedNeutralPt;
545 neutralPt -= footprintCorrection_value;
552 if ( neutralPt < 0. ) {
556 totalPt = chargedPt + neutralPt;
565 bool failsPhotonPtSumOutsideSignalConeCut =
false;
566 double photonSumPt_outsideSignalCone = 0.;
568 const std::vector<reco::PFCandidatePtr>& signalPFGammas = pfTau->signalPFGammaCands();
569 for ( std::vector<reco::PFCandidatePtr>::const_iterator signalPFGamma = signalPFGammas.begin();
570 signalPFGamma != signalPFGammas.end(); ++signalPFGamma ) {
571 double dR =
deltaR(pfTau->eta(), pfTau->phi(), (*signalPFGamma)->eta(), (*signalPFGamma)->phi());
572 if ( dR > pfTau->signalConeSize() ) photonSumPt_outsideSignalCone += (*signalPFGamma)->pt();
575 failsPhotonPtSumOutsideSignalConeCut =
true;
594 return footprintCorrection_value;
596 return photonSumPt_outsideSignalCone;
598 return (fails ? 0. : 1.);
double weightedSum(std::vector< PFCandidatePtr > inColl_, double eta, double phi) const
bool isNonnull() const
Checks for non-null.
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsGeneralQCuts_
bool applyPhotonPtSumOutsideSignalConeCut_
virtual void setP4(const LorentzVector &p4)
set 4-momentum
double maximumRelativeSumPt_
bool applyRelativeSumPtCut_
double deltaBetaFactorThisEvent_
bool applyFootprintCorrection_
double offsetRelativeSumPt_
std::vector< std::unique_ptr< FootprintCorrection > > footprintCorrections_
std::vector< reco::PFCandidatePtr > chargedPFCandidatesInEvent_
bool storeRawFootprintCorrection_
std::auto_ptr< tau::RecoTauQualityCuts > qcuts_
std::auto_ptr< tau::RecoTauQualityCuts > pileupQcutsPUTrackSelection_
double deltaR(double eta1, double eta2, double phi1, double phi2)
double deltaBetaCollectionCone_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
uint32_t maximumOccupancy_
double maxRelPhotonSumPt_outsideSignalCone_
Particle reconstructed by the particle flow algorithm.
std::auto_ptr< tau::RecoTauVertexAssociator > vertexAssociator_
double maxAbsPhotonSumPt_outsideSignalCone_
bool storeRawPhotonSumPt_outsideSignalCone_
virtual const LorentzVector & p4() const
four-momentum Lorentz vector