diff --git a/src/celeritas/CMakeLists.txt b/src/celeritas/CMakeLists.txt index 9b3218a694..3882e3de8f 100644 --- a/src/celeritas/CMakeLists.txt +++ b/src/celeritas/CMakeLists.txt @@ -277,6 +277,7 @@ celeritas_polysource(optical/detail/CerenkovGeneratorAction) celeritas_polysource(optical/detail/CerenkovOffloadAction) celeritas_polysource(optical/detail/OpticalGenAlgorithms) celeritas_polysource(optical/detail/OffloadGatherAction) +celeritas_polysource(optical/detail/ScintGeneratorAction) celeritas_polysource(optical/detail/ScintOffloadAction) celeritas_polysource(phys/detail/DiscreteSelectAction) celeritas_polysource(phys/detail/PreStepAction) diff --git a/src/celeritas/optical/OpticalCollector.cc b/src/celeritas/optical/OpticalCollector.cc index 17c7976d25..d7c6a36716 100644 --- a/src/celeritas/optical/OpticalCollector.cc +++ b/src/celeritas/optical/OpticalCollector.cc @@ -24,6 +24,7 @@ #include "detail/OffloadGatherAction.hh" #include "detail/OffloadParams.hh" #include "detail/OpticalLaunchAction.hh" +#include "detail/ScintGeneratorAction.hh" #include "detail/ScintOffloadAction.hh" namespace celeritas @@ -70,9 +71,7 @@ OpticalCollector::OpticalCollector(CoreParams const& core, Input&& inp) { // Action to generate scintillation optical distributions scint_action_ = std::make_shared( - actions.next_id(), - offload_params_->aux_id(), - std::move(inp.scintillation)); + actions.next_id(), offload_params_->aux_id(), inp.scintillation); actions.insert(scint_action_); } @@ -92,6 +91,20 @@ OpticalCollector::OpticalCollector(CoreParams const& core, Input&& inp) actions.insert(cerenkov_gen_action_); } + if (setup.scintillation) + { + // Action to generate scintillation primaries + scint_gen_action_ = std::make_shared( + actions.next_id(), + offload_params_->aux_id(), + // TODO: Hack: generator action must be before launch action + // but needs optical state aux ID + core.aux_reg()->next_id(), + std::move(inp.scintillation), + inp.auto_flush); + actions.insert(scint_gen_action_); + } + // Create launch action with optical params+state and access to gen data launch_action_ = detail::OpticalLaunchAction::make_and_insert( core, inp.material, offload_params_, inp.primary_capacity); @@ -105,6 +118,9 @@ OpticalCollector::OpticalCollector(CoreParams const& core, Input&& inp) CELER_ENSURE(!cerenkov_gen_action_ || launch_action_->action_id() > cerenkov_gen_action_->action_id()); + CELER_ENSURE(!scint_gen_action_ + || launch_action_->action_id() + > scint_gen_action_->action_id()); } //---------------------------------------------------------------------------// diff --git a/src/celeritas/optical/OpticalCollector.hh b/src/celeritas/optical/OpticalCollector.hh index 8da24701f1..3bdd2ee2f6 100644 --- a/src/celeritas/optical/OpticalCollector.hh +++ b/src/celeritas/optical/OpticalCollector.hh @@ -35,6 +35,7 @@ class OffloadGatherAction; class OpticalLaunchAction; class OffloadParams; class ScintOffloadAction; +class ScintGeneratorAction; } // namespace detail //---------------------------------------------------------------------------// @@ -111,6 +112,7 @@ class OpticalCollector using SPGatherAction = std::shared_ptr; using SPCerenkovGenAction = std::shared_ptr; + using SPScintGenAction = std::shared_ptr; using SPLaunchAction = std::shared_ptr; //// DATA //// @@ -121,6 +123,7 @@ class OpticalCollector SPCerenkovAction cerenkov_action_; SPScintAction scint_action_; SPCerenkovGenAction cerenkov_gen_action_; + SPScintGenAction scint_gen_action_; SPLaunchAction launch_action_; // TODO: tracking loop launch action diff --git a/src/celeritas/optical/ScintillationGenerator.hh b/src/celeritas/optical/ScintillationGenerator.hh index b63e66f286..a85f606482 100644 --- a/src/celeritas/optical/ScintillationGenerator.hh +++ b/src/celeritas/optical/ScintillationGenerator.hh @@ -59,8 +59,8 @@ class ScintillationGenerator public: // Construct from scintillation data and distribution parameters inline CELER_FUNCTION - ScintillationGenerator(GeneratorDistributionData const& dist, - NativeCRef const& shared); + ScintillationGenerator(NativeCRef const& shared, + GeneratorDistributionData const& dist); // Sample a single photon from the distribution template @@ -94,8 +94,8 @@ class ScintillationGenerator */ CELER_FUNCTION ScintillationGenerator::ScintillationGenerator( - GeneratorDistributionData const& dist, - NativeCRef const& shared) + NativeCRef const& shared, + GeneratorDistributionData const& dist) : dist_(dist) , shared_(shared) , sample_cost_(-1, 1) diff --git a/src/celeritas/optical/detail/ScintGeneratorAction.cc b/src/celeritas/optical/detail/ScintGeneratorAction.cc new file mode 100644 index 0000000000..cc7a699fad --- /dev/null +++ b/src/celeritas/optical/detail/ScintGeneratorAction.cc @@ -0,0 +1,161 @@ +//----------------------------------*-C++-*----------------------------------// +// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. +// See the top-level COPYRIGHT file for details. +// SPDX-License-Identifier: (Apache-2.0 OR MIT) +//---------------------------------------------------------------------------// +//! \file celeritas/optical/detail/ScintGeneratorAction.cc +//---------------------------------------------------------------------------// +#include "ScintGeneratorAction.hh" + +#include + +#include "corecel/Assert.hh" +#include "corecel/data/AuxStateVec.hh" +#include "celeritas/global/ActionLauncher.hh" +#include "celeritas/global/CoreParams.hh" +#include "celeritas/global/CoreState.hh" +#include "celeritas/global/TrackExecutor.hh" +#include "celeritas/optical/CoreParams.hh" +#include "celeritas/optical/CoreState.hh" +#include "celeritas/optical/ScintillationParams.hh" +#include "celeritas/optical/TrackData.hh" + +#include "OffloadParams.hh" +#include "OpticalGenAlgorithms.hh" +#include "ScintGeneratorExecutor.hh" + +namespace celeritas +{ +namespace detail +{ +//---------------------------------------------------------------------------// +/*! + * Construct with action ID, data IDs, and optical properties. + */ +ScintGeneratorAction::ScintGeneratorAction(ActionId id, + AuxId offload_id, + AuxId optical_id, + SPConstScintillation scintillation, + size_type auto_flush) + : id_(id) + , offload_id_{offload_id} + , optical_id_{optical_id} + , scintillation_(std::move(scintillation)) + , auto_flush_(auto_flush) +{ + CELER_EXPECT(id_); + CELER_EXPECT(offload_id_); + CELER_EXPECT(optical_id_); + CELER_EXPECT(scintillation_); + CELER_EXPECT(auto_flush_ > 0); +} + +//---------------------------------------------------------------------------// +/*! + * Descriptive name of the action. + */ +std::string_view ScintGeneratorAction::description() const +{ + return "generate scintillation photons from optical distribution data"; +} + +//---------------------------------------------------------------------------// +/*! + * Execute the action with host data. + */ +void ScintGeneratorAction::step(CoreParams const& params, + CoreStateHost& state) const +{ + this->step_impl(params, state); +} + +//---------------------------------------------------------------------------// +/*! + * Execute the action with device data. + */ +void ScintGeneratorAction::step(CoreParams const& params, + CoreStateDevice& state) const +{ + this->step_impl(params, state); +} + +//---------------------------------------------------------------------------// +/*! + * Generate optical track initializers from scintillation distribution data. + */ +template +void ScintGeneratorAction::step_impl(CoreParams const& core_params, + CoreState& core_state) const +{ + auto& offload_state + = get>(core_state.aux(), offload_id_); + auto& optical_state + = get>(core_state.aux(), optical_id_); + + auto& num_photons = optical_state.counters().num_initializers; + auto& num_new_photons = offload_state.buffer_size.num_photons; + + if (num_photons + num_new_photons < auto_flush_) + return; + + auto initializers_size = optical_state.ref().init.initializers.size(); + CELER_VALIDATE(num_photons + num_new_photons <= initializers_size, + << "insufficient capacity (" << initializers_size + << ") for optical photon initializers (total capacity " + "requirement of " + << num_photons + num_new_photons << ")"); + + auto& offload = offload_state.store.ref(); + auto& buffer_size = offload_state.buffer_size.scintillation; + CELER_ASSERT(buffer_size > 0); + + // Calculate the cumulative sum of the number of photons in the buffered + // distributions. These values are used to determine which thread will + // generate initializers from which distribution + auto count = inclusive_scan_photons(offload.scintillation, + offload.offsets, + buffer_size, + core_state.stream_id()); + + // Generate the optical photon initializers from the distribution data + this->generate(core_params, core_state); + + num_photons += count; + num_new_photons -= count; + buffer_size = 0; +} + +//---------------------------------------------------------------------------// +/*! + * Launch a (host) kernel to generate optical photon initializers. + */ +void ScintGeneratorAction::generate(CoreParams const& core_params, + CoreStateHost& core_state) const +{ + auto& offload_state = get>( + core_state.aux(), offload_id_); + auto& optical_state = get>( + core_state.aux(), optical_id_); + + TrackExecutor execute{ + core_params.ptr(), + core_state.ptr(), + detail::ScintGeneratorExecutor{core_state.ptr(), + scintillation_->host_ref(), + offload_state.store.ref(), + optical_state.ptr(), + offload_state.buffer_size}}; + launch_action(*this, core_params, core_state, execute); +} + +//---------------------------------------------------------------------------// +#if !CELER_USE_DEVICE +void ScintGeneratorAction::generate(CoreParams const&, CoreStateDevice&) const +{ + CELER_NOT_CONFIGURED("CUDA OR HIP"); +} +#endif + +//---------------------------------------------------------------------------// +} // namespace detail +} // namespace celeritas diff --git a/src/celeritas/optical/detail/ScintGeneratorAction.cu b/src/celeritas/optical/detail/ScintGeneratorAction.cu new file mode 100644 index 0000000000..1d7fe4afeb --- /dev/null +++ b/src/celeritas/optical/detail/ScintGeneratorAction.cu @@ -0,0 +1,52 @@ +//---------------------------------*-CUDA-*----------------------------------// +// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. +// See the top-level COPYRIGHT file for details. +// SPDX-License-Identifier: (Apache-2.0 OR MIT) +//---------------------------------------------------------------------------// +//! \file celeritas/optical/detail/ScintGeneratorAction.cu +//---------------------------------------------------------------------------// +#include "ScintGeneratorAction.hh" + +#include "corecel/Assert.hh" +#include "corecel/sys/ScopedProfiling.hh" +#include "celeritas/global/ActionLauncher.device.hh" +#include "celeritas/global/TrackExecutor.hh" +#include "celeritas/optical/CoreParams.hh" +#include "celeritas/optical/CoreState.hh" +#include "celeritas/optical/ScintillationParams.hh" + +#include "OffloadParams.hh" +#include "OpticalGenAlgorithms.hh" +#include "ScintGeneratorExecutor.hh" + +namespace celeritas +{ +namespace detail +{ +//---------------------------------------------------------------------------// +/*! + * Launch a kernel to generate optical photon initializers. + */ +void ScintGeneratorAction::generate(CoreParams const& core_params, + CoreStateDevice& core_state) const +{ + auto& offload_state = get>( + core_state.aux(), offload_id_); + auto& optical_state = get>( + core_state.aux(), optical_id_); + + TrackExecutor execute{ + core_params.ptr(), + core_state.ptr(), + detail::ScintGeneratorExecutor{core_state.ptr(), + scintillation_->device_ref(), + offload_state.store.ref(), + optical_state.ptr(), + offload_state.buffer_size}}; + static ActionLauncher const launch_kernel(*this); + launch_kernel(core_state, execute); +} + +//---------------------------------------------------------------------------// +} // namespace detail +} // namespace celeritas diff --git a/src/celeritas/optical/detail/ScintGeneratorAction.hh b/src/celeritas/optical/detail/ScintGeneratorAction.hh new file mode 100644 index 0000000000..8ef453bfcc --- /dev/null +++ b/src/celeritas/optical/detail/ScintGeneratorAction.hh @@ -0,0 +1,96 @@ +//----------------------------------*-C++-*----------------------------------// +// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. +// See the top-level COPYRIGHT file for details. +// SPDX-License-Identifier: (Apache-2.0 OR MIT) +//---------------------------------------------------------------------------// +//! \file celeritas/optical/detail/ScintGeneratorAction.hh +//---------------------------------------------------------------------------// +#pragma once + +#include + +#include "corecel/Macros.hh" +#include "corecel/data/AuxInterface.hh" +#include "corecel/data/Collection.hh" +#include "celeritas/global/ActionInterface.hh" +#include "celeritas/optical/GeneratorDistributionData.hh" + +namespace celeritas +{ +namespace optical +{ +class ScintillationParams; +} // namespace optical + +namespace detail +{ +class OffloadParams; +//---------------------------------------------------------------------------// +/*! + * Generate scintillation photons from optical distribution data. + * + * This samples and buffers new optical track initializers in a reproducible + * way. Rather than let each thread generate all initializers from one + * distribution, the work is split as evenly as possible among threads: + * multiple threads may generate initializers from a single distribution. + */ +class ScintGeneratorAction final : public CoreStepActionInterface +{ + public: + //!@{ + //! \name Type aliases + using SPConstScintillation + = std::shared_ptr; + using SPOffloadParams = std::shared_ptr; + //!@} + + public: + // Construct with action ID, data IDs, and optical properties + ScintGeneratorAction(ActionId id, + AuxId offload_id, + AuxId optical_id, + SPConstScintillation scintillation, + size_type auto_flush); + + // Launch kernel with host data + void step(CoreParams const&, CoreStateHost&) const final; + + // Launch kernel with device data + void step(CoreParams const&, CoreStateDevice&) const final; + + //! ID of the model + ActionId action_id() const final { return id_; } + + //! Short name for the action + std::string_view label() const final + { + return "generate-scintillation-photons"; + } + + // Name of the action (for user output) + std::string_view description() const final; + + //! Dependency ordering of the action + StepActionOrder order() const final { return StepActionOrder::user_post; } + + private: + //// DATA //// + + ActionId id_; + AuxId offload_id_; + AuxId optical_id_; + SPConstScintillation scintillation_; + size_type auto_flush_; + + //// HELPER FUNCTIONS //// + + template + void step_impl(CoreParams const&, CoreState&) const; + + void generate(CoreParams const&, CoreStateHost&) const; + void generate(CoreParams const&, CoreStateDevice&) const; +}; + +//---------------------------------------------------------------------------// +} // namespace detail +} // namespace celeritas diff --git a/src/celeritas/optical/detail/ScintGeneratorExecutor.hh b/src/celeritas/optical/detail/ScintGeneratorExecutor.hh new file mode 100644 index 0000000000..c670808d6b --- /dev/null +++ b/src/celeritas/optical/detail/ScintGeneratorExecutor.hh @@ -0,0 +1,99 @@ +//----------------------------------*-C++-*----------------------------------// +// Copyright 2024 UT-Battelle, LLC, and other Celeritas developers. +// See the top-level COPYRIGHT file for details. +// SPDX-License-Identifier: (Apache-2.0 OR MIT) +//---------------------------------------------------------------------------// +//! \file celeritas/optical/detail/ScintGeneratorExecutor.hh +//---------------------------------------------------------------------------// +#pragma once + +#include "corecel/Macros.hh" +#include "corecel/Types.hh" +#include "corecel/math/Algorithms.hh" +#include "celeritas/global/CoreTrackView.hh" +#include "celeritas/optical/OffloadData.hh" +#include "celeritas/optical/ScintillationGenerator.hh" + +#include "OpticalUtils.hh" + +namespace celeritas +{ +namespace detail +{ +//---------------------------------------------------------------------------// +// LAUNCHER +//---------------------------------------------------------------------------// +/*! + * Generate scintillation photons from optical distribution data. + */ +struct ScintGeneratorExecutor +{ + //// DATA //// + + RefPtr state; + NativeCRef const scintillation; + NativeRef const offload_state; + RefPtr optical_state; + OffloadBufferSize size; + + //// FUNCTIONS //// + + // Generate optical track initializers + inline CELER_FUNCTION void operator()(CoreTrackView const& track) const; +}; + +//---------------------------------------------------------------------------// +// INLINE DEFINITIONS +//---------------------------------------------------------------------------// +/*! + * Generate scintillation photons from optical distribution data. + */ +CELER_FUNCTION void +ScintGeneratorExecutor::operator()(CoreTrackView const& track) const +{ + CELER_EXPECT(state); + CELER_EXPECT(scintillation); + CELER_EXPECT(offload_state); + CELER_EXPECT(optical_state); + CELER_EXPECT(size.scintillation <= offload_state.scintillation.size()); + + using DistId = ItemId; + using InitId = ItemId; + + // Get the cumulative sum of the number of photons in the distributions. + // Each bin gives the range of thread IDs that will generate from the + // corresponding distribution + auto offsets = offload_state.offsets[ItemRange( + ItemId(0), ItemId(size.scintillation))]; + + // Get the total number of initializers to generate + size_type total_work = offsets.back(); + + // Calculate the number of initializers for the thread to generate + size_type local_work = LocalWorkCalculator{ + total_work, state->size()}(track.thread_id().get()); + + auto rng = track.make_rng_engine(); + + for (auto i : range(local_work)) + { + // Calculate the index in the primary buffer this thread will write to + size_type primary_idx = i * state->size() + track.thread_id().get(); + CELER_ASSERT(primary_idx < optical_state->init.initializers.size()); + + // Find the distribution this thread will generate from + size_type dist_idx = find_distribution_index(offsets, primary_idx); + CELER_ASSERT(dist_idx < size.scintillation); + auto const& dist = offload_state.scintillation[DistId(dist_idx)]; + CELER_ASSERT(dist); + + // Generate one primary from the distribution + celeritas::optical::ScintillationGenerator generate(scintillation, + dist); + optical_state->init.initializers[InitId(primary_idx)] = generate(rng); + } +} + +//---------------------------------------------------------------------------// +} // namespace detail +} // namespace celeritas diff --git a/test/celeritas/optical/OpticalCollector.test.cc b/test/celeritas/optical/OpticalCollector.test.cc index 1fa44e33f0..d21b1611f4 100644 --- a/test/celeritas/optical/OpticalCollector.test.cc +++ b/test/celeritas/optical/OpticalCollector.test.cc @@ -120,7 +120,9 @@ class LArSphereOffloadTest : public LArSphereBase VecPrimary make_primaries(size_type count); template - RunResult run(size_type num_tracks, size_type num_steps); + RunResult run(size_type num_primaries, + size_type num_track_slots, + size_type num_steps); protected: using SizeId = ItemId; @@ -130,6 +132,7 @@ class LArSphereOffloadTest : public LArSphereBase // Optical collector options bool use_scintillation_{true}; bool use_cerenkov_{true}; + size_type buffer_capacity_{256}; size_type primary_capacity_{8192}; size_type auto_flush_{4096}; @@ -216,7 +219,7 @@ void LArSphereOffloadTest::build_optical_collector() { inp.scintillation = this->scintillation(); } - inp.buffer_capacity = 256; + inp.buffer_capacity = buffer_capacity_; inp.primary_capacity = primary_capacity_; inp.auto_flush = auto_flush_; @@ -260,7 +263,8 @@ auto LArSphereOffloadTest::make_primaries(size_type count) -> VecPrimary * Run a number of tracks. */ template -auto LArSphereOffloadTest::run(size_type num_tracks, +auto LArSphereOffloadTest::run(size_type num_primaries, + size_type num_track_slots, size_type num_steps) -> RunResult { using DistRef @@ -270,7 +274,7 @@ auto LArSphereOffloadTest::run(size_type num_tracks, StepperInput step_inp; step_inp.params = this->core(); step_inp.stream_id = StreamId{0}; - step_inp.num_track_slots = num_tracks; + step_inp.num_track_slots = num_track_slots; Stepper step(step_inp); LogContextException log_context{this->output_reg().get()}; @@ -281,7 +285,7 @@ auto LArSphereOffloadTest::run(size_type num_tracks, RunResult result; // Initial step - auto primaries = this->make_primaries(num_tracks); + auto primaries = this->make_primaries(num_primaries); StepperResult count; CELER_TRY_HANDLE(count = step(make_span(primaries)), log_context); @@ -336,9 +340,9 @@ auto LArSphereOffloadTest::run(size_type num_tracks, //---------------------------------------------------------------------------// template LArSphereOffloadTest::RunResult - LArSphereOffloadTest::run(size_type, size_type); + LArSphereOffloadTest::run(size_type, size_type, size_type); template LArSphereOffloadTest::RunResult - LArSphereOffloadTest::run(size_type, size_type); + LArSphereOffloadTest::run(size_type, size_type, size_type); //---------------------------------------------------------------------------// // TESTS @@ -349,7 +353,7 @@ TEST_F(LArSphereOffloadTest, host_distributions) auto_flush_ = size_type(-1); this->build_optical_collector(); - auto result = this->run(4, 64); + auto result = this->run(4, 4, 64); EXPECT_EQ(result.cerenkov.total_num_photons + result.scintillation.total_num_photons, @@ -409,7 +413,7 @@ TEST_F(LArSphereOffloadTest, TEST_IF_CELER_DEVICE(device_distributions)) auto_flush_ = size_type(-1); this->build_optical_collector(); - auto result = this->run(8, 32); + auto result = this->run(8, 8, 32); EXPECT_EQ(result.cerenkov.total_num_photons + result.scintillation.total_num_photons, @@ -485,7 +489,7 @@ TEST_F(LArSphereOffloadTest, cerenkov_distributiona) auto_flush_ = size_type(-1); this->build_optical_collector(); - auto result = this->run(4, 16); + auto result = this->run(4, 4, 16); EXPECT_EQ(0, result.scintillation.total_num_photons); EXPECT_EQ(0, result.scintillation.num_photons.size()); @@ -508,7 +512,7 @@ TEST_F(LArSphereOffloadTest, scintillation_distributions) auto_flush_ = size_type(-1); this->build_optical_collector(); - auto result = this->run(4, 16); + auto result = this->run(4, 4, 16); EXPECT_EQ(0, result.cerenkov.total_num_photons); EXPECT_EQ(0, result.cerenkov.num_photons.size()); @@ -527,37 +531,28 @@ TEST_F(LArSphereOffloadTest, scintillation_distributions) TEST_F(LArSphereOffloadTest, host_generate) { - use_scintillation_ = false; - primary_capacity_ = 32768; + buffer_capacity_ = 1024; + primary_capacity_ = 524288; auto_flush_ = 16384; this->build_optical_collector(); - auto result = this->run(4, 16); - - if (CELERITAS_REAL_TYPE == CELERITAS_REAL_TYPE_DOUBLE) - { - EXPECT_EQ(7, result.optical_launch_step); - } - else - { - EXPECT_EQ(8, result.optical_launch_step); - } + auto result = this->run(4, 512, 16); + EXPECT_EQ(2, result.optical_launch_step); EXPECT_EQ(0, result.scintillation.total_num_photons); EXPECT_EQ(0, result.cerenkov.total_num_photons); } TEST_F(LArSphereOffloadTest, TEST_IF_CELER_DEVICE(device_generate)) { - use_scintillation_ = false; - primary_capacity_ = 32768; - auto_flush_ = 16384; + buffer_capacity_ = 2048; + primary_capacity_ = 524288; + auto_flush_ = 262144; this->build_optical_collector(); - auto result = this->run(32, 4); - - EXPECT_EQ(2, result.optical_launch_step); + auto result = this->run(1, 1024, 16); + EXPECT_EQ(7, result.optical_launch_step); EXPECT_EQ(0, result.scintillation.total_num_photons); EXPECT_EQ(0, result.cerenkov.total_num_photons); } diff --git a/test/celeritas/optical/Scintillation.test.cc b/test/celeritas/optical/Scintillation.test.cc index 833b0ae2b9..8793f72c9d 100644 --- a/test/celeritas/optical/Scintillation.test.cc +++ b/test/celeritas/optical/Scintillation.test.cc @@ -277,7 +277,7 @@ TEST_F(MaterialScintillationTest, basic) - generated_dist.points[StepPoint::pre].pos); // Create the generator and output vectors - ScintillationGenerator generate_photon(generated_dist, params->host_ref()); + ScintillationGenerator generate_photon(params->host_ref(), generated_dist); std::vector energy; std::vector time; std::vector cos_theta; @@ -403,7 +403,7 @@ TEST_F(MaterialScintillationTest, stress_test) } // Create the generator - ScintillationGenerator generate_photon(result, data); + ScintillationGenerator generate_photon(data, result); // Check results real_type avg_lambda{0};