-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: Updates to GBTS for Athena Implementation #3882
base: main
Are you sure you want to change the base?
Changes from all commits
b82ec02
86dff84
d7946d4
9c4433a
3730c4a
0566551
41661f1
7d79244
759b72e
43eb185
7c96cd1
9ddf2e4
b33faca
35c79c3
1a7b3a0
8347b8a
ac89d45
0bff8e8
7e2e163
f8edb15
e1709e9
05e3af2
ae8cd35
b5a1ded
83c742c
831f82b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,22 +27,28 @@ constexpr std::size_t N_SEG_CONNS = 6; // was 6 | |
template <typename space_point_t> | ||
struct GbtsSP { | ||
const space_point_t *SP; // want inside to have pointer | ||
int gbtsID; | ||
int combined_ID; | ||
GbtsSP(const space_point_t *sp, int id, int combined_id) | ||
: SP(sp), gbtsID(id), combined_ID{combined_id} { | ||
if (SP->sourceLinks().size() == 1) { // pixels have 1 SL | ||
m_isPixel = true; | ||
} else { | ||
m_isPixel = false; | ||
} | ||
m_phi = std::atan(SP->x() / SP->y()); | ||
int gbtsID; // used to access detector layer information in connector input | ||
// file | ||
int combined_ID; // includes eta id which references the detector module | ||
bool m_isPixel; | ||
float m_phi; | ||
float m_r; | ||
float m_ClusterWidth; | ||
GbtsSP(const space_point_t *sp, int id, int combined_id, bool isPixel, | ||
float ClusterWidth) | ||
: SP(sp), | ||
gbtsID(id), | ||
combined_ID{combined_id}, | ||
m_isPixel(isPixel), | ||
m_ClusterWidth(ClusterWidth) { | ||
m_phi = std::atan2(SP->y(), SP->x()); | ||
m_r = std::sqrt((SP->x() * SP->x()) + (SP->y() * SP->y())); | ||
}; | ||
bool isPixel() const { return m_isPixel; } | ||
bool isSCT() const { return !m_isPixel; } | ||
bool isStrip() const { return !m_isPixel; } | ||
float phi() const { return m_phi; } | ||
bool m_isPixel; | ||
float m_phi; | ||
float r() const { return m_r; } | ||
float ClusterWidth() const { return m_ClusterWidth; } | ||
}; | ||
|
||
template <typename space_point_t> | ||
|
@@ -152,7 +158,7 @@ class GbtsDataStorage { | |
return -1; | ||
} | ||
|
||
int binIndex = pL->getEtaBin(sp.SP->z(), sp.SP->r()); | ||
int binIndex = pL->getEtaBin(sp.SP->z(), sp.r()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Error codes, document we must. Return values, explain we should. Return values (-1, -2, -3), their meaning unclear it is. Documentation for error conditions, add you must. Add enum for error codes: + enum class SpacePointError {
+ Success = 0,
+ InvalidLayer = -1,
+ InvalidEtaBin = -2,
+ InvalidClusterWidth = -3
+ }; Also applies to: 185-189 |
||
|
||
if (binIndex == -1) { | ||
return -2; | ||
|
@@ -165,7 +171,7 @@ class GbtsDataStorage { | |
float max_tau = 100.0; | ||
// can't do this bit yet as dont have cluster width | ||
if (useClusterWidth) { | ||
float cluster_width = 1; // temporary while cluster width not available | ||
float cluster_width = sp.ClusterWidth(); | ||
min_tau = 6.7 * (cluster_width - 0.2); | ||
max_tau = | ||
1.6 + 0.15 / (cluster_width + 0.2) + 6.1 * (cluster_width - 0.2); | ||
Comment on lines
+174
to
177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Magic numbers in tau calculations, explain you must. Constants 6.7, 0.2, 1.6, 0.15, and 6.1, mysterious they are. Document their significance and origin, you should. Extract as named constants with documentation: + // Tau calculation constants for barrel layers
+ static constexpr float MIN_TAU_FACTOR = 6.7f;
+ static constexpr float CLUSTER_WIDTH_OFFSET = 0.2f;
+ static constexpr float MAX_TAU_BASE = 1.6f;
+ static constexpr float MAX_TAU_FACTOR1 = 0.15f;
+ static constexpr float MAX_TAU_FACTOR2 = 6.1f;
|
||
|
@@ -176,7 +182,7 @@ class GbtsDataStorage { | |
sp, min_tau, max_tau)); // adding ftf member to nodes | ||
} else { | ||
if (useClusterWidth) { | ||
float cluster_width = 1; // temporary while cluster width not available | ||
float cluster_width = sp.ClusterWidth(); | ||
if (cluster_width > 0.2) { | ||
return -3; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
// TODO: update to C++17 style | ||
|
||
#include "Acts/Geometry/Extent.hpp" | ||
#include "Acts/Seeding/SeedFilter.hpp" | ||
#include "Acts/Seeding/SeedFinder.hpp" | ||
#include "Acts/Seeding/SeedFinderGbtsConfig.hpp" | ||
#include "Acts/Seeding/SeedFinderUtils.hpp" | ||
|
@@ -166,11 +165,11 @@ void SeedFinderGbts<external_spacepoint_t>::runGbts_TrackFinder( | |
continue; | ||
} | ||
|
||
float r1 = n1->m_spGbts.SP->r(); | ||
float r1 = n1->m_spGbts.r(); | ||
float x1 = n1->m_spGbts.SP->x(); | ||
float y1 = n1->m_spGbts.SP->y(); | ||
float z1 = n1->m_spGbts.SP->z(); | ||
float phi1 = std::atan(x1 / y1); | ||
float phi1 = n1->m_spGbts.phi(); | ||
|
||
float minPhi = phi1 - deltaPhi; | ||
float maxPhi = phi1 + deltaPhi; | ||
|
@@ -199,7 +198,7 @@ void SeedFinderGbts<external_spacepoint_t>::runGbts_TrackFinder( | |
continue; | ||
} | ||
|
||
float r2 = n2->m_spGbts.SP->r(); | ||
float r2 = n2->m_spGbts.r(); | ||
|
||
float dr = r2 - r1; | ||
|
||
|
@@ -545,7 +544,7 @@ void SeedFinderGbts<external_spacepoint_t>::runGbts_TrackFinder( | |
|
||
for (unsigned int idx_m = 1; idx_m < vSP.size() - 1; idx_m++) { | ||
const GbtsSP<external_spacepoint_t>& spM = *vSP.at(idx_m); | ||
const double pS_r = spM.SP->r(); | ||
const double pS_r = spM.r(); | ||
const double pS_x = spM.SP->x(); | ||
const double pS_y = spM.SP->y(); | ||
const double cosA = pS_x / pS_r; | ||
|
@@ -676,8 +675,8 @@ void SeedFinderGbts<external_spacepoint_t>::createSeeds( | |
} else { | ||
// In normal (non LRT) mode penalise SSS by 1000, PSS (if enabled) and | ||
// PPS by 10000 | ||
Comment on lines
676
to
677
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can neglect the LRT case for the moment. Also, I do not think we build PSS and/or PPS at all, so we can probably remove those cases? |
||
if (seed.s3().isSCT()) { | ||
newQ += seed.s1().isSCT() ? 1000.0 : 10000.0; | ||
if (seed.s3().isStrip()) { | ||
newQ += seed.s1().isStrip() ? 1000.0 : 10000.0; | ||
} | ||
} | ||
seed.Q(newQ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a lot detector dependent. Not for now, but probably we need to define a strategy to generalise this code.