CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes | Static Private Attributes
HelixForwardPlaneCrossing Class Referencefinal

#include <HelixForwardPlaneCrossing.h>

Inheritance diagram for HelixForwardPlaneCrossing:
HelixPlaneCrossing

Public Member Functions

virtual DirectionType direction (double s) const
 
 HelixForwardPlaneCrossing (const PositionType &point, const DirectionType &direction, const float curvature, const PropagationDirection propDir=alongMomentum)
 
virtual std::pair< bool, double > pathLength (const Plane &plane)
 
virtual PositionType position (double s) const
 
virtual ~HelixForwardPlaneCrossing ()
 
- Public Member Functions inherited from HelixPlaneCrossing
virtual ~HelixPlaneCrossing ()=default
 

Private Types

typedef Basic3DVector< double > DirectionTypeDouble
 
typedef Basic3DVector< double > PositionTypeDouble
 

Private Attributes

double theCachedCDPhi
 
double theCachedDPhi
 
double theCachedS
 
double theCachedSDPhi
 
double theCosPhi0
 
double theCosTheta
 
const PropagationDirection thePropDir
 
const double theRho
 
double theSinPhi0
 
double theSinTheta
 
const double theX0
 
const double theY0
 
const double theZ0
 

Static Private Attributes

static const float theNumericalPrecision = 5.e-7
 

Additional Inherited Members

- Public Types inherited from HelixPlaneCrossing
typedef Basic3DVector< float > DirectionType
 
typedef Basic3DVector< float > PositionType
 the helix is passed to the constructor and does not appear in the interface More...
 

Detailed Description

Calculates intersections of a helix with planes perpendicular to the z-axis.

Definition at line 12 of file HelixForwardPlaneCrossing.h.

Member Typedef Documentation

Definition at line 55 of file HelixForwardPlaneCrossing.h.

Definition at line 54 of file HelixForwardPlaneCrossing.h.

Constructor & Destructor Documentation

HelixForwardPlaneCrossing::HelixForwardPlaneCrossing ( const PositionType point,
const DirectionType direction,
const float  curvature,
const PropagationDirection  propDir = alongMomentum 
)

Constructor using point, direction and (transverse!) curvature.

Definition at line 6 of file HelixForwardPlaneCrossing.cc.

References p2, CAHitQuadrupletGenerator_cfi::pt2, mathSSE::sqrt(), theCosPhi0, theCosTheta, theSinPhi0, theSinTheta, Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

9  :
10  theX0(point.x()),
11  theY0(point.y()),
12  theZ0(point.z()),
14  thePropDir(propDir),
15  theCachedS(0),
16  theCachedDPhi(0.),
17  theCachedSDPhi(0.),
18  theCachedCDPhi(1.)
19 {
20  //
21  // Components of direction vector (with correct normalisation)
22  //
23  double px = direction.x();
24  double py = direction.y();
25  double pz = direction.z();
26  double pt2 = px*px+py*py;
27  double p2 = pt2+pz*pz;
28  double pI = 1./sqrt(p2);
29  double ptI = 1./sqrt(pt2);
30  theCosPhi0 = px*ptI;
31  theSinPhi0 = py*ptI;
32  theCosTheta = pz*pI;
33  theSinTheta = pt2*ptI*pI;
34 
35 }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
T curvature(T InversePt, const edm::EventSetup &iSetup)
T z() const
Cartesian z coordinate.
T sqrt(T t)
Definition: SSEVec.h:18
double p2[4]
Definition: TauolaWrapper.h:90
virtual DirectionType direction(double s) const
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
virtual HelixForwardPlaneCrossing::~HelixForwardPlaneCrossing ( )
inlinevirtual

Definition at line 21 of file HelixForwardPlaneCrossing.h.

21 {}

Member Function Documentation

HelixPlaneCrossing::DirectionType HelixForwardPlaneCrossing::direction ( double  s) const
virtual

Direction at pathlength s from the starting point.

Implements HelixPlaneCrossing.

Definition at line 73 of file HelixForwardPlaneCrossing.cc.

References MillePedeFileConverter_cfg::e, alignCSCRings::s, theCachedCDPhi, theCachedDPhi, theCachedS, theCachedSDPhi, theCosPhi0, theCosTheta, theNumericalPrecision, theRho, theSinPhi0, and theSinTheta.

Referenced by pathLength().

73  {
74  //
75  // Calculate delta phi (if not already available)
76  //
77  if ( s!=theCachedS ) {
78  theCachedS = s;
81  }
82 
83  if ( fabs(theCachedDPhi)>1.e-4 ) {
84  // full helix formula
86  theSinPhi0*theCachedCDPhi+theCosPhi0*theCachedSDPhi,
88  }
89  else {
90  // 2nd order
91  double dph = theCachedS*theRho*theSinTheta;
92  return DirectionType(theCosPhi0-(theSinPhi0+0.5*theCosPhi0*dph)*dph,
93  theSinPhi0+(theCosPhi0-0.5*theSinPhi0*dph)*dph,
94  theCosTheta/theSinTheta);
95  }
96 }
Basic3DVector< float > DirectionType
virtual std::pair<bool,double> HelixForwardPlaneCrossing::pathLength ( const Plane plane)
inlinevirtual

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

