From 6f399b3708d79b3f8b305733d0ebf9714b737f41 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 11:44:14 +0200 Subject: [PATCH 01/35] - dynamic strip reconstruction for Yuta - added Loose, Medium and Tight tau ID discriminators with pileup weighted isolation - removal of deprecated tau ID discriminators from pat::Taus --- DataFormats/TauReco/interface/PFTau.h | 15 +- DataFormats/TauReco/interface/RecoTauPiZero.h | 64 ++- DataFormats/TauReco/src/PFTau.cc | 28 +- DataFormats/TauReco/src/RecoTauPiZero.cc | 44 +- DataFormats/TauReco/src/classes_def_2.xml | 20 +- .../python/producersLayer1/tauProducer_cfi.py | 111 ++--- .../PatAlgos/python/tools/tauTools.py | 76 ++-- .../Configuration/python/HPSPFTaus_cff.py | 94 +++- .../RecoTau/interface/RecoTauConstructor.h | 13 +- .../PFRecoTauDiscriminationByHPSSelection.cc | 17 +- .../PFRecoTauDiscriminationByIsolation.cc | 197 ++++++--- .../RecoTauBuilderCombinatoricPlugin.cc | 100 +++-- ...uChargedHadronMultiplicityCleanerPlugin.cc | 50 +++ .../plugins/RecoTauPiZeroStripPlugin2.cc | 15 +- .../plugins/RecoTauPiZeroStripPlugin3.cc | 400 ++++++++++++++++++ ...RecoTauDiscriminationByHPSSelection_cfi.py | 1 - .../PFRecoTauDiscriminationByIsolation_cfi.py | 32 +- .../RecoTau/python/RecoTauCleanerPlugins.py | 5 + .../RecoTau/python/RecoTauCleaner_cfi.py | 57 ++- .../python/RecoTauCombinatoricProducer_cfi.py | 7 +- .../python/RecoTauPiZeroBuilderPlugins_cfi.py | 36 +- .../python/RecoTauPiZeroProducer_cfi.py | 6 +- RecoTauTag/RecoTau/src/RecoTauConstructor.cc | 73 +++- 23 files changed, 1110 insertions(+), 351 deletions(-) create mode 100644 RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc create mode 100644 RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc diff --git a/DataFormats/TauReco/interface/PFTau.h b/DataFormats/TauReco/interface/PFTau.h index 16b374e2450c0..e23dac4143d68 100644 --- a/DataFormats/TauReco/interface/PFTau.h +++ b/DataFormats/TauReco/interface/PFTau.h @@ -148,9 +148,16 @@ class PFTau : public BaseTau { /// Retrieve the identified hadronic decay mode according to the number of /// charged and piZero candidates in the signal cone hadronicDecayMode decayMode() const; - hadronicDecayMode calculateDecayMode() const; void setDecayMode(const hadronicDecayMode&); + /// Effect of eta and phi correction of strip on mass of tau candidate + double bendCorrMass() const { return bendCorrMass_; } + void setBendCorrMass(double bendCorrMass) { bendCorrMass_ = bendCorrMass; } + + /// Size of signal cone + double signalConeSize() const { return signalConeSize_; } + void setSignalConeSize(double signalConeSize) { signalConeSize_ = signalConeSize; } + //Electron rejection float emFraction() const; // Ecal/Hcal Cluster Energy float hcalTotOverPLead() const; // total Hcal Cluster E / leadPFChargedHadron P @@ -192,7 +199,7 @@ class PFTau : public BaseTau { CandidatePtr sourceCandidatePtr( size_type i ) const; /// prints information on this PFTau - void dump(std::ostream& out=std::cout) const; + void dump(std::ostream& out = std::cout) const; private: friend class tau::RecoTauConstructor; @@ -226,6 +233,10 @@ class PFTau : public BaseTau { hadronicDecayMode decayMode_; + float bendCorrMass_; + + float signalConeSize_; + reco::PFJetRef jetRef_; PFTauTagInfoRef PFTauTagInfoRef_; reco::PFCandidatePtr leadPFChargedHadrCand_; diff --git a/DataFormats/TauReco/interface/RecoTauPiZero.h b/DataFormats/TauReco/interface/RecoTauPiZero.h index 244f3077c555d..076d7de5e518d 100644 --- a/DataFormats/TauReco/interface/RecoTauPiZero.h +++ b/DataFormats/TauReco/interface/RecoTauPiZero.h @@ -14,32 +14,57 @@ class RecoTauPiZero : public CompositePtrCandidate { kStrips = 3 }; - RecoTauPiZero():CompositePtrCandidate(),algoName_(kUndefined){ - this->setPdgId(111); } - - RecoTauPiZero(PiZeroAlgorithm algoName): - CompositePtrCandidate(), algoName_(algoName) { this->setPdgId(111); } + RecoTauPiZero() + : CompositePtrCandidate(), + algoName_(kUndefined) + { + this->setPdgId(111); + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } + + RecoTauPiZero(PiZeroAlgorithm algoName) + : CompositePtrCandidate(), + algoName_(algoName) + { + this->setPdgId(111); + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// constructor from values RecoTauPiZero(Charge q, const LorentzVector& p4, const Point& vtx = Point( 0, 0, 0 ), int pdgId = 111, int status = 0, bool integerCharge = true, - PiZeroAlgorithm algoName=kUndefined): - CompositePtrCandidate( - q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {} + PiZeroAlgorithm algoName = kUndefined) + : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge ), + algoName_(algoName) + { + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// constructor from values RecoTauPiZero(Charge q, const PolarLorentzVector& p4, const Point& vtx = Point( 0, 0, 0 ), int pdgId = 111, int status = 0, bool integerCharge = true, - PiZeroAlgorithm algoName=kUndefined): - CompositePtrCandidate( - q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {} + PiZeroAlgorithm algoName=kUndefined) + : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge ), + algoName_(algoName) + { + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// constructor from a Candidate - explicit RecoTauPiZero( - const Candidate & p, PiZeroAlgorithm algoName=kUndefined): - CompositePtrCandidate(p),algoName_(algoName) { this->setPdgId(111); } + explicit RecoTauPiZero(const Candidate& p, PiZeroAlgorithm algoName = kUndefined) + : CompositePtrCandidate(p), + algoName_(algoName) + { + this->setPdgId(111); + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// destructor ~RecoTauPiZero(){}; @@ -62,11 +87,20 @@ class RecoTauPiZero : public CompositePtrCandidate { /// Check whether a given algo produced this pi zero bool algoIs(PiZeroAlgorithm algo) const; - void print(std::ostream& out=std::cout) const; + /// Size of correction to account for spread of photon energy in eta and phi + /// in case charged pions make nuclear interactions or photons convert within the tracking detector + float bendCorrEta() const { return bendCorrEta_; } + float bendCorrPhi() const { return bendCorrPhi_; } + void setBendCorrEta(float bendCorrEta) { bendCorrEta_ = bendCorrEta; } + void setBendCorrPhi(float bendCorrPhi) { bendCorrPhi_ = bendCorrPhi; } + + void print(std::ostream& out = std::cout) const; private: PiZeroAlgorithm algoName_; + float bendCorrEta_; + float bendCorrPhi_; }; std::ostream & operator<<(std::ostream& out, const RecoTauPiZero& c); diff --git a/DataFormats/TauReco/src/PFTau.cc b/DataFormats/TauReco/src/PFTau.cc index f67560341df95..bcc8d35364d9f 100644 --- a/DataFormats/TauReco/src/PFTau.cc +++ b/DataFormats/TauReco/src/PFTau.cc @@ -15,14 +15,15 @@ PFTau::PFTau() hcalTotOverPLead_ = NAN; hcalMaxOverPLead_ = NAN; hcal3x3OverPLead_ = NAN; - ecalStripSumEOverPLead_= NAN; + ecalStripSumEOverPLead_ = NAN; bremsRecoveryEOverPLead_ = NAN; electronPreIDOutput_ = NAN; - electronPreIDDecision_= NAN; + electronPreIDDecision_ = NAN; caloComp_ = NAN; segComp_ = NAN; muonDecision_ = NAN; - decayMode_=kNull; + decayMode_ = kNull; + bendCorrMass_ = 0.; } PFTau::PFTau(Charge q, const LorentzVector& p4, const Point& vtx) @@ -40,12 +41,13 @@ PFTau::PFTau(Charge q, const LorentzVector& p4, const Point& vtx) ecalStripSumEOverPLead_= NAN; bremsRecoveryEOverPLead_ = NAN; electronPreIDOutput_ = NAN; - electronPreIDDecision_= NAN; + electronPreIDDecision_ = NAN; caloComp_ = NAN; segComp_ = NAN; muonDecision_ = NAN; - decayMode_=kNull; + decayMode_ = kNull; + bendCorrMass_ = 0.; } PFTau* PFTau::clone() const { return new PFTau(*this); } @@ -177,22 +179,6 @@ void PFTau::setIsolationTauChargedHadronCandidatesRefs(const PFRecoTauChargedHad PFTau::hadronicDecayMode PFTau::decayMode() const { return decayMode_; } -PFTau::hadronicDecayMode PFTau::calculateDecayMode() const { - unsigned int nCharged = signalTauChargedHadronCandidates().size(); - unsigned int nPiZeros = signalPiZeroCandidates().size(); - // If no tracks exist, this is definitely not a tau! - if ( !nCharged ) return kNull; - // Find the maximum number of PiZeros our parameterization can hold - const unsigned int maxPiZeros = kOneProngNPiZero; - // Determine our track index - unsigned int trackIndex = (nCharged - 1)*(maxPiZeros + 1); - // Check if we handle the given number of tracks - if ( trackIndex >= kRareDecayMode ) return kRareDecayMode; - - if(nPiZeros>maxPiZeros) nPiZeros=maxPiZeros; - return static_cast(trackIndex + nPiZeros); -} - void PFTau::setDecayMode(const PFTau::hadronicDecayMode& dm){ decayMode_=dm;} // Setting information about the isolation region diff --git a/DataFormats/TauReco/src/RecoTauPiZero.cc b/DataFormats/TauReco/src/RecoTauPiZero.cc index 7b5fdf78dc7cb..a347175acc738 100644 --- a/DataFormats/TauReco/src/RecoTauPiZero.cc +++ b/DataFormats/TauReco/src/RecoTauPiZero.cc @@ -1,4 +1,5 @@ #include "DataFormats/TauReco/interface/RecoTauPiZero.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/Math/interface/deltaPhi.h" namespace reco { @@ -55,31 +56,30 @@ bool RecoTauPiZero::algoIs(RecoTauPiZero::PiZeroAlgorithm algo) const { return (algoName_ == algo); } -namespace { -std::ostream& operator<<(std::ostream& out, const reco::Candidate::LorentzVector& p4) +namespace { - out << "(mass/pt/eta/phi) (" << std::setiosflags(std::ios::fixed) << std::setprecision(2) - << p4.mass() << "/" << std::setprecision(1) << p4.pt() << "/" << std::setprecision(2) << p4.eta() - << "/" << std::setprecision(2) << p4.phi() << ")"; - return out; -} + std::string getPFCandidateType(reco::PFCandidate::ParticleType pfCandidateType) + { + if ( pfCandidateType == reco::PFCandidate::X ) return "undefined"; + else if ( pfCandidateType == reco::PFCandidate::h ) return "PFChargedHadron"; + else if ( pfCandidateType == reco::PFCandidate::e ) return "PFElectron"; + else if ( pfCandidateType == reco::PFCandidate::mu ) return "PFMuon"; + else if ( pfCandidateType == reco::PFCandidate::gamma ) return "PFGamma"; + else if ( pfCandidateType == reco::PFCandidate::h0 ) return "PFNeutralHadron"; + else if ( pfCandidateType == reco::PFCandidate::h_HF ) return "HF_had"; + else if ( pfCandidateType == reco::PFCandidate::egamma_HF ) return "HF_em"; + else assert(0); + } } -void RecoTauPiZero::print(std::ostream& out) const { - if (!out) return; - - out << "RecoTauPiZero: " << this->p4() << - " nDaughters: " << this->numberOfDaughters() << - " (gamma/e) (" << this->numberOfGammas() << "/" << this->numberOfElectrons() << ")" << - " maxDeltaPhi: " << std::setprecision(3) << maxDeltaPhi() << - " maxDeltaEta: " << std::setprecision(3) << maxDeltaEta() << - " algo: " << algo() << - std::endl; - - for(size_t i = 0; i < this->numberOfDaughters(); ++i) - { - out << "--- daughter " << i << ": " << daughterPtr(i)->p4() << - " key: " << daughterPtr(i).key() << std::endl; +void RecoTauPiZero::print(std::ostream& stream) const +{ + std::cout << "Pt = " << this->pt() << ", eta = " << this->eta() << ", phi = " << this->phi() << std::endl; + size_t numDaughters = this->numberOfDaughters(); + for ( size_t iDaughter = 0; iDaughter < numDaughters; ++iDaughter ) { + const reco::PFCandidate* daughter = dynamic_cast(this->daughterPtr(iDaughter).get()); + std::cout << " daughter #" << iDaughter << " (" << getPFCandidateType(daughter->particleId()) << "):" + << " Pt = " << daughter->pt() << ", eta = " << daughter->eta() << ", phi = " << daughter->phi() << std::endl; } } diff --git a/DataFormats/TauReco/src/classes_def_2.xml b/DataFormats/TauReco/src/classes_def_2.xml index 364601d4fe7c2..e64e3f8ff868c 100644 --- a/DataFormats/TauReco/src/classes_def_2.xml +++ b/DataFormats/TauReco/src/classes_def_2.xml @@ -1,19 +1,20 @@ - + + - - - - - - + + + + + + - + @@ -265,7 +266,8 @@ isolationTauChargedHadronCandidates_.clear(); - + + diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index 0e660c704fec0..3551bddd1467e 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -50,42 +50,12 @@ embedIsolationPFGammaCands = cms.bool(False), ## embed in AOD externally stored isolation PFGammaCandidates # embed IsoDeposits - isoDeposits = cms.PSet( - pfAllParticles = cms.InputTag("tauIsoDepositPFCandidates"), - pfChargedHadron = cms.InputTag("tauIsoDepositPFChargedHadrons"), - pfNeutralHadron = cms.InputTag("tauIsoDepositPFNeutralHadrons"), - pfGamma = cms.InputTag("tauIsoDepositPFGammas") - ), + isoDeposits = cms.PSet(), # user defined isolation variables the variables defined here will be accessible # via pat::Tau::userIsolation(IsolationKeys key) with the key as defined in # DataFormats/PatCandidates/interface/Isolation.h - # - # (set Pt thresholds for PFChargedHadrons (PFGammas) to 1.0 (1.5) GeV, - # matching the thresholds used when computing the tau iso. discriminators - # in RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py) - userIsolation = cms.PSet( - pfAllParticles = cms.PSet( - src = cms.InputTag("tauIsoDepositPFCandidates"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ), - pfChargedHadron = cms.PSet( - src = cms.InputTag("tauIsoDepositPFChargedHadrons"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ), - pfNeutralHadron = cms.PSet( - src = cms.InputTag("tauIsoDepositPFNeutralHadrons"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ), - pfGamma = cms.PSet( - src = cms.InputTag("tauIsoDepositPFGammas"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ) - ), + userIsolation = cms.PSet(), # tau ID (for efficiency studies) addTauID = cms.bool(True), @@ -95,22 +65,18 @@ # disk space decayModeFinding = cms.InputTag("hpsPFTauDiscriminationByDecayModeFinding"), decayModeFindingNewDMs =cms.InputTag("hpsPFTauDiscriminationByDecayModeFindingNewDMs"), -# decayModeFindingOldDMs = cms.InputTag("hpsPFTauDiscriminationByDecayModeFindingOldDMs"), - # byCombinedIsolationDeltaBetaCorrRaw = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr"), - # byVLooseCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr"), - # byLooseCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr"), - # byMediumCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr"), - # byTightCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr"), - chargedIsoPtSum = cms.InputTag("hpsPFTauMVA3IsolationChargedIsoPtSum"), - neutralIsoPtSum = cms.InputTag("hpsPFTauMVA3IsolationNeutralIsoPtSum"), - puCorrPtSum = cms.InputTag("hpsPFTauMVA3IsolationPUcorrPtSum"), - byIsolationMVA3oldDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw'), - byVLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT'), - byLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT'), - byMediumIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwoLT'), - byTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3oldDMwoLT'), - byVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwoLT'), - byVVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwoLT'), + chargedIsoPtSum = cms.InputTag("hpsPFTauChargedIsoPtSum"), + neutralIsoPtSum = cms.InputTag("hpsPFTauNeutralIsoPtSum"), + puCorrPtSum = cms.InputTag("hpsPFTauPUcorrPtSum"), + footprintCorrection = cms.InputTag("hpsPFTauFootprintCorrection"), + photonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauPhotonPtSumOutsideSignalCone"), + ##byIsolationMVA3oldDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw'), + ##byVLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT'), + ##byLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT'), + ##byMediumIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwoLT'), + ##byTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3oldDMwoLT'), + ##byVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwoLT'), + ##byVVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwoLT'), byIsolationMVA3oldDMwLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwLTraw'), byVLooseIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwLT'), byLooseIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwLT'), @@ -118,13 +84,13 @@ byTightIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3oldDMwLT'), byVTightIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwLT'), byVVTightIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwLT'), - byIsolationMVA3newDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3newDMwoLTraw'), - byVLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwoLT'), - byLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3newDMwoLT'), - byMediumIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3newDMwoLT'), - byTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3newDMwoLT'), - byVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3newDMwoLT'), - byVVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwoLT'), + ##byIsolationMVA3newDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3newDMwoLTraw'), + ##byVLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwoLT'), + ##byLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3newDMwoLT'), + ##byMediumIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3newDMwoLT'), + ##byTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3newDMwoLT'), + ##byVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3newDMwoLT'), + ##byVVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwoLT'), byIsolationMVA3newDMwLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3newDMwLTraw'), byVLooseIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwLT'), byLooseIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3newDMwLT'), @@ -132,25 +98,30 @@ byTightIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3newDMwLT'), byVTightIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3newDMwLT'), byVVTightIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT'), - againstElectronLoose = cms.InputTag("hpsPFTauDiscriminationByLooseElectronRejection"), - againstElectronMedium = cms.InputTag("hpsPFTauDiscriminationByMediumElectronRejection"), - againstElectronTight = cms.InputTag("hpsPFTauDiscriminationByTightElectronRejection"), - againstMuonLoose = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection"), - againstMuonMedium = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection"), - againstMuonTight = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection"), - againstMuonLoose2 = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection2"), - againstMuonMedium2 = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection2"), - againstMuonTight2 = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection2"), + ##againstElectronLoose = cms.InputTag("hpsPFTauDiscriminationByLooseElectronRejection"), + ##againstElectronMedium = cms.InputTag("hpsPFTauDiscriminationByMediumElectronRejection"), + ##againstElectronTight = cms.InputTag("hpsPFTauDiscriminationByTightElectronRejection"), + ##againstMuonLoose = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection"), + ##againstMuonMedium = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection"), + ##againstMuonTight = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection"), + ##againstMuonLoose2 = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection2"), + ##againstMuonMedium2 = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection2"), + ##againstMuonTight2 = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection2"), againstMuonLoose3 = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection3"), againstMuonTight3 = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection3"), - againstMuonMVAraw = cms.InputTag('hpsPFTauDiscriminationByMVArawMuonRejection'), - againstMuonLooseMVA = cms.InputTag('hpsPFTauDiscriminationByMVALooseMuonRejection'), - againstMuonMediumMVA = cms.InputTag('hpsPFTauDiscriminationByMVAMediumMuonRejection'), - againstMuonTightMVA = cms.InputTag('hpsPFTauDiscriminationByMVATightMuonRejection'), - byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), + ##againstMuonMVAraw = cms.InputTag('hpsPFTauDiscriminationByMVArawMuonRejection'), + ##againstMuonLooseMVA = cms.InputTag('hpsPFTauDiscriminationByMVALooseMuonRejection'), + ##againstMuonMediumMVA = cms.InputTag('hpsPFTauDiscriminationByMVAMediumMuonRejection'), + ##againstMuonTightMVA = cms.InputTag('hpsPFTauDiscriminationByMVATightMuonRejection'), byLooseCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"), byMediumCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), byTightCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), + byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), + byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + byMediumPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits"), + byTightPileupWeightedIsolationHits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), + byPhotonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone"), + byPileupWeightedIsolationRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits"), againstElectronMVA5raw = cms.InputTag("hpsPFTauDiscriminationByMVA5rawElectronRejection"), againstElectronMVA5category = cms.InputTag("hpsPFTauDiscriminationByMVA5rawElectronRejection:category"), againstElectronVLooseMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5VLooseElectronRejection"), @@ -158,7 +129,7 @@ againstElectronMediumMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5MediumElectronRejection"), againstElectronTightMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5TightElectronRejection"), againstElectronVTightMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5VTightElectronRejection"), -# againstElectronDeadECAL = cms.InputTag("hpsPFTauDiscriminationByDeadECALElectronRejection"), + ##againstElectronDeadECAL = cms.InputTag("hpsPFTauDiscriminationByDeadECALElectronRejection"), ), # mc matching configurables diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 167dce4cfe9b6..27aa7451c11ae 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -102,28 +102,28 @@ def _switchToPFTau(process, # Hadron-plus-strip(s) (HPS) Tau Discriminators hpsTauIDSources = [ ("decayModeFindingNewDMs", "DiscriminationByDecayModeFindingNewDMs"), - ("decayModeFindingOldDMs", "DiscriminationByDecayModeFindingOldDMs"), ("decayModeFinding", "DiscriminationByDecayModeFinding"), # CV: kept for backwards compatibility - ("byLooseIsolation", "DiscriminationByLooseIsolation"), - ("byVLooseCombinedIsolationDeltaBetaCorr", "DiscriminationByVLooseCombinedIsolationDBSumPtCorr"), - ("byLooseCombinedIsolationDeltaBetaCorr", "DiscriminationByLooseCombinedIsolationDBSumPtCorr"), - ("byMediumCombinedIsolationDeltaBetaCorr", "DiscriminationByMediumCombinedIsolationDBSumPtCorr"), - ("byTightCombinedIsolationDeltaBetaCorr", "DiscriminationByTightCombinedIsolationDBSumPtCorr"), - ("byCombinedIsolationDeltaBetaCorrRaw", "DiscriminationByRawCombinedIsolationDBSumPtCorr"), ("byLooseCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"), ("byMediumCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), ("byTightCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), ("byCombinedIsolationDeltaBetaCorrRaw3Hits", "DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), - ("chargedIsoPtSum", "MVA3IsolationChargedIsoPtSum"), - ("neutralIsoPtSum", "MVA3IsolationNeutralIsoPtSum"), - ("puCorrPtSum", "MVA3IsolationPUcorrPtSum"), - ("byIsolationMVA3oldDMwoLTraw", "DiscriminationByIsolationMVA3oldDMwoLTraw"), - ("byVLooseIsolationMVA3oldDMwoLT", "DiscriminationByVLooseIsolationMVA3oldDMwoLT"), - ("byLooseIsolationMVA3oldDMwoLT", "DiscriminationByLooseIsolationMVA3oldDMwoLT"), - ("byMediumIsolationMVA3oldDMwoLT", "DiscriminationByMediumIsolationMVA3oldDMwoLT"), - ("byTightIsolationMVA3oldDMwoLT", "DiscriminationByTightIsolationMVA3oldDMwoLT"), - ("byVTightIsolationMVA3oldDMwoLT", "DiscriminationByVTightIsolationMVA3oldDMwoLT"), - ("byVVTightIsolationMVA3oldDMwoLT", "DiscriminationByVVTightIsolationMVA3oldDMwoLT"), + ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + ("byMediumPileupWeightedIsolation3Hits", "DiscriminationByMediumPileupWeightedIsolation3Hits"), + ("byTightPileupWeightedIsolationHits", "DiscriminationByTightPileupWeightedIsolation3Hits"), + ("byPhotonPtSumOutsideSignalCone", "DiscriminationByPhotonPtSumOutsideSignalCone"), + ("byPileupWeightedIsolationRaw3Hits", "DiscriminationByRawPileupWeightedIsolation3Hits"), + ("chargedIsoPtSum", "ChargedIsoPtSum"), + ("neutralIsoPtSum", "NeutralIsoPtSum"), + ("puCorrPtSum", "PUcorrPtSum"), + ("footprintCorrection", "FootprintCorrection"), + ("photonPtSumOutsideSignalCone", "PhotonPtSumOutsideSignalCone"), + ##("byIsolationMVA3oldDMwoLTraw", "DiscriminationByIsolationMVA3oldDMwoLTraw"), + ##("byVLooseIsolationMVA3oldDMwoLT", "DiscriminationByVLooseIsolationMVA3oldDMwoLT"), + ##("byLooseIsolationMVA3oldDMwoLT", "DiscriminationByLooseIsolationMVA3oldDMwoLT"), + ##("byMediumIsolationMVA3oldDMwoLT", "DiscriminationByMediumIsolationMVA3oldDMwoLT"), + ##("byTightIsolationMVA3oldDMwoLT", "DiscriminationByTightIsolationMVA3oldDMwoLT"), + ##("byVTightIsolationMVA3oldDMwoLT", "DiscriminationByVTightIsolationMVA3oldDMwoLT"), + ##("byVVTightIsolationMVA3oldDMwoLT", "DiscriminationByVVTightIsolationMVA3oldDMwoLT"), ("byIsolationMVA3oldDMwLTraw", "DiscriminationByIsolationMVA3oldDMwLTraw"), ("byVLooseIsolationMVA3oldDMwLT", "DiscriminationByVLooseIsolationMVA3oldDMwLT"), ("byLooseIsolationMVA3oldDMwLT", "DiscriminationByLooseIsolationMVA3oldDMwLT"), @@ -132,12 +132,12 @@ def _switchToPFTau(process, ("byVTightIsolationMVA3oldDMwLT", "DiscriminationByVTightIsolationMVA3oldDMwLT"), ("byVVTightIsolationMVA3oldDMwLT", "DiscriminationByVVTightIsolationMVA3oldDMwLT"), ("byIsolationMVA3newDMwoLTraw", "DiscriminationByIsolationMVA3newDMwoLTraw"), - ("byVLooseIsolationMVA3newDMwoLT", "DiscriminationByVLooseIsolationMVA3newDMwoLT"), - ("byLooseIsolationMVA3newDMwoLT", "DiscriminationByLooseIsolationMVA3newDMwoLT"), - ("byMediumIsolationMVA3newDMwoLT", "DiscriminationByMediumIsolationMVA3newDMwoLT"), - ("byTightIsolationMVA3newDMwoLT", "DiscriminationByTightIsolationMVA3newDMwoLT"), - ("byVTightIsolationMVA3newDMwoLT", "DiscriminationByVTightIsolationMVA3newDMwoLT"), - ("byVVTightIsolationMVA3newDMwoLT", "DiscriminationByVVTightIsolationMVA3newDMwoLT"), + ##("byVLooseIsolationMVA3newDMwoLT", "DiscriminationByVLooseIsolationMVA3newDMwoLT"), + ##("byLooseIsolationMVA3newDMwoLT", "DiscriminationByLooseIsolationMVA3newDMwoLT"), + ##("byMediumIsolationMVA3newDMwoLT", "DiscriminationByMediumIsolationMVA3newDMwoLT"), + ##("byTightIsolationMVA3newDMwoLT", "DiscriminationByTightIsolationMVA3newDMwoLT"), + ##("byVTightIsolationMVA3newDMwoLT", "DiscriminationByVTightIsolationMVA3newDMwoLT"), + ##("byVVTightIsolationMVA3newDMwoLT", "DiscriminationByVVTightIsolationMVA3newDMwoLT"), ("byIsolationMVA3newDMwLTraw", "DiscriminationByIsolationMVA3newDMwLTraw"), ("byVLooseIsolationMVA3newDMwLT", "DiscriminationByVLooseIsolationMVA3newDMwLT"), ("byLooseIsolationMVA3newDMwLT", "DiscriminationByLooseIsolationMVA3newDMwLT"), @@ -145,9 +145,9 @@ def _switchToPFTau(process, ("byTightIsolationMVA3newDMwLT", "DiscriminationByTightIsolationMVA3newDMwLT"), ("byVTightIsolationMVA3newDMwLT", "DiscriminationByVTightIsolationMVA3newDMwLT"), ("byVVTightIsolationMVA3newDMwLT", "DiscriminationByVVTightIsolationMVA3newDMwLT"), - ("againstElectronLoose", "DiscriminationByLooseElectronRejection"), - ("againstElectronMedium", "DiscriminationByMediumElectronRejection"), - ("againstElectronTight", "DiscriminationByTightElectronRejection"), + ##("againstElectronLoose", "DiscriminationByLooseElectronRejection"), + ##("againstElectronMedium", "DiscriminationByMediumElectronRejection"), + ##("againstElectronTight", "DiscriminationByTightElectronRejection"), ("againstElectronMVA5raw", "DiscriminationByMVA5rawElectronRejection"), ("againstElectronMVA5category", "DiscriminationByMVA5rawElectronRejection:category"), ("againstElectronVLooseMVA5", "DiscriminationByMVA5VLooseElectronRejection"), @@ -155,20 +155,20 @@ def _switchToPFTau(process, ("againstElectronMediumMVA5", "DiscriminationByMVA5MediumElectronRejection"), ("againstElectronTightMVA5", "DiscriminationByMVA5TightElectronRejection"), ("againstElectronVTightMVA5", "DiscriminationByMVA5VTightElectronRejection"), - ("againstElectronDeadECAL", "DiscriminationByDeadECALElectronRejection"), - ("againstMuonLoose", "DiscriminationByLooseMuonRejection"), - ("againstMuonMedium", "DiscriminationByMediumMuonRejection"), - ("againstMuonTight", "DiscriminationByTightMuonRejection"), - ("againstMuonLoose2", "DiscriminationByLooseMuonRejection2"), - ("againstMuonMedium2", "DiscriminationByMediumMuonRejection2"), - ("againstMuonTight2", "DiscriminationByTightMuonRejection2"), + ##("againstElectronDeadECAL", "DiscriminationByDeadECALElectronRejection"), + ##("againstMuonLoose", "DiscriminationByLooseMuonRejection"), + ##("againstMuonMedium", "DiscriminationByMediumMuonRejection"), + ##("againstMuonTight", "DiscriminationByTightMuonRejection"), + ##("againstMuonLoose2", "DiscriminationByLooseMuonRejection2"), + ##("againstMuonMedium2", "DiscriminationByMediumMuonRejection2"), + ##("againstMuonTight2", "DiscriminationByTightMuonRejection2"), ("againstMuonLoose3", "DiscriminationByLooseMuonRejection3"), ("againstMuonTight3", "DiscriminationByTightMuonRejection3"), - ("againstMuonMVAraw", "DiscriminationByMVArawMuonRejection"), - ("againstMuonLooseMVA", "DiscriminationByMVALooseMuonRejection"), - ("againstMuonMediumMVA", "DiscriminationByMVAMediumMuonRejection"), - ("againstMuonTightMVA", "DiscriminationByMVATightMuonRejection") ] - + ##("againstMuonMVAraw", "DiscriminationByMVArawMuonRejection"), + ##("againstMuonLooseMVA", "DiscriminationByMVALooseMuonRejection"), + ##("againstMuonMediumMVA", "DiscriminationByMVAMediumMuonRejection"), + ##("againstMuonTightMVA", "DiscriminationByMVATightMuonRejection") + ] # switch to PFTau collection produced for fixed dR = 0.07 signal cone size def switchToPFTauFixedCone(process, diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 62c2dce2c1c6e..837522ce831f5 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -108,7 +108,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr = hpsPFTauDiscriminationByLooseIsolation.clone( deltaBetaPUTrackPtCutOverride = cms.double(0.5), @@ -118,7 +118,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr = hpsPFTauDiscriminationByMediumIsolation.clone( deltaBetaPUTrackPtCutOverride = cms.double(0.5), @@ -128,7 +128,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByTightIsolationDBSumPtCorr = hpsPFTauDiscriminationByTightIsolation.clone( deltaBetaPUTrackPtCutOverride = cms.double(0.5), @@ -138,7 +138,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByIsolationSeqDBSumPtCorr = cms.Sequence( hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr* @@ -549,18 +549,58 @@ hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits ) +hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( + ApplyDiscriminationByECALIsolation = cms.bool(False), + ApplyDiscriminationByWeightedECALIsolation = cms.bool(True), + UseAllPFCandsForWeights = cms.bool(True), + applyFootprintCorrection = cms.bool(True), + applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) +) + +hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + maximumSumPtCut = hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits.maximumSumPtCut +) + +hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + maximumSumPtCut = hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits.maximumSumPtCut +) + +hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + applySumPtCut = cms.bool(False) +) + +hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + Prediscriminants = cms.PSet( + BooleanOperator = cms.string("and"), + decayMode = cms.PSet( + Producer = cms.InputTag('hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone'), + cut = cms.double(0.5) + ) + ), + applySumPtCut = cms.bool(False), + storeRawSumPt = cms.bool(True) +) + +hpsPFTauDiscriminationByPileupWeightedIsolationSeq3Hits = cms.Sequence( + hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone* + hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits +) + # Define the HPS selection discriminator used in cleaning hpsSelectionDiscriminator.PFTauProducer = cms.InputTag("combinatoricRecoTaus") from RecoTauTag.RecoTau.RecoTauCleaner_cfi import RecoTauCleaner -hpsPFTauProducerSansRefs=RecoTauCleaner.clone( - src=cms.InputTag("combinatoricRecoTaus") +hpsPFTauProducerSansRefs = RecoTauCleaner.clone( + src = cms.InputTag("combinatoricRecoTaus") ) from RecoTauTag.RecoTau.RecoTauPiZeroUnembedder_cfi import RecoTauPiZeroUnembedder -hpsPFTauProducer=RecoTauPiZeroUnembedder.clone( - src = cms.InputTag("hpsPFTauProducerSansRefs") +hpsPFTauProducer = RecoTauPiZeroUnembedder.clone( + src = cms.InputTag("hpsPFTauProducerSansRefs") ) @@ -604,7 +644,7 @@ ) from RecoTauTag.RecoTau.PFRecoTauDiscriminationByMVAIsolation2_cff import * -hpsPFTauMVA3IsolationChargedIsoPtSum = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( +hpsPFTauChargedIsoPtSum = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( PFTauProducer = cms.InputTag('hpsPFTauProducer'), Prediscriminants = requireDecayMode.clone(), ApplyDiscriminationByECALIsolation = cms.bool(False), @@ -617,12 +657,12 @@ isoConeSizeForDeltaBeta = cms.double(0.8), verbosity = cms.int32(0) ) -hpsPFTauMVA3IsolationNeutralIsoPtSum = hpsPFTauMVA3IsolationChargedIsoPtSum.clone( +hpsPFTauNeutralIsoPtSum = hpsPFTauChargedIsoPtSum.clone( ApplyDiscriminationByECALIsolation = cms.bool(True), ApplyDiscriminationByTrackerIsolation = cms.bool(False), verbosity = cms.int32(0) ) -hpsPFTauMVA3IsolationPUcorrPtSum = hpsPFTauMVA3IsolationChargedIsoPtSum.clone( +hpsPFTauPUcorrPtSum = hpsPFTauChargedIsoPtSum.clone( ApplyDiscriminationByECALIsolation = cms.bool(False), ApplyDiscriminationByTrackerIsolation = cms.bool(False), applyDeltaBetaCorrection = cms.bool(True), @@ -630,12 +670,24 @@ storeRawPUsumPt = cms.bool(True), verbosity = cms.int32(0) ) -hpsPFTauMVA3IsolationNeutralIsoPtSumWeight = hpsPFTauMVA3IsolationChargedIsoPtSum.clone( +hpsPFTauNeutralIsoPtSumWeight = hpsPFTauChargedIsoPtSum.clone( ApplyDiscriminationByWeightedECALIsolation = cms.bool(True), ApplyDiscriminationByTrackerIsolation = cms.bool(False), UseAllPFCandsForWeights = cms.bool(True), verbosity = cms.int32(0) ) +hpsPFTauFootprintCorrection = hpsPFTauChargedIsoPtSum.clone( + ApplyDiscriminationByTrackerIsolation = cms.bool(False), + storeRawSumPt = cms.bool(False), + storeRawFootprintCorrection = cms.bool(True), + verbosity = cms.int32(0) +) +hpsPFTauPhotonPtSumOutsideSignalCone = hpsPFTauChargedIsoPtSum.clone( + ApplyDiscriminationByTrackerIsolation = cms.bool(False), + storeRawSumPt = cms.bool(False), + storeRawPhotonSumPt_outsideSignalCone = cms.bool(True), + verbosity = cms.int32(0) +) hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw = discriminationByIsolationMVA2raw.clone( PFTauProducer = cms.InputTag('hpsPFTauProducer'), @@ -644,9 +696,9 @@ mvaName = cms.string("RecoTauTag_tauIdMVAoldDMwoLTv1"), mvaOpt = cms.string("oldDMwoLT"), srcTauTransverseImpactParameters = cms.InputTag('hpsPFTauTransverseImpactParameters'), - srcChargedIsoPtSum = cms.InputTag('hpsPFTauMVA3IsolationChargedIsoPtSum'), - srcNeutralIsoPtSum = cms.InputTag('hpsPFTauMVA3IsolationNeutralIsoPtSum'), - srcPUcorrPtSum = cms.InputTag('hpsPFTauMVA3IsolationPUcorrPtSum'), + srcChargedIsoPtSum = cms.InputTag('hpsPFTauChargedIsoPtSum'), + srcNeutralIsoPtSum = cms.InputTag('hpsPFTauNeutralIsoPtSum'), + srcPUcorrPtSum = cms.InputTag('hpsPFTauPUcorrPtSum'), verbosity = cms.int32(0) ) hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT = discriminationByIsolationMVA2VLoose.clone( @@ -758,11 +810,12 @@ hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT = hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwLT.clone() hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAnewDMwLTv1_WPEff40") - hpsPFTauMVAIsolation2Seq = cms.Sequence( - hpsPFTauMVA3IsolationChargedIsoPtSum - + hpsPFTauMVA3IsolationNeutralIsoPtSum - + hpsPFTauMVA3IsolationPUcorrPtSum + hpsPFTauChargedIsoPtSum + + hpsPFTauNeutralIsoPtSum + + hpsPFTauPUcorrPtSum + + hpsPFTauFootprintCorrection + + hpsPFTauPhotonPtSumOutsideSignalCone + hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw + hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT + hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT @@ -813,13 +866,14 @@ #hpsPFTauDiscriminationByIsolationSeqRhoCorr* #hpsPFTauDiscriminationByIsolationSeqCustomRhoCorr* hpsPFTauDiscriminationByIsolationSeqDBSumPtCorr* - + hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr* hpsPFTauDiscriminationByRawChargedIsolationDBSumPtCorr* hpsPFTauDiscriminationByRawGammaIsolationDBSumPtCorr* hpsPFTauDiscriminationByCombinedIsolationSeqDBSumPtCorr* hpsPFTauDiscriminationByCombinedIsolationSeqDBSumPtCorr3Hits* + hpsPFTauDiscriminationByPileupWeightedIsolationSeq3Hits* hpsPFTauDiscriminationByLooseElectronRejection* hpsPFTauDiscriminationByMediumElectronRejection* diff --git a/RecoTauTag/RecoTau/interface/RecoTauConstructor.h b/RecoTauTag/RecoTau/interface/RecoTauConstructor.h index 7fa1345a471a0..1f68ca8a18822 100644 --- a/RecoTauTag/RecoTau/interface/RecoTauConstructor.h +++ b/RecoTauTag/RecoTau/interface/RecoTauConstructor.h @@ -30,6 +30,7 @@ #include "DataFormats/JetReco/interface/PFJetCollection.h" #include "DataFormats/TauReco/interface/PFRecoTauChargedHadron.h" #include "DataFormats/TauReco/interface/RecoTauPiZero.h" +#include "CommonTools/Utils/interface/StringObjectFunction.h" #include "boost/shared_ptr.hpp" #include @@ -53,7 +54,10 @@ class RecoTauConstructor { /// Constructor with PFCandidate Handle RecoTauConstructor(const PFJetRef& jetRef, const edm::Handle& pfCands, - bool copyGammasFromPiZeros=false); + bool copyGammasFromPiZeros = false, + const StringObjectFunction* signalConeSize = 0, + double minAbsPhotonSumPt_insideSignalCone = 2.5, double minRelPhotonSumPt_insideSignalCone = 0., + double minAbsPhotonSumPt_outsideSignalCone = 1.e+9, double minRelPhotonSumPt_outsideSignalCone = 1.e+9); /* * Code to set leading candidates. These are just wrappers about @@ -133,6 +137,13 @@ class RecoTauConstructor { typedef std::map SortedCollectionMap; bool copyGammas_; + + const StringObjectFunction* signalConeSize_; + double minAbsPhotonSumPt_insideSignalCone_; + double minRelPhotonSumPt_insideSignalCone_; + double minAbsPhotonSumPt_outsideSignalCone_; + double minRelPhotonSumPt_outsideSignalCone_; + // Retrieve collection associated to signal/iso and type std::vector* getCollection(Region region, ParticleType type); SortedListPtr getSortedCollection(Region region, ParticleType type); diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc index eed957de77242..41f001baf1806 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc @@ -47,7 +47,6 @@ class PFRecoTauDiscriminationByHPSSelection : public PFTauDiscriminationProducer typedef std::pair DoublePair; typedef std::map DecayModeCutMap; - TauFunc signalConeFun_; DecayModeCutMap decayModeCuts_; double matchingCone_; double minPt_; @@ -60,8 +59,7 @@ class PFRecoTauDiscriminationByHPSSelection : public PFTauDiscriminationProducer }; PFRecoTauDiscriminationByHPSSelection::PFRecoTauDiscriminationByHPSSelection(const edm::ParameterSet& pset) - : PFTauDiscriminationProducerBase(pset), - signalConeFun_(pset.getParameter("coneSizeFormula")) + : PFTauDiscriminationProducerBase(pset) { // Get the matchign cut matchingCone_ = pset.getParameter("matchingCone"); @@ -217,7 +215,7 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c // Check if tau fails mass cut double maxMass_value = (*massWindow.maxMass_)(*tau); - if ( tauP4.M() > maxMass_value || tauP4.M() < massWindow.minMass_ ) { + if ( !((tauP4.M() - tau->bendCorrMass()) < maxMass_value && (tauP4.M() + tau->bendCorrMass()) > massWindow.minMass_) ) { if ( verbosity_ ) { edm::LogPrint("PFTauByHPSSelect") << " fails tau mass-window cut." ; } @@ -243,7 +241,7 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c } // Check if tau passes cone cut - double cone_size = signalConeFun_(*tau); + double cone_size = tau->signalConeSize(); // Check if any charged objects fail the signal cone cut BOOST_FOREACH(const reco::PFRecoTauChargedHadron& cand, tau->signalTauChargedHadronCandidates()) { if ( verbosity_ ) { @@ -258,10 +256,13 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c } // Now check the pizeros BOOST_FOREACH(const reco::RecoTauPiZero& cand, tau->signalPiZeroCandidates()) { + double dEta = TMath::Max(0., fabs(cand.eta() - tauP4.eta()) - cand.bendCorrEta()); + double dPhi = TMath::Max(0., fabs(cand.phi() - tauP4.phi()) - cand.bendCorrPhi()); + double dR = sqrt(dEta*dEta + dPhi*dPhi); if ( verbosity_ ) { - edm::LogPrint("PFTauByHPSSelect") << "dR(tau, signalPiZero) = " << deltaR(cand.p4(), tauP4) ; + edm::LogPrint("PFTauByHPSSelect") << "dR(tau, signalPiZero) = " << dR ; } - if ( deltaR(cand.p4(), tauP4) > cone_size ) { + if ( dR > cone_size ) { if ( verbosity_ ) { edm::LogPrint("PFTauByHPSSelect") << " fails signal-cone cut for strip(s)." ; } @@ -287,7 +288,7 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c } } } - + if ( minPixelHits_ > 0 ) { int numPixelHits = 0; const std::vector& chargedHadrCands = tau->signalPFChargedHadrCands(); diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index 8738f1dbb6cb7..56c43cea2c984 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -4,6 +4,7 @@ #include "RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h" #include "RecoTauTag/RecoTau/interface/RecoTauVertexAssociator.h" #include "RecoTauTag/RecoTau/interface/ConeTools.h" +#include "CommonTools/Utils/interface/StringCutObjectSelector.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "TMath.h" @@ -56,6 +57,10 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas pset.getParameter("storeRawSumPt") : false; storeRawPUsumPt_ = pset.exists("storeRawPUsumPt") ? pset.getParameter("storeRawPUsumPt") : false; + storeRawFootprintCorrection_ = pset.exists("storeRawFootprintCorrection") ? + pset.getParameter("storeRawFootprintCorrection") : false; + storeRawPhotonSumPt_outsideSignalCone_ = pset.exists("storeRawPhotonSumPt_outsideSignalCone") ? + pset.getParameter("storeRawPhotonSumPt_outsideSignalCone") : false; // Sanity check on requested options. We can't apply cuts and store the // raw output at the same time @@ -77,12 +82,14 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas // Can only store one type int numStoreOptions = 0; - if ( storeRawSumPt_ ) ++numStoreOptions; - if ( storeRawOccupancy_ ) ++numStoreOptions; - if ( storeRawPUsumPt_ ) ++numStoreOptions; + if ( storeRawSumPt_ ) ++numStoreOptions; + if ( storeRawOccupancy_ ) ++numStoreOptions; + if ( storeRawPUsumPt_ ) ++numStoreOptions; + if ( storeRawFootprintCorrection_ ) ++numStoreOptions; + if ( storeRawPhotonSumPt_outsideSignalCone_ ) ++numStoreOptions; if ( numStoreOptions > 1 ) { throw cms::Exception("BadIsoConfig") - << "Both 'store sum pt' and 'store occupancy' options are set." + << "Multiple 'store sum pt' and/or 'store occupancy' options are set." << " These options are mutually exclusive."; } @@ -92,6 +99,22 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas customIsoCone_ = -1; } + applyPhotonPtSumOutsideSignalConeCut_ = pset.getParameter("applyPhotonPtSumOutsideSignalConeCut"); + maxAbsPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxAbsPhotonSumPt_outsideSignalCone"); + maxRelPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxRelPhotonSumPt_outsideSignalCone"); + + applyFootprintCorrection_ = pset.getParameter("applyFootprintCorrection"); + if ( applyFootprintCorrection_ ) { + edm::VParameterSet cfgFootprintCorrections = pset.getParameter("footprintCorrections"); + for ( edm::VParameterSet::const_iterator cfgFootprintCorrection = cfgFootprintCorrections.begin(); + cfgFootprintCorrection != cfgFootprintCorrections.end(); ++cfgFootprintCorrection ) { + std::string selection = cfgFootprintCorrection->getParameter("selection"); + double offset = cfgFootprintCorrection->getParameter("offset"); + footprintCorrectionType* footprintCorrection = new footprintCorrectionType(selection, offset); + footprintCorrections_.push_back(footprintCorrection); + } + } + // Get the quality cuts specific to the isolation region edm::ParameterSet isolationQCuts = qualityCutsPSet_.getParameterSet( "isolationQualityCuts"); @@ -99,7 +122,7 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas qcuts_.reset(new tau::RecoTauQualityCuts(isolationQCuts)); vertexAssociator_.reset( - new tau::RecoTauVertexAssociator(qualityCutsPSet_,consumesCollector())); + new tau::RecoTauVertexAssociator(qualityCutsPSet_,consumesCollector())); applyDeltaBeta_ = pset.exists("applyDeltaBetaCorrection") ? pset.getParameter("applyDeltaBetaCorrection") : false; @@ -157,7 +180,13 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas pset.getParameter("verbosity") : 0; } - ~PFRecoTauDiscriminationByIsolation(){} + ~PFRecoTauDiscriminationByIsolation() + { + for ( std::vector::iterator it = footprintCorrections_.begin(); + it != footprintCorrections_.end(); ++it ) { + delete (*it); + } + } void beginEvent(const edm::Event& evt, const edm::EventSetup& evtSetup) override; double discriminate(const PFTauRef& pfTau) const override; @@ -195,10 +224,29 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas double offsetRelativeSumPt_; double customIsoCone_; + bool applyPhotonPtSumOutsideSignalConeCut_; + double maxAbsPhotonSumPt_outsideSignalCone_; + double maxRelPhotonSumPt_outsideSignalCone_; + + bool applyFootprintCorrection_; + struct footprintCorrectionType + { + footprintCorrectionType(const std::string& selection, double offset) + : selection_(selection), + offset_(offset) + {} + ~footprintCorrectionType() {} + StringCutObjectSelector selection_; + double offset_; + }; + std::vector footprintCorrections_; + // Options to store the raw value in the discriminator instead of boolean pass/fail flag bool storeRawOccupancy_; bool storeRawSumPt_; bool storeRawPUsumPt_; + bool storeRawFootprintCorrection_; + bool storeRawPhotonSumPt_outsideSignalCone_; /* ********************************************************************** **** Pileup Subtraction Parameters *********************************** @@ -360,54 +408,51 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const LogTrace("discriminate") << "After track cuts: " << allPU.size() ; // Now apply the rest of the cuts, like pt, and TIP, tracker hits, etc - if(!useAllPFCands_){ - std::vector cleanPU = - pileupQcutsGeneralQCuts_->filterCandRefs(allPU); + if ( !useAllPFCands_ ) { + std::vector cleanPU = + pileupQcutsGeneralQCuts_->filterCandRefs(allPU); std::vector cleanNPU = pileupQcutsGeneralQCuts_->filterCandRefs(allNPU); - LogTrace("discriminate") << "After cleaning cuts: " << cleanPU.size() ; - - // Only select PU tracks inside the isolation cone. - DRFilter deltaBetaFilter(pfTau->p4(), 0, deltaBetaCollectionCone_); - for(auto const & cand : cleanPU) { - if ( deltaBetaFilter(cand) ) isoPU_.push_back(cand); - } - - for(auto const & cand : cleanNPU) { - if ( deltaBetaFilter(cand) ) chPV_.push_back(cand); + // Only select PU tracks inside the isolation cone. + DRFilter deltaBetaFilter(pfTau->p4(), 0, deltaBetaCollectionCone_); + for ( auto const & cand : cleanPU ) { + if ( deltaBetaFilter(cand) ) isoPU_.push_back(cand); + } + + for ( auto const & cand : cleanNPU ) { + if ( deltaBetaFilter(cand) ) chPV_.push_back(cand); } LogTrace("discriminate") << "After cone cuts: " << isoPU_.size() << " " << chPV_.size() ; - }else{ - isoPU_=allPU; - chPV_= allNPU; + } else { + isoPU_ = allPU; + chPV_ = allNPU; } } - if (calculateWeights_) - { - for( auto const & isoObject : isoNeutral_ ) { - if(isoObject->charge() !=0){ - // weight only neutral objects - isoNeutralWeight_.push_back(*isoObject); - continue; - } - - double eta=isoObject->eta(); - double phi=isoObject->phi(); - double sumNPU = 0.5*log(weightedSum(chPV_,eta,phi)); - - double sumPU = 0.5*log(weightedSum(isoPU_,eta,phi)); - PFCandidate neutral = *isoObject; - if (sumNPU+sumPU>0) neutral.setP4(((sumNPU)/(sumNPU+sumPU))*neutral.p4()); - - isoNeutralWeight_.push_back(neutral); - } + if ( calculateWeights_ ) { + for ( auto const & isoObject : isoNeutral_ ) { + if ( isoObject->charge() != 0 ) { + // weight only neutral objects + isoNeutralWeight_.push_back(*isoObject); + continue; } + double eta = isoObject->eta(); + double phi = isoObject->phi(); + double sumNPU = 0.5*log(weightedSum(chPV_, eta, phi)); + + double sumPU = 0.5*log(weightedSum(isoPU_, eta, phi)); + PFCandidate neutral = (*isoObject); + if ( (sumNPU + sumPU) > 0 ) neutral.setP4(((sumNPU)/(sumNPU + sumPU))*neutral.p4()); + + isoNeutralWeight_.push_back(neutral); + } + } + // Check if we want a custom iso cone if ( customIsoCone_ >= 0. ) { DRFilter filter(pfTau->p4(), 0, customIsoCone_); @@ -451,46 +496,59 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const failsOccupancyCut = ( nOccupants > maximumOccupancy_ ); - double totalPt = 0.0; - double puPt = 0.0; + double footprintCorrection_value = 0.; + if ( applyFootprintCorrection_ || storeRawFootprintCorrection_ ) { + for ( std::vector::const_iterator footprintCorrection = footprintCorrections_.begin(); + footprintCorrection != footprintCorrections_.end(); ++footprintCorrection ) { + if ( (*footprintCorrection)->selection_(*pfTau) ) footprintCorrection_value = (*footprintCorrection)->offset_; + } + } + + double totalPt = 0.; + double puPt = 0.; //--- Sum PT requirement if ( applySumPtCut_ || applyRelativeSumPtCut_ || storeRawSumPt_ || storeRawPUsumPt_ ) { double chargedPt = 0.0; double neutralPt = 0.0; double weightedNeutralPt = 0.0; - for( auto const & isoObject : isoCharged_ ) { + for ( auto const & isoObject : isoCharged_ ) { chargedPt += isoObject->pt(); } - if(!calculateWeights_){ - for( auto const & isoObject : isoNeutral_ ) { + if ( !calculateWeights_ ) { + for ( auto const & isoObject : isoNeutral_ ) { neutralPt += isoObject->pt(); } - }else{ - for( auto const & isoObject : isoNeutralWeight_){ - weightedNeutralPt+=isoObject.pt(); + } else { + for ( auto const & isoObject : isoNeutralWeight_ ) { + weightedNeutralPt += isoObject.pt(); } } - for( auto const & isoObject : isoPU_ ) { + for ( auto const & isoObject : isoPU_ ) { puPt += isoObject->pt(); } - LogTrace("discriminate") << "chargedPt = " << chargedPt ; - LogTrace("discriminate") << "neutralPt = " << neutralPt ; - LogTrace("discriminate") << "weighted neutral Pt = " << weightedNeutralPt ; - LogTrace("discriminate") << "puPt = " << puPt << " (delta-beta corr. = " << (deltaBetaFactorThisEvent_*puPt) << ")" ; - if( calculateWeights_) { + LogTrace("discriminate") << "chargedPt = " << chargedPt ; + LogTrace("discriminate") << "neutralPt = " << neutralPt ; + LogTrace("discriminate") << "weighted neutral Pt = " << weightedNeutralPt ; + LogTrace("discriminate") << "puPt = " << puPt << " (delta-beta corr. = " << (deltaBetaFactorThisEvent_*puPt) << ")" ; + + if ( calculateWeights_ ) { neutralPt = weightedNeutralPt; } if ( applyDeltaBeta_ ) { - neutralPt -= deltaBetaFactorThisEvent_*puPt; + neutralPt -= (deltaBetaFactorThisEvent_*puPt); } - + + if ( applyFootprintCorrection_ ) { + neutralPt -= footprintCorrection_value; + } + if ( applyRhoCorrection_ ) { neutralPt -= rhoThisEvent_; } - if ( neutralPt < 0.0 ) { - neutralPt = 0.0; + if ( neutralPt < 0. ) { + neutralPt = 0.; } totalPt = chargedPt + neutralPt; @@ -501,10 +559,25 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const //--- Relative Sum PT requirement failsRelativeSumPtCut = (totalPt > ((pfTau->pt() - offsetRelativeSumPt_)*maximumRelativeSumPt_)); } + + bool failsPhotonPtSumOutsideSignalConeCut = false; + double photonSumPt_outsideSignalCone = 0.; + if ( applyPhotonPtSumOutsideSignalConeCut_ || storeRawPhotonSumPt_outsideSignalCone_ ) { + const std::vector& signalPFGammas = pfTau->signalPFGammaCands(); + for ( std::vector::const_iterator signalPFGamma = signalPFGammas.begin(); + signalPFGamma != signalPFGammas.end(); ++signalPFGamma ) { + double dR = deltaR(pfTau->eta(), pfTau->phi(), (*signalPFGamma)->eta(), (*signalPFGamma)->phi()); + if ( dR > pfTau->signalConeSize() ) photonSumPt_outsideSignalCone += (*signalPFGamma)->pt(); + } + if ( photonSumPt_outsideSignalCone > maxAbsPhotonSumPt_outsideSignalCone_ || photonSumPt_outsideSignalCone > (maxRelPhotonSumPt_outsideSignalCone_*pfTau->pt()) ) { + failsPhotonPtSumOutsideSignalConeCut = true; + } + } bool fails = (applyOccupancyCut_ && failsOccupancyCut) || (applySumPtCut_ && failsSumPtCut) || - (applyRelativeSumPtCut_ && failsRelativeSumPtCut); + (applyRelativeSumPtCut_ && failsRelativeSumPtCut) || + (applyPhotonPtSumOutsideSignalConeCut_ && failsPhotonPtSumOutsideSignalConeCut); // We did error checking in the constructor, so this is safe. if ( storeRawSumPt_ ) { @@ -515,6 +588,10 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const else return 0.; } else if ( storeRawOccupancy_ ) { return nOccupants; + } else if ( storeRawFootprintCorrection_ ) { + return footprintCorrection_value; + } else if ( storeRawPhotonSumPt_outsideSignalCone_ ) { + return photonSumPt_outsideSignalCone; } else { return (fails ? 0. : 1.); } diff --git a/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc b/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc index 96edf7b7fc677..5aaaa268b0740 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc @@ -7,6 +7,8 @@ #include "RecoTauTag/RecoTau/interface/RecoTauCrossCleaning.h" #include "RecoTauTag/RecoTau/interface/ConeTools.h" +#include "CommonTools/Utils/interface/StringObjectFunction.h" + #include "DataFormats/TauReco/interface/PFTau.h" #include "DataFormats/TauReco/interface/PFRecoTauChargedHadron.h" #include "DataFormats/TauReco/interface/RecoTauPiZero.h" @@ -14,6 +16,8 @@ #include "RecoTauTag/RecoTau/interface/RecoTauConstructor.h" #include "RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h" +#include + namespace reco { namespace tau { typedef std::vector ChargedHadronList; @@ -47,13 +51,24 @@ class RecoTauBuilderCombinatoricPlugin : public RecoTauBuilderPlugin }; std::vector decayModesToBuild_; + StringObjectFunction signalConeSize_; + double minAbsPhotonSumPt_insideSignalCone_; + double minRelPhotonSumPt_insideSignalCone_; + double minAbsPhotonSumPt_outsideSignalCone_; + double minRelPhotonSumPt_outsideSignalCone_; + int verbosity_; }; RecoTauBuilderCombinatoricPlugin::RecoTauBuilderCombinatoricPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector && iC) : RecoTauBuilderPlugin(pset, std::move(iC)), qcuts_(pset.getParameterSet("qualityCuts").getParameterSet("signalQualityCuts")), - isolationConeSize_(pset.getParameter("isolationConeSize")) + isolationConeSize_(pset.getParameter("isolationConeSize")), + signalConeSize_(pset.getParameter("signalConeSize")), + minAbsPhotonSumPt_insideSignalCone_(pset.getParameter("minAbsPhotonSumPt_insideSignalCone")), + minRelPhotonSumPt_insideSignalCone_(pset.getParameter("minRelPhotonSumPt_insideSignalCone")), + minAbsPhotonSumPt_outsideSignalCone_(pset.getParameter("minAbsPhotonSumPt_outsideSignalCone")), + minRelPhotonSumPt_outsideSignalCone_(pset.getParameter("minRelPhotonSumPt_outsideSignalCone")) { typedef std::vector VPSet; const VPSet& decayModes = pset.getParameter("decayModes"); @@ -66,7 +81,7 @@ RecoTauBuilderCombinatoricPlugin::RecoTauBuilderCombinatoricPlugin(const edm::Pa info.maxPiZeros_ = decayMode->getParameter("maxPiZeros"); decayModesToBuild_.push_back(info); } - + verbosity_ = ( pset.exists("verbosity") ) ? pset.getParameter("verbosity") : 0; } @@ -144,17 +159,9 @@ namespace } }; - std::string getPFCandidateType(reco::PFCandidate::ParticleType pfCandidateType) + double square(double x) { - if ( pfCandidateType == reco::PFCandidate::X ) return "undefined"; - else if ( pfCandidateType == reco::PFCandidate::h ) return "PFChargedHadron"; - else if ( pfCandidateType == reco::PFCandidate::e ) return "PFElectron"; - else if ( pfCandidateType == reco::PFCandidate::mu ) return "PFMuon"; - else if ( pfCandidateType == reco::PFCandidate::gamma ) return "PFGamma"; - else if ( pfCandidateType == reco::PFCandidate::h0 ) return "PFNeutralHadron"; - else if ( pfCandidateType == reco::PFCandidate::h_HF ) return "HF_had"; - else if ( pfCandidateType == reco::PFCandidate::egamma_HF ) return "HF_em"; - else assert(0); + return x*x; } } @@ -195,20 +202,16 @@ RecoTauBuilderCombinatoricPlugin::operator()( idx = 0; for ( PiZeroList::const_iterator piZero = piZeros.begin(); piZero != piZeros.end(); ++piZero ) { - std::cout << "piZero #" << idx << ": Pt = " << piZero->pt() << ", eta = " << piZero->eta() << ", phi = " << piZero->phi() << std::endl; - size_t numDaughters = piZero->numberOfDaughters(); - for ( size_t iDaughter = 0; iDaughter < numDaughters; ++iDaughter ) { - const reco::PFCandidate* daughter = dynamic_cast(piZero->daughterPtr(iDaughter).get()); - std::cout << " daughter #" << iDaughter << " (" << getPFCandidateType(daughter->particleId()) << "):" - << " Pt = " << daughter->pt() << ", eta = " << daughter->eta() << ", phi = " << daughter->phi() << std::endl; - } + std::cout << "piZero #" << idx << ":" << std::endl; + piZero->print(std::cout); ++idx; } } PFCandPtrs pfchs = qcuts_.filterCandRefs(pfChargedCands(*jet)); PFCandPtrs pfnhs = qcuts_.filterCandRefs(pfCandidates(*jet, reco::PFCandidate::h0)); - + PFCandPtrs pfgammas = qcuts_.filterCandRefs(pfCandidates(*jet, reco::PFCandidate::gamma)); + /// Apply quality cuts to the regional junk around the jet. Note that the /// particle contents of the junk is exclusive to the jet content. PFCandPtrs regionalJunk = qcuts_.filterCandRefs(regionalExtras); @@ -222,8 +225,9 @@ RecoTauBuilderCombinatoricPlugin::operator()( size_t tracksToBuild = decayMode->nCharged_; if ( verbosity_ ) { std::cout << "piZerosToBuild = " << piZerosToBuild << std::endl; + std::cout << "#piZeros = " << piZeros.size() << std::endl; std::cout << "tracksToBuild = " << tracksToBuild << std::endl; - std::cout << "#chargedHadrons = " << chargedHadrons.size() << std::endl; + std::cout << "#chargedHadrons = " << chargedHadrons.size() << std::endl; } // Skip decay mode if jet doesn't have the multiplicity to support it @@ -271,7 +275,10 @@ RecoTauBuilderCombinatoricPlugin::operator()( for ( PiZeroCombo::iterator piZeroCombo = piZeroCombos.begin(); piZeroCombo != piZeroCombos.end(); ++piZeroCombo ) { // Output tau - RecoTauConstructor tau(jet, getPFCands(), true); + RecoTauConstructor tau( + jet, getPFCands(), true, + &signalConeSize_, + minAbsPhotonSumPt_insideSignalCone_, minRelPhotonSumPt_insideSignalCone_, minAbsPhotonSumPt_outsideSignalCone_, minRelPhotonSumPt_outsideSignalCone_); // Reserve space in our collections tau.reserve( RecoTauConstructor::kSignal, @@ -301,6 +308,16 @@ RecoTauBuilderCombinatoricPlugin::operator()( cleanIsolationPiZeros.push_back(precleanedPiZero); } } + if ( verbosity_ ) { + std::cout << "#cleanIsolationPiZeros = " << cleanIsolationPiZeros.size() << std::endl; + int idx = 0; + for ( PiZeroList::const_iterator piZero = cleanIsolationPiZeros.begin(); + piZero != cleanIsolationPiZeros.end(); ++piZero ) { + std::cout << "piZero #" << idx << ":" << std::endl; + piZero->print(std::cout); + ++idx; + } + } // FIXME - are all these reserves okay? will they get propagated to the // dataformat size if they are wrong? @@ -345,7 +362,7 @@ RecoTauBuilderCombinatoricPlugin::operator()( xclean::PredicateAND pfCandFilter_comboChargedHadrons(isolationConeFilter, pfChargedHadronXCleaner_comboChargedHadrons); // 2.) to select neutral PFCandidates within jet xclean::CrossCleanPtrs pfChargedHadronXCleaner_allChargedHadrons(chargedHadrons.begin(), chargedHadrons.end()); - xclean::CrossCleanPtrs piZeroXCleaner(cleanIsolationPiZeros.begin(), cleanIsolationPiZeros.end()); + xclean::CrossCleanPtrs piZeroXCleaner(piZeros.begin(), piZeros.end()); typedef xclean::PredicateAND, xclean::CrossCleanPtrs > pfCandXCleanerType; pfCandXCleanerType pfCandXCleaner_allChargedHadrons(pfChargedHadronXCleaner_allChargedHadrons, piZeroXCleaner); // And this cleaning filter predicate with our Iso cone filter @@ -429,6 +446,18 @@ RecoTauBuilderCombinatoricPlugin::operator()( boost::make_filter_iterator( pfChargedJunk, regionalJunk.end(), regionalJunk.end())); + // Add all PFGamma constituents of the jet that are not part of a PiZero + if ( verbosity_ >= 2 ) { + std::cout << "adding isolation PFGammas not considered in PiZeros:" << std::endl; + } + tau.addPFCands( + RecoTauConstructor::kIsolation, RecoTauConstructor::kGamma, + boost::make_filter_iterator( + pfCandFilter_allChargedHadrons, + pfgammas.begin(), pfgammas.end()), + boost::make_filter_iterator( + pfCandFilter_allChargedHadrons, + pfgammas.end(), pfgammas.end())); // Add all gammas that are in the iso cone but weren't in the // orginal PFJet tau.addPFCands( @@ -458,7 +487,30 @@ RecoTauBuilderCombinatoricPlugin::operator()( std::auto_ptr tauPtr = tau.get(true); - if ( primaryVertexRef.isNonnull() ) tauPtr->setVertex(primaryVertexRef->position()); + if ( primaryVertexRef.isNonnull() ) { + tauPtr->setVertex(primaryVertexRef->position()); + } + + double tauEn = tauPtr->energy(); + double tauPz = tauPtr->pz(); + const double chargedPionMass = 0.13957; // GeV + double tauMass = std::max(tauPtr->mass(), chargedPionMass); + double bendCorrMass2 = 0.; + const std::vector& piZeros = tauPtr->signalPiZeroCandidates(); + BOOST_FOREACH( const RecoTauPiZero& piZero, piZeros ) { + double piZeroEn = piZero.energy(); + double piZeroPx = piZero.px(); + double piZeroPy = piZero.py(); + double piZeroPz = piZero.pz(); + double tau_wo_piZeroPx = tauPtr->px() - piZeroPx; + double tau_wo_piZeroPy = tauPtr->py() - piZeroPy; + // CV: Compute effect of varying strip four-vector by eta and phi correction on tau mass + // (derrivative of tau mass by strip eta, phi has been computed using Mathematica) + bendCorrMass2 += square(((piZeroPz*tauEn - piZeroEn*tauPz)/tauMass)*piZero.bendCorrEta()); + bendCorrMass2 += square(((piZeroPy*tau_wo_piZeroPx - piZeroPx*tau_wo_piZeroPy)/tauMass)*piZero.bendCorrPhi()); + } + //edm::LogPrint("RecoTauBuilderCombinatoricPlugin") << "bendCorrMass2 = " << sqrt(bendCorrMass2) << std::endl; + tauPtr->setBendCorrMass(sqrt(bendCorrMass2)); output.push_back(tauPtr); } diff --git a/RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc b/RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc new file mode 100644 index 0000000000000..ce8688323ce77 --- /dev/null +++ b/RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc @@ -0,0 +1,50 @@ +/* + * RecoTauChargedHadronMultiplicityCleanerPlugin + * + * Author: Christian Veelken, NICPB Tallinn + * + * A reco tau cleaner plugin that ranks the PFTaus by the number of charged hadrons. + */ + +#include "RecoTauTag/RecoTau/interface/RecoTauBuilderPlugins.h" +#include "DataFormats/TauReco/interface/PFTauDiscriminator.h" + +namespace reco { namespace tau { + +class RecoTauChargedHadronMultiplicityCleanerPlugin : public RecoTauCleanerPlugin +{ + public: + RecoTauChargedHadronMultiplicityCleanerPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector&& iC); + virtual ~RecoTauChargedHadronMultiplicityCleanerPlugin(){} + + // Get ranking value for a given tau Ref + double operator()(const reco::PFTauRef&) const override; +}; + +RecoTauChargedHadronMultiplicityCleanerPlugin::RecoTauChargedHadronMultiplicityCleanerPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector&& iC) + : RecoTauCleanerPlugin(pset,std::move(iC)) +{} + +double RecoTauChargedHadronMultiplicityCleanerPlugin::operator()(const reco::PFTauRef& tau) const +{ + // Get the ranking value for this tau. + // N.B. lower value means more "tau like"! + double result = 0.; + const std::vector& chargedHadrons = tau->signalTauChargedHadronCandidates(); + for ( std::vector::const_iterator chargedHadron = chargedHadrons.begin(); + chargedHadron != chargedHadrons.end(); ++chargedHadron ) { + if ( chargedHadron->algo() == PFRecoTauChargedHadron::kChargedPFCandidate ) result -= 8.; + else if ( chargedHadron->algo() == PFRecoTauChargedHadron::kTrack ) result -= 4.; + else if ( chargedHadron->algo() == PFRecoTauChargedHadron::kPFNeutralHadron ) result -= 2.; + else result -= 1.; + } + return result; +} + +}} // end namespace reco::tau + +// Register our plugin +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_EDM_PLUGIN(RecoTauCleanerPluginFactory, + reco::tau::RecoTauChargedHadronMultiplicityCleanerPlugin, + "RecoTauChargedHadronMultiplicityCleanerPlugin"); diff --git a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc index 84bb16d88a94c..df052e5929f9c 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc @@ -170,15 +170,16 @@ void RecoTauPiZeroStripPlugin2::addCandsToStrip(RecoTauPiZero& strip, PFCandPtrs } } -void markCandsInStrip(std::vector& candFlags, const std::set& candIds) +namespace { - for ( std::set::const_iterator candId = candIds.begin(); - candId != candIds.end(); ++candId ) { - candFlags[*candId] = true; + void markCandsInStrip(std::vector& candFlags, const std::set& candIds) + { + for ( std::set::const_iterator candId = candIds.begin(); + candId != candIds.end(); ++candId ) { + candFlags[*candId] = true; + } } -} - -namespace { + inline const reco::TrackBaseRef getTrack(const PFCandidate& cand) { if ( cand.trackRef().isNonnull() ) return reco::TrackBaseRef(cand.trackRef()); diff --git a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc new file mode 100644 index 0000000000000..8616ee0e8c420 --- /dev/null +++ b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc @@ -0,0 +1,400 @@ +/* + * RecoTauPiZeroStripPlugin3 + * + * Merges PFGammas in a PFJet into Candidate piZeros defined as + * strips in eta-phi. + * + * Author: Michail Bachtis (University of Wisconsin) + * + * Code modifications: Evan Friis (UC Davis), + * Christian Veelken (LLR) + * + */ + +#include +#include + +#include "boost/bind.hpp" + +#include "RecoTauTag/RecoTau/interface/RecoTauPiZeroPlugins.h" + +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/TauReco/interface/RecoTauPiZero.h" +#include "DataFormats/JetReco/interface/PFJet.h" +#include "CommonTools/CandUtils/interface/AddFourMomenta.h" +#include "DataFormats/Math/interface/deltaPhi.h" + +#include "RecoTauTag/RecoTau/interface/RecoTauCommonUtilities.h" +#include "RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h" +#include "RecoTauTag/RecoTau/interface/RecoTauVertexAssociator.h" +#include "RecoTauTag/RecoTau/interface/CombinatoricGenerator.h" + +//------------------------------------------------------------------------------- +// CV: the following headers are needed only for debug print-out +#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" +#include "DataFormats/TrackReco/interface/Track.h" +//------------------------------------------------------------------------------- + +#include "TString.h" +#include "TFormula.h" + +namespace reco { namespace tau { + +namespace { + // Apply a hypothesis on the mass of the strips. + math::XYZTLorentzVector applyMassConstraint( + const math::XYZTLorentzVector& vec,double mass) { + double factor = sqrt(vec.energy()*vec.energy()-mass*mass)/vec.P(); + return math::XYZTLorentzVector( + vec.px()*factor,vec.py()*factor,vec.pz()*factor,vec.energy()); + } +} + +class RecoTauPiZeroStripPlugin3 : public RecoTauPiZeroBuilderPlugin +{ + public: + explicit RecoTauPiZeroStripPlugin3(const edm::ParameterSet&, edm::ConsumesCollector &&iC); + virtual ~RecoTauPiZeroStripPlugin3(); + // Return type is auto_ptr + return_type operator()(const reco::PFJet&) const override; + // Hook to update PV information + virtual void beginEvent() override; + + private: + typedef std::vector PFCandPtrs; + void addCandsToStrip(RecoTauPiZero&, PFCandPtrs&, const std::vector&, std::set&, bool&) const; + + RecoTauVertexAssociator vertexAssociator_; + + RecoTauQualityCuts* qcuts_; + bool applyElecTrackQcuts_; + double minGammaEtStripSeed_; + double minGammaEtStripAdd_; + + double minStripEt_; + + std::vector inputPdgIds_; // type of candidates to clusterize + TFormula* etaAssociationDistance_; // size of strip clustering window in eta direction + TFormula* phiAssociationDistance_; // size of strip clustering window in phi direction + + bool updateStripAfterEachDaughter_; + int maxStripBuildIterations_; + + // Parameters for build strip combinations + bool combineStrips_; + int maxStrips_; + double combinatoricStripMassHypo_; + + AddFourMomenta p4Builder_; + + int verbosity_; +}; + +namespace +{ + TFormula* makeFunction(const std::string& functionName, const edm::ParameterSet& pset) + { + TString formula = pset.getParameter("function"); + formula = formula.ReplaceAll("pT", "x"); + TFormula* function = new TFormula(functionName.data(), formula.Data()); + int numParameter = function->GetNpar(); + for ( int idxParameter = 0; idxParameter < numParameter; ++idxParameter ) { + std::string parameterName = Form("par%i", idxParameter); + double parameter = pset.getParameter(parameterName); + function->SetParameter(idxParameter, parameter); + } + return function; + } +} + +RecoTauPiZeroStripPlugin3::RecoTauPiZeroStripPlugin3(const edm::ParameterSet& pset, edm::ConsumesCollector &&iC) + : RecoTauPiZeroBuilderPlugin(pset, std::move(iC)), + vertexAssociator_(pset.getParameter("qualityCuts"), std::move(iC)), + qcuts_(0), + etaAssociationDistance_(0), + phiAssociationDistance_(0) +{ + minGammaEtStripSeed_ = pset.getParameter("minGammaEtStripSeed"); + minGammaEtStripAdd_ = pset.getParameter("minGammaEtStripAdd"); + + minStripEt_ = pset.getParameter("minStripEt"); + + edm::ParameterSet qcuts_pset = pset.getParameterSet("qualityCuts").getParameterSet("signalQualityCuts"); +//------------------------------------------------------------------------------- +// CV: disable track quality cuts for PFElectronsPFElectron +// (treat PFElectrons like PFGammas for the purpose of building eta-phi strips) + applyElecTrackQcuts_ = pset.getParameter("applyElecTrackQcuts"); + if ( !applyElecTrackQcuts_ ) { + qcuts_pset.addParameter("minTrackPt", std::min(minGammaEtStripSeed_, minGammaEtStripAdd_)); + qcuts_pset.addParameter("maxTrackChi2", 1.e+9); + qcuts_pset.addParameter("maxTransverseImpactParameter", 1.e+9); + qcuts_pset.addParameter("maxDeltaZ", 1.e+9); + qcuts_pset.addParameter("minTrackVertexWeight", -1.); + qcuts_pset.addParameter("minTrackPixelHits", 0); + qcuts_pset.addParameter("minTrackHits", 0); + } +//------------------------------------------------------------------------------- + qcuts_pset.addParameter("minGammaEt", std::min(minGammaEtStripSeed_, minGammaEtStripAdd_)); + qcuts_ = new RecoTauQualityCuts(qcuts_pset); + + inputPdgIds_ = pset.getParameter >("stripCandidatesParticleIds"); + edm::ParameterSet stripSize_eta_pset = pset.getParameterSet("stripEtaAssociationDistance"); + etaAssociationDistance_ = makeFunction("etaAssociationDistance", stripSize_eta_pset); + edm::ParameterSet stripSize_phi_pset = pset.getParameterSet("stripPhiAssociationDistance"); + phiAssociationDistance_ = makeFunction("phiAssociationDistance", stripSize_phi_pset); + + updateStripAfterEachDaughter_ = pset.getParameter("updateStripAfterEachDaughter"); + maxStripBuildIterations_ = pset.getParameter("maxStripBuildIterations"); + + combineStrips_ = pset.getParameter("makeCombinatoricStrips"); + if ( combineStrips_ ) { + maxStrips_ = pset.getParameter("maxInputStrips"); + combinatoricStripMassHypo_ = pset.getParameter("stripMassWhenCombining"); + } + + verbosity_ = ( pset.exists("verbosity") ) ? + pset.getParameter("verbosity") : 0; +} + +RecoTauPiZeroStripPlugin3::~RecoTauPiZeroStripPlugin3() +{ + delete qcuts_; + delete etaAssociationDistance_; + delete phiAssociationDistance_; +} + +// Update the primary vertex +void RecoTauPiZeroStripPlugin3::beginEvent() +{ + vertexAssociator_.setEvent(*evt()); +} + +void RecoTauPiZeroStripPlugin3::addCandsToStrip(RecoTauPiZero& strip, PFCandPtrs& cands, const std::vector& candFlags, + std::set& candIdsCurrentStrip, bool& isCandAdded) const +{ + if ( verbosity_ >= 1 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << ":" ; + } + size_t numCands = cands.size(); + for ( size_t candId = 0; candId < numCands; ++candId ) { + if ( (!candFlags[candId]) && candIdsCurrentStrip.find(candId) == candIdsCurrentStrip.end() ) { // do not include same cand twice + reco::PFCandidatePtr cand = cands[candId]; + double etaAssociationDistance_value = etaAssociationDistance_->Eval(strip.pt()) + etaAssociationDistance_->Eval(cand->pt()); + double phiAssociationDistance_value = phiAssociationDistance_->Eval(strip.pt()) + phiAssociationDistance_->Eval(cand->pt()); + if ( fabs(strip.eta() - cand->eta()) < etaAssociationDistance_value && // check if cand is within eta-phi window centered on strip + fabs(strip.phi() - cand->phi()) < phiAssociationDistance_value ) { + if ( verbosity_ >= 2 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "--> adding PFCand #" << candId << " (" << cand.id() << ":" << cand.key() << "): Et = " << cand->et() << ", eta = " << cand->eta() << ", phi = " << cand->phi() ; + } + strip.addDaughter(cand); + if ( updateStripAfterEachDaughter_ ) p4Builder_.set(strip); + isCandAdded = true; + candIdsCurrentStrip.insert(candId); + } + } + } +} + +namespace +{ + void markCandsInStrip(std::vector& candFlags, const std::set& candIds) + { + for ( std::set::const_iterator candId = candIds.begin(); + candId != candIds.end(); ++candId ) { + candFlags[*candId] = true; + } + } + + inline const reco::TrackBaseRef getTrack(const PFCandidate& cand) + { + if ( cand.trackRef().isNonnull() ) return reco::TrackBaseRef(cand.trackRef()); + else if ( cand.gsfTrackRef().isNonnull() ) return reco::TrackBaseRef(cand.gsfTrackRef()); + else return reco::TrackBaseRef(); + } +} + +RecoTauPiZeroStripPlugin3::return_type RecoTauPiZeroStripPlugin3::operator()(const reco::PFJet& jet) const +{ + if ( verbosity_ >= 1 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << ":" ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " minGammaEtStripSeed = " << minGammaEtStripSeed_ ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " minGammaEtStripAdd = " << minGammaEtStripAdd_ ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " minStripEt = " << minStripEt_ ; + } + + PiZeroVector output; + + // Get the candidates passing our quality cuts + qcuts_->setPV(vertexAssociator_.associatedVertex(jet)); + PFCandPtrs candsVector = qcuts_->filterCandRefs(pfCandidates(jet, inputPdgIds_)); + + // Convert to stl::list to allow fast deletions + PFCandPtrs seedCands; + PFCandPtrs addCands; + int idx = 0; + for ( PFCandPtrs::iterator cand = candsVector.begin(); + cand != candsVector.end(); ++cand ) { + if ( verbosity_ >= 1 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "PFGamma #" << idx << " (" << cand->id() << ":" << cand->key() << "): Et = " << (*cand)->et() << ", eta = " << (*cand)->eta() << ", phi = " << (*cand)->phi() ; + } + if ( (*cand)->et() > minGammaEtStripSeed_ ) { + if ( verbosity_ >= 2 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "--> assigning seedCandId = " << seedCands.size() ; + const reco::TrackBaseRef candTrack = getTrack(*cand); + if ( candTrack.isNonnull() ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "track: Pt = " << candTrack->pt() << " eta = " << candTrack->eta() << ", phi = " << candTrack->phi() << ", charge = " << candTrack->charge() ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " (dZ = " << candTrack->dz(vertexAssociator_.associatedVertex(jet)->position()) << ", dXY = " << candTrack->dxy(vertexAssociator_.associatedVertex(jet)->position()) << "," + << " numHits = " << candTrack->hitPattern().numberOfValidTrackerHits() << ", numPxlHits = " << candTrack->hitPattern().numberOfValidPixelHits() << "," + << " chi2 = " << candTrack->normalizedChi2() << ", dPt/Pt = " << (candTrack->ptError()/candTrack->pt()) << ")" ; + } + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "ECAL Et: calibrated = " << (*cand)->ecalEnergy()*sin((*cand)->theta()) << "," + << " raw = " << (*cand)->rawEcalEnergy()*sin((*cand)->theta()) ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "HCAL Et: calibrated = " << (*cand)->hcalEnergy()*sin((*cand)->theta()) << "," + << " raw = " << (*cand)->rawHcalEnergy()*sin((*cand)->theta()) ; + } + seedCands.push_back(*cand); + } else if ( (*cand)->et() > minGammaEtStripAdd_ ) { + if ( verbosity_ >= 2 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "--> assigning addCandId = " << addCands.size() ; + } + addCands.push_back(*cand); + } + ++idx; + } + + std::vector seedCandFlags(seedCands.size()); // true/false: seedCand is already/not yet included in strip + std::vector addCandFlags(addCands.size()); // true/false: addCand is already/not yet included in strip + + std::set seedCandIdsCurrentStrip; + std::set addCandIdsCurrentStrip; + + size_t idxSeed = 0; + while ( idxSeed < seedCands.size() ) { + if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << "processing seed #" << idxSeed ; + + seedCandIdsCurrentStrip.clear(); + addCandIdsCurrentStrip.clear(); + + std::auto_ptr strip(new RecoTauPiZero(*seedCands[idxSeed], RecoTauPiZero::kStrips)); + strip->addDaughter(seedCands[idxSeed]); + seedCandIdsCurrentStrip.insert(idxSeed); + + bool isCandAdded; + int stripBuildIteration = 0; + do { + isCandAdded = false; + + //if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << " adding seedCands to strip..." ; + addCandsToStrip(*strip, seedCands, seedCandFlags, seedCandIdsCurrentStrip, isCandAdded); + //if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << " adding addCands to strip..." ; + addCandsToStrip(*strip, addCands, addCandFlags, addCandIdsCurrentStrip, isCandAdded); + + if ( !updateStripAfterEachDaughter_ ) p4Builder_.set(*strip); + + ++stripBuildIteration; + } while ( isCandAdded && (stripBuildIteration < maxStripBuildIterations_ || maxStripBuildIterations_ == -1) ); + + if ( strip->et() > minStripEt_ ) { // strip passed Et cuts, add it to the event + if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << "Building strip: Et = " << strip->et() << ", eta = " << strip->eta() << ", phi = " << strip->phi() ; + + // Update the vertex + if ( strip->daughterPtr(0).isNonnull() ) strip->setVertex(strip->daughterPtr(0)->vertex()); + output.push_back(strip); + + // Mark daughters as being part of this strip + markCandsInStrip(seedCandFlags, seedCandIdsCurrentStrip); + markCandsInStrip(addCandFlags, addCandIdsCurrentStrip); + } else { // strip failed Et cuts, just skip it + if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << "Discarding strip: Et = " << strip->et() << ", eta = " << strip->eta() << ", phi = " << strip->phi() ; + } + + ++idxSeed; + while ( idxSeed < seedCands.size() && seedCandFlags[idxSeed] ) { + ++idxSeed; // fast-forward to next seed cand not yet included in any strip + } + } + + // Check if we want to combine our strips + if ( combineStrips_ && output.size() > 1 ) { + PiZeroVector stripCombinations; + // Sort the output by descending pt + output.sort(output.begin(), output.end(), + boost::bind(&RecoTauPiZero::pt, _1) > + boost::bind(&RecoTauPiZero::pt, _2)); + // Get the end of interesting set of strips to try and combine + PiZeroVector::const_iterator end_iter = takeNElements( + output.begin(), output.end(), maxStrips_); + + // Look at all the combinations + for ( PiZeroVector::const_iterator first = output.begin(); + first != end_iter-1; ++first ) { + for ( PiZeroVector::const_iterator second = first+1; + second != end_iter; ++second ) { + Candidate::LorentzVector firstP4 = first->p4(); + Candidate::LorentzVector secondP4 = second->p4(); + // If we assume a certain mass for each strip apply it here. + firstP4 = applyMassConstraint(firstP4, combinatoricStripMassHypo_); + secondP4 = applyMassConstraint(secondP4, combinatoricStripMassHypo_); + Candidate::LorentzVector totalP4 = firstP4 + secondP4; + // Make our new combined strip + std::auto_ptr combinedStrips( + new RecoTauPiZero(0, totalP4, + Candidate::Point(0, 0, 0), + //111, 10001, true, RecoTauPiZero::kCombinatoricStrips)); + 111, 10001, true, RecoTauPiZero::kUndefined)); + + // Now loop over the strip members + BOOST_FOREACH(const RecoTauPiZero::daughters::value_type& gamma, + first->daughterPtrVector()) { + combinedStrips->addDaughter(gamma); + } + BOOST_FOREACH(const RecoTauPiZero::daughters::value_type& gamma, + second->daughterPtrVector()) { + combinedStrips->addDaughter(gamma); + } + // Update the vertex + if ( combinedStrips->daughterPtr(0).isNonnull() ) { + combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex()); + } + + // Add to our collection of combined strips + stripCombinations.push_back(combinedStrips); + } + } + // When done doing all the combinations, add the combined strips to the + // output. + output.transfer(output.end(), stripCombinations); + } + + // Compute correction to account for spread of photon energy in eta and phi + // in case charged pions make nuclear interactions or photons convert within the tracking detector + for ( PiZeroVector::iterator strip = output.begin(); + strip != output.end(); ++strip ) { + double bendCorrEta = 0.; + double bendCorrPhi = 0.; + double energySum = 0.; + BOOST_FOREACH(const RecoTauPiZero::daughters::value_type& gamma, + strip->daughterPtrVector()) { + bendCorrEta += (gamma->energy()*etaAssociationDistance_->Eval(gamma->pt())); + bendCorrPhi += (gamma->energy()*phiAssociationDistance_->Eval(gamma->pt())); + energySum += gamma->energy(); + } + if ( energySum > 1.e-2 ) { + bendCorrEta /= energySum; + bendCorrPhi /= energySum; + } + //std::cout << "stripPt = " << strip->pt() << ": bendCorrEta = " << bendCorrEta << ", bendCorrPhi = " << bendCorrPhi << std::endl; + strip->setBendCorrEta(bendCorrEta); + strip->setBendCorrPhi(bendCorrPhi); + } + + return output.release(); +} +}} // end namespace reco::tau + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_EDM_PLUGIN(RecoTauPiZeroBuilderPluginFactory, + reco::tau::RecoTauPiZeroStripPlugin3, "RecoTauPiZeroStripPlugin3"); diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py index b696df359b875..48f680f011703 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py @@ -66,7 +66,6 @@ Prediscriminants = noPrediscriminants, matchingCone = PFRecoTauPFJetInputs.jetConeSize, minTauPt = cms.double(0.0), - coneSizeFormula = cms.string("max(min(0.1, 3.0/pt()), 0.05)"), decayModes = cms.VPSet( decayMode_1Prong0Pi0, decayMode_1Prong1Pi0, diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index d395f033c7609..8c9d929732bbf 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -26,13 +26,16 @@ relativeSumPtCut = cms.double(0.0), relativeSumPtOffset = cms.double(0.0), - qualityCuts = PFTauQualityCuts,# set the standard quality cuts + applyPhotonPtSumOutsideSignalConeCut = cms.bool(False), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.20), + + qualityCuts = PFTauQualityCuts, # set the standard quality cuts # Delta-Beta corrections to remove Pileup applyDeltaBetaCorrection = cms.bool(False), particleFlowSrc = cms.InputTag("particleFlow"), vertexSrc = PFTauQualityCuts.primaryVertexSrc, - # This must correspond to the cone size of the algorithm which built the # tau. (or if customOuterCone option is used, the custom cone size) isoConeSizeForDeltaBeta = cms.double(0.5), @@ -47,6 +50,31 @@ # Uncommenting the parameter below allows this threshold to be overridden. #deltaBetaPUTrackPtCutOverride = cms.double(1.5), + # Tau footprint correction + applyFootprintCorrection = cms.bool(False), + footprintCorrections = cms.VPSet( + cms.PSet( + selection = cms.string("decayMode() = 0"), + offset = cms.double(1.8) + ), + cms.PSet( + selection = cms.string("decayMode() = 1 || decayMode() = 2"), + offset = cms.double(1.5) + ), + cms.PSet( + selection = cms.string("decayMode() = 5"), + offset = cms.double(4.7) + ), + cms.PSet( + selection = cms.string("decayMode() = 6"), + offset = cms.double(1.9) + ), + cms.PSet( + selection = cms.string("decayMode() = 10"), + offset = cms.double(2.0) + ) + ), + # Rho corrections applyRhoCorrection = cms.bool(False), rhoProducer = cms.InputTag("fixedGridRhoFastjetAll"), diff --git a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py index c6bfc1c13f4fa..09687d9dfa2ac 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py @@ -60,6 +60,11 @@ tolerance = cms.double(1.e-2) # CV: consider candidates with almost equal pT to be of the same rank (to avoid sensitivity to rounding errors) ) +chargedHadronMultiplicity = cms.PSet( + name = cms.string("ChargedHadronMultiplicity"), + plugin = cms.string("RecoTauChargedHadronMultiplicityCleanerPlugin") +) + stripMultiplicity = cms.PSet( name = cms.string("StripMultiplicity"), plugin = cms.string("RecoTauStringCleanerPlugin"), diff --git a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py index f990d3c474231..30d65dd479550 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py @@ -2,36 +2,27 @@ import RecoTauTag.RecoTau.RecoTauCleanerPlugins as cleaners -RecoTauCleaner = cms.EDProducer( - "RecoTauCleaner", - src = cms.InputTag("combinatoricRecoTaus"), - cleaners = cms.VPSet( - # Reject taus that have charge == 3 - cleaners.unitCharge, - # Ignore taus reconstructed in pi0 decay modes in which the highest Pt ("leading") pi0 has pt below 2.5 GeV - # (in order to make decay mode reconstruction less sensitive to pile-up) - # NOTE: strips are sorted by decreasing pt - cms.PSet( - name = cms.string("leadStripPtLt2_5"), - plugin = cms.string("RecoTauStringCleanerPlugin"), - selection = cms.string("signalPiZeroCandidates().size() = 0 | signalPiZeroCandidates()[0].pt() > 2.5"), - selectionPassFunction = cms.string("0"), - selectionFailValue = cms.double(1e3) - ), - # Reject taus that are not within DR<0.1 of the jet axis - #cleaners.matchingConeCut, - # Reject taus that fail HPS selections - cms.PSet( - name = cms.string("HPS_Select"), - plugin = cms.string("RecoTauDiscriminantCleanerPlugin"), - src = cms.InputTag("hpsSelectionDiscriminator"), - ), - # CV: Take highes pT tau (use for testing of new high pT tau reconstruction and check if it can become the new default) - cleaners.pt, - # CV: in case two candidates have the same Pt, - # prefer candidates in which PFGammas are part of strips (rather than being merged with PFRecoTauChargedHadrons) - cleaners.stripMultiplicity, - # Take most isolated tau - cleaners.combinedIsolation - ) - ) +RecoTauCleaner = cms.EDProducer("RecoTauCleaner", + src = cms.InputTag("combinatoricRecoTaus"), + cleaners = cms.VPSet( + # Reject taus that have charge == 3 + cleaners.unitCharge, + # Reject taus that are not within DR<0.1 of the jet axis + #cleaners.matchingConeCut, + # Reject taus that fail HPS selections + cms.PSet( + name = cms.string("HPS_Select"), + plugin = cms.string("RecoTauDiscriminantCleanerPlugin"), + src = cms.InputTag("hpsSelectionDiscriminator"), + ), + # CV: prefer 3-prong candidates over 2-prong candidates and 2-prong candidates over 1-prong candidates + cleaners.chargedHadronMultiplicity, + # CV: Take highest pT tau (use for testing of new high pT tau reconstruction and check if it can become the new default) + cleaners.pt, + # CV: in case two candidates have the same Pt, + # prefer candidates in which PFGammas are part of strips (rather than being merged with PFRecoTauChargedHadrons) + cleaners.stripMultiplicity, + # Take most isolated tau + cleaners.combinedIsolation + ) +) diff --git a/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py b/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py index 8a39046ee66d8..8023b7b429927 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py @@ -83,7 +83,12 @@ combinatoricDecayModeConfigs.config2prong0pi0, combinatoricDecayModeConfigs.config2prong1pi0, combinatoricDecayModeConfigs.config3prong0pi0 - ) + ), + signalConeSize = cms.string("max(min(0.1, 3.0/pt()), 0.05)"), + minAbsPhotonSumPt_insideSignalCone = cms.double(2.5), + minRelPhotonSumPt_insideSignalCone = cms.double(0.10), + minAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), # CV: always require at least some photon energy inside signal cone + minRelPhotonSumPt_outsideSignalCone = cms.double(1.e+9) # for a tau to be reconstructed in a decay mode with pi0s ) combinatoricRecoTaus = cms.EDProducer("RecoTauProducer", diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py index fafbeba289195..d8e29335057fd 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py @@ -36,9 +36,9 @@ plugin = cms.string("RecoTauPiZeroStripPlugin"), qualityCuts = PFTauQualityCuts, # Clusterize photons and electrons (PF numbering) - stripCandidatesParticleIds = cms.vint32(2, 4), - stripEtaAssociationDistance = cms.double(0.05), - stripPhiAssociationDistance = cms.double(0.2), + stripCandidatesParticleIds = cms.vint32(2, 4), + stripEtaAssociationDistance = cms.double(0.05), + stripPhiAssociationDistance = cms.double(0.2), makeCombinatoricStrips = cms.bool(False) ) @@ -47,9 +47,9 @@ plugin = cms.string("RecoTauPiZeroStripPlugin"), qualityCuts = PFTauQualityCuts, # Clusterize photons and electrons (PF numbering) - stripCandidatesParticleIds = cms.vint32(2, 4), - stripEtaAssociationDistance = cms.double(0.05), - stripPhiAssociationDistance = cms.double(0.2), + stripCandidatesParticleIds = cms.vint32(2, 4), + stripEtaAssociationDistance = cms.double(0.05), + stripPhiAssociationDistance = cms.double(0.2), makeCombinatoricStrips = cms.bool(True), maxInputStrips = cms.int32(5), stripMassWhenCombining = cms.double(0.0), # assume photon like @@ -67,3 +67,27 @@ maxStripBuildIterations = cms.int32(-1) ) +# Produce a "strips" of photons +# with no track quality cuts applied to PFElectrons +# and eta x phi size of strip increasing for low pT photons +modStrips2 = strips.clone( + plugin = cms.string('RecoTauPiZeroStripPlugin3'), + applyElecTrackQcuts = cms.bool(False), + minGammaEtStripSeed = cms.double(0.5), + minGammaEtStripAdd = cms.double(0.), + minStripEt = cms.double(0.5), + # CV: parametrization of strip size in eta and phi determined by Yuta Takahashi, + # chosen to contain 95% of photons from tau decays + stripEtaAssociationDistance = cms.PSet( + function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), + par0 = cms.double(2.15974e-01), + par1 = cms.double(5.14575e-01) + ), + stripPhiAssociationDistance = cms.PSet( + function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), + par0 = cms.double(3.74961e-01), + par1 = cms.double(5.99882e-01) + ), + updateStripAfterEachDaughter = cms.bool(False), + maxStripBuildIterations = cms.int32(-1) +) diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py index 3e71ed9f9d487..00b5419b8a260 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py @@ -12,7 +12,8 @@ outputSelection = cms.string('pt > 0'), builders = cms.VPSet( #builders.strips - builders.modStrips + #builders.modStrips + builders.modStrips2 ), ranking = cms.VPSet( ranking.isInStrip @@ -39,7 +40,8 @@ builders = cms.VPSet( builders.combinatoricPhotonPairs, #builders.strips - builders.modStrips + #builders.modStrips + builders.modStrips2 ), ranking = cms.VPSet( ranking.nearPiZeroMassBarrel, # Prefer pi zeros +- 0.05 GeV correct mass diff --git a/RecoTauTag/RecoTau/src/RecoTauConstructor.cc b/RecoTauTag/RecoTau/src/RecoTauConstructor.cc index 5e724b429ee6f..c5f36486f0765 100644 --- a/RecoTauTag/RecoTau/src/RecoTauConstructor.cc +++ b/RecoTauTag/RecoTau/src/RecoTauConstructor.cc @@ -3,6 +3,8 @@ #include "RecoTauTag/RecoTau/interface/RecoTauCommonUtilities.h" #include "DataFormats/Common/interface/RefToPtr.h" +#include "DataFormats/Math/interface/deltaR.h" + #include "RecoTauTag/RecoTau/interface/pfRecoTauChargedHadronAuxFunctions.h" #include @@ -10,8 +12,17 @@ namespace reco { namespace tau { -RecoTauConstructor::RecoTauConstructor(const PFJetRef& jet, const edm::Handle& pfCands, bool copyGammasFromPiZeros) - : pfCands_(pfCands) +RecoTauConstructor::RecoTauConstructor(const PFJetRef& jet, const edm::Handle& pfCands, + bool copyGammasFromPiZeros, + const StringObjectFunction* signalConeSize, + double minAbsPhotonSumPt_insideSignalCone, double minRelPhotonSumPt_insideSignalCone, + double minAbsPhotonSumPt_outsideSignalCone, double minRelPhotonSumPt_outsideSignalCone) + : signalConeSize_(signalConeSize), + minAbsPhotonSumPt_insideSignalCone_(minAbsPhotonSumPt_insideSignalCone), + minRelPhotonSumPt_insideSignalCone_(minRelPhotonSumPt_insideSignalCone), + minAbsPhotonSumPt_outsideSignalCone_(minAbsPhotonSumPt_outsideSignalCone), + minRelPhotonSumPt_outsideSignalCone_(minRelPhotonSumPt_outsideSignalCone), + pfCands_(pfCands) { // Initialize tau tau_.reset(new PFTau()); @@ -296,6 +307,50 @@ void RecoTauConstructor::sortAndCopyIntoTau() { } } +namespace +{ + PFTau::hadronicDecayMode calculateDecayMode(const reco::PFTau& tau, double dRsignalCone, + double minAbsPhotonSumPt_insideSignalCone, double minRelPhotonSumPt_insideSignalCone, + double minAbsPhotonSumPt_outsideSignalCone, double minRelPhotonSumPt_outsideSignalCone) + { + unsigned int nCharged = tau.signalTauChargedHadronCandidates().size(); + // If no tracks exist, this is definitely not a tau! + if ( !nCharged ) return PFTau::kNull; + + unsigned int nPiZeros = 0; + const std::vector& piZeros = tau.signalPiZeroCandidates(); + for ( std::vector::const_iterator piZero = piZeros.begin(); + piZero != piZeros.end(); ++piZero ) { + double photonSumPt_insideSignalCone = 0.; + double photonSumPt_outsideSignalCone = 0.; + int numPhotons = piZero->numberOfDaughters(); + for ( int idxPhoton = 0; idxPhoton < numPhotons; ++idxPhoton ) { + const reco::Candidate* photon = piZero->daughter(idxPhoton); + double dR = deltaR(photon->p4(), tau.p4()); + if ( dR < dRsignalCone ) { + photonSumPt_insideSignalCone += photon->pt(); + } else { + photonSumPt_outsideSignalCone += photon->pt(); + } + } + if ( photonSumPt_insideSignalCone > minAbsPhotonSumPt_insideSignalCone || photonSumPt_insideSignalCone > (minRelPhotonSumPt_insideSignalCone*tau.pt()) || + photonSumPt_outsideSignalCone > minAbsPhotonSumPt_outsideSignalCone || photonSumPt_outsideSignalCone > (minRelPhotonSumPt_outsideSignalCone*tau.pt()) ) ++nPiZeros; + } + + // Find the maximum number of PiZeros our parameterization can hold + const unsigned int maxPiZeros = PFTau::kOneProngNPiZero; + + // Determine our track index + unsigned int trackIndex = (nCharged - 1)*(maxPiZeros + 1); + + // Check if we handle the given number of tracks + if ( trackIndex >= PFTau::kRareDecayMode ) return PFTau::kRareDecayMode; + + if ( nPiZeros > maxPiZeros ) nPiZeros = maxPiZeros; + return static_cast(trackIndex + nPiZeros); + } +} + std::auto_ptr RecoTauConstructor::get(bool setupLeadingObjects) { LogDebug("TauConstructorGet") << "Start getting" ; @@ -334,14 +389,14 @@ std::auto_ptr RecoTauConstructor::get(bool setupLeadingObjects) // Set P4 tau_->setP4(p4_); -// tau_->setP4( -// sumPFCandP4( -// getCollection(kSignal, kAll)->begin(), -// getCollection(kSignal, kAll)->end() -// ) -// ); + // Set Decay Mode - PFTau::hadronicDecayMode dm = tau_->calculateDecayMode(); + double dRsignalCone = ( signalConeSize_ ) ? (*signalConeSize_)(*tau_) : 0.5; + tau_->setSignalConeSize(dRsignalCone); + PFTau::hadronicDecayMode dm = calculateDecayMode( + *tau_, + dRsignalCone, + minAbsPhotonSumPt_insideSignalCone_, minRelPhotonSumPt_insideSignalCone_, minAbsPhotonSumPt_outsideSignalCone_, minRelPhotonSumPt_outsideSignalCone_); tau_->setDecayMode(dm); LogDebug("TauConstructorGet") << "Pt = " << tau_->pt() << ", eta = " << tau_->eta() << ", phi = " << tau_->phi() << ", mass = " << tau_->mass() << ", dm = " << tau_->decayMode() ; From 7a535944340a9ff07332f77d9da1ba822762dcc3 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 11:58:27 +0200 Subject: [PATCH 02/35] fixed typo in discriminator name --- PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py | 2 +- PhysicsTools/PatAlgos/python/tools/tauTools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index 3551bddd1467e..bb8119c50d16a 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -117,7 +117,7 @@ byMediumCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), byTightCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), - byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits"), byMediumPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits"), byTightPileupWeightedIsolationHits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), byPhotonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone"), diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 27aa7451c11ae..5282138cc0e4e 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -107,7 +107,7 @@ def _switchToPFTau(process, ("byMediumCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), ("byTightCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), ("byCombinedIsolationDeltaBetaCorrRaw3Hits", "DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), - ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolation3Hits"), ("byMediumPileupWeightedIsolation3Hits", "DiscriminationByMediumPileupWeightedIsolation3Hits"), ("byTightPileupWeightedIsolationHits", "DiscriminationByTightPileupWeightedIsolation3Hits"), ("byPhotonPtSumOutsideSignalCone", "DiscriminationByPhotonPtSumOutsideSignalCone"), From 95f3fb0d4d64a80a42e1a0ebe3125c910483c3de Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:46:26 +0200 Subject: [PATCH 03/35] bug-fix in storing of (raw) footprint correction --- .../PFRecoTauDiscriminationByIsolation.cc | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index 56c43cea2c984..0bf1e79732ff3 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -73,12 +73,11 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas } // sanity check2 - can't use weighted and unweighted iso at the same time - if(includeGammas_ && calculateWeights_) - { - throw cms::Exception("BasIsoConfig") - << "Both 'ApplyDiscriminationByECALIsolation' and 'ApplyDiscriminationByWeightedECALIsolation' " - << "have been set to true. These options are mutually exclusive."; - } + if ( includeGammas_ && calculateWeights_ ) { + throw cms::Exception("BasIsoConfig") + << "Both 'ApplyDiscriminationByECALIsolation' and 'ApplyDiscriminationByWeightedECALIsolation' " + << "have been set to true. These options are mutually exclusive."; + } // Can only store one type int numStoreOptions = 0; @@ -104,7 +103,7 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas maxRelPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxRelPhotonSumPt_outsideSignalCone"); applyFootprintCorrection_ = pset.getParameter("applyFootprintCorrection"); - if ( applyFootprintCorrection_ ) { + if ( applyFootprintCorrection_ || storeRawFootprintCorrection_ ) { edm::VParameterSet cfgFootprintCorrections = pset.getParameter("footprintCorrections"); for ( edm::VParameterSet::const_iterator cfgFootprintCorrection = cfgFootprintCorrections.begin(); cfgFootprintCorrection != cfgFootprintCorrections.end(); ++cfgFootprintCorrection ) { @@ -153,9 +152,9 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas puFactorizedIsoQCuts.second)); pfCandSrc_ = pset.getParameter("particleFlowSrc"); - pfCand_token=consumes(pfCandSrc_); + pfCand_token = consumes(pfCandSrc_); vertexSrc_ = pset.getParameter("vertexSrc"); - vertex_token=consumes(vertexSrc_); + vertex_token = consumes(vertexSrc_); deltaBetaCollectionCone_ = pset.getParameter( "isoConeSizeForDeltaBeta"); std::string deltaBetaFactorFormula = @@ -508,9 +507,9 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const double puPt = 0.; //--- Sum PT requirement if ( applySumPtCut_ || applyRelativeSumPtCut_ || storeRawSumPt_ || storeRawPUsumPt_ ) { - double chargedPt = 0.0; - double neutralPt = 0.0; - double weightedNeutralPt = 0.0; + double chargedPt = 0.; + double neutralPt = 0.; + double weightedNeutralPt = 0.; for ( auto const & isoObject : isoCharged_ ) { chargedPt += isoObject->pt(); } From a90295cb878661b4d7fcccdf7130c639ac3da374 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:47:19 +0200 Subject: [PATCH 04/35] - store neutral pileup weighted isolation pT sum - bug-fix: disable deltaBeta corrections for pileup weighted isolation discriminators --- RecoTauTag/Configuration/python/HPSPFTaus_cff.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 837522ce831f5..3711c5fad261f 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -551,6 +551,7 @@ hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( ApplyDiscriminationByECALIsolation = cms.bool(False), + applyDeltaBetaCorrection = cms.bool(False), ApplyDiscriminationByWeightedECALIsolation = cms.bool(True), UseAllPFCandsForWeights = cms.bool(True), applyFootprintCorrection = cms.bool(True), @@ -814,6 +815,7 @@ hpsPFTauChargedIsoPtSum + hpsPFTauNeutralIsoPtSum + hpsPFTauPUcorrPtSum + + hpsPFTauNeutralIsoPtSumWeight + hpsPFTauFootprintCorrection + hpsPFTauPhotonPtSumOutsideSignalCone + hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw From b7299636119e7bea37f913c6ca6ca431f756f074 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:48:08 +0200 Subject: [PATCH 05/35] added pileup weighted neutral isolation --- PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py | 1 + PhysicsTools/PatAlgos/python/tools/tauTools.py | 1 + 2 files changed, 2 insertions(+) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index bb8119c50d16a..1fd5fee7f38d2 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -68,6 +68,7 @@ chargedIsoPtSum = cms.InputTag("hpsPFTauChargedIsoPtSum"), neutralIsoPtSum = cms.InputTag("hpsPFTauNeutralIsoPtSum"), puCorrPtSum = cms.InputTag("hpsPFTauPUcorrPtSum"), + neutralIsoPtSumWeight = cms.InputTag("hpsPFTauNeutralIsoPtSumWeight"), footprintCorrection = cms.InputTag("hpsPFTauFootprintCorrection"), photonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauPhotonPtSumOutsideSignalCone"), ##byIsolationMVA3oldDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw'), diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 5282138cc0e4e..053e03654bb66 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -115,6 +115,7 @@ def _switchToPFTau(process, ("chargedIsoPtSum", "ChargedIsoPtSum"), ("neutralIsoPtSum", "NeutralIsoPtSum"), ("puCorrPtSum", "PUcorrPtSum"), + ("neutralIsoPtSumWeight", "NeutralIsoPtSumWeight"), ("footprintCorrection", "FootprintCorrection"), ("photonPtSumOutsideSignalCone", "PhotonPtSumOutsideSignalCone"), ##("byIsolationMVA3oldDMwoLTraw", "DiscriminationByIsolationMVA3oldDMwoLTraw"), From b75f447c7167883e38c0fd81f6d5ac9015c9be3f Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:54:16 +0200 Subject: [PATCH 06/35] fixed typo in discriminator name --- PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py | 2 +- PhysicsTools/PatAlgos/python/tools/tauTools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index 1fd5fee7f38d2..39177b9f29d1a 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -120,7 +120,7 @@ byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits"), byMediumPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits"), - byTightPileupWeightedIsolationHits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), + byTightPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), byPhotonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone"), byPileupWeightedIsolationRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits"), againstElectronMVA5raw = cms.InputTag("hpsPFTauDiscriminationByMVA5rawElectronRejection"), diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 053e03654bb66..5680a4e840492 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -109,7 +109,7 @@ def _switchToPFTau(process, ("byCombinedIsolationDeltaBetaCorrRaw3Hits", "DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolation3Hits"), ("byMediumPileupWeightedIsolation3Hits", "DiscriminationByMediumPileupWeightedIsolation3Hits"), - ("byTightPileupWeightedIsolationHits", "DiscriminationByTightPileupWeightedIsolation3Hits"), + ("byTightPileupWeightedIsolation3Hits", "DiscriminationByTightPileupWeightedIsolation3Hits"), ("byPhotonPtSumOutsideSignalCone", "DiscriminationByPhotonPtSumOutsideSignalCone"), ("byPileupWeightedIsolationRaw3Hits", "DiscriminationByRawPileupWeightedIsolation3Hits"), ("chargedIsoPtSum", "ChargedIsoPtSum"), From be2fd1b12ebb9d9a374b5c6f0419514eeea6df45 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 24 May 2015 18:03:57 +0200 Subject: [PATCH 07/35] updated parameters for dynamic strip reconstruction --- .../python/RecoTauPiZeroBuilderPlugins_cfi.py | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py index d8e29335057fd..5a6ed014f35d3 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py @@ -70,24 +70,24 @@ # Produce a "strips" of photons # with no track quality cuts applied to PFElectrons # and eta x phi size of strip increasing for low pT photons -modStrips2 = strips.clone( - plugin = cms.string('RecoTauPiZeroStripPlugin3'), - applyElecTrackQcuts = cms.bool(False), - minGammaEtStripSeed = cms.double(0.5), - minGammaEtStripAdd = cms.double(0.), - minStripEt = cms.double(0.5), - # CV: parametrization of strip size in eta and phi determined by Yuta Takahashi, - # chosen to contain 95% of photons from tau decays - stripEtaAssociationDistance = cms.PSet( - function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), - par0 = cms.double(2.15974e-01), - par1 = cms.double(5.14575e-01) - ), - stripPhiAssociationDistance = cms.PSet( - function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), - par0 = cms.double(3.74961e-01), - par1 = cms.double(5.99882e-01) - ), - updateStripAfterEachDaughter = cms.bool(False), - maxStripBuildIterations = cms.int32(-1) +modStrips2 = strips.clone( + plugin = cms.string('RecoTauPiZeroStripPlugin3'), + applyElecTrackQcuts = cms.bool(False), + minGammaEtStripSeed = cms.double(0.5), + minGammaEtStripAdd = cms.double(0.), + minStripEt = cms.double(0.5), + # CV: parametrization of strip size in eta and phi determined by Yuta Takahashi, + # chosen to contain 95% of photons from tau decays + stripEtaAssociationDistance = cms.PSet( + function = cms.string("TMath::Min(0.15, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))"), + par0 = cms.double(1.97077e-01), + par1 = cms.double(6.58701e-01) + ), + stripPhiAssociationDistance = cms.PSet( + function = cms.string("TMath::Min(0.3, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))"), + par0 = cms.double(3.52476e-01), + par1 = cms.double(7.07716e-01) + ), + updateStripAfterEachDaughter = cms.bool(False), + maxStripBuildIterations = cms.int32(-1) ) From dc1625ec3df606d3ca8502a274a857caf29780b5 Mon Sep 17 00:00:00 2001 From: anehrkor Date: Fri, 29 May 2015 16:25:34 +0200 Subject: [PATCH 08/35] New cleaner module that works also if tau is made up of combination of pf charged hadrons and tracks -> solves rare problem with 3-prongs having charge +/-3. --- .../plugins/RecoTauChargeCleanerPlugin.cc | 59 +++++++++++++++++++ .../RecoTau/python/RecoTauCleanerPlugins.py | 12 ++++ .../RecoTau/python/RecoTauCleaner_cfi.py | 2 +- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc diff --git a/RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc b/RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc new file mode 100644 index 0000000000000..75a03751191a9 --- /dev/null +++ b/RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc @@ -0,0 +1,59 @@ +/* + * Original author: Alexander Nehrkorn (RWTH Aachen) + * + * Description: + * This module rejects tau candidates that do not have unit charge. + * It takes the fact into account that taus do not necessarily need + * to be created from PF charged hadrons only but can be created + * from a combination of PF charged hadrons and tracks. + * + */ + +#include "RecoTauTag/RecoTau/interface/RecoTauBuilderPlugins.h" +#include "DataFormats/TauReco/interface/PFTau.h" +#include "DataFormats/TauReco/interface/PFTauFwd.h" + +namespace reco { namespace tau { + +class RecoTauChargeCleanerPlugin : public RecoTauCleanerPlugin +{ +public: + explicit RecoTauChargeCleanerPlugin(const edm::ParameterSet&, edm::ConsumesCollector &&iC); + ~RecoTauChargeCleanerPlugin() {} + double operator()(const PFTauRef& tau) const override; + +private: + std::vector nprongs_; + double failResult_; + int charge_; +}; + +RecoTauChargeCleanerPlugin::RecoTauChargeCleanerPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector &&iC) + : RecoTauCleanerPlugin(pset,std::move(iC)), + nprongs_(pset.getParameter >("nprongs")), + failResult_(pset.getParameter("selectionFailValue")), + charge_(pset.getParameter("passForCharge")) +{} + +double RecoTauChargeCleanerPlugin::operator()(const PFTauRef& cand) const +{ + int charge = 0; + unsigned nChargedPFCandidate(0), nTrack(0); + for(unsigned iSignalCand = 0; iSignalCand < cand->signalTauChargedHadronCandidates().size(); iSignalCand++){ + charge += cand->signalTauChargedHadronCandidates().at(iSignalCand).charge(); + if(cand->signalTauChargedHadronCandidates().at(iSignalCand).algoIs(reco::PFRecoTauChargedHadron::kChargedPFCandidate)) nChargedPFCandidate++; + else if(cand->signalTauChargedHadronCandidates().at(iSignalCand).algoIs(reco::PFRecoTauChargedHadron::kTrack)) nTrack++; + } + + for(auto nprong : nprongs_){ + if(nChargedPFCandidate+nTrack == nprong) return abs(charge)-charge_; + } + + return failResult_; +} + +}} + +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_EDM_PLUGIN(RecoTauCleanerPluginFactory, reco::tau::RecoTauChargeCleanerPlugin, "RecoTauChargeCleanerPlugin"); diff --git a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py index 09687d9dfa2ac..8dcfc7df1ca76 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py @@ -28,6 +28,18 @@ selectionFailValue = cms.double(0), ) +# similar to unitCharge but handles also cases where tau is made up of +# a combination of tracks and pf charged hadrons +charge = cms.PSet( + name = cms.string("Charge"), + plugin = cms.string("RecoTauChargeCleanerPlugin"), + # cleaner is applied to decay modes with the number of prongs given here + nprongs = cms.vuint32(1,3), + # taus with charge != 1 are rejected + passForCharge = cms.int32(1), + selectionFailValue = cms.double(0), +) + # Prefer taus with pt greater 15 ptGt15 = cms.PSet( name = cms.string("PtGt15"), diff --git a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py index 30d65dd479550..d387946755de3 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py @@ -6,7 +6,7 @@ src = cms.InputTag("combinatoricRecoTaus"), cleaners = cms.VPSet( # Reject taus that have charge == 3 - cleaners.unitCharge, + cleaners.charge, # Reject taus that are not within DR<0.1 of the jet axis #cleaners.matchingConeCut, # Reject taus that fail HPS selections From 10bfa9da986aaecfef38a81a42841936263349a4 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 1 Jun 2015 12:27:34 +0200 Subject: [PATCH 09/35] sutract 2 GeV from k offset values (except for 3prong0pi0), as recommended by Yuta --- .../python/PFRecoTauDiscriminationByIsolation_cfi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index 8c9d929732bbf..a7533cbcabc9e 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -55,19 +55,19 @@ footprintCorrections = cms.VPSet( cms.PSet( selection = cms.string("decayMode() = 0"), - offset = cms.double(1.8) + offset = cms.double(0.0) ), cms.PSet( selection = cms.string("decayMode() = 1 || decayMode() = 2"), - offset = cms.double(1.5) + offset = cms.double(0.0) ), cms.PSet( selection = cms.string("decayMode() = 5"), - offset = cms.double(4.7) + offset = cms.double(2.7) ), cms.PSet( selection = cms.string("decayMode() = 6"), - offset = cms.double(1.9) + offset = cms.double(0.0) ), cms.PSet( selection = cms.string("decayMode() = 10"), From 01212fc7b7a1d57fff3a35d222bac5c5636c73f2 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 3 Jun 2015 16:46:21 +0200 Subject: [PATCH 10/35] added functionality to make tau footprint correction dependent on tauPt --- .../plugins/PFRecoTauDiscriminationByIsolation.cc | 11 +++++++---- .../python/PFRecoTauDiscriminationByIsolation_cfi.py | 10 +++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index 0bf1e79732ff3..fa310d5369055 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -5,6 +5,7 @@ #include "RecoTauTag/RecoTau/interface/RecoTauVertexAssociator.h" #include "RecoTauTag/RecoTau/interface/ConeTools.h" #include "CommonTools/Utils/interface/StringCutObjectSelector.h" +#include "CommonTools/Utils/interface/StringObjectFunction.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "TMath.h" @@ -108,7 +109,7 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas for ( edm::VParameterSet::const_iterator cfgFootprintCorrection = cfgFootprintCorrections.begin(); cfgFootprintCorrection != cfgFootprintCorrections.end(); ++cfgFootprintCorrection ) { std::string selection = cfgFootprintCorrection->getParameter("selection"); - double offset = cfgFootprintCorrection->getParameter("offset"); + std::string offset = cfgFootprintCorrection->getParameter("offset"); footprintCorrectionType* footprintCorrection = new footprintCorrectionType(selection, offset); footprintCorrections_.push_back(footprintCorrection); } @@ -230,13 +231,13 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas bool applyFootprintCorrection_; struct footprintCorrectionType { - footprintCorrectionType(const std::string& selection, double offset) + footprintCorrectionType(const std::string& selection, const std::string& offset) : selection_(selection), offset_(offset) {} ~footprintCorrectionType() {} StringCutObjectSelector selection_; - double offset_; + StringObjectFunction offset_; }; std::vector footprintCorrections_; @@ -499,7 +500,9 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const if ( applyFootprintCorrection_ || storeRawFootprintCorrection_ ) { for ( std::vector::const_iterator footprintCorrection = footprintCorrections_.begin(); footprintCorrection != footprintCorrections_.end(); ++footprintCorrection ) { - if ( (*footprintCorrection)->selection_(*pfTau) ) footprintCorrection_value = (*footprintCorrection)->offset_; + if ( (*footprintCorrection)->selection_(*pfTau) ) { + footprintCorrection_value = (*footprintCorrection)->offset_(*pfTau); + } } } diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index a7533cbcabc9e..37b3758cbc79e 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -55,23 +55,23 @@ footprintCorrections = cms.VPSet( cms.PSet( selection = cms.string("decayMode() = 0"), - offset = cms.double(0.0) + offset = cms.string("0.0") ), cms.PSet( selection = cms.string("decayMode() = 1 || decayMode() = 2"), - offset = cms.double(0.0) + offset = cms.string("0.0") ), cms.PSet( selection = cms.string("decayMode() = 5"), - offset = cms.double(2.7) + offset = cms.string("2.7") ), cms.PSet( selection = cms.string("decayMode() = 6"), - offset = cms.double(0.0) + offset = cms.string("0.0") ), cms.PSet( selection = cms.string("decayMode() = 10"), - offset = cms.double(2.0) + offset = cms.string("max(2.0, 0.22*pt() - 2.0)") ) ), From 760321e4bf93a1a5e72b9e7d298ecdef0e87625b Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 9 Jun 2015 19:38:37 +0200 Subject: [PATCH 11/35] tightened cut on pTouter from 0.20*tauPt to 0.10*tauPt --- .../RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index 37b3758cbc79e..73c7eac0acad9 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -28,7 +28,7 @@ applyPhotonPtSumOutsideSignalConeCut = cms.bool(False), maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.20), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), qualityCuts = PFTauQualityCuts, # set the standard quality cuts From 58113d5969165dd44192e677f513d5db5a9d00b3 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 9 Jun 2015 19:42:16 +0200 Subject: [PATCH 12/35] apply cut on ptOuter also in case of HPS combined islation 3-hit discriminators with deltaBeta correction --- RecoTauTag/Configuration/python/HPSPFTaus_cff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 3711c5fad261f..f08137d4f9216 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -534,8 +534,11 @@ hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits = hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr.clone() hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.qualityCuts.isolationQualityCuts.minTrackHits = cms.uint32(3) +hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits.qualityCuts.isolationQualityCuts.minTrackHits = cms.uint32(3) +hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits.applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits.qualityCuts.isolationQualityCuts.minTrackHits = cms.uint32(3) +hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits.applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( applySumPtCut = False, From cc6bf3c6b2fe1e3b08f398721e4d4d482faafdbb Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 10 Jun 2015 17:37:17 +0200 Subject: [PATCH 13/35] - updated deltaBeta correction factor to 0.2 - updated thresholds for isolation WPs: Loose = 2.5 GeV Medium = 1.5 GeV Tight = 0.8 GeV (no change) --- .../Configuration/python/HPSPFTaus_cff.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index f08137d4f9216..5718fc487c720 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -25,8 +25,8 @@ # Load PFjet input parameters from RecoTauTag.RecoTau.PFRecoTauPFJetInputs_cfi import PFRecoTauPFJetInputs -# deltaBeta correction factor calculated for taus from ak5PFJets (Run I) -ak5dBetaCorrection=0.0772/0.1687 +# deltaBeta correction factor +ak4dBetaCorrection=0.20 # Load MVAs from SQLlite file/prep. DB from RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi import * @@ -134,7 +134,7 @@ deltaBetaPUTrackPtCutOverride = cms.double(0.5), applyDeltaBetaCorrection = True, isoConeSizeForDeltaBeta = 0.8, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, ) @@ -150,10 +150,10 @@ hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%((0.09/0.25)*(ak5dBetaCorrection)), + deltaBetaFactor = "%0.4f"%((0.09/0.25)*(ak4dBetaCorrection)), applyOccupancyCut = False, applySumPtCut = True, - maximumSumPtCut = 3.0, + maximumSumPtCut = 3.5, Prediscriminants = requireDecayMode.clone() ) hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minTrackPt = 0.5 @@ -162,10 +162,10 @@ hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, - maximumSumPtCut = 2.0, + maximumSumPtCut = 2.5, Prediscriminants = requireDecayMode.clone() ) hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minTrackPt = 0.5 @@ -191,10 +191,10 @@ hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, - maximumSumPtCut = 1.0, + maximumSumPtCut = 1.5, Prediscriminants = requireDecayMode.clone() ) hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minTrackPt = 0.5 @@ -203,7 +203,7 @@ hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, maximumSumPtCut = 0.8, From a451d55df24ec1bd7600c8a026934a8c0fc87363 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 8 Jul 2015 18:10:34 +0200 Subject: [PATCH 14/35] updates to tau vertex producers from Arun --- .../RecoTau/plugins/PFTauPrimaryVertexProducer.cc | 10 ++++++---- .../RecoTau/plugins/PFTauSecondaryVertexProducer.cc | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc b/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc index 156e4ac737f42..f22554a583f32 100644 --- a/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc +++ b/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc @@ -252,11 +252,13 @@ void PFTauPrimaryVertexProducer::produce(edm::Event& iEvent,const edm::EventSetu // } for(std::vector::const_iterator vtxTrkRef=thePV.tracks_begin();vtxTrkRefbuild(*iter)); } bool FitOk(true); - if ( transTracks.size() >= 3 ) { + if ( transTracks.size() >= 2 ) { AdaptiveVertexFitter avf; avf.setWeightThreshold(0.1); //weight per track. allow almost every fit, else --> exception try { diff --git a/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc b/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc index cab1ab4e29f6d..f458bc2c6b246 100644 --- a/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc +++ b/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc @@ -88,7 +88,7 @@ void PFTauSecondaryVertexProducer::produce(edm::Event& iEvent,const edm::EventSe for(reco::PFTauCollection::size_type iPFTau = 0; iPFTau < Tau->size(); iPFTau++) { reco::PFTauRef RefPFTau(Tau, iPFTau); std::vector SV; - if(RefPFTau->decayMode()==10){ + if(RefPFTau->decayMode()>=5){ /////////////////////////////////////////////////////////////////////////////////////////////// // Get tracks form PFTau daugthers std::vector transTrk; From e1c054f2de45b5dd63df17cfebdcce0155748665 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 11:44:14 +0200 Subject: [PATCH 15/35] - dynamic strip reconstruction for Yuta - added Loose, Medium and Tight tau ID discriminators with pileup weighted isolation - removal of deprecated tau ID discriminators from pat::Taus --- DataFormats/TauReco/interface/PFTau.h | 15 +- DataFormats/TauReco/interface/RecoTauPiZero.h | 64 ++- DataFormats/TauReco/src/PFTau.cc | 28 +- DataFormats/TauReco/src/RecoTauPiZero.cc | 44 +- DataFormats/TauReco/src/classes_def_2.xml | 20 +- .../python/producersLayer1/tauProducer_cfi.py | 111 ++--- .../PatAlgos/python/tools/tauTools.py | 76 ++-- .../Configuration/python/HPSPFTaus_cff.py | 94 +++- .../RecoTau/interface/RecoTauConstructor.h | 13 +- .../PFRecoTauDiscriminationByHPSSelection.cc | 17 +- .../PFRecoTauDiscriminationByIsolation.cc | 197 ++++++--- .../RecoTauBuilderCombinatoricPlugin.cc | 100 +++-- ...uChargedHadronMultiplicityCleanerPlugin.cc | 50 +++ .../plugins/RecoTauPiZeroStripPlugin2.cc | 15 +- .../plugins/RecoTauPiZeroStripPlugin3.cc | 400 ++++++++++++++++++ ...RecoTauDiscriminationByHPSSelection_cfi.py | 1 - .../PFRecoTauDiscriminationByIsolation_cfi.py | 32 +- .../RecoTau/python/RecoTauCleanerPlugins.py | 5 + .../RecoTau/python/RecoTauCleaner_cfi.py | 57 ++- .../python/RecoTauCombinatoricProducer_cfi.py | 7 +- .../python/RecoTauPiZeroBuilderPlugins_cfi.py | 36 +- .../python/RecoTauPiZeroProducer_cfi.py | 6 +- RecoTauTag/RecoTau/src/RecoTauConstructor.cc | 73 +++- 23 files changed, 1110 insertions(+), 351 deletions(-) create mode 100644 RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc create mode 100644 RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc diff --git a/DataFormats/TauReco/interface/PFTau.h b/DataFormats/TauReco/interface/PFTau.h index 16b374e2450c0..e23dac4143d68 100644 --- a/DataFormats/TauReco/interface/PFTau.h +++ b/DataFormats/TauReco/interface/PFTau.h @@ -148,9 +148,16 @@ class PFTau : public BaseTau { /// Retrieve the identified hadronic decay mode according to the number of /// charged and piZero candidates in the signal cone hadronicDecayMode decayMode() const; - hadronicDecayMode calculateDecayMode() const; void setDecayMode(const hadronicDecayMode&); + /// Effect of eta and phi correction of strip on mass of tau candidate + double bendCorrMass() const { return bendCorrMass_; } + void setBendCorrMass(double bendCorrMass) { bendCorrMass_ = bendCorrMass; } + + /// Size of signal cone + double signalConeSize() const { return signalConeSize_; } + void setSignalConeSize(double signalConeSize) { signalConeSize_ = signalConeSize; } + //Electron rejection float emFraction() const; // Ecal/Hcal Cluster Energy float hcalTotOverPLead() const; // total Hcal Cluster E / leadPFChargedHadron P @@ -192,7 +199,7 @@ class PFTau : public BaseTau { CandidatePtr sourceCandidatePtr( size_type i ) const; /// prints information on this PFTau - void dump(std::ostream& out=std::cout) const; + void dump(std::ostream& out = std::cout) const; private: friend class tau::RecoTauConstructor; @@ -226,6 +233,10 @@ class PFTau : public BaseTau { hadronicDecayMode decayMode_; + float bendCorrMass_; + + float signalConeSize_; + reco::PFJetRef jetRef_; PFTauTagInfoRef PFTauTagInfoRef_; reco::PFCandidatePtr leadPFChargedHadrCand_; diff --git a/DataFormats/TauReco/interface/RecoTauPiZero.h b/DataFormats/TauReco/interface/RecoTauPiZero.h index 244f3077c555d..076d7de5e518d 100644 --- a/DataFormats/TauReco/interface/RecoTauPiZero.h +++ b/DataFormats/TauReco/interface/RecoTauPiZero.h @@ -14,32 +14,57 @@ class RecoTauPiZero : public CompositePtrCandidate { kStrips = 3 }; - RecoTauPiZero():CompositePtrCandidate(),algoName_(kUndefined){ - this->setPdgId(111); } - - RecoTauPiZero(PiZeroAlgorithm algoName): - CompositePtrCandidate(), algoName_(algoName) { this->setPdgId(111); } + RecoTauPiZero() + : CompositePtrCandidate(), + algoName_(kUndefined) + { + this->setPdgId(111); + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } + + RecoTauPiZero(PiZeroAlgorithm algoName) + : CompositePtrCandidate(), + algoName_(algoName) + { + this->setPdgId(111); + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// constructor from values RecoTauPiZero(Charge q, const LorentzVector& p4, const Point& vtx = Point( 0, 0, 0 ), int pdgId = 111, int status = 0, bool integerCharge = true, - PiZeroAlgorithm algoName=kUndefined): - CompositePtrCandidate( - q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {} + PiZeroAlgorithm algoName = kUndefined) + : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge ), + algoName_(algoName) + { + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// constructor from values RecoTauPiZero(Charge q, const PolarLorentzVector& p4, const Point& vtx = Point( 0, 0, 0 ), int pdgId = 111, int status = 0, bool integerCharge = true, - PiZeroAlgorithm algoName=kUndefined): - CompositePtrCandidate( - q, p4, vtx, pdgId, status, integerCharge ),algoName_(algoName) {} + PiZeroAlgorithm algoName=kUndefined) + : CompositePtrCandidate(q, p4, vtx, pdgId, status, integerCharge ), + algoName_(algoName) + { + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// constructor from a Candidate - explicit RecoTauPiZero( - const Candidate & p, PiZeroAlgorithm algoName=kUndefined): - CompositePtrCandidate(p),algoName_(algoName) { this->setPdgId(111); } + explicit RecoTauPiZero(const Candidate& p, PiZeroAlgorithm algoName = kUndefined) + : CompositePtrCandidate(p), + algoName_(algoName) + { + this->setPdgId(111); + bendCorrEta_ = 0.; + bendCorrPhi_ = 0.; + } /// destructor ~RecoTauPiZero(){}; @@ -62,11 +87,20 @@ class RecoTauPiZero : public CompositePtrCandidate { /// Check whether a given algo produced this pi zero bool algoIs(PiZeroAlgorithm algo) const; - void print(std::ostream& out=std::cout) const; + /// Size of correction to account for spread of photon energy in eta and phi + /// in case charged pions make nuclear interactions or photons convert within the tracking detector + float bendCorrEta() const { return bendCorrEta_; } + float bendCorrPhi() const { return bendCorrPhi_; } + void setBendCorrEta(float bendCorrEta) { bendCorrEta_ = bendCorrEta; } + void setBendCorrPhi(float bendCorrPhi) { bendCorrPhi_ = bendCorrPhi; } + + void print(std::ostream& out = std::cout) const; private: PiZeroAlgorithm algoName_; + float bendCorrEta_; + float bendCorrPhi_; }; std::ostream & operator<<(std::ostream& out, const RecoTauPiZero& c); diff --git a/DataFormats/TauReco/src/PFTau.cc b/DataFormats/TauReco/src/PFTau.cc index f67560341df95..bcc8d35364d9f 100644 --- a/DataFormats/TauReco/src/PFTau.cc +++ b/DataFormats/TauReco/src/PFTau.cc @@ -15,14 +15,15 @@ PFTau::PFTau() hcalTotOverPLead_ = NAN; hcalMaxOverPLead_ = NAN; hcal3x3OverPLead_ = NAN; - ecalStripSumEOverPLead_= NAN; + ecalStripSumEOverPLead_ = NAN; bremsRecoveryEOverPLead_ = NAN; electronPreIDOutput_ = NAN; - electronPreIDDecision_= NAN; + electronPreIDDecision_ = NAN; caloComp_ = NAN; segComp_ = NAN; muonDecision_ = NAN; - decayMode_=kNull; + decayMode_ = kNull; + bendCorrMass_ = 0.; } PFTau::PFTau(Charge q, const LorentzVector& p4, const Point& vtx) @@ -40,12 +41,13 @@ PFTau::PFTau(Charge q, const LorentzVector& p4, const Point& vtx) ecalStripSumEOverPLead_= NAN; bremsRecoveryEOverPLead_ = NAN; electronPreIDOutput_ = NAN; - electronPreIDDecision_= NAN; + electronPreIDDecision_ = NAN; caloComp_ = NAN; segComp_ = NAN; muonDecision_ = NAN; - decayMode_=kNull; + decayMode_ = kNull; + bendCorrMass_ = 0.; } PFTau* PFTau::clone() const { return new PFTau(*this); } @@ -177,22 +179,6 @@ void PFTau::setIsolationTauChargedHadronCandidatesRefs(const PFRecoTauChargedHad PFTau::hadronicDecayMode PFTau::decayMode() const { return decayMode_; } -PFTau::hadronicDecayMode PFTau::calculateDecayMode() const { - unsigned int nCharged = signalTauChargedHadronCandidates().size(); - unsigned int nPiZeros = signalPiZeroCandidates().size(); - // If no tracks exist, this is definitely not a tau! - if ( !nCharged ) return kNull; - // Find the maximum number of PiZeros our parameterization can hold - const unsigned int maxPiZeros = kOneProngNPiZero; - // Determine our track index - unsigned int trackIndex = (nCharged - 1)*(maxPiZeros + 1); - // Check if we handle the given number of tracks - if ( trackIndex >= kRareDecayMode ) return kRareDecayMode; - - if(nPiZeros>maxPiZeros) nPiZeros=maxPiZeros; - return static_cast(trackIndex + nPiZeros); -} - void PFTau::setDecayMode(const PFTau::hadronicDecayMode& dm){ decayMode_=dm;} // Setting information about the isolation region diff --git a/DataFormats/TauReco/src/RecoTauPiZero.cc b/DataFormats/TauReco/src/RecoTauPiZero.cc index 7b5fdf78dc7cb..a347175acc738 100644 --- a/DataFormats/TauReco/src/RecoTauPiZero.cc +++ b/DataFormats/TauReco/src/RecoTauPiZero.cc @@ -1,4 +1,5 @@ #include "DataFormats/TauReco/interface/RecoTauPiZero.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/Math/interface/deltaPhi.h" namespace reco { @@ -55,31 +56,30 @@ bool RecoTauPiZero::algoIs(RecoTauPiZero::PiZeroAlgorithm algo) const { return (algoName_ == algo); } -namespace { -std::ostream& operator<<(std::ostream& out, const reco::Candidate::LorentzVector& p4) +namespace { - out << "(mass/pt/eta/phi) (" << std::setiosflags(std::ios::fixed) << std::setprecision(2) - << p4.mass() << "/" << std::setprecision(1) << p4.pt() << "/" << std::setprecision(2) << p4.eta() - << "/" << std::setprecision(2) << p4.phi() << ")"; - return out; -} + std::string getPFCandidateType(reco::PFCandidate::ParticleType pfCandidateType) + { + if ( pfCandidateType == reco::PFCandidate::X ) return "undefined"; + else if ( pfCandidateType == reco::PFCandidate::h ) return "PFChargedHadron"; + else if ( pfCandidateType == reco::PFCandidate::e ) return "PFElectron"; + else if ( pfCandidateType == reco::PFCandidate::mu ) return "PFMuon"; + else if ( pfCandidateType == reco::PFCandidate::gamma ) return "PFGamma"; + else if ( pfCandidateType == reco::PFCandidate::h0 ) return "PFNeutralHadron"; + else if ( pfCandidateType == reco::PFCandidate::h_HF ) return "HF_had"; + else if ( pfCandidateType == reco::PFCandidate::egamma_HF ) return "HF_em"; + else assert(0); + } } -void RecoTauPiZero::print(std::ostream& out) const { - if (!out) return; - - out << "RecoTauPiZero: " << this->p4() << - " nDaughters: " << this->numberOfDaughters() << - " (gamma/e) (" << this->numberOfGammas() << "/" << this->numberOfElectrons() << ")" << - " maxDeltaPhi: " << std::setprecision(3) << maxDeltaPhi() << - " maxDeltaEta: " << std::setprecision(3) << maxDeltaEta() << - " algo: " << algo() << - std::endl; - - for(size_t i = 0; i < this->numberOfDaughters(); ++i) - { - out << "--- daughter " << i << ": " << daughterPtr(i)->p4() << - " key: " << daughterPtr(i).key() << std::endl; +void RecoTauPiZero::print(std::ostream& stream) const +{ + std::cout << "Pt = " << this->pt() << ", eta = " << this->eta() << ", phi = " << this->phi() << std::endl; + size_t numDaughters = this->numberOfDaughters(); + for ( size_t iDaughter = 0; iDaughter < numDaughters; ++iDaughter ) { + const reco::PFCandidate* daughter = dynamic_cast(this->daughterPtr(iDaughter).get()); + std::cout << " daughter #" << iDaughter << " (" << getPFCandidateType(daughter->particleId()) << "):" + << " Pt = " << daughter->pt() << ", eta = " << daughter->eta() << ", phi = " << daughter->phi() << std::endl; } } diff --git a/DataFormats/TauReco/src/classes_def_2.xml b/DataFormats/TauReco/src/classes_def_2.xml index 364601d4fe7c2..e64e3f8ff868c 100644 --- a/DataFormats/TauReco/src/classes_def_2.xml +++ b/DataFormats/TauReco/src/classes_def_2.xml @@ -1,19 +1,20 @@ - + + - - - - - - + + + + + + - + @@ -265,7 +266,8 @@ isolationTauChargedHadronCandidates_.clear(); - + + diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index 0e660c704fec0..3551bddd1467e 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -50,42 +50,12 @@ embedIsolationPFGammaCands = cms.bool(False), ## embed in AOD externally stored isolation PFGammaCandidates # embed IsoDeposits - isoDeposits = cms.PSet( - pfAllParticles = cms.InputTag("tauIsoDepositPFCandidates"), - pfChargedHadron = cms.InputTag("tauIsoDepositPFChargedHadrons"), - pfNeutralHadron = cms.InputTag("tauIsoDepositPFNeutralHadrons"), - pfGamma = cms.InputTag("tauIsoDepositPFGammas") - ), + isoDeposits = cms.PSet(), # user defined isolation variables the variables defined here will be accessible # via pat::Tau::userIsolation(IsolationKeys key) with the key as defined in # DataFormats/PatCandidates/interface/Isolation.h - # - # (set Pt thresholds for PFChargedHadrons (PFGammas) to 1.0 (1.5) GeV, - # matching the thresholds used when computing the tau iso. discriminators - # in RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py) - userIsolation = cms.PSet( - pfAllParticles = cms.PSet( - src = cms.InputTag("tauIsoDepositPFCandidates"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ), - pfChargedHadron = cms.PSet( - src = cms.InputTag("tauIsoDepositPFChargedHadrons"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ), - pfNeutralHadron = cms.PSet( - src = cms.InputTag("tauIsoDepositPFNeutralHadrons"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ), - pfGamma = cms.PSet( - src = cms.InputTag("tauIsoDepositPFGammas"), - deltaR = cms.double(0.5), - threshold = cms.double(0.) - ) - ), + userIsolation = cms.PSet(), # tau ID (for efficiency studies) addTauID = cms.bool(True), @@ -95,22 +65,18 @@ # disk space decayModeFinding = cms.InputTag("hpsPFTauDiscriminationByDecayModeFinding"), decayModeFindingNewDMs =cms.InputTag("hpsPFTauDiscriminationByDecayModeFindingNewDMs"), -# decayModeFindingOldDMs = cms.InputTag("hpsPFTauDiscriminationByDecayModeFindingOldDMs"), - # byCombinedIsolationDeltaBetaCorrRaw = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr"), - # byVLooseCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr"), - # byLooseCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr"), - # byMediumCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr"), - # byTightCombinedIsolationDeltaBetaCorr = cms.InputTag("hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr"), - chargedIsoPtSum = cms.InputTag("hpsPFTauMVA3IsolationChargedIsoPtSum"), - neutralIsoPtSum = cms.InputTag("hpsPFTauMVA3IsolationNeutralIsoPtSum"), - puCorrPtSum = cms.InputTag("hpsPFTauMVA3IsolationPUcorrPtSum"), - byIsolationMVA3oldDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw'), - byVLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT'), - byLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT'), - byMediumIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwoLT'), - byTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3oldDMwoLT'), - byVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwoLT'), - byVVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwoLT'), + chargedIsoPtSum = cms.InputTag("hpsPFTauChargedIsoPtSum"), + neutralIsoPtSum = cms.InputTag("hpsPFTauNeutralIsoPtSum"), + puCorrPtSum = cms.InputTag("hpsPFTauPUcorrPtSum"), + footprintCorrection = cms.InputTag("hpsPFTauFootprintCorrection"), + photonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauPhotonPtSumOutsideSignalCone"), + ##byIsolationMVA3oldDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw'), + ##byVLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT'), + ##byLooseIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT'), + ##byMediumIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3oldDMwoLT'), + ##byTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3oldDMwoLT'), + ##byVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwoLT'), + ##byVVTightIsolationMVA3oldDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwoLT'), byIsolationMVA3oldDMwLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwLTraw'), byVLooseIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwLT'), byLooseIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwLT'), @@ -118,13 +84,13 @@ byTightIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3oldDMwLT'), byVTightIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3oldDMwLT'), byVVTightIsolationMVA3oldDMwLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3oldDMwLT'), - byIsolationMVA3newDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3newDMwoLTraw'), - byVLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwoLT'), - byLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3newDMwoLT'), - byMediumIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3newDMwoLT'), - byTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3newDMwoLT'), - byVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3newDMwoLT'), - byVVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwoLT'), + ##byIsolationMVA3newDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3newDMwoLTraw'), + ##byVLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwoLT'), + ##byLooseIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3newDMwoLT'), + ##byMediumIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByMediumIsolationMVA3newDMwoLT'), + ##byTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3newDMwoLT'), + ##byVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3newDMwoLT'), + ##byVVTightIsolationMVA3newDMwoLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwoLT'), byIsolationMVA3newDMwLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3newDMwLTraw'), byVLooseIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwLT'), byLooseIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByLooseIsolationMVA3newDMwLT'), @@ -132,25 +98,30 @@ byTightIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByTightIsolationMVA3newDMwLT'), byVTightIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByVTightIsolationMVA3newDMwLT'), byVVTightIsolationMVA3newDMwLT = cms.InputTag('hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT'), - againstElectronLoose = cms.InputTag("hpsPFTauDiscriminationByLooseElectronRejection"), - againstElectronMedium = cms.InputTag("hpsPFTauDiscriminationByMediumElectronRejection"), - againstElectronTight = cms.InputTag("hpsPFTauDiscriminationByTightElectronRejection"), - againstMuonLoose = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection"), - againstMuonMedium = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection"), - againstMuonTight = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection"), - againstMuonLoose2 = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection2"), - againstMuonMedium2 = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection2"), - againstMuonTight2 = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection2"), + ##againstElectronLoose = cms.InputTag("hpsPFTauDiscriminationByLooseElectronRejection"), + ##againstElectronMedium = cms.InputTag("hpsPFTauDiscriminationByMediumElectronRejection"), + ##againstElectronTight = cms.InputTag("hpsPFTauDiscriminationByTightElectronRejection"), + ##againstMuonLoose = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection"), + ##againstMuonMedium = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection"), + ##againstMuonTight = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection"), + ##againstMuonLoose2 = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection2"), + ##againstMuonMedium2 = cms.InputTag("hpsPFTauDiscriminationByMediumMuonRejection2"), + ##againstMuonTight2 = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection2"), againstMuonLoose3 = cms.InputTag("hpsPFTauDiscriminationByLooseMuonRejection3"), againstMuonTight3 = cms.InputTag("hpsPFTauDiscriminationByTightMuonRejection3"), - againstMuonMVAraw = cms.InputTag('hpsPFTauDiscriminationByMVArawMuonRejection'), - againstMuonLooseMVA = cms.InputTag('hpsPFTauDiscriminationByMVALooseMuonRejection'), - againstMuonMediumMVA = cms.InputTag('hpsPFTauDiscriminationByMVAMediumMuonRejection'), - againstMuonTightMVA = cms.InputTag('hpsPFTauDiscriminationByMVATightMuonRejection'), - byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), + ##againstMuonMVAraw = cms.InputTag('hpsPFTauDiscriminationByMVArawMuonRejection'), + ##againstMuonLooseMVA = cms.InputTag('hpsPFTauDiscriminationByMVALooseMuonRejection'), + ##againstMuonMediumMVA = cms.InputTag('hpsPFTauDiscriminationByMVAMediumMuonRejection'), + ##againstMuonTightMVA = cms.InputTag('hpsPFTauDiscriminationByMVATightMuonRejection'), byLooseCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"), byMediumCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), byTightCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), + byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), + byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + byMediumPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits"), + byTightPileupWeightedIsolationHits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), + byPhotonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone"), + byPileupWeightedIsolationRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits"), againstElectronMVA5raw = cms.InputTag("hpsPFTauDiscriminationByMVA5rawElectronRejection"), againstElectronMVA5category = cms.InputTag("hpsPFTauDiscriminationByMVA5rawElectronRejection:category"), againstElectronVLooseMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5VLooseElectronRejection"), @@ -158,7 +129,7 @@ againstElectronMediumMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5MediumElectronRejection"), againstElectronTightMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5TightElectronRejection"), againstElectronVTightMVA5 = cms.InputTag("hpsPFTauDiscriminationByMVA5VTightElectronRejection"), -# againstElectronDeadECAL = cms.InputTag("hpsPFTauDiscriminationByDeadECALElectronRejection"), + ##againstElectronDeadECAL = cms.InputTag("hpsPFTauDiscriminationByDeadECALElectronRejection"), ), # mc matching configurables diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 167dce4cfe9b6..27aa7451c11ae 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -102,28 +102,28 @@ def _switchToPFTau(process, # Hadron-plus-strip(s) (HPS) Tau Discriminators hpsTauIDSources = [ ("decayModeFindingNewDMs", "DiscriminationByDecayModeFindingNewDMs"), - ("decayModeFindingOldDMs", "DiscriminationByDecayModeFindingOldDMs"), ("decayModeFinding", "DiscriminationByDecayModeFinding"), # CV: kept for backwards compatibility - ("byLooseIsolation", "DiscriminationByLooseIsolation"), - ("byVLooseCombinedIsolationDeltaBetaCorr", "DiscriminationByVLooseCombinedIsolationDBSumPtCorr"), - ("byLooseCombinedIsolationDeltaBetaCorr", "DiscriminationByLooseCombinedIsolationDBSumPtCorr"), - ("byMediumCombinedIsolationDeltaBetaCorr", "DiscriminationByMediumCombinedIsolationDBSumPtCorr"), - ("byTightCombinedIsolationDeltaBetaCorr", "DiscriminationByTightCombinedIsolationDBSumPtCorr"), - ("byCombinedIsolationDeltaBetaCorrRaw", "DiscriminationByRawCombinedIsolationDBSumPtCorr"), ("byLooseCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits"), ("byMediumCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), ("byTightCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), ("byCombinedIsolationDeltaBetaCorrRaw3Hits", "DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), - ("chargedIsoPtSum", "MVA3IsolationChargedIsoPtSum"), - ("neutralIsoPtSum", "MVA3IsolationNeutralIsoPtSum"), - ("puCorrPtSum", "MVA3IsolationPUcorrPtSum"), - ("byIsolationMVA3oldDMwoLTraw", "DiscriminationByIsolationMVA3oldDMwoLTraw"), - ("byVLooseIsolationMVA3oldDMwoLT", "DiscriminationByVLooseIsolationMVA3oldDMwoLT"), - ("byLooseIsolationMVA3oldDMwoLT", "DiscriminationByLooseIsolationMVA3oldDMwoLT"), - ("byMediumIsolationMVA3oldDMwoLT", "DiscriminationByMediumIsolationMVA3oldDMwoLT"), - ("byTightIsolationMVA3oldDMwoLT", "DiscriminationByTightIsolationMVA3oldDMwoLT"), - ("byVTightIsolationMVA3oldDMwoLT", "DiscriminationByVTightIsolationMVA3oldDMwoLT"), - ("byVVTightIsolationMVA3oldDMwoLT", "DiscriminationByVVTightIsolationMVA3oldDMwoLT"), + ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + ("byMediumPileupWeightedIsolation3Hits", "DiscriminationByMediumPileupWeightedIsolation3Hits"), + ("byTightPileupWeightedIsolationHits", "DiscriminationByTightPileupWeightedIsolation3Hits"), + ("byPhotonPtSumOutsideSignalCone", "DiscriminationByPhotonPtSumOutsideSignalCone"), + ("byPileupWeightedIsolationRaw3Hits", "DiscriminationByRawPileupWeightedIsolation3Hits"), + ("chargedIsoPtSum", "ChargedIsoPtSum"), + ("neutralIsoPtSum", "NeutralIsoPtSum"), + ("puCorrPtSum", "PUcorrPtSum"), + ("footprintCorrection", "FootprintCorrection"), + ("photonPtSumOutsideSignalCone", "PhotonPtSumOutsideSignalCone"), + ##("byIsolationMVA3oldDMwoLTraw", "DiscriminationByIsolationMVA3oldDMwoLTraw"), + ##("byVLooseIsolationMVA3oldDMwoLT", "DiscriminationByVLooseIsolationMVA3oldDMwoLT"), + ##("byLooseIsolationMVA3oldDMwoLT", "DiscriminationByLooseIsolationMVA3oldDMwoLT"), + ##("byMediumIsolationMVA3oldDMwoLT", "DiscriminationByMediumIsolationMVA3oldDMwoLT"), + ##("byTightIsolationMVA3oldDMwoLT", "DiscriminationByTightIsolationMVA3oldDMwoLT"), + ##("byVTightIsolationMVA3oldDMwoLT", "DiscriminationByVTightIsolationMVA3oldDMwoLT"), + ##("byVVTightIsolationMVA3oldDMwoLT", "DiscriminationByVVTightIsolationMVA3oldDMwoLT"), ("byIsolationMVA3oldDMwLTraw", "DiscriminationByIsolationMVA3oldDMwLTraw"), ("byVLooseIsolationMVA3oldDMwLT", "DiscriminationByVLooseIsolationMVA3oldDMwLT"), ("byLooseIsolationMVA3oldDMwLT", "DiscriminationByLooseIsolationMVA3oldDMwLT"), @@ -132,12 +132,12 @@ def _switchToPFTau(process, ("byVTightIsolationMVA3oldDMwLT", "DiscriminationByVTightIsolationMVA3oldDMwLT"), ("byVVTightIsolationMVA3oldDMwLT", "DiscriminationByVVTightIsolationMVA3oldDMwLT"), ("byIsolationMVA3newDMwoLTraw", "DiscriminationByIsolationMVA3newDMwoLTraw"), - ("byVLooseIsolationMVA3newDMwoLT", "DiscriminationByVLooseIsolationMVA3newDMwoLT"), - ("byLooseIsolationMVA3newDMwoLT", "DiscriminationByLooseIsolationMVA3newDMwoLT"), - ("byMediumIsolationMVA3newDMwoLT", "DiscriminationByMediumIsolationMVA3newDMwoLT"), - ("byTightIsolationMVA3newDMwoLT", "DiscriminationByTightIsolationMVA3newDMwoLT"), - ("byVTightIsolationMVA3newDMwoLT", "DiscriminationByVTightIsolationMVA3newDMwoLT"), - ("byVVTightIsolationMVA3newDMwoLT", "DiscriminationByVVTightIsolationMVA3newDMwoLT"), + ##("byVLooseIsolationMVA3newDMwoLT", "DiscriminationByVLooseIsolationMVA3newDMwoLT"), + ##("byLooseIsolationMVA3newDMwoLT", "DiscriminationByLooseIsolationMVA3newDMwoLT"), + ##("byMediumIsolationMVA3newDMwoLT", "DiscriminationByMediumIsolationMVA3newDMwoLT"), + ##("byTightIsolationMVA3newDMwoLT", "DiscriminationByTightIsolationMVA3newDMwoLT"), + ##("byVTightIsolationMVA3newDMwoLT", "DiscriminationByVTightIsolationMVA3newDMwoLT"), + ##("byVVTightIsolationMVA3newDMwoLT", "DiscriminationByVVTightIsolationMVA3newDMwoLT"), ("byIsolationMVA3newDMwLTraw", "DiscriminationByIsolationMVA3newDMwLTraw"), ("byVLooseIsolationMVA3newDMwLT", "DiscriminationByVLooseIsolationMVA3newDMwLT"), ("byLooseIsolationMVA3newDMwLT", "DiscriminationByLooseIsolationMVA3newDMwLT"), @@ -145,9 +145,9 @@ def _switchToPFTau(process, ("byTightIsolationMVA3newDMwLT", "DiscriminationByTightIsolationMVA3newDMwLT"), ("byVTightIsolationMVA3newDMwLT", "DiscriminationByVTightIsolationMVA3newDMwLT"), ("byVVTightIsolationMVA3newDMwLT", "DiscriminationByVVTightIsolationMVA3newDMwLT"), - ("againstElectronLoose", "DiscriminationByLooseElectronRejection"), - ("againstElectronMedium", "DiscriminationByMediumElectronRejection"), - ("againstElectronTight", "DiscriminationByTightElectronRejection"), + ##("againstElectronLoose", "DiscriminationByLooseElectronRejection"), + ##("againstElectronMedium", "DiscriminationByMediumElectronRejection"), + ##("againstElectronTight", "DiscriminationByTightElectronRejection"), ("againstElectronMVA5raw", "DiscriminationByMVA5rawElectronRejection"), ("againstElectronMVA5category", "DiscriminationByMVA5rawElectronRejection:category"), ("againstElectronVLooseMVA5", "DiscriminationByMVA5VLooseElectronRejection"), @@ -155,20 +155,20 @@ def _switchToPFTau(process, ("againstElectronMediumMVA5", "DiscriminationByMVA5MediumElectronRejection"), ("againstElectronTightMVA5", "DiscriminationByMVA5TightElectronRejection"), ("againstElectronVTightMVA5", "DiscriminationByMVA5VTightElectronRejection"), - ("againstElectronDeadECAL", "DiscriminationByDeadECALElectronRejection"), - ("againstMuonLoose", "DiscriminationByLooseMuonRejection"), - ("againstMuonMedium", "DiscriminationByMediumMuonRejection"), - ("againstMuonTight", "DiscriminationByTightMuonRejection"), - ("againstMuonLoose2", "DiscriminationByLooseMuonRejection2"), - ("againstMuonMedium2", "DiscriminationByMediumMuonRejection2"), - ("againstMuonTight2", "DiscriminationByTightMuonRejection2"), + ##("againstElectronDeadECAL", "DiscriminationByDeadECALElectronRejection"), + ##("againstMuonLoose", "DiscriminationByLooseMuonRejection"), + ##("againstMuonMedium", "DiscriminationByMediumMuonRejection"), + ##("againstMuonTight", "DiscriminationByTightMuonRejection"), + ##("againstMuonLoose2", "DiscriminationByLooseMuonRejection2"), + ##("againstMuonMedium2", "DiscriminationByMediumMuonRejection2"), + ##("againstMuonTight2", "DiscriminationByTightMuonRejection2"), ("againstMuonLoose3", "DiscriminationByLooseMuonRejection3"), ("againstMuonTight3", "DiscriminationByTightMuonRejection3"), - ("againstMuonMVAraw", "DiscriminationByMVArawMuonRejection"), - ("againstMuonLooseMVA", "DiscriminationByMVALooseMuonRejection"), - ("againstMuonMediumMVA", "DiscriminationByMVAMediumMuonRejection"), - ("againstMuonTightMVA", "DiscriminationByMVATightMuonRejection") ] - + ##("againstMuonMVAraw", "DiscriminationByMVArawMuonRejection"), + ##("againstMuonLooseMVA", "DiscriminationByMVALooseMuonRejection"), + ##("againstMuonMediumMVA", "DiscriminationByMVAMediumMuonRejection"), + ##("againstMuonTightMVA", "DiscriminationByMVATightMuonRejection") + ] # switch to PFTau collection produced for fixed dR = 0.07 signal cone size def switchToPFTauFixedCone(process, diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 62c2dce2c1c6e..837522ce831f5 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -108,7 +108,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr = hpsPFTauDiscriminationByLooseIsolation.clone( deltaBetaPUTrackPtCutOverride = cms.double(0.5), @@ -118,7 +118,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr = hpsPFTauDiscriminationByMediumIsolation.clone( deltaBetaPUTrackPtCutOverride = cms.double(0.5), @@ -128,7 +128,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByTightIsolationDBSumPtCorr = hpsPFTauDiscriminationByTightIsolation.clone( deltaBetaPUTrackPtCutOverride = cms.double(0.5), @@ -138,7 +138,7 @@ applyOccupancyCut = False, applySumPtCut = True, ) -hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.maximumSumPtCut=hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt +hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.maximumSumPtCut = hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minGammaEt hpsPFTauDiscriminationByIsolationSeqDBSumPtCorr = cms.Sequence( hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr* @@ -549,18 +549,58 @@ hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits ) +hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( + ApplyDiscriminationByECALIsolation = cms.bool(False), + ApplyDiscriminationByWeightedECALIsolation = cms.bool(True), + UseAllPFCandsForWeights = cms.bool(True), + applyFootprintCorrection = cms.bool(True), + applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) +) + +hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + maximumSumPtCut = hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits.maximumSumPtCut +) + +hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + maximumSumPtCut = hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits.maximumSumPtCut +) + +hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + applySumPtCut = cms.bool(False) +) + +hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits.clone( + Prediscriminants = cms.PSet( + BooleanOperator = cms.string("and"), + decayMode = cms.PSet( + Producer = cms.InputTag('hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone'), + cut = cms.double(0.5) + ) + ), + applySumPtCut = cms.bool(False), + storeRawSumPt = cms.bool(True) +) + +hpsPFTauDiscriminationByPileupWeightedIsolationSeq3Hits = cms.Sequence( + hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone* + hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits +) + # Define the HPS selection discriminator used in cleaning hpsSelectionDiscriminator.PFTauProducer = cms.InputTag("combinatoricRecoTaus") from RecoTauTag.RecoTau.RecoTauCleaner_cfi import RecoTauCleaner -hpsPFTauProducerSansRefs=RecoTauCleaner.clone( - src=cms.InputTag("combinatoricRecoTaus") +hpsPFTauProducerSansRefs = RecoTauCleaner.clone( + src = cms.InputTag("combinatoricRecoTaus") ) from RecoTauTag.RecoTau.RecoTauPiZeroUnembedder_cfi import RecoTauPiZeroUnembedder -hpsPFTauProducer=RecoTauPiZeroUnembedder.clone( - src = cms.InputTag("hpsPFTauProducerSansRefs") +hpsPFTauProducer = RecoTauPiZeroUnembedder.clone( + src = cms.InputTag("hpsPFTauProducerSansRefs") ) @@ -604,7 +644,7 @@ ) from RecoTauTag.RecoTau.PFRecoTauDiscriminationByMVAIsolation2_cff import * -hpsPFTauMVA3IsolationChargedIsoPtSum = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( +hpsPFTauChargedIsoPtSum = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( PFTauProducer = cms.InputTag('hpsPFTauProducer'), Prediscriminants = requireDecayMode.clone(), ApplyDiscriminationByECALIsolation = cms.bool(False), @@ -617,12 +657,12 @@ isoConeSizeForDeltaBeta = cms.double(0.8), verbosity = cms.int32(0) ) -hpsPFTauMVA3IsolationNeutralIsoPtSum = hpsPFTauMVA3IsolationChargedIsoPtSum.clone( +hpsPFTauNeutralIsoPtSum = hpsPFTauChargedIsoPtSum.clone( ApplyDiscriminationByECALIsolation = cms.bool(True), ApplyDiscriminationByTrackerIsolation = cms.bool(False), verbosity = cms.int32(0) ) -hpsPFTauMVA3IsolationPUcorrPtSum = hpsPFTauMVA3IsolationChargedIsoPtSum.clone( +hpsPFTauPUcorrPtSum = hpsPFTauChargedIsoPtSum.clone( ApplyDiscriminationByECALIsolation = cms.bool(False), ApplyDiscriminationByTrackerIsolation = cms.bool(False), applyDeltaBetaCorrection = cms.bool(True), @@ -630,12 +670,24 @@ storeRawPUsumPt = cms.bool(True), verbosity = cms.int32(0) ) -hpsPFTauMVA3IsolationNeutralIsoPtSumWeight = hpsPFTauMVA3IsolationChargedIsoPtSum.clone( +hpsPFTauNeutralIsoPtSumWeight = hpsPFTauChargedIsoPtSum.clone( ApplyDiscriminationByWeightedECALIsolation = cms.bool(True), ApplyDiscriminationByTrackerIsolation = cms.bool(False), UseAllPFCandsForWeights = cms.bool(True), verbosity = cms.int32(0) ) +hpsPFTauFootprintCorrection = hpsPFTauChargedIsoPtSum.clone( + ApplyDiscriminationByTrackerIsolation = cms.bool(False), + storeRawSumPt = cms.bool(False), + storeRawFootprintCorrection = cms.bool(True), + verbosity = cms.int32(0) +) +hpsPFTauPhotonPtSumOutsideSignalCone = hpsPFTauChargedIsoPtSum.clone( + ApplyDiscriminationByTrackerIsolation = cms.bool(False), + storeRawSumPt = cms.bool(False), + storeRawPhotonSumPt_outsideSignalCone = cms.bool(True), + verbosity = cms.int32(0) +) hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw = discriminationByIsolationMVA2raw.clone( PFTauProducer = cms.InputTag('hpsPFTauProducer'), @@ -644,9 +696,9 @@ mvaName = cms.string("RecoTauTag_tauIdMVAoldDMwoLTv1"), mvaOpt = cms.string("oldDMwoLT"), srcTauTransverseImpactParameters = cms.InputTag('hpsPFTauTransverseImpactParameters'), - srcChargedIsoPtSum = cms.InputTag('hpsPFTauMVA3IsolationChargedIsoPtSum'), - srcNeutralIsoPtSum = cms.InputTag('hpsPFTauMVA3IsolationNeutralIsoPtSum'), - srcPUcorrPtSum = cms.InputTag('hpsPFTauMVA3IsolationPUcorrPtSum'), + srcChargedIsoPtSum = cms.InputTag('hpsPFTauChargedIsoPtSum'), + srcNeutralIsoPtSum = cms.InputTag('hpsPFTauNeutralIsoPtSum'), + srcPUcorrPtSum = cms.InputTag('hpsPFTauPUcorrPtSum'), verbosity = cms.int32(0) ) hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT = discriminationByIsolationMVA2VLoose.clone( @@ -758,11 +810,12 @@ hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT = hpsPFTauDiscriminationByVLooseIsolationMVA3newDMwLT.clone() hpsPFTauDiscriminationByVVTightIsolationMVA3newDMwLT.mapping[0].cut = cms.string("RecoTauTag_tauIdMVAnewDMwLTv1_WPEff40") - hpsPFTauMVAIsolation2Seq = cms.Sequence( - hpsPFTauMVA3IsolationChargedIsoPtSum - + hpsPFTauMVA3IsolationNeutralIsoPtSum - + hpsPFTauMVA3IsolationPUcorrPtSum + hpsPFTauChargedIsoPtSum + + hpsPFTauNeutralIsoPtSum + + hpsPFTauPUcorrPtSum + + hpsPFTauFootprintCorrection + + hpsPFTauPhotonPtSumOutsideSignalCone + hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw + hpsPFTauDiscriminationByVLooseIsolationMVA3oldDMwoLT + hpsPFTauDiscriminationByLooseIsolationMVA3oldDMwoLT @@ -813,13 +866,14 @@ #hpsPFTauDiscriminationByIsolationSeqRhoCorr* #hpsPFTauDiscriminationByIsolationSeqCustomRhoCorr* hpsPFTauDiscriminationByIsolationSeqDBSumPtCorr* - + hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr* hpsPFTauDiscriminationByRawChargedIsolationDBSumPtCorr* hpsPFTauDiscriminationByRawGammaIsolationDBSumPtCorr* hpsPFTauDiscriminationByCombinedIsolationSeqDBSumPtCorr* hpsPFTauDiscriminationByCombinedIsolationSeqDBSumPtCorr3Hits* + hpsPFTauDiscriminationByPileupWeightedIsolationSeq3Hits* hpsPFTauDiscriminationByLooseElectronRejection* hpsPFTauDiscriminationByMediumElectronRejection* diff --git a/RecoTauTag/RecoTau/interface/RecoTauConstructor.h b/RecoTauTag/RecoTau/interface/RecoTauConstructor.h index 7fa1345a471a0..1f68ca8a18822 100644 --- a/RecoTauTag/RecoTau/interface/RecoTauConstructor.h +++ b/RecoTauTag/RecoTau/interface/RecoTauConstructor.h @@ -30,6 +30,7 @@ #include "DataFormats/JetReco/interface/PFJetCollection.h" #include "DataFormats/TauReco/interface/PFRecoTauChargedHadron.h" #include "DataFormats/TauReco/interface/RecoTauPiZero.h" +#include "CommonTools/Utils/interface/StringObjectFunction.h" #include "boost/shared_ptr.hpp" #include @@ -53,7 +54,10 @@ class RecoTauConstructor { /// Constructor with PFCandidate Handle RecoTauConstructor(const PFJetRef& jetRef, const edm::Handle& pfCands, - bool copyGammasFromPiZeros=false); + bool copyGammasFromPiZeros = false, + const StringObjectFunction* signalConeSize = 0, + double minAbsPhotonSumPt_insideSignalCone = 2.5, double minRelPhotonSumPt_insideSignalCone = 0., + double minAbsPhotonSumPt_outsideSignalCone = 1.e+9, double minRelPhotonSumPt_outsideSignalCone = 1.e+9); /* * Code to set leading candidates. These are just wrappers about @@ -133,6 +137,13 @@ class RecoTauConstructor { typedef std::map SortedCollectionMap; bool copyGammas_; + + const StringObjectFunction* signalConeSize_; + double minAbsPhotonSumPt_insideSignalCone_; + double minRelPhotonSumPt_insideSignalCone_; + double minAbsPhotonSumPt_outsideSignalCone_; + double minRelPhotonSumPt_outsideSignalCone_; + // Retrieve collection associated to signal/iso and type std::vector* getCollection(Region region, ParticleType type); SortedListPtr getSortedCollection(Region region, ParticleType type); diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc index eed957de77242..41f001baf1806 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByHPSSelection.cc @@ -47,7 +47,6 @@ class PFRecoTauDiscriminationByHPSSelection : public PFTauDiscriminationProducer typedef std::pair DoublePair; typedef std::map DecayModeCutMap; - TauFunc signalConeFun_; DecayModeCutMap decayModeCuts_; double matchingCone_; double minPt_; @@ -60,8 +59,7 @@ class PFRecoTauDiscriminationByHPSSelection : public PFTauDiscriminationProducer }; PFRecoTauDiscriminationByHPSSelection::PFRecoTauDiscriminationByHPSSelection(const edm::ParameterSet& pset) - : PFTauDiscriminationProducerBase(pset), - signalConeFun_(pset.getParameter("coneSizeFormula")) + : PFTauDiscriminationProducerBase(pset) { // Get the matchign cut matchingCone_ = pset.getParameter("matchingCone"); @@ -217,7 +215,7 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c // Check if tau fails mass cut double maxMass_value = (*massWindow.maxMass_)(*tau); - if ( tauP4.M() > maxMass_value || tauP4.M() < massWindow.minMass_ ) { + if ( !((tauP4.M() - tau->bendCorrMass()) < maxMass_value && (tauP4.M() + tau->bendCorrMass()) > massWindow.minMass_) ) { if ( verbosity_ ) { edm::LogPrint("PFTauByHPSSelect") << " fails tau mass-window cut." ; } @@ -243,7 +241,7 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c } // Check if tau passes cone cut - double cone_size = signalConeFun_(*tau); + double cone_size = tau->signalConeSize(); // Check if any charged objects fail the signal cone cut BOOST_FOREACH(const reco::PFRecoTauChargedHadron& cand, tau->signalTauChargedHadronCandidates()) { if ( verbosity_ ) { @@ -258,10 +256,13 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c } // Now check the pizeros BOOST_FOREACH(const reco::RecoTauPiZero& cand, tau->signalPiZeroCandidates()) { + double dEta = TMath::Max(0., fabs(cand.eta() - tauP4.eta()) - cand.bendCorrEta()); + double dPhi = TMath::Max(0., fabs(cand.phi() - tauP4.phi()) - cand.bendCorrPhi()); + double dR = sqrt(dEta*dEta + dPhi*dPhi); if ( verbosity_ ) { - edm::LogPrint("PFTauByHPSSelect") << "dR(tau, signalPiZero) = " << deltaR(cand.p4(), tauP4) ; + edm::LogPrint("PFTauByHPSSelect") << "dR(tau, signalPiZero) = " << dR ; } - if ( deltaR(cand.p4(), tauP4) > cone_size ) { + if ( dR > cone_size ) { if ( verbosity_ ) { edm::LogPrint("PFTauByHPSSelect") << " fails signal-cone cut for strip(s)." ; } @@ -287,7 +288,7 @@ PFRecoTauDiscriminationByHPSSelection::discriminate(const reco::PFTauRef& tau) c } } } - + if ( minPixelHits_ > 0 ) { int numPixelHits = 0; const std::vector& chargedHadrCands = tau->signalPFChargedHadrCands(); diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index 8738f1dbb6cb7..56c43cea2c984 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -4,6 +4,7 @@ #include "RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h" #include "RecoTauTag/RecoTau/interface/RecoTauVertexAssociator.h" #include "RecoTauTag/RecoTau/interface/ConeTools.h" +#include "CommonTools/Utils/interface/StringCutObjectSelector.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "TMath.h" @@ -56,6 +57,10 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas pset.getParameter("storeRawSumPt") : false; storeRawPUsumPt_ = pset.exists("storeRawPUsumPt") ? pset.getParameter("storeRawPUsumPt") : false; + storeRawFootprintCorrection_ = pset.exists("storeRawFootprintCorrection") ? + pset.getParameter("storeRawFootprintCorrection") : false; + storeRawPhotonSumPt_outsideSignalCone_ = pset.exists("storeRawPhotonSumPt_outsideSignalCone") ? + pset.getParameter("storeRawPhotonSumPt_outsideSignalCone") : false; // Sanity check on requested options. We can't apply cuts and store the // raw output at the same time @@ -77,12 +82,14 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas // Can only store one type int numStoreOptions = 0; - if ( storeRawSumPt_ ) ++numStoreOptions; - if ( storeRawOccupancy_ ) ++numStoreOptions; - if ( storeRawPUsumPt_ ) ++numStoreOptions; + if ( storeRawSumPt_ ) ++numStoreOptions; + if ( storeRawOccupancy_ ) ++numStoreOptions; + if ( storeRawPUsumPt_ ) ++numStoreOptions; + if ( storeRawFootprintCorrection_ ) ++numStoreOptions; + if ( storeRawPhotonSumPt_outsideSignalCone_ ) ++numStoreOptions; if ( numStoreOptions > 1 ) { throw cms::Exception("BadIsoConfig") - << "Both 'store sum pt' and 'store occupancy' options are set." + << "Multiple 'store sum pt' and/or 'store occupancy' options are set." << " These options are mutually exclusive."; } @@ -92,6 +99,22 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas customIsoCone_ = -1; } + applyPhotonPtSumOutsideSignalConeCut_ = pset.getParameter("applyPhotonPtSumOutsideSignalConeCut"); + maxAbsPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxAbsPhotonSumPt_outsideSignalCone"); + maxRelPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxRelPhotonSumPt_outsideSignalCone"); + + applyFootprintCorrection_ = pset.getParameter("applyFootprintCorrection"); + if ( applyFootprintCorrection_ ) { + edm::VParameterSet cfgFootprintCorrections = pset.getParameter("footprintCorrections"); + for ( edm::VParameterSet::const_iterator cfgFootprintCorrection = cfgFootprintCorrections.begin(); + cfgFootprintCorrection != cfgFootprintCorrections.end(); ++cfgFootprintCorrection ) { + std::string selection = cfgFootprintCorrection->getParameter("selection"); + double offset = cfgFootprintCorrection->getParameter("offset"); + footprintCorrectionType* footprintCorrection = new footprintCorrectionType(selection, offset); + footprintCorrections_.push_back(footprintCorrection); + } + } + // Get the quality cuts specific to the isolation region edm::ParameterSet isolationQCuts = qualityCutsPSet_.getParameterSet( "isolationQualityCuts"); @@ -99,7 +122,7 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas qcuts_.reset(new tau::RecoTauQualityCuts(isolationQCuts)); vertexAssociator_.reset( - new tau::RecoTauVertexAssociator(qualityCutsPSet_,consumesCollector())); + new tau::RecoTauVertexAssociator(qualityCutsPSet_,consumesCollector())); applyDeltaBeta_ = pset.exists("applyDeltaBetaCorrection") ? pset.getParameter("applyDeltaBetaCorrection") : false; @@ -157,7 +180,13 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas pset.getParameter("verbosity") : 0; } - ~PFRecoTauDiscriminationByIsolation(){} + ~PFRecoTauDiscriminationByIsolation() + { + for ( std::vector::iterator it = footprintCorrections_.begin(); + it != footprintCorrections_.end(); ++it ) { + delete (*it); + } + } void beginEvent(const edm::Event& evt, const edm::EventSetup& evtSetup) override; double discriminate(const PFTauRef& pfTau) const override; @@ -195,10 +224,29 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas double offsetRelativeSumPt_; double customIsoCone_; + bool applyPhotonPtSumOutsideSignalConeCut_; + double maxAbsPhotonSumPt_outsideSignalCone_; + double maxRelPhotonSumPt_outsideSignalCone_; + + bool applyFootprintCorrection_; + struct footprintCorrectionType + { + footprintCorrectionType(const std::string& selection, double offset) + : selection_(selection), + offset_(offset) + {} + ~footprintCorrectionType() {} + StringCutObjectSelector selection_; + double offset_; + }; + std::vector footprintCorrections_; + // Options to store the raw value in the discriminator instead of boolean pass/fail flag bool storeRawOccupancy_; bool storeRawSumPt_; bool storeRawPUsumPt_; + bool storeRawFootprintCorrection_; + bool storeRawPhotonSumPt_outsideSignalCone_; /* ********************************************************************** **** Pileup Subtraction Parameters *********************************** @@ -360,54 +408,51 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const LogTrace("discriminate") << "After track cuts: " << allPU.size() ; // Now apply the rest of the cuts, like pt, and TIP, tracker hits, etc - if(!useAllPFCands_){ - std::vector cleanPU = - pileupQcutsGeneralQCuts_->filterCandRefs(allPU); + if ( !useAllPFCands_ ) { + std::vector cleanPU = + pileupQcutsGeneralQCuts_->filterCandRefs(allPU); std::vector cleanNPU = pileupQcutsGeneralQCuts_->filterCandRefs(allNPU); - LogTrace("discriminate") << "After cleaning cuts: " << cleanPU.size() ; - - // Only select PU tracks inside the isolation cone. - DRFilter deltaBetaFilter(pfTau->p4(), 0, deltaBetaCollectionCone_); - for(auto const & cand : cleanPU) { - if ( deltaBetaFilter(cand) ) isoPU_.push_back(cand); - } - - for(auto const & cand : cleanNPU) { - if ( deltaBetaFilter(cand) ) chPV_.push_back(cand); + // Only select PU tracks inside the isolation cone. + DRFilter deltaBetaFilter(pfTau->p4(), 0, deltaBetaCollectionCone_); + for ( auto const & cand : cleanPU ) { + if ( deltaBetaFilter(cand) ) isoPU_.push_back(cand); + } + + for ( auto const & cand : cleanNPU ) { + if ( deltaBetaFilter(cand) ) chPV_.push_back(cand); } LogTrace("discriminate") << "After cone cuts: " << isoPU_.size() << " " << chPV_.size() ; - }else{ - isoPU_=allPU; - chPV_= allNPU; + } else { + isoPU_ = allPU; + chPV_ = allNPU; } } - if (calculateWeights_) - { - for( auto const & isoObject : isoNeutral_ ) { - if(isoObject->charge() !=0){ - // weight only neutral objects - isoNeutralWeight_.push_back(*isoObject); - continue; - } - - double eta=isoObject->eta(); - double phi=isoObject->phi(); - double sumNPU = 0.5*log(weightedSum(chPV_,eta,phi)); - - double sumPU = 0.5*log(weightedSum(isoPU_,eta,phi)); - PFCandidate neutral = *isoObject; - if (sumNPU+sumPU>0) neutral.setP4(((sumNPU)/(sumNPU+sumPU))*neutral.p4()); - - isoNeutralWeight_.push_back(neutral); - } + if ( calculateWeights_ ) { + for ( auto const & isoObject : isoNeutral_ ) { + if ( isoObject->charge() != 0 ) { + // weight only neutral objects + isoNeutralWeight_.push_back(*isoObject); + continue; } + double eta = isoObject->eta(); + double phi = isoObject->phi(); + double sumNPU = 0.5*log(weightedSum(chPV_, eta, phi)); + + double sumPU = 0.5*log(weightedSum(isoPU_, eta, phi)); + PFCandidate neutral = (*isoObject); + if ( (sumNPU + sumPU) > 0 ) neutral.setP4(((sumNPU)/(sumNPU + sumPU))*neutral.p4()); + + isoNeutralWeight_.push_back(neutral); + } + } + // Check if we want a custom iso cone if ( customIsoCone_ >= 0. ) { DRFilter filter(pfTau->p4(), 0, customIsoCone_); @@ -451,46 +496,59 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const failsOccupancyCut = ( nOccupants > maximumOccupancy_ ); - double totalPt = 0.0; - double puPt = 0.0; + double footprintCorrection_value = 0.; + if ( applyFootprintCorrection_ || storeRawFootprintCorrection_ ) { + for ( std::vector::const_iterator footprintCorrection = footprintCorrections_.begin(); + footprintCorrection != footprintCorrections_.end(); ++footprintCorrection ) { + if ( (*footprintCorrection)->selection_(*pfTau) ) footprintCorrection_value = (*footprintCorrection)->offset_; + } + } + + double totalPt = 0.; + double puPt = 0.; //--- Sum PT requirement if ( applySumPtCut_ || applyRelativeSumPtCut_ || storeRawSumPt_ || storeRawPUsumPt_ ) { double chargedPt = 0.0; double neutralPt = 0.0; double weightedNeutralPt = 0.0; - for( auto const & isoObject : isoCharged_ ) { + for ( auto const & isoObject : isoCharged_ ) { chargedPt += isoObject->pt(); } - if(!calculateWeights_){ - for( auto const & isoObject : isoNeutral_ ) { + if ( !calculateWeights_ ) { + for ( auto const & isoObject : isoNeutral_ ) { neutralPt += isoObject->pt(); } - }else{ - for( auto const & isoObject : isoNeutralWeight_){ - weightedNeutralPt+=isoObject.pt(); + } else { + for ( auto const & isoObject : isoNeutralWeight_ ) { + weightedNeutralPt += isoObject.pt(); } } - for( auto const & isoObject : isoPU_ ) { + for ( auto const & isoObject : isoPU_ ) { puPt += isoObject->pt(); } - LogTrace("discriminate") << "chargedPt = " << chargedPt ; - LogTrace("discriminate") << "neutralPt = " << neutralPt ; - LogTrace("discriminate") << "weighted neutral Pt = " << weightedNeutralPt ; - LogTrace("discriminate") << "puPt = " << puPt << " (delta-beta corr. = " << (deltaBetaFactorThisEvent_*puPt) << ")" ; - if( calculateWeights_) { + LogTrace("discriminate") << "chargedPt = " << chargedPt ; + LogTrace("discriminate") << "neutralPt = " << neutralPt ; + LogTrace("discriminate") << "weighted neutral Pt = " << weightedNeutralPt ; + LogTrace("discriminate") << "puPt = " << puPt << " (delta-beta corr. = " << (deltaBetaFactorThisEvent_*puPt) << ")" ; + + if ( calculateWeights_ ) { neutralPt = weightedNeutralPt; } if ( applyDeltaBeta_ ) { - neutralPt -= deltaBetaFactorThisEvent_*puPt; + neutralPt -= (deltaBetaFactorThisEvent_*puPt); } - + + if ( applyFootprintCorrection_ ) { + neutralPt -= footprintCorrection_value; + } + if ( applyRhoCorrection_ ) { neutralPt -= rhoThisEvent_; } - if ( neutralPt < 0.0 ) { - neutralPt = 0.0; + if ( neutralPt < 0. ) { + neutralPt = 0.; } totalPt = chargedPt + neutralPt; @@ -501,10 +559,25 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const //--- Relative Sum PT requirement failsRelativeSumPtCut = (totalPt > ((pfTau->pt() - offsetRelativeSumPt_)*maximumRelativeSumPt_)); } + + bool failsPhotonPtSumOutsideSignalConeCut = false; + double photonSumPt_outsideSignalCone = 0.; + if ( applyPhotonPtSumOutsideSignalConeCut_ || storeRawPhotonSumPt_outsideSignalCone_ ) { + const std::vector& signalPFGammas = pfTau->signalPFGammaCands(); + for ( std::vector::const_iterator signalPFGamma = signalPFGammas.begin(); + signalPFGamma != signalPFGammas.end(); ++signalPFGamma ) { + double dR = deltaR(pfTau->eta(), pfTau->phi(), (*signalPFGamma)->eta(), (*signalPFGamma)->phi()); + if ( dR > pfTau->signalConeSize() ) photonSumPt_outsideSignalCone += (*signalPFGamma)->pt(); + } + if ( photonSumPt_outsideSignalCone > maxAbsPhotonSumPt_outsideSignalCone_ || photonSumPt_outsideSignalCone > (maxRelPhotonSumPt_outsideSignalCone_*pfTau->pt()) ) { + failsPhotonPtSumOutsideSignalConeCut = true; + } + } bool fails = (applyOccupancyCut_ && failsOccupancyCut) || (applySumPtCut_ && failsSumPtCut) || - (applyRelativeSumPtCut_ && failsRelativeSumPtCut); + (applyRelativeSumPtCut_ && failsRelativeSumPtCut) || + (applyPhotonPtSumOutsideSignalConeCut_ && failsPhotonPtSumOutsideSignalConeCut); // We did error checking in the constructor, so this is safe. if ( storeRawSumPt_ ) { @@ -515,6 +588,10 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const else return 0.; } else if ( storeRawOccupancy_ ) { return nOccupants; + } else if ( storeRawFootprintCorrection_ ) { + return footprintCorrection_value; + } else if ( storeRawPhotonSumPt_outsideSignalCone_ ) { + return photonSumPt_outsideSignalCone; } else { return (fails ? 0. : 1.); } diff --git a/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc b/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc index 96edf7b7fc677..5aaaa268b0740 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauBuilderCombinatoricPlugin.cc @@ -7,6 +7,8 @@ #include "RecoTauTag/RecoTau/interface/RecoTauCrossCleaning.h" #include "RecoTauTag/RecoTau/interface/ConeTools.h" +#include "CommonTools/Utils/interface/StringObjectFunction.h" + #include "DataFormats/TauReco/interface/PFTau.h" #include "DataFormats/TauReco/interface/PFRecoTauChargedHadron.h" #include "DataFormats/TauReco/interface/RecoTauPiZero.h" @@ -14,6 +16,8 @@ #include "RecoTauTag/RecoTau/interface/RecoTauConstructor.h" #include "RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h" +#include + namespace reco { namespace tau { typedef std::vector ChargedHadronList; @@ -47,13 +51,24 @@ class RecoTauBuilderCombinatoricPlugin : public RecoTauBuilderPlugin }; std::vector decayModesToBuild_; + StringObjectFunction signalConeSize_; + double minAbsPhotonSumPt_insideSignalCone_; + double minRelPhotonSumPt_insideSignalCone_; + double minAbsPhotonSumPt_outsideSignalCone_; + double minRelPhotonSumPt_outsideSignalCone_; + int verbosity_; }; RecoTauBuilderCombinatoricPlugin::RecoTauBuilderCombinatoricPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector && iC) : RecoTauBuilderPlugin(pset, std::move(iC)), qcuts_(pset.getParameterSet("qualityCuts").getParameterSet("signalQualityCuts")), - isolationConeSize_(pset.getParameter("isolationConeSize")) + isolationConeSize_(pset.getParameter("isolationConeSize")), + signalConeSize_(pset.getParameter("signalConeSize")), + minAbsPhotonSumPt_insideSignalCone_(pset.getParameter("minAbsPhotonSumPt_insideSignalCone")), + minRelPhotonSumPt_insideSignalCone_(pset.getParameter("minRelPhotonSumPt_insideSignalCone")), + minAbsPhotonSumPt_outsideSignalCone_(pset.getParameter("minAbsPhotonSumPt_outsideSignalCone")), + minRelPhotonSumPt_outsideSignalCone_(pset.getParameter("minRelPhotonSumPt_outsideSignalCone")) { typedef std::vector VPSet; const VPSet& decayModes = pset.getParameter("decayModes"); @@ -66,7 +81,7 @@ RecoTauBuilderCombinatoricPlugin::RecoTauBuilderCombinatoricPlugin(const edm::Pa info.maxPiZeros_ = decayMode->getParameter("maxPiZeros"); decayModesToBuild_.push_back(info); } - + verbosity_ = ( pset.exists("verbosity") ) ? pset.getParameter("verbosity") : 0; } @@ -144,17 +159,9 @@ namespace } }; - std::string getPFCandidateType(reco::PFCandidate::ParticleType pfCandidateType) + double square(double x) { - if ( pfCandidateType == reco::PFCandidate::X ) return "undefined"; - else if ( pfCandidateType == reco::PFCandidate::h ) return "PFChargedHadron"; - else if ( pfCandidateType == reco::PFCandidate::e ) return "PFElectron"; - else if ( pfCandidateType == reco::PFCandidate::mu ) return "PFMuon"; - else if ( pfCandidateType == reco::PFCandidate::gamma ) return "PFGamma"; - else if ( pfCandidateType == reco::PFCandidate::h0 ) return "PFNeutralHadron"; - else if ( pfCandidateType == reco::PFCandidate::h_HF ) return "HF_had"; - else if ( pfCandidateType == reco::PFCandidate::egamma_HF ) return "HF_em"; - else assert(0); + return x*x; } } @@ -195,20 +202,16 @@ RecoTauBuilderCombinatoricPlugin::operator()( idx = 0; for ( PiZeroList::const_iterator piZero = piZeros.begin(); piZero != piZeros.end(); ++piZero ) { - std::cout << "piZero #" << idx << ": Pt = " << piZero->pt() << ", eta = " << piZero->eta() << ", phi = " << piZero->phi() << std::endl; - size_t numDaughters = piZero->numberOfDaughters(); - for ( size_t iDaughter = 0; iDaughter < numDaughters; ++iDaughter ) { - const reco::PFCandidate* daughter = dynamic_cast(piZero->daughterPtr(iDaughter).get()); - std::cout << " daughter #" << iDaughter << " (" << getPFCandidateType(daughter->particleId()) << "):" - << " Pt = " << daughter->pt() << ", eta = " << daughter->eta() << ", phi = " << daughter->phi() << std::endl; - } + std::cout << "piZero #" << idx << ":" << std::endl; + piZero->print(std::cout); ++idx; } } PFCandPtrs pfchs = qcuts_.filterCandRefs(pfChargedCands(*jet)); PFCandPtrs pfnhs = qcuts_.filterCandRefs(pfCandidates(*jet, reco::PFCandidate::h0)); - + PFCandPtrs pfgammas = qcuts_.filterCandRefs(pfCandidates(*jet, reco::PFCandidate::gamma)); + /// Apply quality cuts to the regional junk around the jet. Note that the /// particle contents of the junk is exclusive to the jet content. PFCandPtrs regionalJunk = qcuts_.filterCandRefs(regionalExtras); @@ -222,8 +225,9 @@ RecoTauBuilderCombinatoricPlugin::operator()( size_t tracksToBuild = decayMode->nCharged_; if ( verbosity_ ) { std::cout << "piZerosToBuild = " << piZerosToBuild << std::endl; + std::cout << "#piZeros = " << piZeros.size() << std::endl; std::cout << "tracksToBuild = " << tracksToBuild << std::endl; - std::cout << "#chargedHadrons = " << chargedHadrons.size() << std::endl; + std::cout << "#chargedHadrons = " << chargedHadrons.size() << std::endl; } // Skip decay mode if jet doesn't have the multiplicity to support it @@ -271,7 +275,10 @@ RecoTauBuilderCombinatoricPlugin::operator()( for ( PiZeroCombo::iterator piZeroCombo = piZeroCombos.begin(); piZeroCombo != piZeroCombos.end(); ++piZeroCombo ) { // Output tau - RecoTauConstructor tau(jet, getPFCands(), true); + RecoTauConstructor tau( + jet, getPFCands(), true, + &signalConeSize_, + minAbsPhotonSumPt_insideSignalCone_, minRelPhotonSumPt_insideSignalCone_, minAbsPhotonSumPt_outsideSignalCone_, minRelPhotonSumPt_outsideSignalCone_); // Reserve space in our collections tau.reserve( RecoTauConstructor::kSignal, @@ -301,6 +308,16 @@ RecoTauBuilderCombinatoricPlugin::operator()( cleanIsolationPiZeros.push_back(precleanedPiZero); } } + if ( verbosity_ ) { + std::cout << "#cleanIsolationPiZeros = " << cleanIsolationPiZeros.size() << std::endl; + int idx = 0; + for ( PiZeroList::const_iterator piZero = cleanIsolationPiZeros.begin(); + piZero != cleanIsolationPiZeros.end(); ++piZero ) { + std::cout << "piZero #" << idx << ":" << std::endl; + piZero->print(std::cout); + ++idx; + } + } // FIXME - are all these reserves okay? will they get propagated to the // dataformat size if they are wrong? @@ -345,7 +362,7 @@ RecoTauBuilderCombinatoricPlugin::operator()( xclean::PredicateAND pfCandFilter_comboChargedHadrons(isolationConeFilter, pfChargedHadronXCleaner_comboChargedHadrons); // 2.) to select neutral PFCandidates within jet xclean::CrossCleanPtrs pfChargedHadronXCleaner_allChargedHadrons(chargedHadrons.begin(), chargedHadrons.end()); - xclean::CrossCleanPtrs piZeroXCleaner(cleanIsolationPiZeros.begin(), cleanIsolationPiZeros.end()); + xclean::CrossCleanPtrs piZeroXCleaner(piZeros.begin(), piZeros.end()); typedef xclean::PredicateAND, xclean::CrossCleanPtrs > pfCandXCleanerType; pfCandXCleanerType pfCandXCleaner_allChargedHadrons(pfChargedHadronXCleaner_allChargedHadrons, piZeroXCleaner); // And this cleaning filter predicate with our Iso cone filter @@ -429,6 +446,18 @@ RecoTauBuilderCombinatoricPlugin::operator()( boost::make_filter_iterator( pfChargedJunk, regionalJunk.end(), regionalJunk.end())); + // Add all PFGamma constituents of the jet that are not part of a PiZero + if ( verbosity_ >= 2 ) { + std::cout << "adding isolation PFGammas not considered in PiZeros:" << std::endl; + } + tau.addPFCands( + RecoTauConstructor::kIsolation, RecoTauConstructor::kGamma, + boost::make_filter_iterator( + pfCandFilter_allChargedHadrons, + pfgammas.begin(), pfgammas.end()), + boost::make_filter_iterator( + pfCandFilter_allChargedHadrons, + pfgammas.end(), pfgammas.end())); // Add all gammas that are in the iso cone but weren't in the // orginal PFJet tau.addPFCands( @@ -458,7 +487,30 @@ RecoTauBuilderCombinatoricPlugin::operator()( std::auto_ptr tauPtr = tau.get(true); - if ( primaryVertexRef.isNonnull() ) tauPtr->setVertex(primaryVertexRef->position()); + if ( primaryVertexRef.isNonnull() ) { + tauPtr->setVertex(primaryVertexRef->position()); + } + + double tauEn = tauPtr->energy(); + double tauPz = tauPtr->pz(); + const double chargedPionMass = 0.13957; // GeV + double tauMass = std::max(tauPtr->mass(), chargedPionMass); + double bendCorrMass2 = 0.; + const std::vector& piZeros = tauPtr->signalPiZeroCandidates(); + BOOST_FOREACH( const RecoTauPiZero& piZero, piZeros ) { + double piZeroEn = piZero.energy(); + double piZeroPx = piZero.px(); + double piZeroPy = piZero.py(); + double piZeroPz = piZero.pz(); + double tau_wo_piZeroPx = tauPtr->px() - piZeroPx; + double tau_wo_piZeroPy = tauPtr->py() - piZeroPy; + // CV: Compute effect of varying strip four-vector by eta and phi correction on tau mass + // (derrivative of tau mass by strip eta, phi has been computed using Mathematica) + bendCorrMass2 += square(((piZeroPz*tauEn - piZeroEn*tauPz)/tauMass)*piZero.bendCorrEta()); + bendCorrMass2 += square(((piZeroPy*tau_wo_piZeroPx - piZeroPx*tau_wo_piZeroPy)/tauMass)*piZero.bendCorrPhi()); + } + //edm::LogPrint("RecoTauBuilderCombinatoricPlugin") << "bendCorrMass2 = " << sqrt(bendCorrMass2) << std::endl; + tauPtr->setBendCorrMass(sqrt(bendCorrMass2)); output.push_back(tauPtr); } diff --git a/RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc b/RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc new file mode 100644 index 0000000000000..ce8688323ce77 --- /dev/null +++ b/RecoTauTag/RecoTau/plugins/RecoTauChargedHadronMultiplicityCleanerPlugin.cc @@ -0,0 +1,50 @@ +/* + * RecoTauChargedHadronMultiplicityCleanerPlugin + * + * Author: Christian Veelken, NICPB Tallinn + * + * A reco tau cleaner plugin that ranks the PFTaus by the number of charged hadrons. + */ + +#include "RecoTauTag/RecoTau/interface/RecoTauBuilderPlugins.h" +#include "DataFormats/TauReco/interface/PFTauDiscriminator.h" + +namespace reco { namespace tau { + +class RecoTauChargedHadronMultiplicityCleanerPlugin : public RecoTauCleanerPlugin +{ + public: + RecoTauChargedHadronMultiplicityCleanerPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector&& iC); + virtual ~RecoTauChargedHadronMultiplicityCleanerPlugin(){} + + // Get ranking value for a given tau Ref + double operator()(const reco::PFTauRef&) const override; +}; + +RecoTauChargedHadronMultiplicityCleanerPlugin::RecoTauChargedHadronMultiplicityCleanerPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector&& iC) + : RecoTauCleanerPlugin(pset,std::move(iC)) +{} + +double RecoTauChargedHadronMultiplicityCleanerPlugin::operator()(const reco::PFTauRef& tau) const +{ + // Get the ranking value for this tau. + // N.B. lower value means more "tau like"! + double result = 0.; + const std::vector& chargedHadrons = tau->signalTauChargedHadronCandidates(); + for ( std::vector::const_iterator chargedHadron = chargedHadrons.begin(); + chargedHadron != chargedHadrons.end(); ++chargedHadron ) { + if ( chargedHadron->algo() == PFRecoTauChargedHadron::kChargedPFCandidate ) result -= 8.; + else if ( chargedHadron->algo() == PFRecoTauChargedHadron::kTrack ) result -= 4.; + else if ( chargedHadron->algo() == PFRecoTauChargedHadron::kPFNeutralHadron ) result -= 2.; + else result -= 1.; + } + return result; +} + +}} // end namespace reco::tau + +// Register our plugin +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_EDM_PLUGIN(RecoTauCleanerPluginFactory, + reco::tau::RecoTauChargedHadronMultiplicityCleanerPlugin, + "RecoTauChargedHadronMultiplicityCleanerPlugin"); diff --git a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc index 84bb16d88a94c..df052e5929f9c 100644 --- a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc +++ b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin2.cc @@ -170,15 +170,16 @@ void RecoTauPiZeroStripPlugin2::addCandsToStrip(RecoTauPiZero& strip, PFCandPtrs } } -void markCandsInStrip(std::vector& candFlags, const std::set& candIds) +namespace { - for ( std::set::const_iterator candId = candIds.begin(); - candId != candIds.end(); ++candId ) { - candFlags[*candId] = true; + void markCandsInStrip(std::vector& candFlags, const std::set& candIds) + { + for ( std::set::const_iterator candId = candIds.begin(); + candId != candIds.end(); ++candId ) { + candFlags[*candId] = true; + } } -} - -namespace { + inline const reco::TrackBaseRef getTrack(const PFCandidate& cand) { if ( cand.trackRef().isNonnull() ) return reco::TrackBaseRef(cand.trackRef()); diff --git a/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc new file mode 100644 index 0000000000000..8616ee0e8c420 --- /dev/null +++ b/RecoTauTag/RecoTau/plugins/RecoTauPiZeroStripPlugin3.cc @@ -0,0 +1,400 @@ +/* + * RecoTauPiZeroStripPlugin3 + * + * Merges PFGammas in a PFJet into Candidate piZeros defined as + * strips in eta-phi. + * + * Author: Michail Bachtis (University of Wisconsin) + * + * Code modifications: Evan Friis (UC Davis), + * Christian Veelken (LLR) + * + */ + +#include +#include + +#include "boost/bind.hpp" + +#include "RecoTauTag/RecoTau/interface/RecoTauPiZeroPlugins.h" + +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/TauReco/interface/RecoTauPiZero.h" +#include "DataFormats/JetReco/interface/PFJet.h" +#include "CommonTools/CandUtils/interface/AddFourMomenta.h" +#include "DataFormats/Math/interface/deltaPhi.h" + +#include "RecoTauTag/RecoTau/interface/RecoTauCommonUtilities.h" +#include "RecoTauTag/RecoTau/interface/RecoTauQualityCuts.h" +#include "RecoTauTag/RecoTau/interface/RecoTauVertexAssociator.h" +#include "RecoTauTag/RecoTau/interface/CombinatoricGenerator.h" + +//------------------------------------------------------------------------------- +// CV: the following headers are needed only for debug print-out +#include "DataFormats/GsfTrackReco/interface/GsfTrack.h" +#include "DataFormats/TrackReco/interface/Track.h" +//------------------------------------------------------------------------------- + +#include "TString.h" +#include "TFormula.h" + +namespace reco { namespace tau { + +namespace { + // Apply a hypothesis on the mass of the strips. + math::XYZTLorentzVector applyMassConstraint( + const math::XYZTLorentzVector& vec,double mass) { + double factor = sqrt(vec.energy()*vec.energy()-mass*mass)/vec.P(); + return math::XYZTLorentzVector( + vec.px()*factor,vec.py()*factor,vec.pz()*factor,vec.energy()); + } +} + +class RecoTauPiZeroStripPlugin3 : public RecoTauPiZeroBuilderPlugin +{ + public: + explicit RecoTauPiZeroStripPlugin3(const edm::ParameterSet&, edm::ConsumesCollector &&iC); + virtual ~RecoTauPiZeroStripPlugin3(); + // Return type is auto_ptr + return_type operator()(const reco::PFJet&) const override; + // Hook to update PV information + virtual void beginEvent() override; + + private: + typedef std::vector PFCandPtrs; + void addCandsToStrip(RecoTauPiZero&, PFCandPtrs&, const std::vector&, std::set&, bool&) const; + + RecoTauVertexAssociator vertexAssociator_; + + RecoTauQualityCuts* qcuts_; + bool applyElecTrackQcuts_; + double minGammaEtStripSeed_; + double minGammaEtStripAdd_; + + double minStripEt_; + + std::vector inputPdgIds_; // type of candidates to clusterize + TFormula* etaAssociationDistance_; // size of strip clustering window in eta direction + TFormula* phiAssociationDistance_; // size of strip clustering window in phi direction + + bool updateStripAfterEachDaughter_; + int maxStripBuildIterations_; + + // Parameters for build strip combinations + bool combineStrips_; + int maxStrips_; + double combinatoricStripMassHypo_; + + AddFourMomenta p4Builder_; + + int verbosity_; +}; + +namespace +{ + TFormula* makeFunction(const std::string& functionName, const edm::ParameterSet& pset) + { + TString formula = pset.getParameter("function"); + formula = formula.ReplaceAll("pT", "x"); + TFormula* function = new TFormula(functionName.data(), formula.Data()); + int numParameter = function->GetNpar(); + for ( int idxParameter = 0; idxParameter < numParameter; ++idxParameter ) { + std::string parameterName = Form("par%i", idxParameter); + double parameter = pset.getParameter(parameterName); + function->SetParameter(idxParameter, parameter); + } + return function; + } +} + +RecoTauPiZeroStripPlugin3::RecoTauPiZeroStripPlugin3(const edm::ParameterSet& pset, edm::ConsumesCollector &&iC) + : RecoTauPiZeroBuilderPlugin(pset, std::move(iC)), + vertexAssociator_(pset.getParameter("qualityCuts"), std::move(iC)), + qcuts_(0), + etaAssociationDistance_(0), + phiAssociationDistance_(0) +{ + minGammaEtStripSeed_ = pset.getParameter("minGammaEtStripSeed"); + minGammaEtStripAdd_ = pset.getParameter("minGammaEtStripAdd"); + + minStripEt_ = pset.getParameter("minStripEt"); + + edm::ParameterSet qcuts_pset = pset.getParameterSet("qualityCuts").getParameterSet("signalQualityCuts"); +//------------------------------------------------------------------------------- +// CV: disable track quality cuts for PFElectronsPFElectron +// (treat PFElectrons like PFGammas for the purpose of building eta-phi strips) + applyElecTrackQcuts_ = pset.getParameter("applyElecTrackQcuts"); + if ( !applyElecTrackQcuts_ ) { + qcuts_pset.addParameter("minTrackPt", std::min(minGammaEtStripSeed_, minGammaEtStripAdd_)); + qcuts_pset.addParameter("maxTrackChi2", 1.e+9); + qcuts_pset.addParameter("maxTransverseImpactParameter", 1.e+9); + qcuts_pset.addParameter("maxDeltaZ", 1.e+9); + qcuts_pset.addParameter("minTrackVertexWeight", -1.); + qcuts_pset.addParameter("minTrackPixelHits", 0); + qcuts_pset.addParameter("minTrackHits", 0); + } +//------------------------------------------------------------------------------- + qcuts_pset.addParameter("minGammaEt", std::min(minGammaEtStripSeed_, minGammaEtStripAdd_)); + qcuts_ = new RecoTauQualityCuts(qcuts_pset); + + inputPdgIds_ = pset.getParameter >("stripCandidatesParticleIds"); + edm::ParameterSet stripSize_eta_pset = pset.getParameterSet("stripEtaAssociationDistance"); + etaAssociationDistance_ = makeFunction("etaAssociationDistance", stripSize_eta_pset); + edm::ParameterSet stripSize_phi_pset = pset.getParameterSet("stripPhiAssociationDistance"); + phiAssociationDistance_ = makeFunction("phiAssociationDistance", stripSize_phi_pset); + + updateStripAfterEachDaughter_ = pset.getParameter("updateStripAfterEachDaughter"); + maxStripBuildIterations_ = pset.getParameter("maxStripBuildIterations"); + + combineStrips_ = pset.getParameter("makeCombinatoricStrips"); + if ( combineStrips_ ) { + maxStrips_ = pset.getParameter("maxInputStrips"); + combinatoricStripMassHypo_ = pset.getParameter("stripMassWhenCombining"); + } + + verbosity_ = ( pset.exists("verbosity") ) ? + pset.getParameter("verbosity") : 0; +} + +RecoTauPiZeroStripPlugin3::~RecoTauPiZeroStripPlugin3() +{ + delete qcuts_; + delete etaAssociationDistance_; + delete phiAssociationDistance_; +} + +// Update the primary vertex +void RecoTauPiZeroStripPlugin3::beginEvent() +{ + vertexAssociator_.setEvent(*evt()); +} + +void RecoTauPiZeroStripPlugin3::addCandsToStrip(RecoTauPiZero& strip, PFCandPtrs& cands, const std::vector& candFlags, + std::set& candIdsCurrentStrip, bool& isCandAdded) const +{ + if ( verbosity_ >= 1 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << ":" ; + } + size_t numCands = cands.size(); + for ( size_t candId = 0; candId < numCands; ++candId ) { + if ( (!candFlags[candId]) && candIdsCurrentStrip.find(candId) == candIdsCurrentStrip.end() ) { // do not include same cand twice + reco::PFCandidatePtr cand = cands[candId]; + double etaAssociationDistance_value = etaAssociationDistance_->Eval(strip.pt()) + etaAssociationDistance_->Eval(cand->pt()); + double phiAssociationDistance_value = phiAssociationDistance_->Eval(strip.pt()) + phiAssociationDistance_->Eval(cand->pt()); + if ( fabs(strip.eta() - cand->eta()) < etaAssociationDistance_value && // check if cand is within eta-phi window centered on strip + fabs(strip.phi() - cand->phi()) < phiAssociationDistance_value ) { + if ( verbosity_ >= 2 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "--> adding PFCand #" << candId << " (" << cand.id() << ":" << cand.key() << "): Et = " << cand->et() << ", eta = " << cand->eta() << ", phi = " << cand->phi() ; + } + strip.addDaughter(cand); + if ( updateStripAfterEachDaughter_ ) p4Builder_.set(strip); + isCandAdded = true; + candIdsCurrentStrip.insert(candId); + } + } + } +} + +namespace +{ + void markCandsInStrip(std::vector& candFlags, const std::set& candIds) + { + for ( std::set::const_iterator candId = candIds.begin(); + candId != candIds.end(); ++candId ) { + candFlags[*candId] = true; + } + } + + inline const reco::TrackBaseRef getTrack(const PFCandidate& cand) + { + if ( cand.trackRef().isNonnull() ) return reco::TrackBaseRef(cand.trackRef()); + else if ( cand.gsfTrackRef().isNonnull() ) return reco::TrackBaseRef(cand.gsfTrackRef()); + else return reco::TrackBaseRef(); + } +} + +RecoTauPiZeroStripPlugin3::return_type RecoTauPiZeroStripPlugin3::operator()(const reco::PFJet& jet) const +{ + if ( verbosity_ >= 1 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << ":" ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " minGammaEtStripSeed = " << minGammaEtStripSeed_ ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " minGammaEtStripAdd = " << minGammaEtStripAdd_ ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " minStripEt = " << minStripEt_ ; + } + + PiZeroVector output; + + // Get the candidates passing our quality cuts + qcuts_->setPV(vertexAssociator_.associatedVertex(jet)); + PFCandPtrs candsVector = qcuts_->filterCandRefs(pfCandidates(jet, inputPdgIds_)); + + // Convert to stl::list to allow fast deletions + PFCandPtrs seedCands; + PFCandPtrs addCands; + int idx = 0; + for ( PFCandPtrs::iterator cand = candsVector.begin(); + cand != candsVector.end(); ++cand ) { + if ( verbosity_ >= 1 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "PFGamma #" << idx << " (" << cand->id() << ":" << cand->key() << "): Et = " << (*cand)->et() << ", eta = " << (*cand)->eta() << ", phi = " << (*cand)->phi() ; + } + if ( (*cand)->et() > minGammaEtStripSeed_ ) { + if ( verbosity_ >= 2 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "--> assigning seedCandId = " << seedCands.size() ; + const reco::TrackBaseRef candTrack = getTrack(*cand); + if ( candTrack.isNonnull() ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "track: Pt = " << candTrack->pt() << " eta = " << candTrack->eta() << ", phi = " << candTrack->phi() << ", charge = " << candTrack->charge() ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << " (dZ = " << candTrack->dz(vertexAssociator_.associatedVertex(jet)->position()) << ", dXY = " << candTrack->dxy(vertexAssociator_.associatedVertex(jet)->position()) << "," + << " numHits = " << candTrack->hitPattern().numberOfValidTrackerHits() << ", numPxlHits = " << candTrack->hitPattern().numberOfValidPixelHits() << "," + << " chi2 = " << candTrack->normalizedChi2() << ", dPt/Pt = " << (candTrack->ptError()/candTrack->pt()) << ")" ; + } + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "ECAL Et: calibrated = " << (*cand)->ecalEnergy()*sin((*cand)->theta()) << "," + << " raw = " << (*cand)->rawEcalEnergy()*sin((*cand)->theta()) ; + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "HCAL Et: calibrated = " << (*cand)->hcalEnergy()*sin((*cand)->theta()) << "," + << " raw = " << (*cand)->rawHcalEnergy()*sin((*cand)->theta()) ; + } + seedCands.push_back(*cand); + } else if ( (*cand)->et() > minGammaEtStripAdd_ ) { + if ( verbosity_ >= 2 ) { + edm::LogPrint("RecoTauPiZeroStripPlugin3") << "--> assigning addCandId = " << addCands.size() ; + } + addCands.push_back(*cand); + } + ++idx; + } + + std::vector seedCandFlags(seedCands.size()); // true/false: seedCand is already/not yet included in strip + std::vector addCandFlags(addCands.size()); // true/false: addCand is already/not yet included in strip + + std::set seedCandIdsCurrentStrip; + std::set addCandIdsCurrentStrip; + + size_t idxSeed = 0; + while ( idxSeed < seedCands.size() ) { + if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << "processing seed #" << idxSeed ; + + seedCandIdsCurrentStrip.clear(); + addCandIdsCurrentStrip.clear(); + + std::auto_ptr strip(new RecoTauPiZero(*seedCands[idxSeed], RecoTauPiZero::kStrips)); + strip->addDaughter(seedCands[idxSeed]); + seedCandIdsCurrentStrip.insert(idxSeed); + + bool isCandAdded; + int stripBuildIteration = 0; + do { + isCandAdded = false; + + //if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << " adding seedCands to strip..." ; + addCandsToStrip(*strip, seedCands, seedCandFlags, seedCandIdsCurrentStrip, isCandAdded); + //if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << " adding addCands to strip..." ; + addCandsToStrip(*strip, addCands, addCandFlags, addCandIdsCurrentStrip, isCandAdded); + + if ( !updateStripAfterEachDaughter_ ) p4Builder_.set(*strip); + + ++stripBuildIteration; + } while ( isCandAdded && (stripBuildIteration < maxStripBuildIterations_ || maxStripBuildIterations_ == -1) ); + + if ( strip->et() > minStripEt_ ) { // strip passed Et cuts, add it to the event + if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << "Building strip: Et = " << strip->et() << ", eta = " << strip->eta() << ", phi = " << strip->phi() ; + + // Update the vertex + if ( strip->daughterPtr(0).isNonnull() ) strip->setVertex(strip->daughterPtr(0)->vertex()); + output.push_back(strip); + + // Mark daughters as being part of this strip + markCandsInStrip(seedCandFlags, seedCandIdsCurrentStrip); + markCandsInStrip(addCandFlags, addCandIdsCurrentStrip); + } else { // strip failed Et cuts, just skip it + if ( verbosity_ >= 2 ) edm::LogPrint("RecoTauPiZeroStripPlugin3") << "Discarding strip: Et = " << strip->et() << ", eta = " << strip->eta() << ", phi = " << strip->phi() ; + } + + ++idxSeed; + while ( idxSeed < seedCands.size() && seedCandFlags[idxSeed] ) { + ++idxSeed; // fast-forward to next seed cand not yet included in any strip + } + } + + // Check if we want to combine our strips + if ( combineStrips_ && output.size() > 1 ) { + PiZeroVector stripCombinations; + // Sort the output by descending pt + output.sort(output.begin(), output.end(), + boost::bind(&RecoTauPiZero::pt, _1) > + boost::bind(&RecoTauPiZero::pt, _2)); + // Get the end of interesting set of strips to try and combine + PiZeroVector::const_iterator end_iter = takeNElements( + output.begin(), output.end(), maxStrips_); + + // Look at all the combinations + for ( PiZeroVector::const_iterator first = output.begin(); + first != end_iter-1; ++first ) { + for ( PiZeroVector::const_iterator second = first+1; + second != end_iter; ++second ) { + Candidate::LorentzVector firstP4 = first->p4(); + Candidate::LorentzVector secondP4 = second->p4(); + // If we assume a certain mass for each strip apply it here. + firstP4 = applyMassConstraint(firstP4, combinatoricStripMassHypo_); + secondP4 = applyMassConstraint(secondP4, combinatoricStripMassHypo_); + Candidate::LorentzVector totalP4 = firstP4 + secondP4; + // Make our new combined strip + std::auto_ptr combinedStrips( + new RecoTauPiZero(0, totalP4, + Candidate::Point(0, 0, 0), + //111, 10001, true, RecoTauPiZero::kCombinatoricStrips)); + 111, 10001, true, RecoTauPiZero::kUndefined)); + + // Now loop over the strip members + BOOST_FOREACH(const RecoTauPiZero::daughters::value_type& gamma, + first->daughterPtrVector()) { + combinedStrips->addDaughter(gamma); + } + BOOST_FOREACH(const RecoTauPiZero::daughters::value_type& gamma, + second->daughterPtrVector()) { + combinedStrips->addDaughter(gamma); + } + // Update the vertex + if ( combinedStrips->daughterPtr(0).isNonnull() ) { + combinedStrips->setVertex(combinedStrips->daughterPtr(0)->vertex()); + } + + // Add to our collection of combined strips + stripCombinations.push_back(combinedStrips); + } + } + // When done doing all the combinations, add the combined strips to the + // output. + output.transfer(output.end(), stripCombinations); + } + + // Compute correction to account for spread of photon energy in eta and phi + // in case charged pions make nuclear interactions or photons convert within the tracking detector + for ( PiZeroVector::iterator strip = output.begin(); + strip != output.end(); ++strip ) { + double bendCorrEta = 0.; + double bendCorrPhi = 0.; + double energySum = 0.; + BOOST_FOREACH(const RecoTauPiZero::daughters::value_type& gamma, + strip->daughterPtrVector()) { + bendCorrEta += (gamma->energy()*etaAssociationDistance_->Eval(gamma->pt())); + bendCorrPhi += (gamma->energy()*phiAssociationDistance_->Eval(gamma->pt())); + energySum += gamma->energy(); + } + if ( energySum > 1.e-2 ) { + bendCorrEta /= energySum; + bendCorrPhi /= energySum; + } + //std::cout << "stripPt = " << strip->pt() << ": bendCorrEta = " << bendCorrEta << ", bendCorrPhi = " << bendCorrPhi << std::endl; + strip->setBendCorrEta(bendCorrEta); + strip->setBendCorrPhi(bendCorrPhi); + } + + return output.release(); +} +}} // end namespace reco::tau + +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_EDM_PLUGIN(RecoTauPiZeroBuilderPluginFactory, + reco::tau::RecoTauPiZeroStripPlugin3, "RecoTauPiZeroStripPlugin3"); diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py index b696df359b875..48f680f011703 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByHPSSelection_cfi.py @@ -66,7 +66,6 @@ Prediscriminants = noPrediscriminants, matchingCone = PFRecoTauPFJetInputs.jetConeSize, minTauPt = cms.double(0.0), - coneSizeFormula = cms.string("max(min(0.1, 3.0/pt()), 0.05)"), decayModes = cms.VPSet( decayMode_1Prong0Pi0, decayMode_1Prong1Pi0, diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index d395f033c7609..8c9d929732bbf 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -26,13 +26,16 @@ relativeSumPtCut = cms.double(0.0), relativeSumPtOffset = cms.double(0.0), - qualityCuts = PFTauQualityCuts,# set the standard quality cuts + applyPhotonPtSumOutsideSignalConeCut = cms.bool(False), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.20), + + qualityCuts = PFTauQualityCuts, # set the standard quality cuts # Delta-Beta corrections to remove Pileup applyDeltaBetaCorrection = cms.bool(False), particleFlowSrc = cms.InputTag("particleFlow"), vertexSrc = PFTauQualityCuts.primaryVertexSrc, - # This must correspond to the cone size of the algorithm which built the # tau. (or if customOuterCone option is used, the custom cone size) isoConeSizeForDeltaBeta = cms.double(0.5), @@ -47,6 +50,31 @@ # Uncommenting the parameter below allows this threshold to be overridden. #deltaBetaPUTrackPtCutOverride = cms.double(1.5), + # Tau footprint correction + applyFootprintCorrection = cms.bool(False), + footprintCorrections = cms.VPSet( + cms.PSet( + selection = cms.string("decayMode() = 0"), + offset = cms.double(1.8) + ), + cms.PSet( + selection = cms.string("decayMode() = 1 || decayMode() = 2"), + offset = cms.double(1.5) + ), + cms.PSet( + selection = cms.string("decayMode() = 5"), + offset = cms.double(4.7) + ), + cms.PSet( + selection = cms.string("decayMode() = 6"), + offset = cms.double(1.9) + ), + cms.PSet( + selection = cms.string("decayMode() = 10"), + offset = cms.double(2.0) + ) + ), + # Rho corrections applyRhoCorrection = cms.bool(False), rhoProducer = cms.InputTag("fixedGridRhoFastjetAll"), diff --git a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py index c6bfc1c13f4fa..09687d9dfa2ac 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py @@ -60,6 +60,11 @@ tolerance = cms.double(1.e-2) # CV: consider candidates with almost equal pT to be of the same rank (to avoid sensitivity to rounding errors) ) +chargedHadronMultiplicity = cms.PSet( + name = cms.string("ChargedHadronMultiplicity"), + plugin = cms.string("RecoTauChargedHadronMultiplicityCleanerPlugin") +) + stripMultiplicity = cms.PSet( name = cms.string("StripMultiplicity"), plugin = cms.string("RecoTauStringCleanerPlugin"), diff --git a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py index f990d3c474231..30d65dd479550 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py @@ -2,36 +2,27 @@ import RecoTauTag.RecoTau.RecoTauCleanerPlugins as cleaners -RecoTauCleaner = cms.EDProducer( - "RecoTauCleaner", - src = cms.InputTag("combinatoricRecoTaus"), - cleaners = cms.VPSet( - # Reject taus that have charge == 3 - cleaners.unitCharge, - # Ignore taus reconstructed in pi0 decay modes in which the highest Pt ("leading") pi0 has pt below 2.5 GeV - # (in order to make decay mode reconstruction less sensitive to pile-up) - # NOTE: strips are sorted by decreasing pt - cms.PSet( - name = cms.string("leadStripPtLt2_5"), - plugin = cms.string("RecoTauStringCleanerPlugin"), - selection = cms.string("signalPiZeroCandidates().size() = 0 | signalPiZeroCandidates()[0].pt() > 2.5"), - selectionPassFunction = cms.string("0"), - selectionFailValue = cms.double(1e3) - ), - # Reject taus that are not within DR<0.1 of the jet axis - #cleaners.matchingConeCut, - # Reject taus that fail HPS selections - cms.PSet( - name = cms.string("HPS_Select"), - plugin = cms.string("RecoTauDiscriminantCleanerPlugin"), - src = cms.InputTag("hpsSelectionDiscriminator"), - ), - # CV: Take highes pT tau (use for testing of new high pT tau reconstruction and check if it can become the new default) - cleaners.pt, - # CV: in case two candidates have the same Pt, - # prefer candidates in which PFGammas are part of strips (rather than being merged with PFRecoTauChargedHadrons) - cleaners.stripMultiplicity, - # Take most isolated tau - cleaners.combinedIsolation - ) - ) +RecoTauCleaner = cms.EDProducer("RecoTauCleaner", + src = cms.InputTag("combinatoricRecoTaus"), + cleaners = cms.VPSet( + # Reject taus that have charge == 3 + cleaners.unitCharge, + # Reject taus that are not within DR<0.1 of the jet axis + #cleaners.matchingConeCut, + # Reject taus that fail HPS selections + cms.PSet( + name = cms.string("HPS_Select"), + plugin = cms.string("RecoTauDiscriminantCleanerPlugin"), + src = cms.InputTag("hpsSelectionDiscriminator"), + ), + # CV: prefer 3-prong candidates over 2-prong candidates and 2-prong candidates over 1-prong candidates + cleaners.chargedHadronMultiplicity, + # CV: Take highest pT tau (use for testing of new high pT tau reconstruction and check if it can become the new default) + cleaners.pt, + # CV: in case two candidates have the same Pt, + # prefer candidates in which PFGammas are part of strips (rather than being merged with PFRecoTauChargedHadrons) + cleaners.stripMultiplicity, + # Take most isolated tau + cleaners.combinedIsolation + ) +) diff --git a/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py b/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py index 8a39046ee66d8..8023b7b429927 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauCombinatoricProducer_cfi.py @@ -83,7 +83,12 @@ combinatoricDecayModeConfigs.config2prong0pi0, combinatoricDecayModeConfigs.config2prong1pi0, combinatoricDecayModeConfigs.config3prong0pi0 - ) + ), + signalConeSize = cms.string("max(min(0.1, 3.0/pt()), 0.05)"), + minAbsPhotonSumPt_insideSignalCone = cms.double(2.5), + minRelPhotonSumPt_insideSignalCone = cms.double(0.10), + minAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), # CV: always require at least some photon energy inside signal cone + minRelPhotonSumPt_outsideSignalCone = cms.double(1.e+9) # for a tau to be reconstructed in a decay mode with pi0s ) combinatoricRecoTaus = cms.EDProducer("RecoTauProducer", diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py index fafbeba289195..d8e29335057fd 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py @@ -36,9 +36,9 @@ plugin = cms.string("RecoTauPiZeroStripPlugin"), qualityCuts = PFTauQualityCuts, # Clusterize photons and electrons (PF numbering) - stripCandidatesParticleIds = cms.vint32(2, 4), - stripEtaAssociationDistance = cms.double(0.05), - stripPhiAssociationDistance = cms.double(0.2), + stripCandidatesParticleIds = cms.vint32(2, 4), + stripEtaAssociationDistance = cms.double(0.05), + stripPhiAssociationDistance = cms.double(0.2), makeCombinatoricStrips = cms.bool(False) ) @@ -47,9 +47,9 @@ plugin = cms.string("RecoTauPiZeroStripPlugin"), qualityCuts = PFTauQualityCuts, # Clusterize photons and electrons (PF numbering) - stripCandidatesParticleIds = cms.vint32(2, 4), - stripEtaAssociationDistance = cms.double(0.05), - stripPhiAssociationDistance = cms.double(0.2), + stripCandidatesParticleIds = cms.vint32(2, 4), + stripEtaAssociationDistance = cms.double(0.05), + stripPhiAssociationDistance = cms.double(0.2), makeCombinatoricStrips = cms.bool(True), maxInputStrips = cms.int32(5), stripMassWhenCombining = cms.double(0.0), # assume photon like @@ -67,3 +67,27 @@ maxStripBuildIterations = cms.int32(-1) ) +# Produce a "strips" of photons +# with no track quality cuts applied to PFElectrons +# and eta x phi size of strip increasing for low pT photons +modStrips2 = strips.clone( + plugin = cms.string('RecoTauPiZeroStripPlugin3'), + applyElecTrackQcuts = cms.bool(False), + minGammaEtStripSeed = cms.double(0.5), + minGammaEtStripAdd = cms.double(0.), + minStripEt = cms.double(0.5), + # CV: parametrization of strip size in eta and phi determined by Yuta Takahashi, + # chosen to contain 95% of photons from tau decays + stripEtaAssociationDistance = cms.PSet( + function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), + par0 = cms.double(2.15974e-01), + par1 = cms.double(5.14575e-01) + ), + stripPhiAssociationDistance = cms.PSet( + function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), + par0 = cms.double(3.74961e-01), + par1 = cms.double(5.99882e-01) + ), + updateStripAfterEachDaughter = cms.bool(False), + maxStripBuildIterations = cms.int32(-1) +) diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py index 3e71ed9f9d487..00b5419b8a260 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroProducer_cfi.py @@ -12,7 +12,8 @@ outputSelection = cms.string('pt > 0'), builders = cms.VPSet( #builders.strips - builders.modStrips + #builders.modStrips + builders.modStrips2 ), ranking = cms.VPSet( ranking.isInStrip @@ -39,7 +40,8 @@ builders = cms.VPSet( builders.combinatoricPhotonPairs, #builders.strips - builders.modStrips + #builders.modStrips + builders.modStrips2 ), ranking = cms.VPSet( ranking.nearPiZeroMassBarrel, # Prefer pi zeros +- 0.05 GeV correct mass diff --git a/RecoTauTag/RecoTau/src/RecoTauConstructor.cc b/RecoTauTag/RecoTau/src/RecoTauConstructor.cc index 5e724b429ee6f..c5f36486f0765 100644 --- a/RecoTauTag/RecoTau/src/RecoTauConstructor.cc +++ b/RecoTauTag/RecoTau/src/RecoTauConstructor.cc @@ -3,6 +3,8 @@ #include "RecoTauTag/RecoTau/interface/RecoTauCommonUtilities.h" #include "DataFormats/Common/interface/RefToPtr.h" +#include "DataFormats/Math/interface/deltaR.h" + #include "RecoTauTag/RecoTau/interface/pfRecoTauChargedHadronAuxFunctions.h" #include @@ -10,8 +12,17 @@ namespace reco { namespace tau { -RecoTauConstructor::RecoTauConstructor(const PFJetRef& jet, const edm::Handle& pfCands, bool copyGammasFromPiZeros) - : pfCands_(pfCands) +RecoTauConstructor::RecoTauConstructor(const PFJetRef& jet, const edm::Handle& pfCands, + bool copyGammasFromPiZeros, + const StringObjectFunction* signalConeSize, + double minAbsPhotonSumPt_insideSignalCone, double minRelPhotonSumPt_insideSignalCone, + double minAbsPhotonSumPt_outsideSignalCone, double minRelPhotonSumPt_outsideSignalCone) + : signalConeSize_(signalConeSize), + minAbsPhotonSumPt_insideSignalCone_(minAbsPhotonSumPt_insideSignalCone), + minRelPhotonSumPt_insideSignalCone_(minRelPhotonSumPt_insideSignalCone), + minAbsPhotonSumPt_outsideSignalCone_(minAbsPhotonSumPt_outsideSignalCone), + minRelPhotonSumPt_outsideSignalCone_(minRelPhotonSumPt_outsideSignalCone), + pfCands_(pfCands) { // Initialize tau tau_.reset(new PFTau()); @@ -296,6 +307,50 @@ void RecoTauConstructor::sortAndCopyIntoTau() { } } +namespace +{ + PFTau::hadronicDecayMode calculateDecayMode(const reco::PFTau& tau, double dRsignalCone, + double minAbsPhotonSumPt_insideSignalCone, double minRelPhotonSumPt_insideSignalCone, + double minAbsPhotonSumPt_outsideSignalCone, double minRelPhotonSumPt_outsideSignalCone) + { + unsigned int nCharged = tau.signalTauChargedHadronCandidates().size(); + // If no tracks exist, this is definitely not a tau! + if ( !nCharged ) return PFTau::kNull; + + unsigned int nPiZeros = 0; + const std::vector& piZeros = tau.signalPiZeroCandidates(); + for ( std::vector::const_iterator piZero = piZeros.begin(); + piZero != piZeros.end(); ++piZero ) { + double photonSumPt_insideSignalCone = 0.; + double photonSumPt_outsideSignalCone = 0.; + int numPhotons = piZero->numberOfDaughters(); + for ( int idxPhoton = 0; idxPhoton < numPhotons; ++idxPhoton ) { + const reco::Candidate* photon = piZero->daughter(idxPhoton); + double dR = deltaR(photon->p4(), tau.p4()); + if ( dR < dRsignalCone ) { + photonSumPt_insideSignalCone += photon->pt(); + } else { + photonSumPt_outsideSignalCone += photon->pt(); + } + } + if ( photonSumPt_insideSignalCone > minAbsPhotonSumPt_insideSignalCone || photonSumPt_insideSignalCone > (minRelPhotonSumPt_insideSignalCone*tau.pt()) || + photonSumPt_outsideSignalCone > minAbsPhotonSumPt_outsideSignalCone || photonSumPt_outsideSignalCone > (minRelPhotonSumPt_outsideSignalCone*tau.pt()) ) ++nPiZeros; + } + + // Find the maximum number of PiZeros our parameterization can hold + const unsigned int maxPiZeros = PFTau::kOneProngNPiZero; + + // Determine our track index + unsigned int trackIndex = (nCharged - 1)*(maxPiZeros + 1); + + // Check if we handle the given number of tracks + if ( trackIndex >= PFTau::kRareDecayMode ) return PFTau::kRareDecayMode; + + if ( nPiZeros > maxPiZeros ) nPiZeros = maxPiZeros; + return static_cast(trackIndex + nPiZeros); + } +} + std::auto_ptr RecoTauConstructor::get(bool setupLeadingObjects) { LogDebug("TauConstructorGet") << "Start getting" ; @@ -334,14 +389,14 @@ std::auto_ptr RecoTauConstructor::get(bool setupLeadingObjects) // Set P4 tau_->setP4(p4_); -// tau_->setP4( -// sumPFCandP4( -// getCollection(kSignal, kAll)->begin(), -// getCollection(kSignal, kAll)->end() -// ) -// ); + // Set Decay Mode - PFTau::hadronicDecayMode dm = tau_->calculateDecayMode(); + double dRsignalCone = ( signalConeSize_ ) ? (*signalConeSize_)(*tau_) : 0.5; + tau_->setSignalConeSize(dRsignalCone); + PFTau::hadronicDecayMode dm = calculateDecayMode( + *tau_, + dRsignalCone, + minAbsPhotonSumPt_insideSignalCone_, minRelPhotonSumPt_insideSignalCone_, minAbsPhotonSumPt_outsideSignalCone_, minRelPhotonSumPt_outsideSignalCone_); tau_->setDecayMode(dm); LogDebug("TauConstructorGet") << "Pt = " << tau_->pt() << ", eta = " << tau_->eta() << ", phi = " << tau_->phi() << ", mass = " << tau_->mass() << ", dm = " << tau_->decayMode() ; From c26646c4c2aaea1ae1640e6bd6c43963407b9d5f Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 11:58:27 +0200 Subject: [PATCH 16/35] fixed typo in discriminator name --- PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py | 2 +- PhysicsTools/PatAlgos/python/tools/tauTools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index 3551bddd1467e..bb8119c50d16a 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -117,7 +117,7 @@ byMediumCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), byTightCombinedIsolationDeltaBetaCorr3Hits = cms.InputTag("hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), - byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits"), byMediumPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits"), byTightPileupWeightedIsolationHits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), byPhotonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone"), diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 27aa7451c11ae..5282138cc0e4e 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -107,7 +107,7 @@ def _switchToPFTau(process, ("byMediumCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits"), ("byTightCombinedIsolationDeltaBetaCorr3Hits", "DiscriminationByTightCombinedIsolationDBSumPtCorr3Hits"), ("byCombinedIsolationDeltaBetaCorrRaw3Hits", "DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), - ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolationDBSum3Hits"), + ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolation3Hits"), ("byMediumPileupWeightedIsolation3Hits", "DiscriminationByMediumPileupWeightedIsolation3Hits"), ("byTightPileupWeightedIsolationHits", "DiscriminationByTightPileupWeightedIsolation3Hits"), ("byPhotonPtSumOutsideSignalCone", "DiscriminationByPhotonPtSumOutsideSignalCone"), From 9e81b22f3e1b7558d63314bbaea814937e6cfc1a Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:46:26 +0200 Subject: [PATCH 17/35] bug-fix in storing of (raw) footprint correction --- .../PFRecoTauDiscriminationByIsolation.cc | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index 56c43cea2c984..0bf1e79732ff3 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -73,12 +73,11 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas } // sanity check2 - can't use weighted and unweighted iso at the same time - if(includeGammas_ && calculateWeights_) - { - throw cms::Exception("BasIsoConfig") - << "Both 'ApplyDiscriminationByECALIsolation' and 'ApplyDiscriminationByWeightedECALIsolation' " - << "have been set to true. These options are mutually exclusive."; - } + if ( includeGammas_ && calculateWeights_ ) { + throw cms::Exception("BasIsoConfig") + << "Both 'ApplyDiscriminationByECALIsolation' and 'ApplyDiscriminationByWeightedECALIsolation' " + << "have been set to true. These options are mutually exclusive."; + } // Can only store one type int numStoreOptions = 0; @@ -104,7 +103,7 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas maxRelPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxRelPhotonSumPt_outsideSignalCone"); applyFootprintCorrection_ = pset.getParameter("applyFootprintCorrection"); - if ( applyFootprintCorrection_ ) { + if ( applyFootprintCorrection_ || storeRawFootprintCorrection_ ) { edm::VParameterSet cfgFootprintCorrections = pset.getParameter("footprintCorrections"); for ( edm::VParameterSet::const_iterator cfgFootprintCorrection = cfgFootprintCorrections.begin(); cfgFootprintCorrection != cfgFootprintCorrections.end(); ++cfgFootprintCorrection ) { @@ -153,9 +152,9 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas puFactorizedIsoQCuts.second)); pfCandSrc_ = pset.getParameter("particleFlowSrc"); - pfCand_token=consumes(pfCandSrc_); + pfCand_token = consumes(pfCandSrc_); vertexSrc_ = pset.getParameter("vertexSrc"); - vertex_token=consumes(vertexSrc_); + vertex_token = consumes(vertexSrc_); deltaBetaCollectionCone_ = pset.getParameter( "isoConeSizeForDeltaBeta"); std::string deltaBetaFactorFormula = @@ -508,9 +507,9 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const double puPt = 0.; //--- Sum PT requirement if ( applySumPtCut_ || applyRelativeSumPtCut_ || storeRawSumPt_ || storeRawPUsumPt_ ) { - double chargedPt = 0.0; - double neutralPt = 0.0; - double weightedNeutralPt = 0.0; + double chargedPt = 0.; + double neutralPt = 0.; + double weightedNeutralPt = 0.; for ( auto const & isoObject : isoCharged_ ) { chargedPt += isoObject->pt(); } From b71d423d38dab5b948e242925848fa11846a18d0 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:47:19 +0200 Subject: [PATCH 18/35] - store neutral pileup weighted isolation pT sum - bug-fix: disable deltaBeta corrections for pileup weighted isolation discriminators --- RecoTauTag/Configuration/python/HPSPFTaus_cff.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 837522ce831f5..3711c5fad261f 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -551,6 +551,7 @@ hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( ApplyDiscriminationByECALIsolation = cms.bool(False), + applyDeltaBetaCorrection = cms.bool(False), ApplyDiscriminationByWeightedECALIsolation = cms.bool(True), UseAllPFCandsForWeights = cms.bool(True), applyFootprintCorrection = cms.bool(True), @@ -814,6 +815,7 @@ hpsPFTauChargedIsoPtSum + hpsPFTauNeutralIsoPtSum + hpsPFTauPUcorrPtSum + + hpsPFTauNeutralIsoPtSumWeight + hpsPFTauFootprintCorrection + hpsPFTauPhotonPtSumOutsideSignalCone + hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw From 00052a277f4638d0419fb89813173263d126a164 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:48:08 +0200 Subject: [PATCH 19/35] added pileup weighted neutral isolation --- PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py | 1 + PhysicsTools/PatAlgos/python/tools/tauTools.py | 1 + 2 files changed, 2 insertions(+) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index bb8119c50d16a..1fd5fee7f38d2 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -68,6 +68,7 @@ chargedIsoPtSum = cms.InputTag("hpsPFTauChargedIsoPtSum"), neutralIsoPtSum = cms.InputTag("hpsPFTauNeutralIsoPtSum"), puCorrPtSum = cms.InputTag("hpsPFTauPUcorrPtSum"), + neutralIsoPtSumWeight = cms.InputTag("hpsPFTauNeutralIsoPtSumWeight"), footprintCorrection = cms.InputTag("hpsPFTauFootprintCorrection"), photonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauPhotonPtSumOutsideSignalCone"), ##byIsolationMVA3oldDMwoLTraw = cms.InputTag('hpsPFTauDiscriminationByIsolationMVA3oldDMwoLTraw'), diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 5282138cc0e4e..053e03654bb66 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -115,6 +115,7 @@ def _switchToPFTau(process, ("chargedIsoPtSum", "ChargedIsoPtSum"), ("neutralIsoPtSum", "NeutralIsoPtSum"), ("puCorrPtSum", "PUcorrPtSum"), + ("neutralIsoPtSumWeight", "NeutralIsoPtSumWeight"), ("footprintCorrection", "FootprintCorrection"), ("photonPtSumOutsideSignalCone", "PhotonPtSumOutsideSignalCone"), ##("byIsolationMVA3oldDMwoLTraw", "DiscriminationByIsolationMVA3oldDMwoLTraw"), From a8ebbe614bb00eb32de0d6d4a00c69a28897cc83 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 19 May 2015 12:54:16 +0200 Subject: [PATCH 20/35] fixed typo in discriminator name --- PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py | 2 +- PhysicsTools/PatAlgos/python/tools/tauTools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py index 1fd5fee7f38d2..39177b9f29d1a 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/tauProducer_cfi.py @@ -120,7 +120,7 @@ byCombinedIsolationDeltaBetaCorrRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), byLoosePileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits"), byMediumPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits"), - byTightPileupWeightedIsolationHits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), + byTightPileupWeightedIsolation3Hits = cms.InputTag("hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits"), byPhotonPtSumOutsideSignalCone = cms.InputTag("hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone"), byPileupWeightedIsolationRaw3Hits = cms.InputTag("hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits"), againstElectronMVA5raw = cms.InputTag("hpsPFTauDiscriminationByMVA5rawElectronRejection"), diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 053e03654bb66..5680a4e840492 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -109,7 +109,7 @@ def _switchToPFTau(process, ("byCombinedIsolationDeltaBetaCorrRaw3Hits", "DiscriminationByRawCombinedIsolationDBSumPtCorr3Hits"), ("byLoosePileupWeightedIsolation3Hits", "DiscriminationByLoosePileupWeightedIsolation3Hits"), ("byMediumPileupWeightedIsolation3Hits", "DiscriminationByMediumPileupWeightedIsolation3Hits"), - ("byTightPileupWeightedIsolationHits", "DiscriminationByTightPileupWeightedIsolation3Hits"), + ("byTightPileupWeightedIsolation3Hits", "DiscriminationByTightPileupWeightedIsolation3Hits"), ("byPhotonPtSumOutsideSignalCone", "DiscriminationByPhotonPtSumOutsideSignalCone"), ("byPileupWeightedIsolationRaw3Hits", "DiscriminationByRawPileupWeightedIsolation3Hits"), ("chargedIsoPtSum", "ChargedIsoPtSum"), From 0fbd3422fee5e40efc2ce79f7c5b2dd0c71fbb54 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 24 May 2015 18:03:57 +0200 Subject: [PATCH 21/35] updated parameters for dynamic strip reconstruction --- .../python/RecoTauPiZeroBuilderPlugins_cfi.py | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py index d8e29335057fd..5a6ed014f35d3 100644 --- a/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauPiZeroBuilderPlugins_cfi.py @@ -70,24 +70,24 @@ # Produce a "strips" of photons # with no track quality cuts applied to PFElectrons # and eta x phi size of strip increasing for low pT photons -modStrips2 = strips.clone( - plugin = cms.string('RecoTauPiZeroStripPlugin3'), - applyElecTrackQcuts = cms.bool(False), - minGammaEtStripSeed = cms.double(0.5), - minGammaEtStripAdd = cms.double(0.), - minStripEt = cms.double(0.5), - # CV: parametrization of strip size in eta and phi determined by Yuta Takahashi, - # chosen to contain 95% of photons from tau decays - stripEtaAssociationDistance = cms.PSet( - function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), - par0 = cms.double(2.15974e-01), - par1 = cms.double(5.14575e-01) - ), - stripPhiAssociationDistance = cms.PSet( - function = cms.string("TMath::Max(0.05, [0]*TMath::Power(pT, -[1]))"), - par0 = cms.double(3.74961e-01), - par1 = cms.double(5.99882e-01) - ), - updateStripAfterEachDaughter = cms.bool(False), - maxStripBuildIterations = cms.int32(-1) +modStrips2 = strips.clone( + plugin = cms.string('RecoTauPiZeroStripPlugin3'), + applyElecTrackQcuts = cms.bool(False), + minGammaEtStripSeed = cms.double(0.5), + minGammaEtStripAdd = cms.double(0.), + minStripEt = cms.double(0.5), + # CV: parametrization of strip size in eta and phi determined by Yuta Takahashi, + # chosen to contain 95% of photons from tau decays + stripEtaAssociationDistance = cms.PSet( + function = cms.string("TMath::Min(0.15, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))"), + par0 = cms.double(1.97077e-01), + par1 = cms.double(6.58701e-01) + ), + stripPhiAssociationDistance = cms.PSet( + function = cms.string("TMath::Min(0.3, TMath::Max(0.05, [0]*TMath::Power(pT, -[1])))"), + par0 = cms.double(3.52476e-01), + par1 = cms.double(7.07716e-01) + ), + updateStripAfterEachDaughter = cms.bool(False), + maxStripBuildIterations = cms.int32(-1) ) From 40fae231290fd53293dce3bff121ec86e1fe37f3 Mon Sep 17 00:00:00 2001 From: anehrkor Date: Fri, 29 May 2015 16:25:34 +0200 Subject: [PATCH 22/35] New cleaner module that works also if tau is made up of combination of pf charged hadrons and tracks -> solves rare problem with 3-prongs having charge +/-3. --- .../plugins/RecoTauChargeCleanerPlugin.cc | 59 +++++++++++++++++++ .../RecoTau/python/RecoTauCleanerPlugins.py | 12 ++++ .../RecoTau/python/RecoTauCleaner_cfi.py | 2 +- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc diff --git a/RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc b/RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc new file mode 100644 index 0000000000000..75a03751191a9 --- /dev/null +++ b/RecoTauTag/RecoTau/plugins/RecoTauChargeCleanerPlugin.cc @@ -0,0 +1,59 @@ +/* + * Original author: Alexander Nehrkorn (RWTH Aachen) + * + * Description: + * This module rejects tau candidates that do not have unit charge. + * It takes the fact into account that taus do not necessarily need + * to be created from PF charged hadrons only but can be created + * from a combination of PF charged hadrons and tracks. + * + */ + +#include "RecoTauTag/RecoTau/interface/RecoTauBuilderPlugins.h" +#include "DataFormats/TauReco/interface/PFTau.h" +#include "DataFormats/TauReco/interface/PFTauFwd.h" + +namespace reco { namespace tau { + +class RecoTauChargeCleanerPlugin : public RecoTauCleanerPlugin +{ +public: + explicit RecoTauChargeCleanerPlugin(const edm::ParameterSet&, edm::ConsumesCollector &&iC); + ~RecoTauChargeCleanerPlugin() {} + double operator()(const PFTauRef& tau) const override; + +private: + std::vector nprongs_; + double failResult_; + int charge_; +}; + +RecoTauChargeCleanerPlugin::RecoTauChargeCleanerPlugin(const edm::ParameterSet& pset, edm::ConsumesCollector &&iC) + : RecoTauCleanerPlugin(pset,std::move(iC)), + nprongs_(pset.getParameter >("nprongs")), + failResult_(pset.getParameter("selectionFailValue")), + charge_(pset.getParameter("passForCharge")) +{} + +double RecoTauChargeCleanerPlugin::operator()(const PFTauRef& cand) const +{ + int charge = 0; + unsigned nChargedPFCandidate(0), nTrack(0); + for(unsigned iSignalCand = 0; iSignalCand < cand->signalTauChargedHadronCandidates().size(); iSignalCand++){ + charge += cand->signalTauChargedHadronCandidates().at(iSignalCand).charge(); + if(cand->signalTauChargedHadronCandidates().at(iSignalCand).algoIs(reco::PFRecoTauChargedHadron::kChargedPFCandidate)) nChargedPFCandidate++; + else if(cand->signalTauChargedHadronCandidates().at(iSignalCand).algoIs(reco::PFRecoTauChargedHadron::kTrack)) nTrack++; + } + + for(auto nprong : nprongs_){ + if(nChargedPFCandidate+nTrack == nprong) return abs(charge)-charge_; + } + + return failResult_; +} + +}} + +#include "FWCore/Framework/interface/MakerMacros.h" + +DEFINE_EDM_PLUGIN(RecoTauCleanerPluginFactory, reco::tau::RecoTauChargeCleanerPlugin, "RecoTauChargeCleanerPlugin"); diff --git a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py index 09687d9dfa2ac..8dcfc7df1ca76 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleanerPlugins.py @@ -28,6 +28,18 @@ selectionFailValue = cms.double(0), ) +# similar to unitCharge but handles also cases where tau is made up of +# a combination of tracks and pf charged hadrons +charge = cms.PSet( + name = cms.string("Charge"), + plugin = cms.string("RecoTauChargeCleanerPlugin"), + # cleaner is applied to decay modes with the number of prongs given here + nprongs = cms.vuint32(1,3), + # taus with charge != 1 are rejected + passForCharge = cms.int32(1), + selectionFailValue = cms.double(0), +) + # Prefer taus with pt greater 15 ptGt15 = cms.PSet( name = cms.string("PtGt15"), diff --git a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py index 30d65dd479550..d387946755de3 100644 --- a/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py +++ b/RecoTauTag/RecoTau/python/RecoTauCleaner_cfi.py @@ -6,7 +6,7 @@ src = cms.InputTag("combinatoricRecoTaus"), cleaners = cms.VPSet( # Reject taus that have charge == 3 - cleaners.unitCharge, + cleaners.charge, # Reject taus that are not within DR<0.1 of the jet axis #cleaners.matchingConeCut, # Reject taus that fail HPS selections From 5ac4715edf3e5a17bf57ca3b91e709e6346d561e Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 1 Jun 2015 12:27:34 +0200 Subject: [PATCH 23/35] sutract 2 GeV from k offset values (except for 3prong0pi0), as recommended by Yuta --- .../python/PFRecoTauDiscriminationByIsolation_cfi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index 8c9d929732bbf..a7533cbcabc9e 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -55,19 +55,19 @@ footprintCorrections = cms.VPSet( cms.PSet( selection = cms.string("decayMode() = 0"), - offset = cms.double(1.8) + offset = cms.double(0.0) ), cms.PSet( selection = cms.string("decayMode() = 1 || decayMode() = 2"), - offset = cms.double(1.5) + offset = cms.double(0.0) ), cms.PSet( selection = cms.string("decayMode() = 5"), - offset = cms.double(4.7) + offset = cms.double(2.7) ), cms.PSet( selection = cms.string("decayMode() = 6"), - offset = cms.double(1.9) + offset = cms.double(0.0) ), cms.PSet( selection = cms.string("decayMode() = 10"), From 48e4e2f8695593bf9bb8dc01ef291b2c09b881f4 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 3 Jun 2015 16:46:21 +0200 Subject: [PATCH 24/35] added functionality to make tau footprint correction dependent on tauPt --- .../plugins/PFRecoTauDiscriminationByIsolation.cc | 11 +++++++---- .../python/PFRecoTauDiscriminationByIsolation_cfi.py | 10 +++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index 0bf1e79732ff3..fa310d5369055 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -5,6 +5,7 @@ #include "RecoTauTag/RecoTau/interface/RecoTauVertexAssociator.h" #include "RecoTauTag/RecoTau/interface/ConeTools.h" #include "CommonTools/Utils/interface/StringCutObjectSelector.h" +#include "CommonTools/Utils/interface/StringObjectFunction.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "TMath.h" @@ -108,7 +109,7 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas for ( edm::VParameterSet::const_iterator cfgFootprintCorrection = cfgFootprintCorrections.begin(); cfgFootprintCorrection != cfgFootprintCorrections.end(); ++cfgFootprintCorrection ) { std::string selection = cfgFootprintCorrection->getParameter("selection"); - double offset = cfgFootprintCorrection->getParameter("offset"); + std::string offset = cfgFootprintCorrection->getParameter("offset"); footprintCorrectionType* footprintCorrection = new footprintCorrectionType(selection, offset); footprintCorrections_.push_back(footprintCorrection); } @@ -230,13 +231,13 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas bool applyFootprintCorrection_; struct footprintCorrectionType { - footprintCorrectionType(const std::string& selection, double offset) + footprintCorrectionType(const std::string& selection, const std::string& offset) : selection_(selection), offset_(offset) {} ~footprintCorrectionType() {} StringCutObjectSelector selection_; - double offset_; + StringObjectFunction offset_; }; std::vector footprintCorrections_; @@ -499,7 +500,9 @@ PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const if ( applyFootprintCorrection_ || storeRawFootprintCorrection_ ) { for ( std::vector::const_iterator footprintCorrection = footprintCorrections_.begin(); footprintCorrection != footprintCorrections_.end(); ++footprintCorrection ) { - if ( (*footprintCorrection)->selection_(*pfTau) ) footprintCorrection_value = (*footprintCorrection)->offset_; + if ( (*footprintCorrection)->selection_(*pfTau) ) { + footprintCorrection_value = (*footprintCorrection)->offset_(*pfTau); + } } } diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index a7533cbcabc9e..37b3758cbc79e 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -55,23 +55,23 @@ footprintCorrections = cms.VPSet( cms.PSet( selection = cms.string("decayMode() = 0"), - offset = cms.double(0.0) + offset = cms.string("0.0") ), cms.PSet( selection = cms.string("decayMode() = 1 || decayMode() = 2"), - offset = cms.double(0.0) + offset = cms.string("0.0") ), cms.PSet( selection = cms.string("decayMode() = 5"), - offset = cms.double(2.7) + offset = cms.string("2.7") ), cms.PSet( selection = cms.string("decayMode() = 6"), - offset = cms.double(0.0) + offset = cms.string("0.0") ), cms.PSet( selection = cms.string("decayMode() = 10"), - offset = cms.double(2.0) + offset = cms.string("max(2.0, 0.22*pt() - 2.0)") ) ), From 96af3aba3e35e3180da01cebb3370c09453064a5 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 9 Jun 2015 19:38:37 +0200 Subject: [PATCH 25/35] tightened cut on pTouter from 0.20*tauPt to 0.10*tauPt --- .../RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py index 37b3758cbc79e..73c7eac0acad9 100644 --- a/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py +++ b/RecoTauTag/RecoTau/python/PFRecoTauDiscriminationByIsolation_cfi.py @@ -28,7 +28,7 @@ applyPhotonPtSumOutsideSignalConeCut = cms.bool(False), maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.20), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), qualityCuts = PFTauQualityCuts, # set the standard quality cuts From 7b3568d3e41b6bdc56184047ea2df93b263cfc32 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 9 Jun 2015 19:42:16 +0200 Subject: [PATCH 26/35] apply cut on ptOuter also in case of HPS combined islation 3-hit discriminators with deltaBeta correction --- RecoTauTag/Configuration/python/HPSPFTaus_cff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index 3711c5fad261f..f08137d4f9216 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -534,8 +534,11 @@ hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits = hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr.clone() hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.qualityCuts.isolationQualityCuts.minTrackHits = cms.uint32(3) +hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits.qualityCuts.isolationQualityCuts.minTrackHits = cms.uint32(3) +hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr3Hits.applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits.qualityCuts.isolationQualityCuts.minTrackHits = cms.uint32(3) +hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr3Hits.applyPhotonPtSumOutsideSignalConeCut = cms.bool(True) hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits = hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr3Hits.clone( applySumPtCut = False, From ff1b2110cf1040529acc14c8e9a2173883612c5f Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 10 Jun 2015 17:37:17 +0200 Subject: [PATCH 27/35] - updated deltaBeta correction factor to 0.2 - updated thresholds for isolation WPs: Loose = 2.5 GeV Medium = 1.5 GeV Tight = 0.8 GeV (no change) --- .../Configuration/python/HPSPFTaus_cff.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py index f08137d4f9216..5718fc487c720 100644 --- a/RecoTauTag/Configuration/python/HPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/HPSPFTaus_cff.py @@ -25,8 +25,8 @@ # Load PFjet input parameters from RecoTauTag.RecoTau.PFRecoTauPFJetInputs_cfi import PFRecoTauPFJetInputs -# deltaBeta correction factor calculated for taus from ak5PFJets (Run I) -ak5dBetaCorrection=0.0772/0.1687 +# deltaBeta correction factor +ak4dBetaCorrection=0.20 # Load MVAs from SQLlite file/prep. DB from RecoTauTag.Configuration.loadRecoTauTagMVAsFromPrepDB_cfi import * @@ -134,7 +134,7 @@ deltaBetaPUTrackPtCutOverride = cms.double(0.5), applyDeltaBetaCorrection = True, isoConeSizeForDeltaBeta = 0.8, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, ) @@ -150,10 +150,10 @@ hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByVLooseIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%((0.09/0.25)*(ak5dBetaCorrection)), + deltaBetaFactor = "%0.4f"%((0.09/0.25)*(ak4dBetaCorrection)), applyOccupancyCut = False, applySumPtCut = True, - maximumSumPtCut = 3.0, + maximumSumPtCut = 3.5, Prediscriminants = requireDecayMode.clone() ) hpsPFTauDiscriminationByVLooseCombinedIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minTrackPt = 0.5 @@ -162,10 +162,10 @@ hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByLooseIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, - maximumSumPtCut = 2.0, + maximumSumPtCut = 2.5, Prediscriminants = requireDecayMode.clone() ) hpsPFTauDiscriminationByLooseCombinedIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minTrackPt = 0.5 @@ -191,10 +191,10 @@ hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByMediumIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, - maximumSumPtCut = 1.0, + maximumSumPtCut = 1.5, Prediscriminants = requireDecayMode.clone() ) hpsPFTauDiscriminationByMediumCombinedIsolationDBSumPtCorr.qualityCuts.isolationQualityCuts.minTrackPt = 0.5 @@ -203,7 +203,7 @@ hpsPFTauDiscriminationByTightCombinedIsolationDBSumPtCorr = hpsPFTauDiscriminationByTightIsolationDBSumPtCorr.clone( ApplyDiscriminationByTrackerIsolation = True, ApplyDiscriminationByECALIsolation = True, - deltaBetaFactor = "%0.4f"%(ak5dBetaCorrection), + deltaBetaFactor = "%0.4f"%(ak4dBetaCorrection), applyOccupancyCut = False, applySumPtCut = True, maximumSumPtCut = 0.8, From abaac8e282cb13c01eb07950ac00edd0008ac235 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 8 Jul 2015 18:10:34 +0200 Subject: [PATCH 28/35] updates to tau vertex producers from Arun --- .../RecoTau/plugins/PFTauPrimaryVertexProducer.cc | 10 ++++++---- .../RecoTau/plugins/PFTauSecondaryVertexProducer.cc | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc b/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc index 156e4ac737f42..f22554a583f32 100644 --- a/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc +++ b/RecoTauTag/RecoTau/plugins/PFTauPrimaryVertexProducer.cc @@ -252,11 +252,13 @@ void PFTauPrimaryVertexProducer::produce(edm::Event& iEvent,const edm::EventSetu // } for(std::vector::const_iterator vtxTrkRef=thePV.tracks_begin();vtxTrkRefbuild(*iter)); } bool FitOk(true); - if ( transTracks.size() >= 3 ) { + if ( transTracks.size() >= 2 ) { AdaptiveVertexFitter avf; avf.setWeightThreshold(0.1); //weight per track. allow almost every fit, else --> exception try { diff --git a/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc b/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc index cab1ab4e29f6d..f458bc2c6b246 100644 --- a/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc +++ b/RecoTauTag/RecoTau/plugins/PFTauSecondaryVertexProducer.cc @@ -88,7 +88,7 @@ void PFTauSecondaryVertexProducer::produce(edm::Event& iEvent,const edm::EventSe for(reco::PFTauCollection::size_type iPFTau = 0; iPFTau < Tau->size(); iPFTau++) { reco::PFTauRef RefPFTau(Tau, iPFTau); std::vector SV; - if(RefPFTau->decayMode()==10){ + if(RefPFTau->decayMode()>=5){ /////////////////////////////////////////////////////////////////////////////////////////////// // Get tracks form PFTau daugthers std::vector transTrk; From d3058a045278563baeafb952b2f032911e88340b Mon Sep 17 00:00:00 2001 From: AJ Johnson Date: Thu, 16 Jul 2015 15:15:38 +0200 Subject: [PATCH 29/35] Added missing discriminators to updateHPSPFTaus_cff.py - their absence was causing unit tests to fail. --- .../Configuration/python/updateHPSPFTaus_cff.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py index 49c090d733c84..25666b0effe81 100644 --- a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py @@ -11,4 +11,17 @@ ''' -updateHPSPFTaus = cms.Sequence() +updateHPSPFTaus = cms.Sequence( + hpsPFTauChargedIsoPtSum* + hpsPFTauNeutralIsoPtSum* + hpsPFTauPUcorrPtSum* + hpsPFTauNeutralIsoPtSumWeight* + hpsPFTauFootprintCorrection* + hpsPFTauPhotonPtSumOutsideSignalCone* + hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits* + hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits* + hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone* + hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits +) From 1765f5823d7a558c73fa081ad177bbe964359b7f Mon Sep 17 00:00:00 2001 From: AJ Johnson Date: Sun, 19 Jul 2015 12:32:36 +0200 Subject: [PATCH 30/35] Added import statements whose absence was causing the unit tests to fail --- .../Configuration/python/updateHPSPFTaus_cff.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py index 25666b0effe81..d039daf8bda74 100644 --- a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py @@ -11,6 +11,17 @@ ''' + +from RecoTauTag.RecoTau.PFRecoTauDiscriminationByMVAIsolation2_cff import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationByIsolation_cfi import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationByLeadingTrackFinding_cfi import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstElectron_cfi import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstElectronMVA5_cfi import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuon_cfi import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuon2_cfi import * +from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuonMVA_cfi import * + updateHPSPFTaus = cms.Sequence( hpsPFTauChargedIsoPtSum* hpsPFTauNeutralIsoPtSum* From 16846ea4bbc3268ad158e4e895a3272acc82ccaf Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 22 Jul 2015 10:33:09 +0200 Subject: [PATCH 31/35] updated patTau selection to use new discriminators --- .../PatAlgos/python/cleaningLayer1/tauCleaner_cfi.py | 6 +++--- PhysicsTools/PatAlgos/python/tools/tauTools.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PhysicsTools/PatAlgos/python/cleaningLayer1/tauCleaner_cfi.py b/PhysicsTools/PatAlgos/python/cleaningLayer1/tauCleaner_cfi.py index 0a1f241e92fdb..bd961ba20904e 100644 --- a/PhysicsTools/PatAlgos/python/cleaningLayer1/tauCleaner_cfi.py +++ b/PhysicsTools/PatAlgos/python/cleaningLayer1/tauCleaner_cfi.py @@ -7,8 +7,8 @@ preselection = cms.string( 'tauID("decayModeFinding") > 0.5 &' ' tauID("byLooseCombinedIsolationDeltaBetaCorr3Hits") > 0.5 &' - ' tauID("againstMuonTight") > 0.5 &' - ' tauID("againstElectronMedium") > 0.5' + ' tauID("againstMuonTight3") > 0.5 &' + ' tauID("againstElectronVLooseMVA5") > 0.5' ), # overlap checking configurables @@ -34,5 +34,5 @@ ), # finalCut (any string-based cut on pat::Tau) - finalCut = cms.string('pt > 20. & abs(eta) < 2.3'), + finalCut = cms.string('pt > 18. & abs(eta) < 2.3'), ) diff --git a/PhysicsTools/PatAlgos/python/tools/tauTools.py b/PhysicsTools/PatAlgos/python/tools/tauTools.py index 5680a4e840492..6de2055df4d5f 100644 --- a/PhysicsTools/PatAlgos/python/tools/tauTools.py +++ b/PhysicsTools/PatAlgos/python/tools/tauTools.py @@ -209,8 +209,8 @@ def switchToPFTauHPS(process, ## adapt cleanPatTaus if hasattr(process, "cleanPatTaus" + patTauLabel + postfix): getattr(process, "cleanPatTaus" + patTauLabel + postfix).preselection = \ - 'pt > 20 & abs(eta) < 2.3 & tauID("decayModeFindingOldDMs") > 0.5 & tauID("byLooseCombinedIsolationDeltaBetaCorr3Hits") > 0.5' \ - + ' & tauID("againstMuonTight3") > 0.5 & tauID("againstElectronLoose") > 0.5' + 'pt > 18 & abs(eta) < 2.3 & tauID("decayModeFinding") > 0.5 & tauID("byLooseCombinedIsolationDeltaBetaCorr3Hits") > 0.5' \ + + ' & tauID("againstMuonTight3") > 0.5 & tauID("againstElectronVLooseMVA5") > 0.5' # Select switcher by string def switchToPFTauByType(process, From 3a3c7075156d45a873a572cb596d67b825693e50 Mon Sep 17 00:00:00 2001 From: AJ Johnson Date: Thu, 6 Aug 2015 17:44:43 +0200 Subject: [PATCH 32/35] New attempt to add Dynamic Strip Reco to 7_6_X - a new PR was necessary because of a rebase while debugging Previous PR at: https://github.com/cms-sw/cmssw/pull/10215/ --- CommonTools/ParticleFlow/python/pfTaus_cff.py | 44 +++++++++++++++++++ .../python/HLT_25ns14e33_v1_cff.py | 20 +++++++++ .../python/HLT_25ns14e33_v3_cff.py | 20 +++++++++ .../Configuration/python/HLT_50nsGRun_cff.py | 20 +++++++++ .../python/HLT_50ns_5e33_v1_cff.py | 20 +++++++++ .../python/HLT_50ns_5e33_v3_cff.py | 20 +++++++++ .../Configuration/python/HLT_FULL_cff.py | 28 ++++++++++++ .../Configuration/python/HLT_GRun_cff.py | 20 +++++++++ .../python/updateHPSPFTaus_cff.py | 2 + 9 files changed, 194 insertions(+) diff --git a/CommonTools/ParticleFlow/python/pfTaus_cff.py b/CommonTools/ParticleFlow/python/pfTaus_cff.py index 5f1642b279515..e9368bc808463 100644 --- a/CommonTools/ParticleFlow/python/pfTaus_cff.py +++ b/CommonTools/ParticleFlow/python/pfTaus_cff.py @@ -126,6 +126,50 @@ pfTauTagInfoProducer.PFJetTracksAssociatorProducer = 'pfJetTracksAssociatorAtVertex' +# Produce primary vertices + +from RecoTauTag.RecoTau.PFTauPrimaryVertexProducer_cfi import * +from RecoTauTag.RecoTau.PFTauSecondaryVertexProducer_cfi import * +from RecoTauTag.RecoTau.PFTauTransverseImpactParameters_cfi import * +hpsPFTauPrimaryVertexProducer = PFTauPrimaryVertexProducer.clone( + PFTauTag = cms.InputTag("hpsPFTauProducer"), + ElectronTag = cms.InputTag(""), + MuonTag = cms.InputTag(""), + PVTag = cms.InputTag("offlinePrimaryVertices"), + beamSpot = cms.InputTag("offlineBeamSpot"), + TrackCollectionTag = cms.InputTag("generalTracks"), + Algorithm = cms.int32(1), + useBeamSpot = cms.bool(True), + RemoveMuonTracks = cms.bool(False), + RemoveElectronTracks = cms.bool(False), + useSelectedTaus = cms.bool(False), + discriminators = cms.VPSet( + cms.PSet( + discriminator = cms.InputTag('hpsPFTauDiscriminationByDecayModeFindingNewDMs'), + selectionCut = cms.double(0.5) + ) + ), + cut = cms.string("pt > 18.0 & abs(eta) < 2.4") +) + + +hpsPFTauSecondaryVertexProducer = PFTauSecondaryVertexProducer.clone( + PFTauTag = cms.InputTag("hpsPFTauProducer") +) +hpsPFTauTransverseImpactParameters = PFTauTransverseImpactParameters.clone( + PFTauTag = cms.InputTag("hpsPFTauProducer"), + PFTauPVATag = cms.InputTag("hpsPFTauPrimaryVertexProducer"), + PFTauSVATag = cms.InputTag("hpsPFTauSecondaryVertexProducer"), + useFullCalculation = cms.bool(False) +) +hpsPFTauVertexAndImpactParametersSeq = cms.Sequence( + hpsPFTauPrimaryVertexProducer* + hpsPFTauSecondaryVertexProducer* + hpsPFTauTransverseImpactParameters +) + + + pfTausPreSequence = cms.Sequence( pfJetTracksAssociatorAtVertex + pfTauPFJets08Region + diff --git a/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py b/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py index e89340450d63d..df131c07567a1 100644 --- a/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py +++ b/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py @@ -10653,6 +10653,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -10717,6 +10721,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16460,6 +16468,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16524,6 +16536,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19450,6 +19466,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py b/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py index a99e232a34767..d204e8a08f4b1 100644 --- a/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py +++ b/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py @@ -11538,6 +11538,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11602,6 +11606,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17338,6 +17346,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17402,6 +17414,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21203,6 +21219,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py b/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py index 35f74819a219c..9ec5a67ea3cd8 100644 --- a/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py +++ b/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py @@ -11963,6 +11963,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -12027,6 +12031,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17989,6 +17997,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -18053,6 +18065,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21498,6 +21514,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py b/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py index 6e7a13211c4e3..a96c68f0d4623 100644 --- a/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py +++ b/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py @@ -10936,6 +10936,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11000,6 +11004,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16518,6 +16526,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16582,6 +16594,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19605,6 +19621,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py b/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py index 0badd3d5f8fd4..fe15dbd1cb0cc 100644 --- a/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py +++ b/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py @@ -11928,6 +11928,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11992,6 +11996,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17954,6 +17962,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -18018,6 +18030,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21445,6 +21461,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_FULL_cff.py b/HLTrigger/Configuration/python/HLT_FULL_cff.py index 1dd1d6e423165..a3cbcb7b8770c 100644 --- a/HLTrigger/Configuration/python/HLT_FULL_cff.py +++ b/HLTrigger/Configuration/python/HLT_FULL_cff.py @@ -12943,6 +12943,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -13007,6 +13011,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -13605,6 +13613,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -13669,6 +13681,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19328,6 +19344,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19392,6 +19412,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -23354,6 +23378,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_GRun_cff.py b/HLTrigger/Configuration/python/HLT_GRun_cff.py index 577acb01422ef..14f0a7768d331 100644 --- a/HLTrigger/Configuration/python/HLT_GRun_cff.py +++ b/HLTrigger/Configuration/python/HLT_GRun_cff.py @@ -11575,6 +11575,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11639,6 +11643,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17375,6 +17383,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17439,6 +17451,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21135,6 +21151,10 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), + applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), + maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), + maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), + applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py index d039daf8bda74..523413f24c7cc 100644 --- a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py @@ -22,6 +22,8 @@ from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuon2_cfi import * from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuonMVA_cfi import * +from RecoTauTag.Configuration.HPSPFTaus_cff import * + updateHPSPFTaus = cms.Sequence( hpsPFTauChargedIsoPtSum* hpsPFTauNeutralIsoPtSum* From 732990d7b42b838a119f7db5a763c78c94eef272 Mon Sep 17 00:00:00 2001 From: AJ Johnson Date: Sun, 9 Aug 2015 23:24:56 +0200 Subject: [PATCH 33/35] Added fillDescriptions() method, reverted HLT dumps to previous version since they may not be modified. Now failing unit test 1330.0 as well as 135.4. Attempting to diagnose but updating the PR anyway to iterate with the experts. --- .../python/HLT_25ns14e33_v1_cff.py | 20 ------------- .../python/HLT_25ns14e33_v3_cff.py | 20 ------------- .../Configuration/python/HLT_50nsGRun_cff.py | 20 ------------- .../python/HLT_50ns_5e33_v1_cff.py | 20 ------------- .../python/HLT_50ns_5e33_v3_cff.py | 20 ------------- .../Configuration/python/HLT_FULL_cff.py | 28 ------------------- .../Configuration/python/HLT_GRun_cff.py | 20 ------------- .../interface/TauDiscriminationProducerBase.h | 1 + .../PFRecoTauDiscriminationByIsolation.cc | 14 ++++++++++ 9 files changed, 15 insertions(+), 148 deletions(-) diff --git a/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py b/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py index df131c07567a1..e89340450d63d 100644 --- a/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py +++ b/HLTrigger/Configuration/python/HLT_25ns14e33_v1_cff.py @@ -10653,10 +10653,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -10721,10 +10717,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16468,10 +16460,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16536,10 +16524,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19466,10 +19450,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py b/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py index d204e8a08f4b1..a99e232a34767 100644 --- a/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py +++ b/HLTrigger/Configuration/python/HLT_25ns14e33_v3_cff.py @@ -11538,10 +11538,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11606,10 +11602,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17346,10 +17338,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17414,10 +17402,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21219,10 +21203,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py b/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py index 9ec5a67ea3cd8..35f74819a219c 100644 --- a/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py +++ b/HLTrigger/Configuration/python/HLT_50nsGRun_cff.py @@ -11963,10 +11963,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -12031,10 +12027,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17997,10 +17989,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -18065,10 +18053,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21514,10 +21498,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py b/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py index a96c68f0d4623..6e7a13211c4e3 100644 --- a/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py +++ b/HLTrigger/Configuration/python/HLT_50ns_5e33_v1_cff.py @@ -10936,10 +10936,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11004,10 +11000,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16526,10 +16518,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -16594,10 +16582,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19621,10 +19605,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py b/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py index fe15dbd1cb0cc..0badd3d5f8fd4 100644 --- a/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py +++ b/HLTrigger/Configuration/python/HLT_50ns_5e33_v3_cff.py @@ -11928,10 +11928,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11996,10 +11992,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17962,10 +17954,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -18030,10 +18018,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21461,10 +21445,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_FULL_cff.py b/HLTrigger/Configuration/python/HLT_FULL_cff.py index a3cbcb7b8770c..1dd1d6e423165 100644 --- a/HLTrigger/Configuration/python/HLT_FULL_cff.py +++ b/HLTrigger/Configuration/python/HLT_FULL_cff.py @@ -12943,10 +12943,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -13011,10 +13007,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -13613,10 +13605,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -13681,10 +13669,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19344,10 +19328,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -19412,10 +19392,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -23378,10 +23354,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/HLTrigger/Configuration/python/HLT_GRun_cff.py b/HLTrigger/Configuration/python/HLT_GRun_cff.py index 14f0a7768d331..577acb01422ef 100644 --- a/HLTrigger/Configuration/python/HLT_GRun_cff.py +++ b/HLTrigger/Configuration/python/HLT_GRun_cff.py @@ -11575,10 +11575,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -11643,10 +11639,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17383,10 +17375,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( False ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -17451,10 +17439,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), @@ -21151,10 +21135,6 @@ applyOccupancyCut = cms.bool( False ), applyDeltaBetaCorrection = cms.bool( False ), applyRelativeSumPtCut = cms.bool( True ), - applyPhotonPtSumOutsideSignalConeCut = cms.bool( False ), - maxAbsPhotonSumPt_outsideSignalCone = cms.double(1.e+9), - maxRelPhotonSumPt_outsideSignalCone = cms.double(0.10), - applyFootprintCorrection = cms.bool(False), maximumOccupancy = cms.uint32( 0 ), deltaBetaPUTrackPtCutOverride = cms.double( 0.5 ), ApplyDiscriminationByWeightedECALIsolation = cms.bool( False ), diff --git a/RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h b/RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h index f5e17c02eba2e..c933264b2b0c2 100644 --- a/RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h +++ b/RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h @@ -85,6 +85,7 @@ class TauDiscriminationProducerBase : public edm::stream::EDProducer<> { evt.getByToken(disc_token, handle); }; }; + protected: //value given to taus that fail prediscriminants diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index fa310d5369055..f2b501161531b 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -190,6 +190,7 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas void beginEvent(const edm::Event& evt, const edm::EventSetup& evtSetup) override; double discriminate(const PFTauRef& pfTau) const override; + static void fillDescriptions(edm::ConfigurationDescriptions & descriptions); inline double weightedSum(std::vector inColl_, double eta, double phi) const { double out = 1.0; @@ -318,6 +319,19 @@ void PFRecoTauDiscriminationByIsolation::beginEvent(const edm::Event& event, con } } + +void +PFRecoTauDiscriminationByIsolation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) +{ + edm::ParameterSetDescription iDesc; + iDesc.add("applyPhotonPtSumOutsideSignalConeCut",false); + iDesc.add("maxAbsPhotonSumPt_outsideSignalCone",1.e+9); + iDesc.add("maxRelPhotonSumPt_outsideSignalCone",0.10); + iDesc.add("applyFootprintCorrection",false); +} + + + double PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const { From 3115aed669d501b4569e9032fb67d8753fbfeca8 Mon Sep 17 00:00:00 2001 From: AJ Johnson Date: Tue, 11 Aug 2015 10:29:54 +0200 Subject: [PATCH 34/35] Added Christian's alternate fix to the HLT issues. Now passing all tests except 135.4 (missing module label: combinatoricRecoTaus) --- CommonTools/ParticleFlow/python/pfTaus_cff.py | 45 ------------------- .../PFRecoTauDiscriminationByIsolation.cc | 28 ++++-------- 2 files changed, 9 insertions(+), 64 deletions(-) diff --git a/CommonTools/ParticleFlow/python/pfTaus_cff.py b/CommonTools/ParticleFlow/python/pfTaus_cff.py index e9368bc808463..2395d583c6bad 100644 --- a/CommonTools/ParticleFlow/python/pfTaus_cff.py +++ b/CommonTools/ParticleFlow/python/pfTaus_cff.py @@ -125,51 +125,6 @@ pfTauTagInfoProducer.PFCandidateProducer = jetConfig.ak4PFJets.src pfTauTagInfoProducer.PFJetTracksAssociatorProducer = 'pfJetTracksAssociatorAtVertex' - -# Produce primary vertices - -from RecoTauTag.RecoTau.PFTauPrimaryVertexProducer_cfi import * -from RecoTauTag.RecoTau.PFTauSecondaryVertexProducer_cfi import * -from RecoTauTag.RecoTau.PFTauTransverseImpactParameters_cfi import * -hpsPFTauPrimaryVertexProducer = PFTauPrimaryVertexProducer.clone( - PFTauTag = cms.InputTag("hpsPFTauProducer"), - ElectronTag = cms.InputTag(""), - MuonTag = cms.InputTag(""), - PVTag = cms.InputTag("offlinePrimaryVertices"), - beamSpot = cms.InputTag("offlineBeamSpot"), - TrackCollectionTag = cms.InputTag("generalTracks"), - Algorithm = cms.int32(1), - useBeamSpot = cms.bool(True), - RemoveMuonTracks = cms.bool(False), - RemoveElectronTracks = cms.bool(False), - useSelectedTaus = cms.bool(False), - discriminators = cms.VPSet( - cms.PSet( - discriminator = cms.InputTag('hpsPFTauDiscriminationByDecayModeFindingNewDMs'), - selectionCut = cms.double(0.5) - ) - ), - cut = cms.string("pt > 18.0 & abs(eta) < 2.4") -) - - -hpsPFTauSecondaryVertexProducer = PFTauSecondaryVertexProducer.clone( - PFTauTag = cms.InputTag("hpsPFTauProducer") -) -hpsPFTauTransverseImpactParameters = PFTauTransverseImpactParameters.clone( - PFTauTag = cms.InputTag("hpsPFTauProducer"), - PFTauPVATag = cms.InputTag("hpsPFTauPrimaryVertexProducer"), - PFTauSVATag = cms.InputTag("hpsPFTauSecondaryVertexProducer"), - useFullCalculation = cms.bool(False) -) -hpsPFTauVertexAndImpactParametersSeq = cms.Sequence( - hpsPFTauPrimaryVertexProducer* - hpsPFTauSecondaryVertexProducer* - hpsPFTauTransverseImpactParameters -) - - - pfTausPreSequence = cms.Sequence( pfJetTracksAssociatorAtVertex + pfTauPFJets08Region + diff --git a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc index f2b501161531b..4c40327597596 100644 --- a/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc +++ b/RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByIsolation.cc @@ -99,11 +99,15 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas customIsoCone_ = -1; } - applyPhotonPtSumOutsideSignalConeCut_ = pset.getParameter("applyPhotonPtSumOutsideSignalConeCut"); - maxAbsPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxAbsPhotonSumPt_outsideSignalCone"); - maxRelPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxRelPhotonSumPt_outsideSignalCone"); - - applyFootprintCorrection_ = pset.getParameter("applyFootprintCorrection"); + applyPhotonPtSumOutsideSignalConeCut_ = ( pset.exists("applyPhotonPtSumOutsideSignalConeCut") ) ? + pset.getParameter("applyPhotonPtSumOutsideSignalConeCut") : false; + if ( applyPhotonPtSumOutsideSignalConeCut_ ) { + maxAbsPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxAbsPhotonSumPt_outsideSignalCone"); + maxRelPhotonSumPt_outsideSignalCone_ = pset.getParameter("maxRelPhotonSumPt_outsideSignalCone"); + } + + applyFootprintCorrection_ = ( pset.exists("applyFootprintCorrection") ) ? + pset.getParameter("applyFootprintCorrection") : false; if ( applyFootprintCorrection_ || storeRawFootprintCorrection_ ) { edm::VParameterSet cfgFootprintCorrections = pset.getParameter("footprintCorrections"); for ( edm::VParameterSet::const_iterator cfgFootprintCorrection = cfgFootprintCorrections.begin(); @@ -190,7 +194,6 @@ class PFRecoTauDiscriminationByIsolation : public PFTauDiscriminationProducerBas void beginEvent(const edm::Event& evt, const edm::EventSetup& evtSetup) override; double discriminate(const PFTauRef& pfTau) const override; - static void fillDescriptions(edm::ConfigurationDescriptions & descriptions); inline double weightedSum(std::vector inColl_, double eta, double phi) const { double out = 1.0; @@ -319,19 +322,6 @@ void PFRecoTauDiscriminationByIsolation::beginEvent(const edm::Event& event, con } } - -void -PFRecoTauDiscriminationByIsolation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) -{ - edm::ParameterSetDescription iDesc; - iDesc.add("applyPhotonPtSumOutsideSignalConeCut",false); - iDesc.add("maxAbsPhotonSumPt_outsideSignalCone",1.e+9); - iDesc.add("maxRelPhotonSumPt_outsideSignalCone",0.10); - iDesc.add("applyFootprintCorrection",false); -} - - - double PFRecoTauDiscriminationByIsolation::discriminate(const PFTauRef& pfTau) const { From 398866a1db973cb65ff7c87aaf76d1c71c08662d Mon Sep 17 00:00:00 2001 From: AJ Johnson Date: Thu, 13 Aug 2015 11:29:36 +0200 Subject: [PATCH 35/35] Per Slava's suggestion, removed modules from cms.Sequence and added them to import section instead. Now runTheMatrix passes all tests!!! --- .../python/updateHPSPFTaus_cff.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py index 523413f24c7cc..d6c2be075e4df 100644 --- a/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py +++ b/RecoTauTag/Configuration/python/updateHPSPFTaus_cff.py @@ -22,19 +22,19 @@ from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuon2_cfi import * from RecoTauTag.RecoTau.PFRecoTauDiscriminationAgainstMuonMVA_cfi import * -from RecoTauTag.Configuration.HPSPFTaus_cff import * - -updateHPSPFTaus = cms.Sequence( - hpsPFTauChargedIsoPtSum* - hpsPFTauNeutralIsoPtSum* - hpsPFTauPUcorrPtSum* - hpsPFTauNeutralIsoPtSumWeight* - hpsPFTauFootprintCorrection* - hpsPFTauPhotonPtSumOutsideSignalCone* - hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits* - hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits* - hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits* - hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits* - hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone* - hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits -) +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauChargedIsoPtSum +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauNeutralIsoPtSum +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauPUcorrPtSum +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauNeutralIsoPtSumWeight +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauFootprintCorrection +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauPhotonPtSumOutsideSignalCone +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauDiscriminationByRawCombinedIsolationDBSumPtCorr3Hits +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauDiscriminationByLoosePileupWeightedIsolation3Hits +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauDiscriminationByMediumPileupWeightedIsolation3Hits +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauDiscriminationByTightPileupWeightedIsolation3Hits +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauDiscriminationByPhotonPtSumOutsideSignalCone +from RecoTauTag.Configuration.HPSPFTaus_cff import hpsPFTauDiscriminationByRawPileupWeightedIsolation3Hits + + +updateHPSPFTaus = cms.Sequence() +