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 
14 #pragma GCC visibility push(hidden)
16 public:
17 
19  int barrelSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) const {
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  }
29 
33  int endcapSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) const {
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  }
42 
43 };
44 
45 #pragma GCC visibility pop
46 #endif
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
int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
T z() const
Definition: PV3DBase.h:63
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:61