diff --git a/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx index 94a6c1157c233ef06bd969a0e3fa728d29f5cf07..33e5dbd1fc4e0cf72db95f92c0796eeea85505d6 100644 --- a/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx +++ b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx @@ -60,22 +60,6 @@ StatusCode TauEleOLRDecorator::execute(xAOD::TauJet& tau) m_xElectronContainer = electronInHandle.cptr(); ATH_MSG_DEBUG(" read: " << electronInHandle.key() << " = " << "..." ); - //part of EDM, this check is not necessary -#ifndef XAODTAU_VERSIONS_TAUJET_V3_H - if (!m_bEleOLRMatchAvailableChecked) - { - m_bEleOLRMatchAvailable = tau.isAvailable<char>("ele_olr_pass"); - m_bEleOLRMatchAvailableChecked = true; - if (m_bEleOLRMatchAvailable) - { - ATH_MSG_DEBUG("ele_olr_pass decoration is available on first tau processed, switched of processing for further taus."); - ATH_MSG_DEBUG("If a reprocessing of the electron overlap removal is needed, please pass a shallow copy of the original tau."); - } - } - if (m_bEleOLRMatchAvailable) - return StatusCode::SUCCESS; -#endif - const xAOD::Electron * xEleMatch = 0; float fLHScore = -4.; // default if no match was found @@ -100,46 +84,25 @@ StatusCode TauEleOLRDecorator::execute(xAOD::TauJet& tau) fLHScore = m_tEMLHTool->calculate(xEleMatch); // create link to the matched electron - if (xEleMatch) - { - -#ifndef XAODTAU_VERSIONS_TAUJET_V3_H - ElementLink < xAOD::ElectronContainer > lElectronMatchLink(xEleMatch, *(m_xElectronContainer)); - tau.auxdecor< ElementLink< xAOD::ElectronContainer > >("electronLink" ) = lElectronMatchLink; -#else - tau.setDetail( xAOD::TauJetParameters::electronLink, xEleMatch, (m_xElectronContainer) ); -#endif - } - else - { - -#ifndef XAODTAU_VERSIONS_TAUJET_V3_H - ElementLink < xAOD::ElectronContainer > lElectronMatchLink; - tau.auxdecor< ElementLink< xAOD::ElectronContainer > >("electronLink" ) = lElectronMatchLink; -#else - tau.setDetail( xAOD::TauJetParameters::electronLink, (const xAOD::IParticle* ) 0 ); -#endif - } + if (xEleMatch) { + tau.setDetail( xAOD::TauJetParameters::electronLink, xEleMatch, (m_xElectronContainer) ); + } + else { + tau.setDetail( xAOD::TauJetParameters::electronLink, (const xAOD::IParticle* ) 0 ); + } // decorate tau with score -#ifndef XAODTAU_VERSIONS_TAUJET_V3_H - tau.auxdecor< float >( "ele_match_lhscore" ) = fLHScore; -#else tau.setDiscriminant( xAOD::TauJetParameters::EleMatchLikelihoodScore, fLHScore ); -#endif bool bPass = false; - if (tau.nTracks() == 1) - bPass = (fLHScore <= getCutVal(tau.track(0)->eta(), - tau.pt()/1000.)); - else + if (tau.nTracks() == 1) { + bPass = (fLHScore <= getCutVal(tau.track(0)->eta(), tau.pt()/1000.)); + } + else { bPass = true; -#ifndef XAODTAU_VERSIONS_TAUJET_V3_H - tau.auxdecor< char >( "ele_olr_pass" ) = static_cast<char>(bPass); -#else - tau.setIsTau(xAOD::TauJetParameters::PassEleOLR, bPass); -#endif + } + tau.setIsTau(xAOD::TauJetParameters::PassEleOLR, bPass); return StatusCode::SUCCESS; } diff --git a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx index 3bf19f174458bb5a967d626235966b8e9b25ba53..7b7e04386b259575c44de4f064335d3b196d7110 100644 --- a/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx +++ b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx @@ -168,11 +168,7 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) if(tau.nTracks() > 0){ const xAOD::TrackParticle* track = 0; -#ifdef XAODTAU_VERSIONS_TAUJET_V3_H track = tau.track(0)->track(); -#else - track = tau.track(0); -#endif acc_absEtaLead(tau) = fabs( track->eta() ); acc_leadTrackEta(tau) = fabs( track->eta() ); acc_absDeltaEta(tau) = fabs( track->eta() - tau.eta() ); diff --git a/Reconstruction/tauRecTools/tauRecTools/TauEleOLRDecorator.h b/Reconstruction/tauRecTools/tauRecTools/TauEleOLRDecorator.h index e5461b0cf150056679261c1344ceeda686d29d37..4938fe8fbc755e0bc7ad618fa8f6f2d0ef591c02 100644 --- a/Reconstruction/tauRecTools/tauRecTools/TauEleOLRDecorator.h +++ b/Reconstruction/tauRecTools/tauRecTools/TauEleOLRDecorator.h @@ -34,20 +34,14 @@ class TauEleOLRDecorator: virtual public TauRecToolBase virtual StatusCode finalize() override; private: + float getCutVal(float fEta, float fPt); + + SG::ReadHandleKey<xAOD::ElectronContainer> m_electronInputContainer{this,"Key_electronInputContainer", "Electrons", "input electron container key"}; std::unique_ptr<AsgElectronLikelihoodTool> m_tEMLHTool; const xAOD::ElectronContainer* m_xElectronContainer; bool m_bElectonsAvailable; std::string m_sEleOLRFilePath; std::unique_ptr<TH2F> m_hCutValues; -#ifndef XAODTAU_VERSIONS_TAUJET_V3_H - bool m_bEleOLRMatchAvailable=false; - bool m_bEleOLRMatchAvailableChecked=false; -#endif - - private: - float getCutVal(float fEta, float fPt); - - SG::ReadHandleKey<xAOD::ElectronContainer> m_electronInputContainer{this,"Key_electronInputContainer", "Electrons", "input electron container key"}; }; #endif