CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonBarrelNavigableLayer.cc
Go to the documentation of this file.
1 
19 
20 /* Collaborating Class Header */
27 /* C++ Headers */
28 #include <algorithm>
29 
30 using namespace std;
31 std::vector<const DetLayer*>
33 
34  std::vector<const DetLayer*> result;
35 
36  if ( dir == insideOut ) {
37  pushResult(result, theOuterBarrelLayers);
38  pushResult(result, theOuterBackwardLayers);
39  pushResult(result, theOuterForwardLayers);
40  }
41  else {
42  pushResult(result, theInnerBarrelLayers);
43  reverse(result.begin(),result.end());
44  pushResult(result, theInnerBackwardLayers);
45  pushResult(result, theInnerForwardLayers);
46  }
47 
48  result.reserve(result.size());
49  return result;
50 
51 }
52 
53 
54 std::vector<const DetLayer*>
56  PropagationDirection dir) const {
57 
58  std::vector<const DetLayer*> result;
59 
60  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
61  pushResult(result, theOuterBarrelLayers, fts);
62  pushResult(result, theOuterBackwardLayers, fts);
63  pushResult(result, theOuterForwardLayers, fts);
64  }
65  else {
66  pushResult(result, theInnerBarrelLayers, fts);
67  reverse(result.begin(),result.end());
68  pushResult(result, theInnerBackwardLayers, fts);
69  pushResult(result, theInnerForwardLayers, fts);
70  }
71  result.reserve(result.size());
72  return result;
73 }
74 
75 std::vector<const DetLayer*>
77 
78  std::vector<const DetLayer*> result;
79 
80  if ( dir == insideOut ) {
81  pushResult(result, theAllOuterBarrelLayers);
82  pushResult(result, theAllOuterBackwardLayers);
83  pushResult(result, theAllOuterForwardLayers);
84  }
85  else {
86  pushResult(result, theAllInnerBarrelLayers);
87  reverse(result.begin(),result.end());
88  pushResult(result, theAllInnerBackwardLayers);
89  pushResult(result, theAllInnerForwardLayers);
90  }
91 
92  result.reserve(result.size());
93  return result;
94 }
95 
96 std::vector<const DetLayer*>
98  PropagationDirection dir) const {
99  std::vector<const DetLayer*> result;
100 
101  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
102  pushCompatibleResult(result, theAllOuterBarrelLayers, fts);
103  pushCompatibleResult(result, theAllOuterBackwardLayers, fts);
104  pushCompatibleResult(result, theAllOuterForwardLayers, fts);
105  }
106  else {
107  pushCompatibleResult(result, theAllInnerBarrelLayers, fts);
108  reverse(result.begin(),result.end());
109  pushCompatibleResult(result, theAllInnerBackwardLayers, fts);
110  pushCompatibleResult(result, theAllInnerForwardLayers, fts);
111  }
112  result.reserve(result.size());
113  return result;
114 
115 }
116 
117 
118 void MuonBarrelNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
119  const MapB& map) const {
120 
121  for ( MapBI i = map.begin(); i != map.end(); i++ ) result.push_back((*i).first);
122 
123 }
124 
125 void MuonBarrelNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
126  const MapE& map) const {
127 
128  for ( MapEI i = map.begin(); i != map.end(); i++ ) result.push_back((*i).first);
129 }
130 
131 
132 void MuonBarrelNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
133  const MapB& map,
134  const FreeTrajectoryState& fts) const {
135  for ( MapBI i = map.begin(); i != map.end(); i++ )
136  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
137 }
138 
139 void MuonBarrelNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
140  const MapE& map,
141  const FreeTrajectoryState& fts) const {
142 
143  for (MapEI i = map.begin(); i != map.end(); i++)
144  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
145 
146 }
147 
148 void MuonBarrelNavigableLayer::pushCompatibleResult(std::vector<const DetLayer*>& result,
149  const MapB& map,
150  const FreeTrajectoryState& fts) const {
151  MuonEtaRange range= trackingRange(fts);
152  for ( MapBI i = map.begin(); i != map.end(); i++ )
153  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
154 }
155 
156 void MuonBarrelNavigableLayer::pushCompatibleResult(std::vector<const DetLayer*>& result,
157  const MapE& map,
158  const FreeTrajectoryState& fts) const {
159  MuonEtaRange range= trackingRange(fts);
160  for (MapEI i = map.begin(); i != map.end(); i++)
161  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
162 
163 }
164 
166  return theDetLayer;
167 }
168 
169 
171  edm::LogError("MuonBarrelNavigableLayer") << "MuonBarrelNavigableLayer::setDetLayer called!! " << endl;
172 }
173 
174 
176  theInnerBarrelLayers = innerBL;
177 }
179 
180  theAllInnerBarrelLayers = innerCBL;
181 
182 }
183 
int i
Definition: DBlmapReader.cc:9
void pushResult(std::vector< const DetLayer * > &result, const MapB &map) const
std::map< ForwardDetLayer *, MuonEtaRange, MuonDetLayerComp > MapE
MapB::const_iterator MapBI
virtual void setDetLayer(DetLayer *)
set DetLayer
PropagationDirection
virtual std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const
NavigableLayer interface.
dictionary map
Definition: Association.py:205
std::map< BarrelDetLayer *, MuonEtaRange, MuonDetLayerComp > MapB
void setInwardCompatibleLinks(const MapB &)
virtual std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const
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:75
void setInwardLinks(const MapB &)
set inward links
dbl *** dir
Definition: mlp_gen.cc:35
void pushCompatibleResult(std::vector< const DetLayer * > &result, const MapB &map, const FreeTrajectoryState &fts) const