CMS 3D CMS Logo

LayerCollector.cc
Go to the documentation of this file.
4 
5 using namespace std;
6 
7 vector<const DetLayer*> LayerCollector::allLayers(const FTS& aFts) const {
8  vector<const DetLayer*> myLayers;
9 
10  FTS myFts(aFts.parameters());
11 
12  vector<const DetLayer*> nextLayers = theStartingLayerFinder(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 }
53 
54 vector<const BarrelDetLayer*> LayerCollector::barrelLayers(const FTS& aFts) const {
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 }
65 
66 vector<const ForwardDetLayer*> LayerCollector::forwardLayers(const FTS& aFts) const {
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 }
LayerCollector::forwardLayers
std::vector< const ForwardDetLayer * > forwardLayers(const FTS &aFts) const
Definition: LayerCollector.cc:66
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
python.cmstools.all
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
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
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
GeomDetEnumerators::endcap
Definition: GeomDetEnumerators.h:9
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
BarrelDetLayer
Definition: BarrelDetLayer.h:22
LayerCollector.h
std
Definition: JetResolutionObject.h:76
L1TkHTMissProducer_cfi.deltaZ
deltaZ
Definition: L1TkHTMissProducer_cfi.py:13
ForwardDetLayer
Definition: ForwardDetLayer.h:22
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
rangesIntersect
bool rangesIntersect(const Range &a, const Range &b)
Definition: rangesIntersect.h:14
TrajectoryStateOnSurface::globalParameters
const GlobalTrajectoryParameters & globalParameters() const
Definition: TrajectoryStateOnSurface.h:64
NavigationSchool.h
dummy
Definition: DummySelector.h:38
FTS
FreeTrajectoryState FTS
Definition: RecoMuonValidator.cc:23
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
StartingLayerFinder.h