CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
StraightLinePlaneCrossing Class Reference

#include <StraightLinePlaneCrossing.h>

Public Types

using DirectionType = Basic3DVector< float >
 
using PositionType = Basic3DVector< float >
 

Public Member Functions

std::pair< bool, double > pathLength (const Plane &plane) const
 
PositionType position (float s) const
 
std::pair< bool, PositionTypeposition (const Plane &plane) const
 
 StraightLinePlaneCrossing (const PositionType &point, const DirectionType &momentum, const PropagationDirection propDir=alongMomentum)
 
 ~StraightLinePlaneCrossing ()
 

Private Attributes

const PositionType theP0
 
const PropagationDirection thePropDir
 
const PositionType theX0
 

Detailed Description

Calculates intersections of a line with a plane.

Definition at line 14 of file StraightLinePlaneCrossing.h.

Member Typedef Documentation

Definition at line 22 of file StraightLinePlaneCrossing.h.

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.

Constructor & Destructor Documentation

StraightLinePlaneCrossing::StraightLinePlaneCrossing ( const PositionType point,
const DirectionType momentum,
const PropagationDirection  propDir = alongMomentum 
)
inline

Constructor using point and momentum.

Definition at line 27 of file StraightLinePlaneCrossing.h.

29  :
30  theX0(point),
31  theP0(momentum.unit()),
32  thePropDir(propDir) {}
const PropagationDirection thePropDir
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
StraightLinePlaneCrossing::~StraightLinePlaneCrossing ( )
inline

Definition at line 35 of file StraightLinePlaneCrossing.h.

References pathLength().

35 {}

Member Function Documentation

std::pair< bool, double > StraightLinePlaneCrossing::pathLength ( const Plane plane) const

Propagation status (true if valid) and (signed) path length along the helix from the starting point to the plane.

Definition at line 9 of file StraightLinePlaneCrossing.cc.

References alongMomentum, Basic3DVector< T >::dot(), f, Plane::normalVector(), oppositeToMomentum, GloballyPositioned< T >::position(), theP0, thePropDir, and theX0.

Referenced by NavPlane::distanceAlongLine(), HelixBarrelPlaneCrossingByCircle::pathLength(), position(), RKPropagatorInS::propagateParametersOnPlane(), AnalyticalPropagator::propagateParametersOnPlane(), and ~StraightLinePlaneCrossing().

9  {
10  //
11  // calculate path length
12  //
13  PositionType planePosition(plane.position());
14  DirectionType planeNormal(plane.normalVector());
15  auto pz = planeNormal.dot(theP0);
16  auto dS = -planeNormal.dot(theX0-planePosition)/pz;
17  // check direction
18  auto opposite2Track = ( (thePropDir==alongMomentum) & (dS<0.f) ) |
19  ( (thePropDir==oppositeToMomentum) & (dS>0.f) );
20  //
21  // Return result
22  //
23  return std::pair<bool,double>(!opposite2Track,dS);
24 }
const PropagationDirection thePropDir
Basic3DVector< float > PositionType
GlobalVector normalVector() const
Definition: Plane.h:41
Basic3DVector< float > DirectionType
double f[11][100]
const PositionType & position() const
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
PositionType StraightLinePlaneCrossing::position ( float  s) const
inline
std::pair< bool, StraightLinePlaneCrossing::PositionType > StraightLinePlaneCrossing::position ( const Plane plane) const

Simplified interface in case the path length is not needed

Definition at line 27 of file StraightLinePlaneCrossing.cc.

References pathLength(), and position().

28 {
29  auto crossed = pathLength(plane);
30  if (crossed.first) return std::pair<bool,PositionType>(true, position(crossed.second));
31  else return std::pair<bool,PositionType>(false, PositionType());
32 }
Basic3DVector< float > PositionType
PositionType position(float s) const
std::pair< bool, double > pathLength(const Plane &plane) const

Member Data Documentation

const PositionType StraightLinePlaneCrossing::theP0
private

Definition at line 56 of file StraightLinePlaneCrossing.h.

Referenced by pathLength(), and position().

const PropagationDirection StraightLinePlaneCrossing::thePropDir
private

Definition at line 57 of file StraightLinePlaneCrossing.h.

Referenced by pathLength().

const PositionType StraightLinePlaneCrossing::theX0
private

Definition at line 55 of file StraightLinePlaneCrossing.h.

Referenced by pathLength(), and position().