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