CMS 3D CMS Logo

Public Types | Public Member Functions

RKCartesianDistance Class Reference

Estimator of the distance between two state vectors, e.g. for convergence test. More...

#include <RKCartesianDistance.h>

Inheritance diagram for RKCartesianDistance:
RKDistance< double, 6 >

List of all members.

Public Types

typedef double Scalar
typedef RKSmallVector< double, 6 > Vector

Public Member Functions

virtual Scalar operator() (const Vector &rka, const Vector &rkb, const Scalar &s) const
virtual ~RKCartesianDistance ()

Detailed Description

Estimator of the distance between two state vectors, e.g. for convergence test.

Definition at line 13 of file RKCartesianDistance.h.


Member Typedef Documentation

Reimplemented from RKDistance< double, 6 >.

Definition at line 16 of file RKCartesianDistance.h.

Reimplemented from RKDistance< double, 6 >.

Definition at line 17 of file RKCartesianDistance.h.


Constructor & Destructor Documentation

virtual RKCartesianDistance::~RKCartesianDistance ( ) [inline, virtual]

Definition at line 19 of file RKCartesianDistance.h.

{}

Member Function Documentation

virtual Scalar RKCartesianDistance::operator() ( const Vector rka,
const Vector rkb,
const Scalar s 
) const [inline, virtual]

Implements RKDistance< double, 6 >.

Definition at line 21 of file RKCartesianDistance.h.

References a, b, mag(), CartesianStateAdaptor::momentum(), and CartesianStateAdaptor::position().

                                                                                          {
    CartesianStateAdaptor a(rka), b(rkb);

    return (a.position()-b.position()).mag() + 
      (a.momentum() - b.momentum()).mag() / b.momentum().mag();
  }