CMS 3D CMS Logo

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

#include <LayerCollector.h>

Public Member Functions

std::vector< const DetLayer * > allLayers (const FTS &aFts) const
 
std::vector< const BarrelDetLayer * > barrelLayers (const FTS &aFts) const
 
float deltaR () const
 
float deltaZ () const
 
const StartingLayerFinderfinder () const
 
std::vector< const ForwardDetLayer * > forwardLayers (const FTS &aFts) const
 
 LayerCollector (NavigationSchool const *aSchool, const Propagator *aPropagator, const StartingLayerFinder *aFinder, float dr, float dz)
 
const Propagatorpropagator () const
 
 ~LayerCollector ()
 

Private Types

typedef FreeTrajectoryState FTS
 
typedef std::pair< float, float > Range
 
typedef TrajectoryStateOnSurface TSOS
 

Private Member Functions

bool rangesIntersect (const Range &a, const Range &b) const
 

Private Attributes

float theDeltaR
 
float theDeltaZ
 
const PropagatorthePropagator
 
NavigationSchool const * theSchool
 
const StartingLayerFindertheStartingLayerFinder
 

Detailed Description

Class collecting all layers of the tracker.

Definition at line 19 of file LayerCollector.h.

Member Typedef Documentation

◆ FTS

Definition at line 21 of file LayerCollector.h.

◆ Range

typedef std::pair<float, float> LayerCollector::Range
private

Definition at line 23 of file LayerCollector.h.

◆ TSOS

Definition at line 22 of file LayerCollector.h.

Constructor & Destructor Documentation

◆ LayerCollector()

LayerCollector::LayerCollector ( NavigationSchool const *  aSchool,
const Propagator aPropagator,
const StartingLayerFinder aFinder,
float  dr,
float  dz 
)
inline

Definition at line 26 of file LayerCollector.h.

31  : theSchool(aSchool), thePropagator(aPropagator), theStartingLayerFinder(aFinder), theDeltaR(dr), theDeltaZ(dz) {}

◆ ~LayerCollector()

LayerCollector::~LayerCollector ( )
inline

Definition at line 33 of file LayerCollector.h.

33 {}

Member Function Documentation

◆ allLayers()

vector< const DetLayer * > LayerCollector::allLayers ( const FTS aFts) const

Definition at line 7 of file LayerCollector.cc.

7  {
8  vector<const DetLayer*> myLayers;
9 
10  FTS myFts(aFts.parameters());
11 
12  vector<const DetLayer*> nextLayers = finder()->startingLayers(myFts, deltaR(), deltaZ());
13 
14  vector<const DetLayer*> dummy;
15 
16  bool inside = true;
17  while (inside) {
18  inside = false;
19  for (vector<const DetLayer*>::iterator ilay = nextLayers.begin(); ilay != nextLayers.end(); ilay++) {
20  TSOS pTsos = propagator()->propagate(myFts, (**ilay).surface());
21 
22  if (pTsos.isValid()) {
23  inside = true;
24 
25  if ((**ilay).location() == GeomDetEnumerators::barrel) {
26  Range barrZRange((**ilay).position().z() - 0.5 * ((**ilay).surface().bounds().length()),
27  (**ilay).position().z() + 0.5 * ((**ilay).surface().bounds().length()));
28  Range trajZRange(pTsos.globalPosition().z() - deltaZ(), pTsos.globalPosition().z() + deltaZ());
29 
30  if (rangesIntersect(trajZRange, barrZRange))
31  myLayers.push_back(*ilay);
32 
33  } else if ((**ilay).location() == GeomDetEnumerators::endcap) {
34  const ForwardDetLayer* fwd = dynamic_cast<const ForwardDetLayer*>(*ilay);
35  Range fwdRRange((*fwd).specificSurface().innerRadius(), (*fwd).specificSurface().outerRadius());
36  Range trajRRange(pTsos.globalPosition().perp() - deltaR(), pTsos.globalPosition().perp() + deltaR());
37 
38  if (rangesIntersect(trajRRange, fwdRRange))
39  myLayers.push_back(*ilay);
40  }
41 
42  myFts = FTS(pTsos.globalParameters());
43 
44  nextLayers = theSchool->nextLayers(**ilay, *pTsos.freeState(), propagator()->propagationDirection());
45 
46  break;
47  }
48  }
49  }
50 
51  return myLayers;
52 }

