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

Fix a bug that default material and grid json input did not work #484

Merged
merged 2 commits into from
Nov 15, 2023
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
5 changes: 3 additions & 2 deletions examples/options/src/options/detector_input_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ traccc::detector_input_options::detector_input_options(
po::options_description& desc) {
desc.add_options()("detector_file", po::value<std::string>()->required(),
"specify detector file");
desc.add_options()("material_file", po::value<std::string>(),
desc.add_options()("material_file",
po::value<std::string>()->default_value(""),
"specify material file");
desc.add_options()("grid_file", po::value<std::string>(),
desc.add_options()("grid_file", po::value<std::string>()->default_value(""),
"specify surface grid file");
}

Expand Down
12 changes: 8 additions & 4 deletions examples/run/cpu/seeding_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ int seq_run(const traccc::seeding_input_config& /*i_cfg*/,

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);

reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}
auto [host_det, names] =
detray::io::read_detector<host_detector_type>(host_mr, reader_cfg);

Expand Down
12 changes: 8 additions & 4 deletions examples/run/cpu/truth_finding_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ int seq_run(const traccc::finding_input_config& i_cfg,

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);

reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}
const auto [host_det, names] =
detray::io::read_detector<host_detector_type>(host_mr, reader_cfg);

Expand Down
12 changes: 8 additions & 4 deletions examples/run/cpu/truth_fitting_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@ int main(int argc, char* argv[]) {

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);

reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}
const auto [host_det, names] =
detray::io::read_detector<host_detector_type>(host_mr, reader_cfg);

Expand Down
12 changes: 8 additions & 4 deletions examples/run/cuda/seeding_example_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,14 @@ int seq_run(const traccc::seeding_input_config& /*i_cfg*/,

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);

reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}
auto [host_det, names] =
detray::io::read_detector<host_detector_type>(mng_mr, reader_cfg);

Expand Down
12 changes: 8 additions & 4 deletions examples/run/cuda/truth_finding_example_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,14 @@ int seq_run(const traccc::finding_input_config& i_cfg,

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);

reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}
auto [host_det, names] =
detray::io::read_detector<host_detector_type>(mng_mr, reader_cfg);

Expand Down
12 changes: 8 additions & 4 deletions examples/run/cuda/truth_fitting_example_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ int main(int argc, char* argv[]) {

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);

reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}
auto [host_det, names] =
detray::io::read_detector<host_detector_type>(mng_mr, reader_cfg);

Expand Down
12 changes: 8 additions & 4 deletions examples/run/sycl/seeding_example_sycl.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,14 @@ int seq_run(const traccc::seeding_input_config& /*i_cfg*/,

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);

reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}
auto [host_det, names] =
detray::io::read_detector<host_detector_type>(host_mr, reader_cfg);

Expand Down
11 changes: 8 additions & 3 deletions examples/simulation/simulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,14 @@ int main(int argc, char* argv[]) {

// Read the detector
detray::io::detector_reader_config reader_cfg{};
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file)
.add_file(traccc::io::data_directory() + det_opts.material_file)
.add_file(traccc::io::data_directory() + det_opts.grid_file);
reader_cfg.add_file(traccc::io::data_directory() + det_opts.detector_file);
if (!det_opts.material_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() +
det_opts.material_file);
}
if (!det_opts.grid_file.empty()) {
reader_cfg.add_file(traccc::io::data_directory() + det_opts.grid_file);
}

// Memory resource used by the EDM.
vecmem::host_memory_resource host_mr;
Expand Down
2 changes: 1 addition & 1 deletion tests/common/tests/kalman_fitting_telescope_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class KalmanFittingTelescopeTests : public KalmanFittingTests {
}

protected:
virtual void SetUp() override {
static void SetUpTestCase() {
vecmem::host_memory_resource host_mr;

detray::tel_det_config<> tel_cfg{rectangle};
Expand Down
2 changes: 1 addition & 1 deletion tests/common/tests/kalman_fitting_wire_chamber_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class KalmanFittingWireChamberTests : public KalmanFittingTests {
}

protected:
virtual void SetUp() override {
static void SetUpTestCase() {
vecmem::host_memory_resource host_mr;

detray::wire_chamber_config wire_chamber_cfg;
Expand Down
Loading