98{
99
100
102
103 for (
auto entry :
m_map)
104 {
105
106 std::vector<FPGATrackSimHit>& hits_inner =
entry.second.first;
107 std::vector<FPGATrackSimHit>& hits_outer =
entry.second.second;
108
109 for (auto hit_in : hits_inner) {
110 int startsize = spacepoints.size();
111 bool foundPair =
searchForMatch(hit_in,hits_outer,tower,spacepoints);
112
114
115 std::vector<int> nextmod =
entry.first;
116 nextmod[3]+=1;
117 auto entry2 =
m_map.find(nextmod);
118 if (entry2!=
m_map.end()) {
119 foundPair =
searchForMatch(hit_in,entry2->second.second,tower,spacepoints);
121 }
122 }
123
124
126
127 std::vector<int> nextphimod =
entry.first;
128 nextphimod[2]+=1;
129 auto entry3 =
m_map.find(nextphimod);
130 if (entry3!=
m_map.end()) {
131 foundPair =
searchForMatch(hit_in,entry3->second.second,tower,spacepoints);
133 }
134 }
135
136
138
139 std::vector<int> next2mod =
entry.first;
140 next2mod[3]+=1;
141 next2mod[2]+=1;
142 auto entry4 =
m_map.find(next2mod);
143 if (entry4!=
m_map.end()) {
144 foundPair =
searchForMatch(hit_in,entry4->second.second,tower,spacepoints);
146 }
147 }
148
149 if (!foundPair) {
151 else {
153 ATH_MSG_DEBUG(
"Unpaired hit z = " << hit_in.getZ() <<
", r = " << hit_in.getR() <<
", phi = " << hit_in.getGPhi() <<
", phi module = " << hit_in.getPhiModule() <<
", eta module = " << hit_in.getEtaModule());
154 }
155 }
156
158 }
159
160
161 for (const FPGATrackSimHit& hit_out : hits_outer) {
162 bool foundPair=false;
163 for (const FPGATrackSimHit& hit_in : hits_inner) {
164 if (std::abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
165 foundPair=true;
166 break;
167 }
168 }
169
170
171 std::vector<int> nextmod =
entry.first;
172 nextmod[3]-=1;
173 auto entry2 =
m_map.find(nextmod);
174 if (entry2!=
m_map.end()) {
175 for (const auto & hit_in : entry2->second.first) {
176 if (std::abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
177 foundPair=true;
179 break;
180 }
181 }
182 }
183
184
185 if (!foundPair) {
186
187 std::vector<int> nextphimod =
entry.first;
188 nextphimod[2]-=1;
189 auto entry3 =
m_map.find(nextphimod);
190 if (entry3!=
m_map.end()) {
191 for (const auto & hit_in : entry3->second.first) {
192 if (std::abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
193 foundPair=true;
195 break;
196 }
197 }
198 }
199 }
200
201
202 if (!foundPair) {
203
204 std::vector<int> next2mod =
entry.first;
205 next2mod[3]-=1;
206 next2mod[2]-=1;
207 auto entry4 =
m_map.find(next2mod);
208 if (entry4!=
m_map.end()) {
209 for (const auto & hit_in : entry4->second.first) {
210 if (std::abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
211 foundPair=true;
213 break;
214 }
215 }
216 }
217 }
218
219 if (!foundPair) {
221 else {
223 ATH_MSG_DEBUG(
"Unpaired hit z = " << hit_out.getZ() <<
", r = " << hit_out.getR() <<
", phi = " << hit_out.getGPhi() <<
", phi module = " << hit_out.getPhiModule() <<
", eta module = " << hit_out.getEtaModule());
224 }
225 }
226 }
227 }
228
229
231
234
235
236 return StatusCode::SUCCESS;
237}