Skip to content
Snippets Groups Projects
Commit b5fe44a0 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'macro' into 'master'

tauRecTools: remove preprocessed macros not needed in R22

See merge request atlas/athena!30965
parents fa205fb7 8fadf793
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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() );
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment