CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
StartingLayerFinder Class Reference

#include <StartingLayerFinder.h>

Public Member Functions

std::vector< const DetLayer * > operator() (const FreeTrajectoryState &aFts, float dr, float dz) const
 
 StartingLayerFinder (Propagator const &aPropagator, MeasurementTracker const &tracker)
 

Private Member Functions

void checkPixelLayers () const
 
const std::vector< const ForwardDetLayer * > firstNegPixelFwdLayer () const
 
const BarrelDetLayerfirstPixelBarrelLayer () const
 
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer () const
 

Private Attributes

std::vector< const ForwardDetLayer * > theFirstNegPixelFwdLayer
 
const BarrelDetLayertheFirstPixelBarrelLayer = nullptr
 
std::vector< const ForwardDetLayer * > theFirstPosPixelFwdLayer
 
MeasurementTracker const & theMeasurementTracker
 
bool thePixelLayersValid = false
 
Propagator const & thePropagator
 

Detailed Description

Finds the nearest navigable layer. Needed to start trajectory building in case the seed does not have a DetLayer

Definition at line 25 of file StartingLayerFinder.h.

Constructor & Destructor Documentation

◆ StartingLayerFinder()

StartingLayerFinder::StartingLayerFinder ( Propagator const &  aPropagator,
MeasurementTracker const &  tracker 
)
inline

Definition at line 27 of file StartingLayerFinder.h.

28  : thePropagator(aPropagator),
MeasurementTracker const & theMeasurementTracker
std::vector< const ForwardDetLayer * > theFirstNegPixelFwdLayer
std::vector< const ForwardDetLayer * > theFirstPosPixelFwdLayer
Propagator const & thePropagator

Member Function Documentation

◆ checkPixelLayers()

void StartingLayerFinder::checkPixelLayers ( ) const
private

Definition at line 93 of file StartingLayerFinder.cc.

References GeometricSearchTracker::negPixelForwardLayers(), GeometricSearchTracker::pixelBarrelLayers(), and GeometricSearchTracker::posPixelForwardLayers().

93  {
94  if (!thePixelLayersValid) {
95  const GeometricSearchTracker* theGeometricSearchTracker = theMeasurementTracker.geometricSearchTracker();
96 
97  theFirstPixelBarrelLayer = theGeometricSearchTracker->pixelBarrelLayers().front();
98  theFirstNegPixelFwdLayer = theGeometricSearchTracker->negPixelForwardLayers();
99  theFirstPosPixelFwdLayer = theGeometricSearchTracker->posPixelForwardLayers();
100  thePixelLayersValid = true;
101  }
102 }
MeasurementTracker const & theMeasurementTracker
const BarrelDetLayer * theFirstPixelBarrelLayer
std::vector< const ForwardDetLayer * > theFirstNegPixelFwdLayer
std::vector< ForwardDetLayer const * > const & posPixelForwardLayers() const
std::vector< ForwardDetLayer const * > const & negPixelForwardLayers() const
std::vector< BarrelDetLayer const * > const & pixelBarrelLayers() const
std::vector< const ForwardDetLayer * > theFirstPosPixelFwdLayer

◆ firstNegPixelFwdLayer()

const vector< const ForwardDetLayer * > StartingLayerFinder::firstNegPixelFwdLayer ( ) const
private

Definition at line 83 of file StartingLayerFinder.cc.

83  {
86 }
std::vector< const ForwardDetLayer * > theFirstNegPixelFwdLayer

◆ firstPixelBarrelLayer()

const BarrelDetLayer * StartingLayerFinder::firstPixelBarrelLayer ( ) const
private

Definition at line 78 of file StartingLayerFinder.cc.

78  {
81 }
const BarrelDetLayer * theFirstPixelBarrelLayer

◆ firstPosPixelFwdLayer()

const vector< const ForwardDetLayer * > StartingLayerFinder::firstPosPixelFwdLayer ( ) const
private

Definition at line 88 of file StartingLayerFinder.cc.

88  {
91 }
std::vector< const ForwardDetLayer * > theFirstPosPixelFwdLayer

