File indexing completed on 2024-04-06 12:28:46
0001 #ifndef TkDetLayers_LayerCrossingSide_h
0002 #define TkDetLayers_LayerCrossingSide_h
0003
0004
0005 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0006
0007
0008
0009
0010
0011
0012
0013
0014 #pragma GCC visibility push(hidden)
0015 class LayerCrossingSide {
0016 public:
0017
0018 static int barrelSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) {
0019 auto pos = startingState.globalPosition();
0020 auto dir = startingState.globalMomentum();
0021 bool outwards = (pos.x() * dir.x() + pos.y() * dir.y()) > 0;
0022
0023 auto inout = outwards ? alongMomentum : oppositeToMomentum;
0024
0025 return (prop.propagationDirection() == inout ? 0 : 1);
0026 }
0027
0028
0029
0030
0031 static int endcapSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) {
0032 auto zpos = startingState.globalPosition().z();
0033 bool outwards = (startingState.globalMomentum().z() * zpos) > 0;
0034
0035 auto inout = outwards ? alongMomentum : oppositeToMomentum;
0036
0037 return (prop.propagationDirection() == inout ? 0 : 1);
0038 }
0039 };
0040
0041 #pragma GCC visibility pop
0042 #endif