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