CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
RKOne4OrderStep< T, N > Class Template Reference

#include <RKOne4OrderStep.h>

Public Types

typedef T Scalar
 
typedef RKSmallVector< T, NVector
 

Public Member Functions

std::pair< Vector, Toperator() (Scalar startPar, const Vector &startState, const RKDerivative< T, N > &deriv, const RKDistance< T, N > &dist, Scalar step)
 

Detailed Description

template<typename T, int N>
class RKOne4OrderStep< T, N >

Definition at line 11 of file RKOne4OrderStep.h.

Member Typedef Documentation

template<typename T , int N>
typedef T RKOne4OrderStep< T, N >::Scalar

Definition at line 14 of file RKOne4OrderStep.h.

template<typename T , int N>
typedef RKSmallVector<T,N> RKOne4OrderStep< T, N >::Vector

Definition at line 15 of file RKOne4OrderStep.h.

Member Function Documentation

template<typename T , int N>
std::pair< Vector, T> RKOne4OrderStep< T, N >::operator() ( Scalar  startPar,
const Vector startState,
const RKDerivative< T, N > &  deriv,
const RKDistance< T, N > &  dist,
Scalar  step 
)
inline

Definition at line 18 of file RKOne4OrderStep.h.

References funct::abs(), and diffTreeTool::diff.

20  {
21  const Scalar huge = 1.e5; // ad hoc protection against infinities, must be done better!
22  const Scalar hugediff = 100.;
23 
24  RK4OneStepTempl<T,N> solver;
25  Vector one( solver(startPar, startState, deriv, step));
26  if (std::abs(one[0])>huge || std::abs(one(1))>huge) return std::pair<Vector, Scalar>(one,hugediff);
27 
28  Vector firstHalf( solver(startPar, startState, deriv, step/2));
29  Vector secondHalf(solver(startPar+step/2, firstHalf, deriv, step/2));
30  Scalar diff = dist(one, secondHalf, startPar+step);
31  return std::pair<Vector, Scalar>(secondHalf,diff);
32  }
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
step