#include <TrackingTools/GeomPropagators/interface/StraightLinePlaneCrossing.h>
Public Types | |
typedef Basic3DVector< float > | DirectionType |
typedef Basic3DVector< float > | PositionType |
The types for position and direction are frame-neutral (not global, local, etc. | |
Public Member Functions | |
std::pair< bool, double > | pathLength (const Plane &plane) const |
Propagation status (true if valid) and (signed) path length along the helix from the starting point to the plane. | |
std::pair< bool, PositionType > | position (const Plane &plane) const |
Simplified interface in case the path length is not needed. | |
PositionType | position (double s) const |
Position at pathlength s from the starting point. | |
StraightLinePlaneCrossing (const PositionType &point, const DirectionType &momentum, const PropagationDirection propDir=alongMomentum) | |
Constructor using point and momentum. | |
~StraightLinePlaneCrossing () | |
Private Types | |
typedef Basic3DVector< float > | DirectionTypeDouble |
typedef Basic3DVector< float > | PositionTypeDouble |
Private Attributes | |
const PositionTypeDouble | theP0 |
const PropagationDirection | thePropDir |
const PositionTypeDouble | theX0 |
Definition at line 14 of file StraightLinePlaneCrossing.h.
typedef Basic3DVector<float> StraightLinePlaneCrossing::DirectionType |
Definition at line 22 of file StraightLinePlaneCrossing.h.
typedef Basic3DVector<float> StraightLinePlaneCrossing::DirectionTypeDouble [private] |
Definition at line 53 of file StraightLinePlaneCrossing.h.
typedef Basic3DVector<float> StraightLinePlaneCrossing::PositionType |
The types for position and direction are frame-neutral (not global, local, etc.
) so this interface can be used in any frame. Of course, the helix and the plane must be defined in the same frame, which is also the frame of the result.
Definition at line 21 of file StraightLinePlaneCrossing.h.
typedef Basic3DVector<float> StraightLinePlaneCrossing::PositionTypeDouble [private] |
Definition at line 52 of file StraightLinePlaneCrossing.h.
StraightLinePlaneCrossing::StraightLinePlaneCrossing | ( | const PositionType & | point, | |
const DirectionType & | momentum, | |||
const PropagationDirection | propDir = alongMomentum | |||
) |
Constructor using point and momentum.
Definition at line 8 of file StraightLinePlaneCrossing.cc.
00010 : 00011 theX0(point), 00012 theP0(momentum.unit()), 00013 thePropDir(propDir) { 00014 // cout << "StraightLinePlaneCrossing: x0 = " << point 00015 // << ", p0 = " << momentum << endl; 00016 } //
StraightLinePlaneCrossing::~StraightLinePlaneCrossing | ( | ) | [inline] |
Propagation status (true if valid) and (signed) path length along the helix from the starting point to the plane.
Definition at line 21 of file StraightLinePlaneCrossing.cc.
References alongMomentum, Plane::normalVector(), oppositeToMomentum, GloballyPositioned< T >::position(), theP0, thePropDir, and theX0.
Referenced by HelixBarrelPlaneCrossingByCircle::pathLength(), position(), RKPropagatorInS::propagateParametersOnPlane(), and AnalyticalPropagator::propagateWithLineCrossing().
00021 { 00022 // 00023 // Protect against p_normal=0 and calculate path length 00024 // 00025 PositionTypeDouble planePosition(plane.position()); 00026 DirectionTypeDouble planeNormal(plane.normalVector()); 00027 // double pz = plane.localZ(GlobalVector(theP0)); 00028 double pz = planeNormal.dot(theP0); 00029 // cout << "pz = " << pz << endl; 00030 if ( fabs(pz)<FLT_MIN ) return std::pair<bool,double>(false,0); 00031 // double dS = -plane.localZ(GlobalPoint(theX0))/pz; 00032 double dS = -planeNormal.dot(theX0-planePosition)/pz; 00033 // if ( thePropDir==alongMomentum ) cout << "alongMomentum "; 00034 // else if ( thePropDir==oppositeToMomentum ) cout << "oppositeToMomentum "; 00035 // else cout << "anyDirection "; 00036 // cout << dS << endl; 00037 if ( (thePropDir==alongMomentum && dS<0.) || 00038 (thePropDir==oppositeToMomentum && dS>0.) ) return std::pair<bool,double>(false,0); 00039 // 00040 // Return result 00041 // 00042 return std::pair<bool,double>(true,dS); 00043 }
std::pair< bool, StraightLinePlaneCrossing::PositionType > StraightLinePlaneCrossing::position | ( | const Plane & | plane | ) | const |
Simplified interface in case the path length is not needed.
Definition at line 46 of file StraightLinePlaneCrossing.cc.
References pathLength(), and position().
00047 { 00048 std::pair<bool,double> crossed = pathLength(plane); 00049 if (crossed.first) return std::pair<bool,PositionType>(true, position(crossed.second)); 00050 else return std::pair<bool,PositionType>(false, PositionType()); 00051 }
PositionType StraightLinePlaneCrossing::position | ( | double | s | ) | const [inline] |
Position at pathlength s from the starting point.
Definition at line 40 of file StraightLinePlaneCrossing.h.
Referenced by position(), CtfSpecialSeedGenerator::postCheck(), RKPropagatorInS::propagateParametersOnPlane(), and AnalyticalPropagator::propagateWithLineCrossing().
00040 {return PositionType(theX0+s*theP0);}
const PositionTypeDouble StraightLinePlaneCrossing::theP0 [private] |
Definition at line 56 of file StraightLinePlaneCrossing.h.
Referenced by pathLength(), and position().
const PropagationDirection StraightLinePlaneCrossing::thePropDir [private] |
const PositionTypeDouble StraightLinePlaneCrossing::theX0 [private] |
Definition at line 55 of file StraightLinePlaneCrossing.h.
Referenced by pathLength(), and position().