Skip to content
Snippets Groups Projects
Commit 699ab21c authored by sutt's avatar sutt
Browse files

Add protection again nan input rnages for the RoiDescriptor

In the past algorithms have often calculated parameters incorrectly as nan,
and then tried to ceate RoiDescriptors with these parameters, so the RoiDescriptor
has explicit protection agains such nan input and throws an exception.

However, this check is only on the central values - the asumption being that the ranges
are sensible, and so they will only be nan if the central value is nan, so they do not need
to be independently checked.

However, there is a case of an attempt to create an RoiDescriptorthe with nan ranges
but with sensible central values, so now we add the range checks also to the limits of
the Roi.

This is in response to https://its.cern.ch/jira/browse/ATR-22017, although it will not fix
the problem, since the problem is most likely in the miscalculation upstream of the ranges
themselves by some algorithm, so the RoiDescriptor can not fix this, and must throw an
exception itself.

The ultimate fix, must be to identify the algorithm creating the problematic parameters
in the first place, otherwise the processing for this event would need to be abandoned.
parent eac34946
No related tags found
1 merge request!36364Add protection again nan input ranges for the RoiDescriptor
......@@ -72,7 +72,9 @@ RoiDescriptor::RoiDescriptor(double eta_, double etaMinus_, double etaPlus_,
m_manageConstituents(true),
m_version(RoiVersion)
{
construct( eta_, etaMinus_, etaPlus_, phi_, phiMinus_, phiPlus_, zed_, zedMinus_, zedPlus_ );
construct( RoiUtil::etacheck(eta_), RoiUtil::etacheck(etaMinus_), RoiUtil::etacheck(etaPlus_),
RoiUtil::phicheck(phi_), RoiUtil::phicheck(phiMinus_), RoiUtil::phicheck(phiPlus_),
RoiUtil::zedcheck(zed_), RoiUtil::zedcheck(zedMinus_), RoiUtil::zedcheck(zedPlus_) );
}
......@@ -96,8 +98,10 @@ RoiDescriptor::RoiDescriptor(double etaMinus_, double etaPlus_,
if ( phiMinus_>phiPlus_ ) phi_ += M_PI;
if ( phi_<-M_PI ) phi_ -= M_2PI;
if ( phi_>M_PI ) phi_ += M_2PI;
construct( eta_, etaMinus_, etaPlus_, phi_, phiMinus_, phiPlus_, 0, -s_zedWidthDefault, s_zedWidthDefault );
construct( RoiUtil::etacheck(eta_), RoiUtil::etacheck(etaMinus_), RoiUtil::etacheck(etaPlus_),
RoiUtil::phicheck(phi_), RoiUtil::phicheck(phiMinus_), RoiUtil::phicheck(phiPlus_),
0, -s_zedWidthDefault, s_zedWidthDefault );
}
......
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