Implements HelixPlaneCrossing.

Definition at line 26 of file HelixForwardPlaneCrossing.h.

References funct::abs(), alongMomentum, direction(), min(), oppositeToMomentum, GloballyPositioned< T >::position(), position(), alignCSCRings::s, theCosTheta, thePropDir, theZ0, unlikely, and Basic3DVector< T >::z().

Referenced by CompositeTECWedge::computeCrossings(), TIDRing::computeCrossings(), and CompositeTECPetal::computeCrossings().

26  {
27  //
28  // Protect against p_z=0 and calculate path length
29  //
31 
32  double dS = (plane.position().z()-theZ0) / theCosTheta;
33 
34  // negative logic to avoid checking for anyDirection...
35  return std::make_pair( ! (
36  ( (thePropDir==alongMomentum) & (dS<0.) ) |
37  ( (thePropDir==oppositeToMomentum) & (dS>0.) )
38  ) , dS);
39 
40  }
virtual PositionType position(double s) const
#define unlikely(x)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
return(e1-e2)*(e1-e2)+dp *dp
const PropagationDirection thePropDir
HelixPlaneCrossing::PositionType HelixForwardPlaneCrossing::position ( double  s) const
virtual

Position at pathlength s from the starting point.

Implements HelixPlaneCrossing.

Definition at line 41 of file HelixForwardPlaneCrossing.cc.

References funct::abs(), MillePedeFileConverter_cfg::e, connectstrParser::o, alignCSCRings::s, theCachedCDPhi, theCachedDPhi, theCachedS, theCachedSDPhi, theCosPhi0, theCosTheta, theRho, theSinPhi0, theSinTheta, theX0, theY0, and theZ0.

Referenced by CompositeTECWedge::computeCrossings(), TIDRing::computeCrossings(), CompositeTECPetal::computeCrossings(), and pathLength().

41  {
42  //
43  // Calculate delta phi (if not already available)
44  //
45  if ( s!=theCachedS ) {
46  theCachedS = s;
49  }
50  //
51  // Calculate with appropriate formulation of full helix formula or with
52  // 2nd order approximation.
53  //
54  if ( std::abs(theCachedDPhi)>1.e-4 ) {
55  // "standard" helix formula
56  double o = 1./theRho;
58  theY0+( theCosPhi0*(1.-theCachedCDPhi)+theSinPhi0*theCachedSDPhi)*o,
60  }
61  else {
62  // 2nd order
63  double st = theCachedS*theSinTheta;
64  return PositionType(theX0+(theCosPhi0-st*0.5*theRho*theSinPhi0)*st,
65  theY0+(theSinPhi0+st*0.5*theRho*theCosPhi0)*st,
66  theZ0+st*theCosTheta/theSinTheta);
67  }
68 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Basic3DVector< float > PositionType
the helix is passed to the constructor and does not appear in the interface
Basic3DVector< double > PositionTypeDouble

Member Data Documentation

double HelixForwardPlaneCrossing::theCachedCDPhi
mutableprivate

Definition at line 67 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCachedDPhi
mutableprivate

Definition at line 65 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCachedS
mutableprivate

Definition at line 64 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCachedSDPhi
mutableprivate

Definition at line 66 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theCosPhi0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), HelixForwardPlaneCrossing(), and position().

double HelixForwardPlaneCrossing::theCosTheta
private
const float HelixForwardPlaneCrossing::theNumericalPrecision = 5.e-7
staticprivate

Definition at line 69 of file HelixForwardPlaneCrossing.h.

Referenced by direction().

const PropagationDirection HelixForwardPlaneCrossing::thePropDir
private

Definition at line 62 of file HelixForwardPlaneCrossing.h.

Referenced by pathLength().

const double HelixForwardPlaneCrossing::theRho
private

Definition at line 60 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), and position().

double HelixForwardPlaneCrossing::theSinPhi0
private

Definition at line 58 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), HelixForwardPlaneCrossing(), and position().

double HelixForwardPlaneCrossing::theSinTheta
private

Definition at line 59 of file HelixForwardPlaneCrossing.h.

Referenced by direction(), HelixForwardPlaneCrossing(), and position().

const double HelixForwardPlaneCrossing::theX0
private

Definition at line 57 of file HelixForwardPlaneCrossing.h.

Referenced by position().

const double HelixForwardPlaneCrossing::theY0
private

Definition at line 57 of file HelixForwardPlaneCrossing.h.

Referenced by position().

const double HelixForwardPlaneCrossing::theZ0
private

Definition at line 57 of file HelixForwardPlaneCrossing.h.

Referenced by pathLength(), and position().