CMS 3D CMS Logo

Public Member Functions | Private Attributes

RKPropagatorInZ Class Reference

#include <RKPropagatorInZ.h>

Inheritance diagram for RKPropagatorInZ:
Propagator

List of all members.

Public Member Functions

virtual Propagatorclone () const
virtual const MagneticFieldmagneticField () const
virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState &, const Cylinder &) const
virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState &, const Plane &) const
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &, const Plane &) const
virtual std::pair
< TrajectoryStateOnSurface,
double > 
propagateWithPath (const FreeTrajectoryState &, const Cylinder &) const
 RKPropagatorInZ (const MagVolume &vol, PropagationDirection dir=alongMomentum)

Private Attributes

const MagVolumetheVolume

Detailed Description

Definition at line 7 of file RKPropagatorInZ.h.


Constructor & Destructor Documentation

RKPropagatorInZ::RKPropagatorInZ ( const MagVolume vol,
PropagationDirection  dir = alongMomentum 
) [inline]

Definition at line 10 of file RKPropagatorInZ.h.

Referenced by clone().

                                                                                   : 
    Propagator(dir), theVolume( &vol) {}

Member Function Documentation

Propagator * RKPropagatorInZ::clone ( void  ) const [virtual]

Implements Propagator.

Definition at line 79 of file RKPropagatorInZ.cc.

References RKPropagatorInZ().

{
    return new RKPropagatorInZ(*this);
}
virtual const MagneticField* RKPropagatorInZ::magneticField ( ) const [inline, virtual]

Implements Propagator.

Definition at line 27 of file RKPropagatorInZ.h.

References theVolume.

{return theVolume;}
TrajectoryStateOnSurface RKPropagatorInZ::propagate ( const FreeTrajectoryState ,
const Cylinder  
) const [virtual]

Implements Propagator.

Definition at line 62 of file RKPropagatorInZ.cc.

TrajectoryStateOnSurface RKPropagatorInZ::propagate ( const FreeTrajectoryState ts,
const Plane plane 
) const [virtual]

Implements Propagator.

Definition at line 13 of file RKPropagatorInZ.cc.

References FreeTrajectoryState::charge(), alignCSCRings::e, PV3DBase< T, PVType, FrameType >::mag(), FreeTrajectoryState::momentum(), pos, FreeTrajectoryState::position(), dqm_diff::start, theVolume, GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

{
  //typedef RK4PreciseSolver<double,5>           Solver;
  //typedef RKAdaptiveSolver<double,RKOne4OrderStep, 5>   Solver;
    typedef RKAdaptiveSolver<double,RKOneCashKarpStep, 5>   Solver;
    typedef Solver::Vector                       RKVector;

    GlobalPoint pos( ts.position());
    GlobalVector mom( ts.momentum());

    // cout << "RKPropagatorInZ: starting from FTS " << ts << endl;

    LocalPoint startpos = plane.toLocal(pos);
    LocalVector startmom = plane.toLocal(mom);
    double pzSign = startmom.z() > 0 ? 1.0 : -1.0;

    // cout << "In local plane coordinates: " << startpos << ", momentum " << startmom << endl;

    RKVector start;
    start(0) = startpos.x();
    start(1) = startpos.y();
    start(2) = startmom.x()/startmom.z();
    start(3) = startmom.y()/startmom.z();
    start(4) = pzSign * ts.charge() / startmom.mag();

    // cout << "RKPropagatorInZ: Solving with par " <<  startpos.z() << " and state " << start << endl;

    RKLocalFieldProvider localField( *theVolume, plane);

    CurvilinearLorentzForce<double,5> deriv(localField);
    RKCurvilinearDistance<double,5> dist;
    double eps = 1.e-5;
    Solver solver;
    try {
        RKVector rkresult = solver( startpos.z(), start, -startpos.z(), deriv, dist, eps);

        return TrajectoryStateOnSurface( LocalTrajectoryParameters( rkresult(4), rkresult(2), rkresult(3),
                                                                    rkresult(0), rkresult(1), pzSign),
                                         plane, theVolume);
    }
    catch (CurvilinearLorentzForceException& e) {
        // the propagation failed due to momentum almost parallel to the plane.
        // This does not mean the propagation is impossible, but it should be done
        // in a different parametrization (e.g. s)  
        return TrajectoryStateOnSurface();
    }
}
std::pair< TrajectoryStateOnSurface, double > RKPropagatorInZ::propagateWithPath ( const FreeTrajectoryState ,
const Plane  
) const [virtual]

Implements Propagator.

Definition at line 68 of file RKPropagatorInZ.cc.

{
    return std::pair< TrajectoryStateOnSurface, double>();
}
std::pair< TrajectoryStateOnSurface, double > RKPropagatorInZ::propagateWithPath ( const FreeTrajectoryState ,
const Cylinder  
) const [virtual]

Implements Propagator.

Definition at line 74 of file RKPropagatorInZ.cc.

{
    return std::pair< TrajectoryStateOnSurface, double>();
}

Member Data Documentation

Definition at line 31 of file RKPropagatorInZ.h.

Referenced by magneticField(), and propagate().