diff --git a/neuland/application/R3BNeulandSimApp.cxx b/neuland/application/R3BNeulandSimApp.cxx index b22ad4e5b..a5d94d42a 100644 --- a/neuland/application/R3BNeulandSimApp.cxx +++ b/neuland/application/R3BNeulandSimApp.cxx @@ -58,12 +58,7 @@ namespace R3B::Neuland { if (options.type == "muon") { - return create_muon_generator(*random_gen_, - options_pos.num_of_dp, - options.energy, - options_pos.location.x, - options_pos.location.y, - options_pos.location.z); + return create_muon_generator(*random_gen_, options_pos.num_of_dp, options.energy, options_pos.location); } if (options.type == "box") { diff --git a/neuland/application/R3BNeulandSimApp.h b/neuland/application/R3BNeulandSimApp.h index d89569f1f..cdf748b4b 100644 --- a/neuland/application/R3BNeulandSimApp.h +++ b/neuland/application/R3BNeulandSimApp.h @@ -11,12 +11,6 @@ namespace R3B::Neuland constexpr auto DEFAULT_NEULAND_Z_POS = 1650.; // cm constexpr auto DEFAULT_NEULAND_ENERGY = 0.6; // GeV - struct XYZCoordinate - { - double x{}; - double y{}; - double z{}; - }; class SimulationApplication : public Application { diff --git a/neuland/shared/R3BNeulandCommon.h b/neuland/shared/R3BNeulandCommon.h index 0ea09623e..fda3a01d4 100644 --- a/neuland/shared/R3BNeulandCommon.h +++ b/neuland/shared/R3BNeulandCommon.h @@ -124,4 +124,11 @@ namespace R3B::Neuland // NeuLAND TPAT: constexpr auto NeulandOnSpillTpatPos = 0U; // 0 based + + struct XYZCoordinate + { + double x{}; + double y{}; + double z{}; + }; } // namespace R3B::Neuland diff --git a/neuland/simulation/generator/R3BNeulandGenerators.h b/neuland/simulation/generator/R3BNeulandGenerators.h index 2d4e977ad..c7352c99e 100644 --- a/neuland/simulation/generator/R3BNeulandGenerators.h +++ b/neuland/simulation/generator/R3BNeulandGenerators.h @@ -9,21 +9,16 @@ // NOTE: what's the purpose of this file? Just function definitions? -inline auto create_muon_generator(TRandom3& random_gen, - int num_dp, - double energy, - double x_pos, - double y_pos, - double z_pos) +inline auto create_muon_generator(TRandom3& random_gen, int num_dp, double energy,const R3B::Neuland::XYZCoordinate& pos) { constexpr auto PID = 2112; auto detector_box_size = ::R3B::Neuland::DetectorBoxSize{}; - detector_box_size.xmin = x_pos - R3B::Neuland::BarLength / 2; - detector_box_size.xmax = x_pos + R3B::Neuland::BarLength / 2; - detector_box_size.ymin = y_pos - R3B::Neuland::BarLength / 2; - detector_box_size.ymax = y_pos + R3B::Neuland::BarLength / 2; - detector_box_size.zmin = z_pos - (R3B::Neuland::BarSize_Z * num_dp); - detector_box_size.zmax = z_pos + (R3B::Neuland::BarSize_Z * num_dp); + detector_box_size.xmin = pos.x - R3B::Neuland::BarLength / 2; + detector_box_size.xmax = pos.x + R3B::Neuland::BarLength / 2; + detector_box_size.ymin = pos.y - R3B::Neuland::BarLength / 2; + detector_box_size.ymax = pos.y + R3B::Neuland::BarLength / 2; + detector_box_size.zmin = pos.z - (R3B::Neuland::BarSize_Z * num_dp); + detector_box_size.zmax = pos.z + (R3B::Neuland::BarSize_Z * num_dp); auto angle_dist = R3B::Neuland::AngleDist{}; auto energy_dist = R3B::Neuland::EnergyDist{};