Skip to content
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

Improve the seeding and finding performance #735

Merged
merged 4 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions core/include/traccc/seeding/detail/seeding_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@ struct seedfinder_config {
seedfinder_config() { setup(); }

// limiting location of measurements
// Beomki's note: this value introduces redundant bins
// without any spacepoints
// m_config.zMin = -2800.;
// m_config.zMax = 2800.;
float zMin = -1186.f * unit<float>::mm;
float zMax = 1186.f * unit<float>::mm;
float zMin = -2000.f * unit<float>::mm;
float zMax = 2000.f * unit<float>::mm;
float rMax = 200.f * unit<float>::mm;
// WARNING: if rMin is smaller than impactMax, the bin size will be 2*pi,
// which will make seeding very slow!
Expand All @@ -42,12 +38,12 @@ struct seedfinder_config {
// lower cutoff for seeds in MeV
float minPt = 500.f * unit<float>::MeV;
// cot of maximum theta angle
// equivalent to 2.7 eta (pseudorapidity)
float cotThetaMax = 7.40627f;
// equivalent to 4 eta (pseudorapidity)
float cotThetaMax = 27.2845f;
// minimum distance in mm in r between two measurements within one seed
float deltaRMin = 1 * unit<float>::mm;
float deltaRMin = 20 * unit<float>::mm;
// maximum distance in mm in r between two measurements within one seed
float deltaRMax = 60 * unit<float>::mm;
float deltaRMax = 280 * unit<float>::mm;

// FIXME: this is not used yet
// float upperPtResolutionPerSeed = 20* Acts::GeV;
Expand All @@ -61,12 +57,12 @@ struct seedfinder_config {
// impact parameter in mm
float impactMax = 10. * unit<float>::mm;
// how many sigmas of scattering angle should be considered?
float sigmaScattering = 1.0;
float sigmaScattering = 3.0;
// Upper pt limit for scattering calculation
float maxPtScattering = 10 * unit<float>::GeV;

// for how many seeds can one SpacePoint be the middle SpacePoint?
int maxSeedsPerSpM = 20;
int maxSeedsPerSpM = 10;

float bFieldInZ = 1.99724f * unit<float>::T;
// location of beam in x,y plane.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ class finding_performance_writer {
{"Num", plot_helpers::binning("N", 30, -0.5f, 29.5f)}};

/// Cut values
scalar pT_cut = 0.1f * traccc::unit<scalar>::GeV;
scalar pT_cut = 0.5f * traccc::unit<scalar>::GeV;
scalar z_min = -500.f * traccc::unit<scalar>::mm;
scalar z_max = 500.f * traccc::unit<scalar>::mm;
scalar r_max = 200.f * traccc::unit<scalar>::mm;
};

/// Construct from configuration and log level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ class seeding_performance_writer {
{"Num", plot_helpers::binning("N", 30, -0.5f, 29.5f)}};

/// Cut values
scalar pT_cut = 1.f * traccc::unit<scalar>::GeV;
scalar pT_cut = 0.5f * traccc::unit<scalar>::GeV;
scalar z_min = -500.f * traccc::unit<scalar>::mm;
scalar z_max = 500.f * traccc::unit<scalar>::mm;
scalar r_max = 200.f * traccc::unit<scalar>::mm;
};

/// Construct from configuration and log level.
Expand Down
4 changes: 3 additions & 1 deletion performance/src/efficiency/finding_performance_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ void finding_performance_writer::write_common(
for (auto const& [pid, ptc] : evt_map.ptc_map) {

// Count only charged particles which satisfy pT_cut
if (ptc.charge == 0 || getter::perp(ptc.momentum) < m_cfg.pT_cut) {
if (ptc.charge == 0 || getter::perp(ptc.momentum) < m_cfg.pT_cut ||
ptc.vertex[2] < m_cfg.z_min || ptc.vertex[2] > m_cfg.z_max ||
getter::perp(ptc.vertex) > m_cfg.r_max) {
continue;
}

Expand Down
8 changes: 6 additions & 2 deletions performance/src/efficiency/seeding_performance_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ void seeding_performance_writer::write(
for (auto const& [pid, ptc] : evt_map.ptc_map) {

// Count only charged particles which satisfiy pT_cut
if (ptc.charge == 0 || getter::perp(ptc.momentum) < m_cfg.pT_cut) {
if (ptc.charge == 0 || getter::perp(ptc.momentum) < m_cfg.pT_cut ||
ptc.vertex[2] < m_cfg.z_min || ptc.vertex[2] > m_cfg.z_max ||
getter::perp(ptc.vertex) > m_cfg.r_max) {
continue;
}

Expand Down Expand Up @@ -128,7 +130,9 @@ void seeding_performance_writer::write(
for (auto const& [pid, ptc] : evt_map.ptc_map) {

// Count only charged particles which satisfiy pT_cut
if (ptc.charge == 0 || getter::perp(ptc.momentum) < m_cfg.pT_cut) {
if (ptc.charge == 0 || getter::perp(ptc.momentum) < m_cfg.pT_cut ||
ptc.vertex[2] < m_cfg.z_min || ptc.vertex[2] > m_cfg.z_max ||
getter::perp(ptc.vertex) > m_cfg.r_max) {
continue;
}

Expand Down
7 changes: 7 additions & 0 deletions tests/cpu/compare_with_acts_seeding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ TEST_P(CompareWithActsSeedingTests, Run) {

// Seeding Config
traccc::seedfinder_config traccc_config;
traccc_config.zMin = -1186.f * traccc::unit<float>::mm;
traccc_config.zMax = 1186.f * traccc::unit<float>::mm;
traccc_config.cotThetaMax = 7.40627f;
traccc_config.deltaRMin = 1.f * traccc::unit<float>::mm;
traccc_config.deltaRMax = 60.f * traccc::unit<float>::mm;
traccc_config.sigmaScattering = 1.0f;

traccc::spacepoint_grid_config grid_config(traccc_config);

// Declare algorithms
Expand Down
Loading