Commit 52c4d0ba authored by Lynn Garren's avatar Lynn Garren
Browse files

restore abs function - G4 calls abs(HepLorentzVector)

parent 1de900cc
......@@ -2,7 +2,7 @@
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: TemplateFunctions.h,v 1.1.2.2 2004/06/30 15:38:30 garren Exp $
// $Id: TemplateFunctions.h,v 1.1.2.3 2004/07/01 17:38:51 garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
......@@ -19,6 +19,8 @@
#include <cmath> // double abs()
#include <stdlib.h> // int abs()
#include "CLHEP/config/CLHEP.h"
using namespace std;
// Geant 4.6.2 still has at least one reference to sqr
......@@ -33,6 +35,18 @@ inline T sqr(const T& x) {
}
#endif
// Geant4 calls abs(CLHEP::HepLorentzVector)
#ifndef CLHEP_ABS_DEFINED
#define CLHEP_ABS_DEFINED
#ifdef abs
#undef abs
#endif
template <class T>
inline T abs(const T& a) {
return a < 0 ? -a : a;
}
#endif
#endif /* HEP_TEMPLATEFUNCTIONS_H */
#endif // ENABLE_BACKWARDS_COMPATIBILITY
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment