CMS 3D CMS Logo

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