63 const std::vector<CDCWireHit*>& wireHits)
const
66 std::vector<const CDCWire*> m_wireNeighbors;
67 m_wireNeighbors.reserve(nWireNeighbors);
69 std::vector<CDCWireHit*> m_wireHitNeighbors;
70 m_wireHitNeighbors.reserve(2 * nWireNeighbors);
73 const CDCWire& wire = from->getWire();
81 const CDCWire* cwSixthSecondWireNeighbor = ccwSixthSecondWireNeighbor;
85 const CDCWire* cwTwelvethSecondWireNeighbor = ccwTwelvethSecondWireNeighbor;
91 m_wireNeighbors.push_back(ccwSixthSecondWireNeighbor);
93 if (cwInWireNeighbor) m_wireNeighbors.push_back(cwInWireNeighbor);
94 if (ccwInWireNeighbor) m_wireNeighbors.push_back(ccwInWireNeighbor);
97 if (cwWireNeighbor) m_wireNeighbors.push_back(cwWireNeighbor);
99 if (ccwWireNeighbor) m_wireNeighbors.push_back(ccwWireNeighbor);
101 if (cwOutWireNeighbor) m_wireNeighbors.push_back(cwOutWireNeighbor);
102 if (ccwOutWireNeighbor) m_wireNeighbors.push_back(ccwOutWireNeighbor);
105 m_wireNeighbors.push_back(ccwTwelvethSecondWireNeighbor);
108 if (cwSixthSecondWireNeighbor) {
109 cwSixthSecondWireNeighbor = cwSixthSecondWireNeighbor->
getNeighborCW();
110 m_wireNeighbors.push_back(cwSixthSecondWireNeighbor);
112 if (ccwSixthSecondWireNeighbor) {
113 ccwSixthSecondWireNeighbor = ccwSixthSecondWireNeighbor->
getNeighborCCW();
114 m_wireNeighbors.push_back(ccwSixthSecondWireNeighbor);
117 if (cwInWireNeighbor) {
119 m_wireNeighbors.push_back(cwInWireNeighbor);
121 if (ccwInWireNeighbor) {
123 m_wireNeighbors.push_back(ccwInWireNeighbor);
126 if (cwWireNeighbor) {
128 m_wireNeighbors.push_back(cwWireNeighbor);
130 if (ccwWireNeighbor) {
132 m_wireNeighbors.push_back(ccwWireNeighbor);
135 if (cwOutWireNeighbor) {
137 m_wireNeighbors.push_back(cwOutWireNeighbor);
139 if (ccwOutWireNeighbor) {
141 m_wireNeighbors.push_back(ccwOutWireNeighbor);
144 if (cwTwelvethSecondWireNeighbor) {
145 cwTwelvethSecondWireNeighbor = cwTwelvethSecondWireNeighbor->
getNeighborCW();
146 m_wireNeighbors.push_back(cwTwelvethSecondWireNeighbor);
148 if (ccwTwelvethSecondWireNeighbor) {
149 ccwTwelvethSecondWireNeighbor = ccwTwelvethSecondWireNeighbor->
getNeighborCCW();
150 m_wireNeighbors.push_back(ccwTwelvethSecondWireNeighbor);
154 std::sort(std::begin(m_wireNeighbors), std::end(m_wireNeighbors));
161 const bool prepared =
164 for (
const CDCWire* neighborWire : m_wireNeighbors) {
165 ConstVectorRange<CDCWireHit*> neighborWireHits = [&]() -> ConstVectorRange<CDCWireHit*> {
174 return ConstVectorRange<CDCWireHit*>{
175 std::equal_range(wireHits.begin(), wireHits.end(), neighborWire, LessOf<Deref>())
179 m_wireHitNeighbors.insert(m_wireHitNeighbors.end(),
180 neighborWireHits.
begin(),
181 neighborWireHits.
end());
184 return m_wireHitNeighbors;