Skip to content
Snippets Groups Projects
Commit a82c16ea authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'fixBLS2' into 'master'

Allow VertexPointEstimator to return early to prevent FPE errors ATR-24159

Closes ATR-24159

See merge request atlas/athena!46520
parents 930cad2c d04e882e
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,7 @@ namespace InDet {
std::vector<double> m_maxHl; /**maximum ratio H/l */
std::vector<double> m_maxPhi; /**maximum DPhi at the estimated vertex position */
double m_maxChi2; /** max chi2 of the estimated vertex position*/
bool m_returnOnError;
};
}
......
......@@ -27,7 +27,7 @@ namespace InDet {
// ----------------------------------
VertexPointEstimator::VertexPointEstimator(const std::string& type, const std::string& name, const IInterface* parent) :
AthAlgTool(type, name, parent),
m_maxChi2(20.)
m_maxChi2(20.), m_returnOnError(true)
{
declareInterface<VertexPointEstimator>(this);
/// Cuts for selecting track pairs
......@@ -77,6 +77,7 @@ namespace InDet {
declareProperty("MaxDeltaR", m_maxDr);
declareProperty("MaxHl", m_maxHl);
declareProperty("MaxPhi", m_maxPhi);
declareProperty("ReturnOnError", m_returnOnError);
}
// ----------------------------------
......@@ -246,6 +247,7 @@ namespace InDet {
if (D == 0.) {
ATH_MSG_DEBUG("Concentric circles, should not happen return (0,0,0)");
errorcode = 1;
if(m_returnOnError) return intPoint;
}
U = D - RA[0] - RA[1]; // signed separation, if > 0., the circles do not intersect, if < 0., they might
// rotate, translate to a system, where the two circle centres lie on the X axis
......@@ -312,6 +314,7 @@ namespace InDet {
//Cut if distance of minimum approach is too big
ATH_MSG_DEBUG("XY distance of minimum approach is too large, return (0,0,0)");
errorcode = 2;
if(m_returnOnError) return intPoint;
}
}
......@@ -351,6 +354,7 @@ namespace InDet {
if (std::max(A,B) < minArcLength || std::max(A,B) > maxArcLength) { // limit the minimum arc length
ATH_MSG_DEBUG("Unacceptable arc length");
errorcode = 5;
if(m_returnOnError) return intPoint;
}
int J = 0;
......@@ -364,17 +368,20 @@ namespace InDet {
if(deltaR>maxDr || deltaR<minDr){
ATH_MSG_DEBUG("Unaceptable circle distance");
errorcode = 6;
if(m_returnOnError) return intPoint;
}
if(hl>maxHl){
ATH_MSG_DEBUG("Unacceptable h/D ratio");
errorcode = 7;
if(m_returnOnError) return intPoint;
}
deltaPhi = PHI; // quick fix: cannot get rid of (double) PHI as it is passed by ref and deltaPhi is a float
if(deltaPhi>maxPhi){
ATH_MSG_DEBUG("Unacceptable difference in phi");
errorcode = 8;
if(m_returnOnError) return intPoint;
}
return intPoint;
......
......@@ -112,7 +112,7 @@ int main()
ToolHandle<InDet::VertexPointEstimator> tool ("InDet::VertexPointEstimator");
assert( tool.retrieve().isSuccess() );
tool->setProperty("ReturnOnError", false).ignore();
test1 (*tool);
return 0;
......
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