00001 #ifndef TkDetLayers_LayerCrossingSide_h 00002 #define TkDetLayers_LayerCrossingSide_h 00003 00004 // temporary solution 00005 #include "TrackingTools/GeomPropagators/interface/Propagator.h" 00006 00014 class LayerCrossingSide { 00015 public: 00016 00018 int barrelSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) const { 00019 GlobalPoint pos = startingState.globalPosition(); 00020 GlobalVector radial(pos.x(), pos.y(), 0); 00021 if (startingState.globalMomentum().dot( radial) > 0) { // momentum points outwards 00022 return (prop.propagationDirection() == alongMomentum ? 0 : 1); 00023 } 00024 else { // momentum points inwards 00025 return (prop.propagationDirection() == oppositeToMomentum ? 0 : 1); 00026 } 00027 } 00028 00032 int endcapSide(const TrajectoryStateOnSurface& startingState, const Propagator& prop) const { 00033 float zpos = startingState.globalPosition().z(); 00034 if (startingState.globalMomentum().z() * zpos > 0) { // momentum points outwards 00035 return (prop.propagationDirection() == alongMomentum ? 0 : 1); 00036 } 00037 else { // momentum points inwards 00038 return (prop.propagationDirection() == oppositeToMomentum ? 0 : 1); 00039 } 00040 } 00041 00042 }; 00043 00044 #endif