CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LayerCrossingSide.h
Go to the documentation of this file.
1 #ifndef TkDetLayers_LayerCrossingSide_h
2 #define TkDetLayers_LayerCrossingSide_h
3 
4 // temporary solution
6 
15 public:
16 
18  int barrelSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) const {
19  GlobalPoint pos = startingState.globalPosition();
20  GlobalVector radial(pos.x(), pos.y(), 0);
21  if (startingState.globalMomentum().dot( radial) > 0) { // momentum points outwards
22  return (prop.propagationDirection() == alongMomentum ? 0 : 1);
23  }
24  else { // momentum points inwards
25  return (prop.propagationDirection() == oppositeToMomentum ? 0 : 1);
26  }
27  }
28 
32  int endcapSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) const {
33  float zpos = startingState.globalPosition().z();
34  if (startingState.globalMomentum().z() * zpos > 0) { // momentum points outwards
35  return (prop.propagationDirection() == alongMomentum ? 0 : 1);
36  }
37  else { // momentum points inwards
38  return (prop.propagationDirection() == oppositeToMomentum ? 0 : 1);
39  }
40  }
41 
42 };
43 
44 #endif
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:143
T y() const
Definition: PV3DBase.h:57
GlobalPoint globalPosition() const
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:107
int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
T z() const
Definition: PV3DBase.h:58
int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
returns 0 if barrel layer crossed from inside, 1 if from outside
GlobalVector globalMomentum() const
T x() const
Definition: PV3DBase.h:56