◆ operator()()

vector< const DetLayer * > StartingLayerFinder::operator() ( const FreeTrajectoryState aFts,
float  dr,
float  dz 
) const

Definition at line 30 of file StartingLayerFinder.cc.

References PVValHelper::dz, FreeTrajectoryState::parameters(), position, and rangesIntersect().

30  {
31  vector<const DetLayer*> mylayers;
32  mylayers.reserve(3);
33 
34  FreeTrajectoryState fastFts(aFts.parameters());
35 
36  //barrel pixel
38 
39  if (pTsos.isValid()) {
40  Range barrZRange(
41  firstPixelBarrelLayer()->position().z() - 0.5 * (firstPixelBarrelLayer()->surface().bounds().length()),
42  firstPixelBarrelLayer()->position().z() + 0.5 * (firstPixelBarrelLayer()->surface().bounds().length()));
43  Range trajZRange(pTsos.globalPosition().z() - dz, pTsos.globalPosition().z() + dz);
44 
45  if (rangesIntersect(trajZRange, barrZRange)) {
46  mylayers.push_back(firstPixelBarrelLayer());
47  }
48  }
49 
50  //negative fwd pixel
51 
52  for (auto infwd : firstPosPixelFwdLayer()) {
53  pTsos = thePropagator.propagate(fastFts, infwd->surface());
54  if (pTsos.isValid()) {
55  Range nfwdRRange(infwd->specificSurface().innerRadius(), infwd->specificSurface().outerRadius());
56  Range trajRRange(pTsos.globalPosition().perp() - dr, pTsos.globalPosition().perp() + dr);
57  if (rangesIntersect(trajRRange, nfwdRRange)) {
58  mylayers.push_back(infwd);
59  }
60  }
61  }
62 
63  //positive fwd pixel
64  for (auto ipfwd : firstPosPixelFwdLayer()) {
65  pTsos = thePropagator.propagate(fastFts, ipfwd->surface());
66  if (pTsos.isValid()) {
67  Range pfwdRRange(ipfwd->specificSurface().innerRadius(), ipfwd->specificSurface().outerRadius());
68  Range trajRRange(pTsos.globalPosition().perp() - dr, pTsos.globalPosition().perp() + dr);
69  if (rangesIntersect(trajRRange, pfwdRRange)) {
70  mylayers.push_back(ipfwd);
71  }
72  }
73  }
74 
75  return mylayers;
76 }
PixelRecoRange< float > Range
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
const GlobalTrajectoryParameters & parameters() const
const std::vector< const ForwardDetLayer * > firstPosPixelFwdLayer() const
bool rangesIntersect(const Range &a, const Range &b)
const BarrelDetLayer * firstPixelBarrelLayer() const
static int position[264][3]
Definition: ReadPGInfo.cc:289
Propagator const & thePropagator

Member Data Documentation

◆ theFirstNegPixelFwdLayer

std::vector<const ForwardDetLayer*> StartingLayerFinder::theFirstNegPixelFwdLayer
mutableprivate

Definition at line 44 of file StartingLayerFinder.h.

◆ theFirstPixelBarrelLayer

const BarrelDetLayer* StartingLayerFinder::theFirstPixelBarrelLayer = nullptr
mutableprivate

Definition at line 43 of file StartingLayerFinder.h.

◆ theFirstPosPixelFwdLayer

std::vector<const ForwardDetLayer*> StartingLayerFinder::theFirstPosPixelFwdLayer
mutableprivate

Definition at line 45 of file StartingLayerFinder.h.

◆ theMeasurementTracker

MeasurementTracker const& StartingLayerFinder::theMeasurementTracker
private

Definition at line 41 of file StartingLayerFinder.h.

◆ thePixelLayersValid

bool StartingLayerFinder::thePixelLayersValid = false
mutableprivate

Definition at line 42 of file StartingLayerFinder.h.

◆ thePropagator

Propagator const& StartingLayerFinder::thePropagator
private

Definition at line 40 of file StartingLayerFinder.h.