Namespaces | Functions

WCSimMathUtil Namespace Reference

Namespaces

namespace  ROOT

Functions

template<class T >
sqr (T x)
Double_t pythag (Double_t x, Double_t y)
Double_t pythag (Double_t x, Double_t y, Double_t z)
Double_t pythag (Double_t x1, Double_t y1, Double_t z1, Double_t x2, Double_t y2, Double_t z2)
Double_t DotProduct (Double_t *A, Double_t *B)
Double_t Magnitude (Double_t *A, Double_t *B)
Double_t Determinant (Double_t a, Double_t b, Double_t c)
void SubtractVec (Double_t *A, Double_t *B, Double_t *res)
void RealRoots (Double_t a, Double_t b, Double_t arg_sqrt, Double_t &firstRoot, Double_t &secondRoot)

Function Documentation

Double_t WCSimMathUtil::Determinant ( Double_t  a,
Double_t  b,
Double_t  c 
)

Definition at line 33 of file WCSimMathUtil.cc.

Referenced by ClassImp().

  {
    return (b * b) - (4 * a * c);
  } // end determinant

Double_t WCSimMathUtil::DotProduct ( Double_t *  A,
Double_t *  B 
)

Definition at line 8 of file WCSimMathUtil.cc.

Referenced by ClassImp(), and WCSimVertexFinderPoint::GlbPeakGeo().

  {
    Double_t dotprod = 0.;
    for ( Int_t i = 0; i < 3; i++) {
      dotprod += A[i]*B[i];
    }
    return  dotprod;
  }

Double_t WCSimMathUtil::Magnitude ( Double_t *  A,
Double_t *  B 
)

Definition at line 17 of file WCSimMathUtil.cc.

References pythag().

Referenced by ClassImp(), and WCSimVertexFinderPoint::GlbPeakGeo().

  {
    Double_t dx     = fabs(A[0] - B[0]);
    Double_t dy     = fabs(A[1] - B[1]);
    Double_t dz     = fabs(A[2] - B[2]);
    return pythag(dx,dy,dz);
  }

Double_t WCSimMathUtil::pythag ( Double_t  x,
Double_t  y 
) [inline]

Definition at line 10 of file WCSimMathUtil.hh.

References sqr().

Referenced by Magnitude().

   {
     return sqrt(sqr(x)+sqr(y));
   }

Double_t WCSimMathUtil::pythag ( Double_t  x1,
Double_t  y1,
Double_t  z1,
Double_t  x2,
Double_t  y2,
Double_t  z2 
) [inline]

Definition at line 20 of file WCSimMathUtil.hh.

References sqr().

   {
     return sqrt(sqr(x2-x1)+sqr(y2-y1)+sqr(z2-z1));
   }

Double_t WCSimMathUtil::pythag ( Double_t  x,
Double_t  y,
Double_t  z 
) [inline]

Definition at line 15 of file WCSimMathUtil.hh.

References sqr().

   {
     return sqrt(sqr(x)+sqr(y)+sqr(z));
   }

void WCSimMathUtil::RealRoots ( Double_t  a,
Double_t  b,
Double_t  arg_sqrt,
Double_t &  firstRoot,
Double_t &  secondRoot 
)

Definition at line 39 of file WCSimMathUtil.cc.

Referenced by ClassImp().

  {
    firstRoot  = (-b + arg_sqrt)/(2*a);
    secondRoot = (-b - arg_sqrt)/(2*a);
    //std::cout << "\nFirst Real Root: \t" << firstRoot << "\n";
    //std::cout << "Second Real Root: \t" << secondRoot << "\n";
   } // end realRoots

template<class T >
T WCSimMathUtil::sqr ( x  )  [inline]

Definition at line 9 of file WCSimMathUtil.hh.

Referenced by ClassImp(), and pythag().

{return x*x;}

void WCSimMathUtil::SubtractVec ( Double_t *  A,
Double_t *  B,
Double_t *  res 
)

Definition at line 25 of file WCSimMathUtil.cc.

Referenced by ClassImp(), and WCSimVertexFinderPoint::GlbPeakGeo().

  {
    for (Int_t i = 0; i < 3; i++) {
      res[i] = A[i] - B[i];
    }
  }