test
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 
17 
18 /* Collaborating Class Header */
25 /* C++ Headers */
26 #include <algorithm>
27 
28 using namespace std;
29 std::vector<const DetLayer*>
31 
32  std::vector<const DetLayer*> result;
33 
34  if ( dir == insideOut ) {
35  pushResult(result, theOuterBarrelLayers);
36  pushResult(result, theOuterBackwardLayers);
37  pushResult(result, theOuterForwardLayers);
38  }
39  else {
40  pushResult(result, theInnerBarrelLayers);
41  reverse(result.begin(),result.end());
42  pushResult(result, theInnerBackwardLayers);
43  pushResult(result, theInnerForwardLayers);
44  }
45 
46  result.reserve(result.size());
47  return result;
48 
49 }
50 
51 
52 std::vector<const DetLayer*>
54  PropagationDirection dir) const {
55 
56  std::vector<const DetLayer*> result;
57 
58  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
59  pushResult(result, theOuterBarrelLayers, fts);
60  pushResult(result, theOuterBackwardLayers, fts);
61  pushResult(result, theOuterForwardLayers, fts);
62  }
63  else {
64  pushResult(result, theInnerBarrelLayers, fts);
65  reverse(result.begin(),result.end());
66  pushResult(result, theInnerBackwardLayers, fts);
67  pushResult(result, theInnerForwardLayers, fts);
68  }
69  result.reserve(result.size());
70  return result;
71 }
72 
73 std::vector<const DetLayer*>
75 
76  std::vector<const DetLayer*> result;
77 
78  if ( dir == insideOut ) {
79  pushResult(result, theAllOuterBarrelLayers);
80  pushResult(result, theAllOuterBackwardLayers);
81  pushResult(result, theAllOuterForwardLayers);
82  }
83  else {
84  pushResult(result, theAllInnerBarrelLayers);
85  reverse(result.begin(),result.end());
86  pushResult(result, theAllInnerBackwardLayers);
87  pushResult(result, theAllInnerForwardLayers);
88  }
89 
90  result.reserve(result.size());
91  return result;
92 }
93 
94 std::vector<const DetLayer*>
96  PropagationDirection dir) const {
97  std::vector<const DetLayer*> result;
98 
99  if ( (isInsideOut(fts) && dir == alongMomentum) || ( !isInsideOut(fts) && dir == oppositeToMomentum)) {
100  pushCompatibleResult(result, theAllOuterBarrelLayers, fts);
101  pushCompatibleResult(result, theAllOuterBackwardLayers, fts);
102  pushCompatibleResult(result, theAllOuterForwardLayers, fts);
103  }
104  else {
105  pushCompatibleResult(result, theAllInnerBarrelLayers, fts);
106  reverse(result.begin(),result.end());
107  pushCompatibleResult(result, theAllInnerBackwardLayers, fts);
108  pushCompatibleResult(result, theAllInnerForwardLayers, fts);
109  }
110  result.reserve(result.size());
111  return result;
112 
113 }
114 
115 
116 void MuonBarrelNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
117  const MapB& map) const {
118 
119  for ( MapBI i = map.begin(); i != map.end(); i++ ) result.push_back((*i).first);
120 
121 }
122 
123 void MuonBarrelNavigableLayer::pushResult(std::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 void MuonBarrelNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
131  const MapB& map,
132  const FreeTrajectoryState& fts) const {
133  for ( MapBI i = map.begin(); i != map.end(); i++ )
134  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
135 }
136 
137 void MuonBarrelNavigableLayer::pushResult(std::vector<const DetLayer*>& result,
138  const MapE& map,
139  const FreeTrajectoryState& fts) const {
140 
141  for (MapEI i = map.begin(); i != map.end(); i++)
142  if ((*i).second.isInside(fts.position().eta())) result.push_back((*i).first);
143 
144 }
145 
146 void MuonBarrelNavigableLayer::pushCompatibleResult(std::vector<const DetLayer*>& result,
147  const MapB& map,
148  const FreeTrajectoryState& fts) const {
149  MuonEtaRange range= trackingRange(fts);
150  for ( MapBI i = map.begin(); i != map.end(); i++ )
151  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
152 }
153 
154 void MuonBarrelNavigableLayer::pushCompatibleResult(std::vector<const DetLayer*>& result,
155  const MapE& map,
156  const FreeTrajectoryState& fts) const {
157  MuonEtaRange range= trackingRange(fts);
158  for (MapEI i = map.begin(); i != map.end(); i++)
159  if ((*i).second.isCompatible(range)) result.push_back((*i).first);
160 
161 }
162 
164  return theDetLayer;
165 }
166 
167 
169  edm::LogError("MuonBarrelNavigableLayer") << "MuonBarrelNavigableLayer::setDetLayer called!! " << endl;
170 }
171 
172 
174  theInnerBarrelLayers = innerBL;
175 }
177 
178  theAllInnerBarrelLayers = innerCBL;
179 
180 }
181 
virtual std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const override
int i
Definition: DBlmapReader.cc:9
void pushResult(std::vector< const DetLayer * > &result, const MapB &map) const
virtual std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const override
NavigableLayer interface.
MapB::const_iterator MapBI
std::map< const BarrelDetLayer *, MuonEtaRange, MuonDetLayerComp > MapB
PropagationDirection
tuple result
Definition: mps_fire.py:84
virtual void setDetLayer(const DetLayer *) override
set DetLayer
void setInwardCompatibleLinks(const MapB &)
MapE::const_iterator MapEI
virtual const DetLayer * detLayer() const override
return DetLayer
std::map< const ForwardDetLayer *, MuonEtaRange, MuonDetLayerComp > MapE
GlobalPoint position() const
T eta() const
Definition: PV3DBase.h:76
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