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

◆ Scalar

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

Definition at line 13 of file RKOne4OrderStep.h.

◆ Vector

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

Definition at line 14 of file RKOne4OrderStep.h.

Member Function Documentation

◆ operator()()

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 16 of file RKOne4OrderStep.h.

References funct::abs(), change_name::diff, and SiPixelPI::one.

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)
27  return std::pair<Vector, Scalar>(one, hugediff);
28 
29  Vector firstHalf(solver(startPar, startState, deriv, step / 2));
30  Vector secondHalf(solver(startPar + step / 2, firstHalf, deriv, step / 2));
31  Scalar diff = dist(one, secondHalf, startPar + step);
32  return std::pair<Vector, Scalar>(secondHalf, diff);
33  }
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
step
Definition: StallMonitor.cc:83