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; }
BTLNavigableLayer::setInwardCompatibleLinks
void setInwardCompatibleLinks(const MapB &)
Definition: BTLNavigableLayer.cc:147
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
oppositeToMomentum
Definition: PropagationDirection.h:4
MapBI
MapB::const_iterator MapBI
Definition: MTDDetLayerMap.h:38
BTLNavigableLayer::detLayer
const DetLayer * detLayer() const override
return DetLayer
Definition: BTLNavigableLayer.cc:140
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
BTLNavigableLayer.h
MTDEtaRange
Definition: MTDEtaRange.h:15
groupFilesInBlocks.reverse
reverse
Definition: groupFilesInBlocks.py:131
MTDDetLayerMap.h
MapEI
MapE::const_iterator MapEI
Definition: MTDDetLayerMap.h:39
BTLNavigableLayer::setDetLayer
void setDetLayer(const DetLayer *) override
set DetLayer
Definition: BTLNavigableLayer.cc:142
MapB
std::map< const BarrelDetLayer *, MTDEtaRange, MTDDetLayerComp > MapB
Definition: MTDDetLayerMap.h:36
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
BarrelDetLayer.h
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
std
Definition: JetResolutionObject.h:76
MTDEtaRange.h
NavigationDirection
NavigationDirection
Definition: NavigationDirection.h:4
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
MapE
std::map< const ForwardDetLayer *, MTDEtaRange, MTDDetLayerComp > MapE
Definition: MTDDetLayerMap.h:37
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
BTLNavigableLayer::compatibleLayers
std::vector< const DetLayer * > compatibleLayers(NavigationDirection dir) const override
Definition: BTLNavigableLayer.cc:60
DetLayer.h
insideOut
Definition: NavigationDirection.h:4
BTLNavigableLayer::pushCompatibleResult
void pushCompatibleResult(std::vector< const DetLayer * > &result, const MapB &map, const FreeTrajectoryState &fts) const
Definition: BTLNavigableLayer.cc:122
mps_fire.result
result
Definition: mps_fire.py:311
genParticles_cff.map
map
Definition: genParticles_cff.py:11
BTLNavigableLayer::nextLayers
std::vector< const DetLayer * > nextLayers(NavigationDirection dir) const override
NavigableLayer interface.
Definition: BTLNavigableLayer.cc:24
alongMomentum
Definition: PropagationDirection.h:4
BTLNavigableLayer::pushResult
void pushResult(std::vector< const DetLayer * > &result, const MapB &map) const
Definition: BTLNavigableLayer.cc:96
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
BTLNavigableLayer::setInwardLinks
void setInwardLinks(const MapB &)
set inward links
Definition: BTLNavigableLayer.cc:146