CMS 3D CMS Logo

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