CMS 3D CMS Logo

ETLNavigableLayer.cc
Go to the documentation of this file.
1 
13 
14 /* Collaborating Class Header */
18 #include <algorithm>
19 
20 using namespace std;
21 using namespace edm;
22 
23 vector<const DetLayer*>
25 
26  vector<const DetLayer*> result;
27  vector<const DetLayer*> barrel;
28 
29  if ( dir == insideOut ) {
30  pushResult(result, theOuterEndcapLayers);
31  }
32  else {
33  pushResult(result, theInnerEndcapLayers);
34  reverse(result.begin(),result.end());
35  pushResult(barrel, theInnerBarrelLayers);
36  reverse(barrel.begin(),barrel.end());
37  result.insert(result.end(),barrel.begin(),barrel.end());
38  }
39 
40  result.reserve(result.size());
41  return result;
42 
43 }
44 
45 
46 vector<const DetLayer*>
48  PropagationDirection dir) const {
49 
50  vector<const DetLayer*> result;
51  vector<const DetLayer*> barrel;
52 
53  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
54  pushResult(result, theOuterEndcapLayers, fts);
55  }
56  else {
57  pushResult(result, theInnerEndcapLayers, fts);
58  reverse(result.begin(),result.end());
59  pushResult(barrel, theInnerBarrelLayers, fts);
60  reverse(barrel.begin(),barrel.end());
61  result.insert(result.end(),barrel.begin(),barrel.end());
62  }
63 
64  result.reserve(result.size());
65  return result;
66 
67 }
68 
69 vector<const DetLayer*>
71 
72  vector<const DetLayer*> result;
73  vector<const DetLayer*> barrel;
74 
75  if ( dir == insideOut ) {
76  pushResult(result, theAllOuterEndcapLayers);
77  }
78  else {
79  pushResult(result, theAllInnerEndcapLayers);
80  reverse(result.begin(),result.end());
81  pushResult(barrel, theAllInnerBarrelLayers);
82  reverse(barrel.begin(),barrel.end());
83  result.insert(result.end(),barrel.begin(),barrel.end());
84  }
85 
86  result.reserve(result.size());
87  return result;
88 
89 }
90 vector<const DetLayer*>
92  PropagationDirection dir) const {
93  vector<const DetLayer*> result;
94  vector<const DetLayer*> barrel;
95 
96  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
97  pushCompatibleResult(result, theAllOuterEndcapLayers, fts);
98  }
99  else {
100  pushCompatibleResult(result, theAllInnerEndcapLayers, fts);
101  reverse(result.begin(),result.end());
102  pushCompatibleResult(barrel, theAllInnerBarrelLayers, fts);
103  reverse(barrel.begin(),barrel.end());
104  result.insert(result.end(),barrel.begin(),barrel.end());
105  }
106  result.reserve(result.size());
107  return result;
108 
109 }
110 
111 void ETLNavigableLayer::pushResult(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 
119 void ETLNavigableLayer::pushResult(vector<const DetLayer*>& result,
120  const MapE& map) const {
121 
122  for (MapEI i = map.begin(); i != map.end(); i++) result.push_back((*i).first);
123 
124 }
125 
126 
127 void ETLNavigableLayer::pushResult(vector<const DetLayer*>& result,
128  const MapE& map,
129  const FreeTrajectoryState& fts) const {
130 
131  for (MapEI i = map.begin(); i != map.end(); i++)
132  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
133 
134 }
135 
136 
137 void ETLNavigableLayer::pushResult(vector<const DetLayer*>& result,
138  const MapB& map,
139  const FreeTrajectoryState& fts) const {
140 
141  for (MapBI i = map.begin(); i != map.end(); i++)
142  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
143 
144 }
145 
146 
147 void ETLNavigableLayer::pushCompatibleResult(vector<const DetLayer*>& result,
148  const MapB& map,
149  const FreeTrajectoryState& fts) const {
150  MTDEtaRange range=trackingRange(fts);
151  for ( MapBI i = map.begin(); i != map.end(); i++ )
152  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
153 }
154 
155 void ETLNavigableLayer::pushCompatibleResult(vector<const DetLayer*>& result,
156  const MapE& map,
157  const FreeTrajectoryState& fts) const {
158  MTDEtaRange range=trackingRange(fts);
159  for (MapEI i = map.begin(); i != map.end(); i++)
160  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
161 
162 }
163 
164 
166 
167  return theDetLayer;
168 
169 }
170 
171 
173 
174  edm::LogError ("ETLNavigablaLayer") << "ETLNavigableLayer::setDetLayer called!! " << endl;
175 
176 }
177 
178 
180  const MapE& innerEL) {
181 
182  theInnerBarrelLayers = innerBL;
183  theInnerEndcapLayers = innerEL;
184 
185 }
187  const MapE& innerCEL) {
188 
189  theAllInnerBarrelLayers = innerCBL;
190  theAllInnerEndcapLayers = innerCEL;
191 
192 }
193 
void pushCompatibleResult(std::vector< const DetLayer * > &result, const MapB &map, const FreeTrajectoryState &fts) const
void pushResult(std::vector< const DetLayer * > &result, const MapB &map) const
MapB::const_iterator MapBI
std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const override
std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const override
NavigableLayer interface.
std::map< const BarrelDetLayer *, MTDEtaRange, MTDDetLayerComp > MapB
void setDetLayer(const DetLayer *) override
set DetLayer
PropagationDirection
GlobalPoint position() const
const DetLayer * detLayer() const override
return DetLayer
void setInwardCompatibleLinks(const MapB &, const MapE &)
T eta() const
Definition: PV3DBase.h:76
HLT enums.
MapE::const_iterator MapEI
dbl *** dir
Definition: mlp_gen.cc:35
void setInwardLinks(const MapB &, const MapE &)
set inward links
std::map< const ForwardDetLayer *, MTDEtaRange, MTDDetLayerComp > MapE