CMS 3D CMS Logo

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:
18  static int barrelSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) {
19  auto pos = startingState.globalPosition();
20  auto dir = startingState.globalMomentum();
21  bool outwards = (pos.x() * dir.x() + pos.y() * dir.y()) > 0;
22 
23  auto inout = outwards ? alongMomentum : oppositeToMomentum;
24 
25  return (prop.propagationDirection() == inout ? 0 : 1);
26  }
27 
31  static int endcapSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) {
32  auto zpos = startingState.globalPosition().z();
33  bool outwards = (startingState.globalMomentum().z() * zpos) > 0;
34 
35  auto inout = outwards ? alongMomentum : oppositeToMomentum;
36 
37  return (prop.propagationDirection() == inout ? 0 : 1);
38  }
39 };
40 
41 #pragma GCC visibility pop
42 #endif
static int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
returns 0 if barrel layer crossed from inside, 1 if from outside
T z() const
Definition: PV3DBase.h:61
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
GlobalPoint globalPosition() const
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
GlobalVector globalMomentum() const