CMS 3D CMS Logo

BTLNavigableLayer.cc
Go to the documentation of this file.
1 
12 
13 /* Collaborating Class Header */
20 /* C++ Headers */
21 #include <algorithm>
22 
23 using namespace std;
24 std::vector<const DetLayer*>
26 
27  std::vector<const DetLayer*> result;
28 
29  if ( dir == insideOut ) {
30  pushResult(result, theOuterBarrelLayers);
31  pushResult(result, theOuterBackwardLayers);
32  pushResult(result, theOuterForwardLayers);
33  }
34  else {
35  pushResult(result, theInnerBarrelLayers);
36  reverse(result.begin(),result.end());
37  pushResult(result, theInnerBackwardLayers);
38  pushResult(result, theInnerForwardLayers);
39  }
40 
41  result.reserve(result.size());
42  return result;
43 
44 }
45 
46 
47 std::vector<const DetLayer*>
49  PropagationDirection dir) const {
50 
51  std::vector<const DetLayer*> result;
52 
53  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
54  pushResult(result, theOuterBarrelLayers, fts);
55  pushResult(result, theOuterBackwardLayers, fts);
56  pushResult(result, theOuterForwardLayers, fts);
57  }
58  else {
59  pushResult(result, theInnerBarrelLayers, fts);
60  reverse(result.begin(),result.end());
61  pushResult(result, theInnerBackwardLayers, fts);
62  pushResult(result, theInnerForwardLayers, fts);
63  }
64  result.reserve(result.size());
65  return result;
66 }
67 
68 std::vector<const DetLayer*>
70 
71  std::vector<const DetLayer*> result;
72 
73  if ( dir == insideOut ) {
74  pushResult(result, theAllOuterBarrelLayers);
75  pushResult(result, theAllOuterBackwardLayers);
76  pushResult(result, theAllOuterForwardLayers);
77  }
78  else {
79  pushResult(result, theAllInnerBarrelLayers);
80  reverse(result.begin(),result.end());
81  pushResult(result, theAllInnerBackwardLayers);
82  pushResult(result, theAllInnerForwardLayers);
83  }
84 
85  result.reserve(result.size());
86  return result;
87 }
88 
89 std::vector<const DetLayer*>
91  PropagationDirection dir) const {
92  std::vector<const DetLayer*> result;
93 
94  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
95  pushCompatibleResult(result, theAllOuterBarrelLayers, fts);
96  pushCompatibleResult(result, theAllOuterBackwardLayers, fts);
97  pushCompatibleResult(result, theAllOuterForwardLayers, fts);
98  }
99  else {
100  pushCompatibleResult(result, theAllInnerBarrelLayers, fts);
101  reverse(result.begin(),result.end());
102  pushCompatibleResult(result, theAllInnerBackwardLayers, fts);
103  pushCompatibleResult(result, theAllInnerForwardLayers, fts);
104  }
105  result.reserve(result.size());
106  return result;
107 
108 }
109 
110 
111 void BTLNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
112  const MapB& map) const {
113 
114  for ( MapBI i = map.begin(); i != map.end(); i++ ) result.push_back((*i).first);
115 
116 }
117 
118 void BTLNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
119  const MapE& map) const {
120 
121  for ( MapEI i = map.begin(); i != map.end(); i++ ) result.push_back((*i).first);
122 }
123 
124 
125 void BTLNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
126  const MapB& map,
127  const FreeTrajectoryState& fts) const {
128  for ( MapBI i = map.begin(); i != map.end(); i++ )
129  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
130 }
131 
132 void BTLNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
133  const MapE& map,
134  const FreeTrajectoryState& fts) const {
135 
136  for (MapEI i = map.begin(); i != map.end(); i++)
137  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
138 
139 }
140 
141 void BTLNavigableLayer::pushCompatibleResult(std::vector<const DetLayer*>& result,
142  const MapB& map,
143  const FreeTrajectoryState& fts) const {
144  MTDEtaRange range= trackingRange(fts);
145  for ( MapBI i = map.begin(); i != map.end(); i++ )
146  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
147 }
148 
149 void BTLNavigableLayer::pushCompatibleResult(std::vector<const DetLayer*>& result,
150  const MapE& map,
151  const FreeTrajectoryState& fts) const {
152  MTDEtaRange range= trackingRange(fts);
153  for (MapEI i = map.begin(); i != map.end(); i++)
154  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
155 
156 }
157 
159  return theDetLayer;
160 }
161 
162 
164  edm::LogError("BTLNavigableLayer") << "BTLNavigableLayer::setDetLayer called!! " << endl;
165 }
166 
167 
169  theInnerBarrelLayers = innerBL;
170 }
172 
173  theAllInnerBarrelLayers = innerCBL;
174 
175 }
176 
MapB::const_iterator MapBI
std::map< const BarrelDetLayer *, MTDEtaRange, MTDDetLayerComp > MapB
PropagationDirection
void setDetLayer(const DetLayer *) override
set DetLayer
void pushCompatibleResult(std::vector< const DetLayer * > &result, const MapB &map, const FreeTrajectoryState &fts) const
GlobalPoint position() const
T eta() const
Definition: PV3DBase.h:76
std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const override
MapE::const_iterator MapEI
dbl *** dir
Definition: mlp_gen.cc:35
std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const override
NavigableLayer interface.
void setInwardLinks(const MapB &)
set inward links
const DetLayer * detLayer() const override
return DetLayer
void setInwardCompatibleLinks(const MapB &)
void pushResult(std::vector< const DetLayer * > &result, const MapB &map) const
std::map< const ForwardDetLayer *, MTDEtaRange, MTDDetLayerComp > MapE