CMS 3D CMS Logo

List of all members | Static Public Member Functions
LayerCrossingSide Class Reference

#include <LayerCrossingSide.h>

Static Public Member Functions

static int barrelSide (const TrajectoryStateOnSurface &startingState, const Propagator &prop)
 returns 0 if barrel layer crossed from inside, 1 if from outside More...
 
static int endcapSide (const TrajectoryStateOnSurface &startingState, const Propagator &prop)
 

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 15 of file LayerCrossingSide.h.

Member Function Documentation

static int LayerCrossingSide::barrelSide ( const TrajectoryStateOnSurface startingState,
const Propagator prop 
)
inlinestatic

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

Definition at line 18 of file LayerCrossingSide.h.

References alongMomentum, DeadROC_duringRun::dir, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), oppositeToMomentum, and Propagator::propagationDirection().

Referenced by TBLayer::groupedCompatibleDetsV(), TIBRing::groupedCompatibleDetsV(), TOBRod::groupedCompatibleDetsV(), Phase2OTBarrelRod::groupedCompatibleDetsV(), and TIBRing::searchNeighbors().

18  {
19  auto pos = startingState.globalPosition();
20  auto dir = startingState.globalMomentum();
21  bool outwards = (pos.x() * dir.x() + pos.y() * dir.y()) > 0;
22 
23  auto inout = outwards ? alongMomentum : oppositeToMomentum;
24 
25  return (prop.propagationDirection() == inout ? 0 : 1);
26  }
GlobalPoint globalPosition() const
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
GlobalVector globalMomentum() const
static int LayerCrossingSide::endcapSide ( const TrajectoryStateOnSurface startingState,
const Propagator prop 
)
inlinestatic

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

Definition at line 31 of file LayerCrossingSide.h.

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

Referenced by PixelForwardLayer::groupedCompatibleDetsV(), PixelForwardLayerPhase1::groupedCompatibleDetsV(), TECLayer::groupedCompatibleDetsV(), CompositeTECWedge::groupedCompatibleDetsV(), TIDRing::groupedCompatibleDetsV(), Phase2EndcapRing::groupedCompatibleDetsV(), PixelBlade::groupedCompatibleDetsV(), CompositeTECPetal::groupedCompatibleDetsV(), PixelForwardLayer::searchNeighbors(), and PixelForwardLayerPhase1::searchNeighbors().

31  {
32  auto zpos = startingState.globalPosition().z();
33  bool outwards = (startingState.globalMomentum().z() * zpos) > 0;
34 
35  auto inout = outwards ? alongMomentum : oppositeToMomentum;
36 
37  return (prop.propagationDirection() == inout ? 0 : 1);
38  }
GlobalPoint globalPosition() const
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
T z() const
Definition: PV3DBase.h:61
GlobalVector globalMomentum() const