Skip to content

Commit

Permalink
coordinates in gen improved
Browse files Browse the repository at this point in the history
  • Loading branch information
P-Ulrich committed Jan 29, 2025
1 parent 2ecafad commit 12c281c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 24 deletions.
7 changes: 1 addition & 6 deletions neuland/application/R3BNeulandSimApp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{
Expand Down
6 changes: 0 additions & 6 deletions neuland/application/R3BNeulandSimApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
7 changes: 7 additions & 0 deletions neuland/shared/R3BNeulandCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 7 additions & 12 deletions neuland/simulation/generator/R3BNeulandGenerators.h
Original file line number Diff line number Diff line change
Expand Up @@ -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{};
Expand Down

0 comments on commit 12c281c

Please sign in to comment.