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

Simulation Tweaks, main branch (2025.01.08.) #809

Merged
merged 1 commit into from
Jan 8, 2025
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
4 changes: 2 additions & 2 deletions simulation/include/traccc/simulation/measurement_smearer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2023 CERN for the benefit of the ACTS project
* (c) 2023-2025 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand Down Expand Up @@ -35,7 +35,7 @@ struct measurement_smearer {
const scalar_type stddev_local1)
: stddev({stddev_local0, stddev_local1}) {}

measurement_smearer(measurement_smearer& smearer)
measurement_smearer(const measurement_smearer& smearer)
: stddev(smearer.stddev), generator(smearer.generator) {}

void set_seed(const uint_fast64_t sd) { generator.seed(sd); }
Expand Down
33 changes: 22 additions & 11 deletions simulation/include/traccc/simulation/smearing_writer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** Detray library, part of the ACTS project (R&D line)
*
* (c) 2023-2024 CERN for the benefit of the ACTS project
* (c) 2023-2025 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/
Expand All @@ -26,6 +26,10 @@
#include <dfe/dfe_io_dsv.hpp>
#include <dfe/dfe_namedtuple.hpp>

// System include(s).
#include <filesystem>
#include <string>

namespace traccc {

template <typename smearer_t>
Expand All @@ -45,18 +49,25 @@ struct smearing_writer : detray::actor {
};

struct state {
state(std::size_t event_id, config&& writer_cfg,
state(std::size_t event_id, const config& writer_cfg,
const std::string directory)
: m_particle_writer(directory +
traccc::io::get_event_filename(
event_id, "-particles_initial.csv")),
m_hit_writer(directory + traccc::io::get_event_filename(
event_id, "-hits.csv")),
m_meas_writer(directory + traccc::io::get_event_filename(
event_id, "-measurements.csv")),
: m_particle_writer((std::filesystem::path{directory} /
traccc::io::get_event_filename(
event_id, "-particles_initial.csv"))
.native()),
m_hit_writer(
(std::filesystem::path{directory} /
traccc::io::get_event_filename(event_id, "-hits.csv"))
.native()),
m_meas_writer((std::filesystem::path{directory} /
traccc::io::get_event_filename(
event_id, "-measurements.csv"))
.native()),
m_measurement_hit_id_writer(
directory + traccc::io::get_event_filename(
event_id, "-measurement-simhit-map.csv")),
(std::filesystem::path{directory} /
traccc::io::get_event_filename(
event_id, "-measurement-simhit-map.csv"))
.native()),
m_meas_smearer(writer_cfg.smearer) {}

uint64_t particle_id = 0u;
Expand Down
Loading