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 }
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:428
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
MessageLogger.h
DetLayer
Definition: DetLayer.h:21
MuonForwardNavigableLayer::detLayer
const DetLayer * detLayer() const override
return DetLayer
Definition: MuonForwardNavigableLayer.cc:141
edm
HLT enums.
Definition: AlignableModifier.h:19
MuonForwardNavigableLayer::setInwardLinks
void setInwardLinks(const MapB &, const MapE &)
set inward links
Definition: MuonForwardNavigableLayer.cc:147
MuonForwardNavigableLayer::pushResult
void pushResult(std::vector< const DetLayer * > &result, const MapB &map) const
Definition: MuonForwardNavigableLayer.cc:97
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
Definition: MuonEtaRange.h:15
MuonForwardNavigableLayer.h
MuonForwardNavigableLayer::pushCompatibleResult
void pushCompatibleResult(std::vector< const DetLayer * > &result, const MapB &map, const FreeTrajectoryState &fts) const
Definition: MuonForwardNavigableLayer.cc:123
MuonForwardNavigableLayer::setInwardCompatibleLinks
void setInwardCompatibleLinks(const MapB &, const MapE &)
Definition: MuonForwardNavigableLayer.cc:151
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
std
Definition: JetResolutionObject.h:76
NavigationDirection
NavigationDirection
Definition: NavigationDirection.h:4
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
ForwardDetLayer.h
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
MapBI
MapB::const_iterator MapBI
Definition: MuonDetLayerMap.h:38
DetLayer.h
MuonForwardNavigableLayer::setDetLayer
void setDetLayer(const DetLayer *) override
set DetLayer
Definition: MuonForwardNavigableLayer.cc:143
insideOut
Definition: NavigationDirection.h:4
MuonForwardNavigableLayer::compatibleLayers
std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const override
Definition: MuonForwardNavigableLayer.cc:62
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
MuonForwardNavigableLayer::nextLayers
std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const override
NavigableLayer interface.
Definition: MuonForwardNavigableLayer.cc:25