CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/RecoTracker/TkDetLayers/src/LayerCrossingSide.h

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