CMS 3D CMS Logo

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 
26  vector<const DetLayer*> result;
27  vector<const DetLayer*> barrel;
28 
29  if (dir == insideOut) {
30  pushResult(result, theOuterEndcapLayers);
31  } else {
32  pushResult(result, theInnerEndcapLayers);
33  reverse(result.begin(), result.end());
34  pushResult(barrel, theInnerBarrelLayers);
35  reverse(barrel.begin(), barrel.end());
36  result.insert(result.end(), barrel.begin(), barrel.end());
37  }
38 
39  result.reserve(result.size());
40  return result;
41 }
42 
44  PropagationDirection dir) const {
45  vector<const DetLayer*> result;
46  vector<const DetLayer*> barrel;
47 
48  if ((isInsideOut(fts) && dir == alongMomentum) || (!isInsideOut(fts) && dir == oppositeToMomentum)) {
49  pushResult(result, theOuterEndcapLayers, fts);
50  } else {
51  pushResult(result, theInnerEndcapLayers, fts);
52  reverse(result.begin(), result.end());
53  pushResult(barrel, theInnerBarrelLayers, fts);
54  reverse(barrel.begin(), barrel.end());
55  result.insert(result.end(), barrel.begin(), barrel.end());
56  }
57 
58  result.reserve(result.size());
59  return result;
60 }
61 
63  vector<const DetLayer*> result;
64  vector<const DetLayer*> barrel;
65 
66  if (dir == insideOut) {
67  pushResult(result, theAllOuterEndcapLayers);
68  } else {
69  pushResult(result, theAllInnerEndcapLayers);
70  reverse(result.begin(), result.end());
71  pushResult(barrel, theAllInnerBarrelLayers);
72  reverse(barrel.begin(), barrel.end());
73  result.insert(result.end(), barrel.begin(), barrel.end());
74  }
75 
76  result.reserve(result.size());
77  return result;
78 }
80  PropagationDirection dir) const {
81  vector<const DetLayer*> result;
82  vector<const DetLayer*> barrel;
83 
84  if ((isInsideOut(fts) && dir == alongMomentum) || (!isInsideOut(fts) && dir == oppositeToMomentum)) {
85  pushCompatibleResult(result, theAllOuterEndcapLayers, fts);
86  } else {
87  pushCompatibleResult(result, theAllInnerEndcapLayers, fts);
88  reverse(result.begin(), result.end());
89  pushCompatibleResult(barrel, theAllInnerBarrelLayers, fts);
90  reverse(barrel.begin(), barrel.end());
91  result.insert(result.end(), barrel.begin(), barrel.end());
92  }
93  result.reserve(result.size());
94  return result;
95 }
96 
97 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result, const MapB& map) const {
98  for (MapBI i = map.begin(); i != map.end(); i++)
99  result.push_back((*i).first);
100 }
101 
102 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result, const MapE& map) const {
103  for (MapEI i = map.begin(); i != map.end(); i++)
104  result.push_back((*i).first);
105 }
106 
107 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result,
108  const MapE& map,
109  const FreeTrajectoryState& fts) const {
110  for (MapEI i = map.begin(); i != map.end(); i++)
111  if ((*i).second.isInside(fts.position().eta()))
112  result.push_back((*i).first);
113 }
114 
115 void MuonForwardNavigableLayer::pushResult(vector<const DetLayer*>& result,
116  const MapB& map,
117  const FreeTrajectoryState& fts) const {
118  for (MapBI i = map.begin(); i != map.end(); i++)
119  if ((*i).second.isInside(fts.position().eta()))
120  result.push_back((*i).first);
121 }
122 
124  const MapB& map,
125  const FreeTrajectoryState& fts) const {
126  MuonEtaRange range = trackingRange(fts);
127  for (MapBI i = map.begin(); i != map.end(); i++)
128  if ((*i).second.isCompatible(range))
129  result.push_back((*i).first);
130 }
131 
133  const MapE& map,
134  const FreeTrajectoryState& fts) const {
135  MuonEtaRange range = trackingRange(fts);
136  for (MapEI i = map.begin(); i != map.end(); i++)
137  if ((*i).second.isCompatible(range))
138  result.push_back((*i).first);
139 }
140 
141 const DetLayer* MuonForwardNavigableLayer::detLayer() const { return theDetLayer; }
142 
144  edm::LogError("MuonForwardNavigablaLayer") << "MuonForwardNavigableLayer::setDetLayer called!! " << endl;
145 }
146 
147 void MuonForwardNavigableLayer::setInwardLinks(const MapB& innerBL, const MapE& innerEL) {
148  theInnerBarrelLayers = innerBL;
149  theInnerEndcapLayers = innerEL;
150 }
151 void MuonForwardNavigableLayer::setInwardCompatibleLinks(const MapB& innerCBL, const MapE& innerCEL) {
152  theAllInnerBarrelLayers = innerCBL;
153  theAllInnerEndcapLayers = innerCEL;
154 }
std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const override
T eta() const
Definition: PV3DBase.h:73
MapB::const_iterator MapBI
std::map< const BarrelDetLayer *, MuonEtaRange, MuonDetLayerComp > MapB
PropagationDirection
Log< level::Error, false > LogError
void pushResult(std::vector< const DetLayer *> &result, const MapB &map) const
void setInwardLinks(const MapB &, const MapE &)
set inward links
GlobalPoint position() const
MapE::const_iterator MapEI
void pushCompatibleResult(std::vector< const DetLayer *> &result, const MapB &map, const FreeTrajectoryState &fts) const
const DetLayer * detLayer() const override
return DetLayer
std::map< const ForwardDetLayer *, MuonEtaRange, MuonDetLayerComp > MapE
void setDetLayer(const DetLayer *) override
set DetLayer
HLT enums.
void setInwardCompatibleLinks(const MapB &, const MapE &)
std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const override
NavigableLayer interface.