8 #ifndef StMuUtilities_h
9 #define StMuUtilities_h
14 template<
class T>
inline T fabsMax(T a, T b) {
return (fabs(a)>fabs(b)) ? a : b;}
15 template<
class T>
inline T fabsMin(T a, T b) {
return (fabs(a)<fabs(b)) ? a : b;}
18 template<
class T,
class U>
19 inline unsigned short pack2UnsignedShort(T t, U scale) {
20 return (
unsigned short) (t*scale +0.5);
23 template<
class T,
class U>
24 inline short pack2Short(T t, U scale) {
25 return (
unsigned short) (t*scale +0.5);
28 template<
class T,
class U>
29 inline unsigned int pack2UnsignedInt(T t, U scale) {
30 return (
unsigned int) (t*scale +0.5);
33 template<
class T,
class U>
34 inline int pack2Int(T t, U scale) {
35 return (
int) (t*scale +0.5);
38 template<
class T,
class U>
39 inline double unPack(T v, U scale) {
40 return ((
double)v)/scale;