CMS 3D CMS Logo

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