26 return StatusCode::SUCCESS;
32 ATH_MSG_INFO(
"-----------------------------------------");
40 ATH_MSG_INFO(
"-----------------------------------------");
41 return StatusCode::SUCCESS;
46 for (
int i = 0;
i <
header.nTowers(); ++
i)
49 std::vector<FPGATrackSimHit>
hits = tower.
hits();
50 if (
hits.empty())
continue;
57 return StatusCode::SUCCESS;
67 for (
const auto & hit :
hits) {
72 ATH_MSG_DEBUG(
"Pixel hit z = " << hit.getZ() <<
", r = " << hit.getR() <<
", phi = " << hit.getGPhi());
77 std::vector<int> module_desc(4);
79 module_desc[0] = (
int)hit.getDetectorZone();
80 module_desc[1] = hit.getPhysLayer()/2;
81 unsigned side = hit.getPhysLayer()%2;
82 module_desc[2] = hit.getPhiModule();
83 module_desc[3] = hit.getEtaModule();
86 m_map[module_desc].first.push_back(hit);
88 m_map[module_desc].second.push_back(hit);
91 ATH_MSG_DEBUG(
"Running spacepoints default tool over " << strip_hits <<
" strip hits.");
93 return StatusCode::SUCCESS;
105 std::vector<FPGATrackSimHit>& hits_inner =
entry.second.first;
106 std::vector<FPGATrackSimHit>& hits_outer =
entry.second.second;
108 for (
auto hit_in : hits_inner) {
109 int startsize = spacepoints.size();
110 bool foundPair =
searchForMatch(hit_in,hits_outer,tower,spacepoints);
114 std::vector<int> nextmod =
entry.first;
116 auto entry2 =
m_map.find(nextmod);
117 if (entry2!=
m_map.end()) {
118 foundPair =
searchForMatch(hit_in,entry2->second.second,tower,spacepoints);
126 std::vector<int> nextphimod =
entry.first;
128 auto entry3 =
m_map.find(nextphimod);
129 if (entry3!=
m_map.end()) {
130 foundPair =
searchForMatch(hit_in,entry3->second.second,tower,spacepoints);
138 std::vector<int> next2mod =
entry.first;
141 auto entry4 =
m_map.find(next2mod);
142 if (entry4!=
m_map.end()) {
143 foundPair =
searchForMatch(hit_in,entry4->second.second,tower,spacepoints);
152 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());
161 bool foundPair=
false;
163 if (abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
170 std::vector<int> nextmod =
entry.first;
172 auto entry2 =
m_map.find(nextmod);
173 if (entry2!=
m_map.end()) {
174 for (
auto hit_in : entry2->second.first) {
175 if (abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
186 std::vector<int> nextphimod =
entry.first;
188 auto entry3 =
m_map.find(nextphimod);
189 if (entry3!=
m_map.end()) {
190 for (
const auto & hit_in : entry3->second.first) {
191 if (abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
203 std::vector<int> next2mod =
entry.first;
206 auto entry4 =
m_map.find(next2mod);
207 if (entry4!=
m_map.end()) {
208 for (
auto hit_in : entry4->second.first) {
209 if (abs(hit_in.getGPhi()-hit_out.getGPhi()) <
m_phiwindow) {
222 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());
235 return StatusCode::SUCCESS;
241 bool foundPair =
false;
263 float r = TMath::Sqrt(
x*
x +
y*
y);
264 ATH_MSG_DEBUG(
"Spacepoint x = " <<
x <<
", y = " <<
y <<
", z = " <<
z <<
", r = " <<
r);
275 new_truth.
add(truth_in);
276 new_truth.
add(truth_out);
318 spacepoints.push_back(sp);
327 float r_sp = (hit_in.
getR() + hit_out.
getR()) / 2.0;;
328 float z_sp = (hit_in.
getZ() + hit_out.
getZ()) / 2.0;;
330 float delta_phi_local = (hit_in.
getGPhi() - hit_out.
getGPhi()) * r_sp;
334 static const float stereo_angle = 0.026;
335 z_sp += delta_phi_local/
tan(stereo_angle)/2.0;
339 static const float stereo_angle = 0.020;
340 r_sp += delta_phi_local/
tan(stereo_angle)/2.0;
345 float r_bounds[19] = {394.0, 415.5, 442.0, 472.4, 498.85, 521.45, 547.05, 566.65, 591.0, 621.8, 654.7, 683.9, 710.2, 739.4, 784.2, 838.8, 887.6, 937.7, 967.8};
350 if (r_sp!=r_limited) {
351 ATH_MSG_WARNING(
"Spacepoint location not in module boundary: r_sp=" << r_sp
359 if (r_sp!=r_limited) {
360 ATH_MSG_WARNING(
"Crossing spacepoint location too far from module boundary: r_sp=" << r_sp
361 <<
" not in [" << r_bounds[hit_in.
getEtaModule()+1]-window <<
"," << r_bounds[hit_in.
getEtaModule()+1]+window <<
"]");
369 x = r_sp*
cos(phi_sp);
370 y = r_sp*
sin(phi_sp);