Skip to content
Snippets Groups Projects
Commit e1d53d82 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'special_case_MVACalib_TRTConv_Run3' into 'main'

special case to avoid TRT photon Conversion in MVA calibration

See merge request atlas/athena!69947
parents b9a6ae75 1360bab7
No related branches found
No related tags found
No related merge requests found
...@@ -64,20 +64,32 @@ StatusCode egammaMVASvc::getEnergy(const xAOD::CaloCluster& cluster, ...@@ -64,20 +64,32 @@ StatusCode egammaMVASvc::getEnergy(const xAOD::CaloCluster& cluster,
ATH_MSG_FATAL("Trying to calibrate an electron, but disabled"); ATH_MSG_FATAL("Trying to calibrate an electron, but disabled");
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
} else if (xAOD::EgammaHelpers::isConvertedPhoton(&eg) &&
xAOD::EgammaHelpers::conversionRadius(static_cast<const xAOD::Photon*>(&eg)) < m_maxConvR) {
if (!m_mvaConvertedPhoton.empty()) {
mvaE = m_mvaConvertedPhoton->getEnergy(cluster, &eg);
} else {
ATH_MSG_FATAL("Trying to calibrate a converted photon, but disabled");
return StatusCode::FAILURE;
}
} else if (xAOD::EgammaHelpers::isPhoton(&eg)) { } else if (xAOD::EgammaHelpers::isPhoton(&eg)) {
if (!m_mvaUnconvertedPhoton.empty()) { const xAOD::Photon* ph = static_cast<const xAOD::Photon*>(&eg);
mvaE = m_mvaUnconvertedPhoton->getEnergy(cluster, &eg); bool isConvCalib = xAOD::EgammaHelpers::isConvertedPhoton(ph) &&
xAOD::EgammaHelpers::conversionRadius(ph) < m_maxConvR;
if (m_removeTRTConvBarrel) {
// special case in Run3 to avoid TRT converted photons in the barrel
using enum xAOD::EgammaParameters::ConversionType;
const xAOD::EgammaParameters::ConversionType conversionType = xAOD::EgammaHelpers::conversionType(ph);
const bool isTRTConv = (conversionType == singleTRT) || (conversionType == doubleTRT); // 2 or 4
const bool isTRTEndcap = std::abs(ph->eta()) > 0.8;
isConvCalib = isConvCalib && (isTRTEndcap || !isTRTConv);
}
if (isConvCalib) {
if (!m_mvaConvertedPhoton.empty()) {
mvaE = m_mvaConvertedPhoton->getEnergy(cluster, &eg);
} else {
ATH_MSG_FATAL("Trying to calibrate a converted photon, but disabled");
return StatusCode::FAILURE;
}
} else { } else {
ATH_MSG_FATAL("Trying to calibrate an unconverted photon, but disabled"); if (!m_mvaUnconvertedPhoton.empty()) {
return StatusCode::FAILURE; mvaE = m_mvaUnconvertedPhoton->getEnergy(cluster, &eg);
} else {
ATH_MSG_FATAL("Trying to calibrate an unconverted photon, but disabled");
return StatusCode::FAILURE;
}
} }
} else { } else {
ATH_MSG_FATAL("Egamma object is of unsupported type"); ATH_MSG_FATAL("Egamma object is of unsupported type");
......
...@@ -68,6 +68,10 @@ private: ...@@ -68,6 +68,10 @@ private:
"MaxConvRadius", 800.0, "MaxConvRadius", 800.0,
"The maximum conversion radius for a photon to be considered converted"}; "The maximum conversion radius for a photon to be considered converted"};
Gaudi::Property<bool> m_removeTRTConvBarrel {this,
"RemoveTRTConvBarrel", false,
"Remove TRT converted photons in the barrel"};
}; };
#endif #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