CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonForwardNavigableLayer.cc
Go to the documentation of this file.
1 
15 
16 /* Collaborating Class Header */
20 #include <algorithm>
21 
22 using namespace std;
23 using namespace edm;
24 
25 vector<const DetLayer*>
27 
28  vector<const DetLayer*> result;
29  vector<const DetLayer*> barrel;
30 
31  if ( dir == insideOut ) {
32  pushResult(result, theOuterEndcapLayers);
33  }
34  else {
35  pushResult(result, theInnerEndcapLayers);
36  reverse(result.begin(),result.end());
37  pushResult(barrel, theInnerBarrelLayers);
38  reverse(barrel.begin(),barrel.end());
39  result.insert(result.end(),barrel.begin(),barrel.end());
40  }
41 
42  result.reserve(result.size());
43  return result;
44 
45 }
46 
47 
48 vector<const DetLayer*>
50  PropagationDirection dir) const {
51 
52  vector<const DetLayer*> result;
53  vector<const DetLayer*> barrel;
54 
55  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
56  pushResult(result, theOuterEndcapLayers, fts);
57  }
58  else {
59  pushResult(result, theInnerEndcapLayers, fts);
60  reverse(result.begin(),result.end());
61  pushResult(barrel, theInnerBarrelLayers, fts);
62  reverse(barrel.begin(),barrel.end());
63  result.insert(result.end(),barrel.begin(),barrel.end());
64  }
65 
66  result.reserve(result.size());
67  return result;
68 
69 }
70 
71 vector<const DetLayer*>
73 
74  vector<const DetLayer*> result;
75  vector<const DetLayer*> barrel;
76 
77  if ( dir == insideOut ) {
78  pushResult(result, theAllOuterEndcapLayers);
79  }
80  else {
81  pushResult(result, theAllInnerEndcapLayers);
82  reverse(result.begin(),result.end());
83  pushResult(barrel, theAllInnerBarrelLayers);
84  reverse(barrel.begin(),barrel.end());
85  result.insert(result.end(),barrel.begin(),barrel.end());
86  }
87 
88  result.reserve(result.size());
89  return result;
90 
91 }
92 vector<const DetLayer*>
94  PropagationDirection dir) const {
95  vector<const DetLayer*> result;
96  vector<const DetLayer*> barrel;
97 
98  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
99  pushCompatibleResult(result, theAllOuterEndcapLayers, fts);
100  }
101  else {
102  pushCompatibleResult(result, theAllInnerEndcapLayers, fts);
103  reverse(result.begin(),result.end());
104  pushCompatibleResult(barrel, theAllInnerBarrelLayers, fts);
105  reverse(barrel.begin(),barrel.end());
106  result.insert(result.end(),barrel.begin(),barrel.end());
107  }
108  result.reserve(result.size());
109  return result;
110 
111 }
112 
113 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result,
114  const MapB& map) const {
115 
116  for (MapBI i = map.begin(); i != map.end(); i++) result.push_back((*i).first);
117 
118 }
119 
120 
121 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result,
122  const MapE& map) const {
123 
124  for (MapEI i = map.begin(); i != map.end(); i++) result.push_back((*i).first);
125 
126 }
127 
128 
129 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result,
130  const MapE& map,
131  const FreeTrajectoryState& fts) const {
132 
133  for (MapEI i = map.begin(); i != map.end(); i++)
134  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
135 
136 }
137 
138 
139 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result,
140  const MapB& map,
141  const FreeTrajectoryState& fts) const {
142 
143  for (MapBI i = map.begin(); i != map.end(); i++)
144  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
145 
146 }
147 
148 
150  const MapB& map,
151  const FreeTrajectoryState& fts) const {
152  MuonEtaRange range=trackingRange(fts);
153  for ( MapBI i = map.begin(); i != map.end(); i++ )
154  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
155 }
156 
158  const MapE& map,
159  const FreeTrajectoryState& fts) const {
160  MuonEtaRange range=trackingRange(fts);
161  for (MapEI i = map.begin(); i != map.end(); i++)
162  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
163 
164 }
165 
166 
168 
169  return theDetLayer;
170 
171 }
172 
173 
175 
176  edm::LogError ("MuonForwardNavigablaLayer") << "MuonForwardNavigableLayer::setDetLayer called!! " << endl;
177 
178 }
179 
180 
182  const MapE& innerEL) {
183 
184  theInnerBarrelLayers = innerBL;
185  theInnerEndcapLayers = innerEL;
186 
187 }
189  const MapE& innerCEL) {
190 
191  theAllInnerBarrelLayers = innerCBL;
192  theAllInnerEndcapLayers = innerCEL;
193 
194 }
195 
int i
Definition: DBlmapReader.cc:9
virtual std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const override
MapB::const_iterator MapBI
std::map< const BarrelDetLayer *, MuonEtaRange, MuonDetLayerComp > MapB
PropagationDirection
void pushResult(std::vector< const DetLayer * > &result, const MapB &map) const
void setInwardLinks(const MapB &, const MapE &)
set inward links
tuple result
Definition: mps_fire.py:84
void pushCompatibleResult(std::vector< const DetLayer * > &result, const MapB &map, const FreeTrajectoryState &fts) const
MapE::const_iterator MapEI
virtual const DetLayer * detLayer() const override
return DetLayer
std::map< const ForwardDetLayer *, MuonEtaRange, MuonDetLayerComp > MapE
GlobalPoint position() const
virtual void setDetLayer(const DetLayer *) override
set DetLayer
T eta() const
Definition: PV3DBase.h:76
void setInwardCompatibleLinks(const MapB &, const MapE &)
dbl *** dir
Definition: mlp_gen.cc:35
virtual std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const override
NavigableLayer interface.