CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
LayerCrossingSide Class Reference

#include <LayerCrossingSide.h>

Public Member Functions

int barrelSide (const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
 returns 0 if barrel layer crossed from inside, 1 if from outside More...
 
int endcapSide (const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
 

Detailed Description

Helper class to determine if a TrajectoryStateOnSurface would cross a layer from the inside, or from the outside, if propagated with a propagator with a defined direction. No propagations performed, the result is very fast but not correct in case of a looping track that first goes outwards, then inwards, before crossing a layer.

Definition at line 15 of file LayerCrossingSide.h.

Member Function Documentation

int LayerCrossingSide::barrelSide ( const TrajectoryStateOnSurface startingState,
const Propagator prop 
) const
inline

returns 0 if barrel layer crossed from inside, 1 if from outside

Definition at line 19 of file LayerCrossingSide.h.

References alongMomentum, Vector3DBase< T, FrameTag >::dot(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), oppositeToMomentum, pos, Propagator::propagationDirection(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

19  {
20  GlobalPoint pos = startingState.globalPosition();
21  GlobalVector radial(pos.x(), pos.y(), 0);
22  if (startingState.globalMomentum().dot( radial) > 0) { // momentum points outwards
23  return (prop.propagationDirection() == alongMomentum ? 0 : 1);
24  }
25  else { // momentum points inwards
26  return (prop.propagationDirection() == oppositeToMomentum ? 0 : 1);
27  }
28  }
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
T y() const
Definition: PV3DBase.h:62
GlobalPoint globalPosition() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
GlobalVector globalMomentum() const
T x() const
Definition: PV3DBase.h:61
int LayerCrossingSide::endcapSide ( const TrajectoryStateOnSurface startingState,
const Propagator prop 
) const
inline

returns 0 if endcap layer crossed from inside, ie from the side of the interation region, 1 if from outside

Definition at line 33 of file LayerCrossingSide.h.

References alongMomentum, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), oppositeToMomentum, Propagator::propagationDirection(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by TECLayer::groupedCompatibleDetsV().

33  {
34  float zpos = startingState.globalPosition().z();
35  if (startingState.globalMomentum().z() * zpos > 0) { // momentum points outwards
36  return (prop.propagationDirection() == alongMomentum ? 0 : 1);
37  }
38  else { // momentum points inwards
39  return (prop.propagationDirection() == oppositeToMomentum ? 0 : 1);
40  }
41  }
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
GlobalPoint globalPosition() const
T z() const
Definition: PV3DBase.h:63
GlobalVector globalMomentum() const