CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 20 of file LayerCollector.h.

Member Typedef Documentation

Definition at line 24 of file LayerCollector.h.

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

Definition at line 26 of file LayerCollector.h.

Definition at line 25 of file LayerCollector.h.

Constructor & Destructor Documentation

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

Definition at line 30 of file LayerCollector.h.

34  :
35  theSchool(aSchool),
36  thePropagator(aPropagator),
37  theStartingLayerFinder(aFinder),
38  theDeltaR(dr),
39  theDeltaZ(dz) { }
const Propagator * thePropagator
NavigationSchool const * theSchool
const StartingLayerFinder * theStartingLayerFinder
LayerCollector::~LayerCollector ( )
inline

Definition at line 41 of file LayerCollector.h.

41 {}

Member Function Documentation

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

Definition at line 7 of file LayerCollector.cc.

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

Referenced by ConversionSeedFinder::findLayers().

7  {
8 
9 
10  vector<const DetLayer*> myLayers;
11 
12 
13 
14  FTS myFts(aFts.parameters());
15 
16  vector<const DetLayer*> nextLayers = finder()->startingLayers(myFts, deltaR(), deltaZ());
17 
18  vector<const DetLayer*> dummy;
19 
20 
21 
22 
23  bool inside = true;
24  while(inside) {
25 
26  inside = false;
27  for(vector<const DetLayer*>::iterator ilay = nextLayers.begin(); ilay != nextLayers.end(); ilay++) {
28 
29 
30  TSOS pTsos = propagator()->propagate(myFts, (**ilay).surface());
31 
32 
33  if(pTsos.isValid()) {
34 
35  inside = true;
36 
37 
38 
39  if((**ilay).location() == GeomDetEnumerators::barrel) {
40 
41  Range barrZRange((**ilay).position().z() -
42  0.5*((**ilay).surface().bounds().length()),
43  (**ilay).position().z() +
44  0.5*((**ilay).surface().bounds().length()));
45  Range trajZRange(pTsos.globalPosition().z() - deltaZ(),
46  pTsos.globalPosition().z() + deltaZ());
47 
48  if(rangesIntersect(trajZRange, barrZRange))
49  myLayers.push_back(*ilay);
50 
51  } else if((**ilay).location() == GeomDetEnumerators::endcap) {
52 
53  const ForwardDetLayer* fwd =
54  dynamic_cast<const ForwardDetLayer*>(*ilay);
55  Range fwdRRange((*fwd).specificSurface().innerRadius(),
56  (*fwd).specificSurface().outerRadius());
57  Range trajRRange(pTsos.globalPosition().perp() - deltaR(),
58  pTsos.globalPosition().perp() + deltaR());
59 
60  if(rangesIntersect(trajRRange, fwdRRange))
61  myLayers.push_back(*ilay);
62 
63  }
64 
65  myFts = FTS(pTsos.globalParameters());
66 
67 
68  nextLayers = theSchool->nextLayers(**ilay, *pTsos.freeState(),
70 
71 
72  break;
73 
74 
75  }
76 
77 
78 
79  }
80  }
81 
82 
83 
84 
85  return myLayers;
86 }
T perp() const
Definition: PV3DBase.h:72
const GlobalTrajectoryParameters & parameters() const
float deltaR() const
GlobalPoint globalPosition() const
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
NavigationSchool const * theSchool
const StartingLayerFinder * finder() const
bool rangesIntersect(const Range &a, const Range &b) const
std::pair< float, float > Range
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:64
float deltaZ() const
const Propagator * propagator() const
const GlobalTrajectoryParameters & globalParameters() const
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
std::vector< const DetLayer * > startingLayers(const FTS &aFts, float dr, float dz) const
FreeTrajectoryState FTS
vector< const BarrelDetLayer * > LayerCollector::barrelLayers ( const FTS aFts) const

Definition at line 88 of file LayerCollector.cc.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor::all().

88  {
89 
90  vector<const DetLayer*> all = allLayers(aFts);
91  vector<const BarrelDetLayer*> barrelLayers;
92 
93 
94  for(vector<const DetLayer*>::iterator ilay = all.begin();
95  ilay != all.end(); ilay++) {
96 
97  if(const BarrelDetLayer* myBarrel =
98  dynamic_cast<const BarrelDetLayer*>(*ilay))
99  barrelLayers.push_back(myBarrel);
100  }
101 
102 
103  return barrelLayers;
104 }
std::vector< const BarrelDetLayer * > barrelLayers(const FTS &aFts) const
std::vector< const DetLayer * > allLayers(const FTS &aFts) const
float LayerCollector::deltaR ( ) const
inline

Definition at line 49 of file LayerCollector.h.

References theDeltaR.

49 {return theDeltaR;}
float LayerCollector::deltaZ ( ) const
inline

Definition at line 50 of file LayerCollector.h.

References theDeltaZ.

50 {return theDeltaZ;}
const StartingLayerFinder* LayerCollector::finder ( ) const
inline

Definition at line 48 of file LayerCollector.h.

References theStartingLayerFinder.

48 {return theStartingLayerFinder;}
const StartingLayerFinder * theStartingLayerFinder
vector< const ForwardDetLayer * > LayerCollector::forwardLayers ( const FTS aFts) const

Definition at line 106 of file LayerCollector.cc.

References Vispa.Plugins.EdmBrowser.EdmDataAccessor::all().

106  {
107 
108  vector<const DetLayer*> all = allLayers(aFts);
109  vector<const ForwardDetLayer*> fwdLayers;
110 
111 
112  for(vector<const DetLayer*>::iterator ilay = all.begin();
113  ilay != all.end(); ilay++) {
114 
115  if(const ForwardDetLayer* myFwd =
116  dynamic_cast<const ForwardDetLayer*>(*ilay))
117  fwdLayers.push_back(myFwd);
118  }
119 
120 
121  return fwdLayers;
122 }
std::vector< const DetLayer * > allLayers(const FTS &aFts) const
const Propagator* LayerCollector::propagator ( ) const
inline

Definition at line 47 of file LayerCollector.h.

References thePropagator.

47 {return thePropagator;}
const Propagator * thePropagator
bool LayerCollector::rangesIntersect ( const Range a,
const Range b 
) const
inlineprivate

Definition at line 61 of file LayerCollector.h.

61  {
62  if ( a.first > b.second || b.first > a.second) return false;
63  else return true;
64  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

Member Data Documentation

float LayerCollector::theDeltaR
private

Definition at line 56 of file LayerCollector.h.

Referenced by deltaR().

float LayerCollector::theDeltaZ
private

Definition at line 57 of file LayerCollector.h.

Referenced by deltaZ().

const Propagator* LayerCollector::thePropagator
private

Definition at line 54 of file LayerCollector.h.

Referenced by propagator().

NavigationSchool const* LayerCollector::theSchool
private

Definition at line 53 of file LayerCollector.h.

const StartingLayerFinder* LayerCollector::theStartingLayerFinder
private

Definition at line 55 of file LayerCollector.h.

Referenced by finder().