References GeomDetEnumerators::barrel, PbPb_ZMuSkimMuonDPG_cff::deltaR, GeomDetEnumerators::endcap, HLT_2018_cff::finder, TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), TrackCandidateProducer_cfi::propagator, rangesIntersect(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ConversionSeedFinder::findLayers().

◆ barrelLayers()

vector< const BarrelDetLayer * > LayerCollector::barrelLayers ( const FTS aFts) const

Definition at line 54 of file LayerCollector.cc.

54  {
55  vector<const DetLayer*> all = allLayers(aFts);
56  vector<const BarrelDetLayer*> barrelLayers;
57 
58  for (vector<const DetLayer*>::iterator ilay = all.begin(); ilay != all.end(); ilay++) {
59  if (const BarrelDetLayer* myBarrel = dynamic_cast<const BarrelDetLayer*>(*ilay))
60  barrelLayers.push_back(myBarrel);
61  }
62 
63  return barrelLayers;
64 }

References python.cmstools::all().

◆ deltaR()

float LayerCollector::deltaR ( ) const
inline

Definition at line 41 of file LayerCollector.h.

41 { return theDeltaR; }

References theDeltaR.

◆ deltaZ()

float LayerCollector::deltaZ ( ) const
inline

Definition at line 42 of file LayerCollector.h.

42 { return theDeltaZ; }

References theDeltaZ.

◆ finder()

const StartingLayerFinder* LayerCollector::finder ( ) const
inline

Definition at line 40 of file LayerCollector.h.

40 { return theStartingLayerFinder; }

References theStartingLayerFinder.

◆ forwardLayers()

vector< const ForwardDetLayer * > LayerCollector::forwardLayers ( const FTS aFts) const

Definition at line 66 of file LayerCollector.cc.

66  {
67  vector<const DetLayer*> all = allLayers(aFts);
68  vector<const ForwardDetLayer*> fwdLayers;
69 
70  for (vector<const DetLayer*>::iterator ilay = all.begin(); ilay != all.end(); ilay++) {
71  if (const ForwardDetLayer* myFwd = dynamic_cast<const ForwardDetLayer*>(*ilay))
72  fwdLayers.push_back(myFwd);
73  }
74 
75  return fwdLayers;
76 }

References python.cmstools::all().

◆ propagator()

const Propagator* LayerCollector::propagator ( ) const
inline

Definition at line 39 of file LayerCollector.h.

39 { return thePropagator; }

References thePropagator.

◆ rangesIntersect()

bool LayerCollector::rangesIntersect ( const Range a,
const Range b 
) const
inlineprivate

Definition at line 51 of file LayerCollector.h.

51  {
52  if (a.first > b.second || b.first > a.second)
53  return false;
54  else
55  return true;
56  }

References a, and b.

Member Data Documentation

◆ theDeltaR

float LayerCollector::theDeltaR
private

Definition at line 48 of file LayerCollector.h.

Referenced by deltaR().

◆ theDeltaZ

float LayerCollector::theDeltaZ
private

Definition at line 49 of file LayerCollector.h.

Referenced by deltaZ().

◆ thePropagator

const Propagator* LayerCollector::thePropagator
private

Definition at line 46 of file LayerCollector.h.

Referenced by propagator().

◆ theSchool

NavigationSchool const* LayerCollector::theSchool
private

Definition at line 45 of file LayerCollector.h.

◆ theStartingLayerFinder

const StartingLayerFinder* LayerCollector::theStartingLayerFinder
private

Definition at line 47 of file LayerCollector.h.

Referenced by finder().

LayerCollector::theStartingLayerFinder
const StartingLayerFinder * theStartingLayerFinder
Definition: LayerCollector.h:47
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
LayerCollector::deltaZ
float deltaZ() const
Definition: LayerCollector.h:42
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:26
LayerCollector::barrelLayers
std::vector< const BarrelDetLayer * > barrelLayers(const FTS &aFts) const
Definition: LayerCollector.cc:54
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GeomDetEnumerators::barrel
Definition: GeomDetEnumerators.h:9
LayerCollector::allLayers
std::vector< const DetLayer * > allLayers(const FTS &aFts) const
Definition: LayerCollector.cc:7
LayerCollector::Range
std::pair< float, float > Range
Definition: LayerCollector.h:23
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
LayerCollector::theDeltaR
float theDeltaR
Definition: LayerCollector.h:48
NavigationSchool::nextLayers
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&... args) const
Definition: NavigationSchool.h:33
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
LayerCollector::FTS
FreeTrajectoryState FTS
Definition: LayerCollector.h:21
LayerCollector::propagator
const Propagator * propagator() const
Definition: LayerCollector.h:39
Propagator::propagationDirection
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
LayerCollector::theDeltaZ
float theDeltaZ
Definition: LayerCollector.h:49
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
GeomDetEnumerators::endcap
Definition: GeomDetEnumerators.h:9
LayerCollector::thePropagator
const Propagator * thePropagator
Definition: LayerCollector.h:46
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
LayerCollector::finder
const StartingLayerFinder * finder() const
Definition: LayerCollector.h:40
BarrelDetLayer
Definition: BarrelDetLayer.h:22
LayerCollector::theSchool
NavigationSchool const * theSchool
Definition: LayerCollector.h:45
ForwardDetLayer
Definition: ForwardDetLayer.h:22
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
PVValHelper::dz
Definition: PVValidationHelpers.h:50
LayerCollector::deltaR
float deltaR() const
Definition: LayerCollector.h:41
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
LayerCollector::rangesIntersect
bool rangesIntersect(const Range &a, const Range &b) const
Definition: LayerCollector.h:51
TrajectoryStateOnSurface::globalParameters
const GlobalTrajectoryParameters & globalParameters() const
Definition: TrajectoryStateOnSurface.h:64
dummy
Definition: DummySelector.h:38
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
StartingLayerFinder::startingLayers
std::vector< const DetLayer * > startingLayers(const FTS &aFts, float dr, float dz) const
Definition: StartingLayerFinder.cc:18
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54