Skip to content

Commit

Permalink
Merge branch 'main' into use-surface-link
Browse files Browse the repository at this point in the history
  • Loading branch information
beomki-yeo authored Oct 11, 2024
2 parents 1e927f7 + bc55abf commit 0d2f584
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 28 deletions.
4 changes: 2 additions & 2 deletions core/include/traccc/fitting/kalman_filter/kalman_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ struct kalman_actor : detray::actor {
// Change the charge of hypothesized particles when the sign of qop
// is changed (This rarely happens when qop is set with a poor seed
// resolution)
detail::correct_particle_hypothesis(stepping._ptc,
trk_state.filtered());
propagation.set_particle(detail::correct_particle_hypothesis(
stepping._ptc, propagation._stepping._bound_params));

// Update iterator
actor_state.next();
Expand Down
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,11 @@ 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;
scalar matching_ratio = 0.5f;
};

/// Construct from configuration and log level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ 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;
scalar matching_ratio = 0.5f;
};

/// Construct from configuration and log level.
Expand Down
18 changes: 11 additions & 7 deletions performance/src/efficiency/finding_performance_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,16 @@ void finding_performance_writer::write_common(
std::vector<particle_hit_count> particle_hit_counts =
identify_contributing_particles(measurements, evt_map.meas_ptc_map);

if (particle_hit_counts.size() == 1) {
auto pid = particle_hit_counts.at(0).ptc.particle_id;
// Consider it being matched if hit counts is larger than the half
// of the number of measurements
assert(measurements.size() > 0u);
if (particle_hit_counts.at(0).hit_counts / measurements.size() >
m_cfg.matching_ratio) {
const auto pid = particle_hit_counts.at(0).ptc.particle_id;
match_counter[pid]++;
}

if (particle_hit_counts.size() > 1) {
} else {
for (particle_hit_count const& phc : particle_hit_counts) {
auto pid = phc.ptc.particle_id;
const auto pid = phc.ptc.particle_id;
fake_counter[pid]++;
}
}
Expand All @@ -187,7 +189,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
16 changes: 11 additions & 5 deletions performance/src/efficiency/seeding_performance_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ void seeding_performance_writer::write(
seed_collection_types::const_device seeds(seeds_view);
for (const seed& sd : seeds) {

const auto measurements = sd.get_measurements(spacepoints_view);

// Check which particle matches this seed.
std::vector<particle_hit_count> particle_hit_counts =
identify_contributing_particles(
sd.get_measurements(spacepoints_view), evt_map.meas_ptc_map);
identify_contributing_particles(measurements, evt_map.meas_ptc_map);

if (particle_hit_counts.size() == 1) {
if (particle_hit_counts.at(0).hit_counts / measurements.size() >
m_cfg.matching_ratio) {
auto pid = particle_hit_counts.at(0).ptc.particle_id;
match_counter[pid]++;
}
Expand All @@ -84,7 +86,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 +132,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

0 comments on commit 0d2f584

Please sign in to comment.