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
 
std::pair< bool, PositionTypeposition (const Plane &plane) const
 
PositionType position (float s) 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

◆ DirectionType

Definition at line 22 of file StraightLinePlaneCrossing.h.

◆ 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.

Constructor & Destructor Documentation

◆ StraightLinePlaneCrossing()

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.

30  : theX0(point), theP0(momentum.unit()), thePropDir(propDir) {}

◆ ~StraightLinePlaneCrossing()

StraightLinePlaneCrossing::~StraightLinePlaneCrossing ( )
inline

Definition at line 33 of file StraightLinePlaneCrossing.h.

33 {}

Member Function Documentation

◆ pathLength()

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 8 of file StraightLinePlaneCrossing.cc.

8  {
9  //
10  // calculate path length
11  //
12  PositionType planePosition(plane.position());
13  DirectionType planeNormal(plane.normalVector());
14  auto pz = planeNormal.dot(theP0);
15  auto dS = -planeNormal.dot(theX0 - planePosition) / pz;
16  // check direction
17  auto opposite2Track =
18  ((thePropDir == alongMomentum) & (dS < 0.f)) | ((thePropDir == oppositeToMomentum) & (dS > 0.f));
19  //
20  // Return result
21  //
22  return std::pair<bool, double>(!opposite2Track, dS);
23 }

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

Referenced by HelixBarrelPlaneCrossingByCircle::pathLength(), position(), and RKPropagatorInS::propagateParametersOnPlane().

◆ position() [1/2]

std::pair< bool, StraightLinePlaneCrossing::PositionType > StraightLinePlaneCrossing::position ( const Plane plane) const

Simplified interface in case the path length is not needed

Definition at line 25 of file StraightLinePlaneCrossing.cc.

25  {
26  auto crossed = pathLength(plane);
27  if (crossed.first)
28  return std::pair<bool, PositionType>(true, position(crossed.second));
29  else
30  return std::pair<bool, PositionType>(false, PositionType());
31 }

References pathLength(), and position().

◆ position() [2/2]

PositionType StraightLinePlaneCrossing::position ( float  s) const
inline

Position at pathlength s from the starting point.

Definition at line 42 of file StraightLinePlaneCrossing.h.

42 { return PositionType(theX0 + s * theP0); }

References alignCSCRings::s, theP0, and theX0.

Referenced by position(), CtfSpecialSeedGenerator::postCheck(), and RKPropagatorInS::propagateParametersOnPlane().

Member Data Documentation

◆ theP0

const PositionType StraightLinePlaneCrossing::theP0
private

Definition at line 54 of file StraightLinePlaneCrossing.h.

Referenced by pathLength(), and position().

◆ thePropDir

const PropagationDirection StraightLinePlaneCrossing::thePropDir
private

Definition at line 55 of file StraightLinePlaneCrossing.h.

Referenced by pathLength().

◆ theX0

const PositionType StraightLinePlaneCrossing::theX0
private

Definition at line 53 of file StraightLinePlaneCrossing.h.

Referenced by pathLength(), and position().

StraightLinePlaneCrossing::theX0
const PositionType theX0
Definition: StraightLinePlaneCrossing.h:53
StraightLinePlaneCrossing::DirectionType
Basic3DVector< float > DirectionType
Definition: StraightLinePlaneCrossing.h:22
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
oppositeToMomentum
Definition: PropagationDirection.h:4
StraightLinePlaneCrossing::thePropDir
const PropagationDirection thePropDir
Definition: StraightLinePlaneCrossing.h:55
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Basic3DVector::dot
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
Definition: extBasic3DVector.h:189
StraightLinePlaneCrossing::PositionType
Basic3DVector< float > PositionType
Definition: StraightLinePlaneCrossing.h:21
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
StraightLinePlaneCrossing::position
PositionType position(float s) const
Definition: StraightLinePlaneCrossing.h:42
point
*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::pathLength
std::pair< bool, double > pathLength(const Plane &plane) const
Definition: StraightLinePlaneCrossing.cc:8
alongMomentum
Definition: PropagationDirection.h:4
StraightLinePlaneCrossing::theP0
const PositionType theP0
Definition: StraightLinePlaneCrossing.h:54
Plane::normalVector
GlobalVector normalVector() const
Definition: Plane.h:41