CMS 3D CMS Logo

LayerCrossingSide Class Reference

Helper class to determine if a TrajectoryStateOnSurface would cross a layer from the inside, or from the outside, if propagated with a propagator with a defined direction. More...

#include <RecoTracker/TkDetLayers/interface/LayerCrossingSide.h>

List of all members.

Public Member Functions

int barrelSide (const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
 returns 0 if barrel layer crossed from inside, 1 if from outside
int endcapSide (const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
 returns 0 if endcap layer crossed from inside, ie from the side of the interation region, 1 if from outside


Detailed Description

Helper class to determine if a TrajectoryStateOnSurface would cross a layer from the inside, or from the outside, if propagated with a propagator with a defined direction.

No propagations performed, the result is very fast but not correct in case of a looping track that first goes outwards, then inwards, before crossing a layer.

Definition at line 14 of file LayerCrossingSide.h.


Member Function Documentation

int LayerCrossingSide::barrelSide ( const TrajectoryStateOnSurface startingState,
const Propagator prop 
) const [inline]

returns 0 if barrel layer crossed from inside, 1 if from outside

Definition at line 18 of file LayerCrossingSide.h.

References alongMomentum, Vector3DBase< T, FrameTag >::dot(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), oppositeToMomentum, Propagator::propagationDirection(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

00018                                                                                               {
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   }

int LayerCrossingSide::endcapSide ( const TrajectoryStateOnSurface startingState,
const Propagator prop 
) const [inline]

returns 0 if endcap layer crossed from inside, ie from the side of the interation region, 1 if from outside

Definition at line 32 of file LayerCrossingSide.h.

References alongMomentum, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), oppositeToMomentum, Propagator::propagationDirection(), and PV3DBase< T, PVType, FrameType >::z().

00032                                                                                               {
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   }


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:27:27 2009 for CMSSW by  doxygen 1.5.4