Skip to content
Snippets Groups Projects
Commit 46230898 authored by Nils Gillwald's avatar Nils Gillwald Committed by Edward Moyse
Browse files

Bug fix and updated expected behaviour for EGammaVariableCorrection tool

parent 62b298d9
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!41740Bug fix and updated expected behaviour for EGammaVariableCorrection tool
...@@ -358,7 +358,7 @@ bool ElectronPhotonVariableCorrectionBase::isEqualToUncorrectedDiscontinuity(con ...@@ -358,7 +358,7 @@ bool ElectronPhotonVariableCorrectionBase::isEqualToUncorrectedDiscontinuity(con
const StatusCode ElectronPhotonVariableCorrectionBase::getKinematicProperties(const xAOD::Egamma& egamma_object, float& pt, float& eta, float& phi) const const StatusCode ElectronPhotonVariableCorrectionBase::getKinematicProperties(const xAOD::Egamma& egamma_object, float& pt, float& eta, float& phi) const
{ {
// just reteriving eta and pt is probably less expensive then checking if I need it and // just retrieving eta and pt is probably less expensive then checking if I need it and
// then retrieve it only if I actually need it // then retrieve it only if I actually need it
// protection against bad clusters // protection against bad clusters
...@@ -380,6 +380,11 @@ const StatusCode ElectronPhotonVariableCorrectionBase::getKinematicProperties(co ...@@ -380,6 +380,11 @@ const StatusCode ElectronPhotonVariableCorrectionBase::getKinematicProperties(co
et = (cosheta != 0.) ? energy/cosheta : 0.; et = (cosheta != 0.) ? energy/cosheta : 0.;
} }
pt = et; pt = et;
// issue a warning if pT is unphysical - i.e. < 0
if (pt < 0)
{
ATH_MSG_WARNING("Encountered EGamma object with strange pT: " << pt << " MeV. Correcting as if it has a pT of 0.");
}
// phi // phi
phi = cluster->phiBE(2); phi = cluster->phiBE(2);
...@@ -629,7 +634,7 @@ const StatusCode ElectronPhotonVariableCorrectionBase::getCorrectionParameters(s ...@@ -629,7 +634,7 @@ const StatusCode ElectronPhotonVariableCorrectionBase::getCorrectionParameters(s
switch (m_ParameterTypeVector.at(parameter_itr)) switch (m_ParameterTypeVector.at(parameter_itr))
{ {
case ElectronPhotonVariableCorrectionBase::parameterType::EtaDependentTGraph: case ElectronPhotonVariableCorrectionBase::parameterType::EtaDependentTGraph:
// evaluate TGraph at abs(eta) // evaluate TGraph at eta
properties.at(parameter_itr) = m_graphCopies.at(parameter_itr)->Eval(etaForBinned); properties.at(parameter_itr) = m_graphCopies.at(parameter_itr)->Eval(etaForBinned);
break; break;
case ElectronPhotonVariableCorrectionBase::parameterType::PtDependentTGraph: case ElectronPhotonVariableCorrectionBase::parameterType::PtDependentTGraph:
...@@ -770,12 +775,12 @@ const StatusCode ElectronPhotonVariableCorrectionBase::findBin(int& return_bin, ...@@ -770,12 +775,12 @@ const StatusCode ElectronPhotonVariableCorrectionBase::findBin(int& return_bin,
{ {
// need to find the bin in which the evalPoint is // need to find the bin in which the evalPoint is
return_bin = -1; return_bin = -1;
// if the evalPoint is < 0, something is very wrong // if the evalPoint is < lowest bin edge, interpolate to -inf and return leftmost value
if (evalPoint < binning.at(0)) if (evalPoint < binning.at(0))
{ {
// I use it for eta and pT, so error message is tailored to that... return_bin = 0;
ATH_MSG_ERROR("Abs(Eta) or pT of object is smaller than 0."); // found bin, no need to continue here
return StatusCode::FAILURE; return StatusCode::SUCCESS;
} }
// loop over bin boundaries // loop over bin boundaries
//run only up to binning.size()-1, as running to binning.size() will get a seg fault for the boundary check //run only up to binning.size()-1, as running to binning.size() will get a seg fault for the boundary check
......
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