From 6f0824cfe1d082fbad506a919b4a4b15871ec42f Mon Sep 17 00:00:00 2001 From: Alex Jentsch <ajentsch@bnl.gov> Date: Fri, 10 Sep 2021 15:57:07 +0000 Subject: [PATCH] Change units to mm, and put in detector offset to center the coordinates. --- benchmarks/far_forward/scripts/gen_far_forward_protons.cxx | 4 ++-- benchmarks/far_forward/scripts/hits_far_forward_protons.cxx | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/benchmarks/far_forward/scripts/gen_far_forward_protons.cxx b/benchmarks/far_forward/scripts/gen_far_forward_protons.cxx index 3a8cbc21..b6d3df26 100644 --- a/benchmarks/far_forward/scripts/gen_far_forward_protons.cxx +++ b/benchmarks/far_forward/scripts/gen_far_forward_protons.cxx @@ -21,8 +21,8 @@ void gen_far_forward_protons(int n_events = 100, double minMomentum = 270.0; //GeV double maxMomentum = 275.0; //GeV - double cos_theta_min = std::cos(0.0*(M_PI/180.0)); //we need MRAD for the units - syntax is degrees*Pi/180 - double cos_theta_max = std::cos(0.2864789*(M_PI/180.0)); //1.15 degrees = 20mrad FF region is 0.0 to 20.0 mrad + double cos_theta_min = std::cos(0.0); //we need MRAD for the units - syntax is degrees*Pi/180 + double cos_theta_max = std::cos(0.005); //1.15 degrees = 20mrad FF region is 0.0 to 20.0 mrad WriterAscii hepmc_output(out_fname); int events_parsed = 0; diff --git a/benchmarks/far_forward/scripts/hits_far_forward_protons.cxx b/benchmarks/far_forward/scripts/hits_far_forward_protons.cxx index e4d6ff45..dad7a185 100644 --- a/benchmarks/far_forward/scripts/hits_far_forward_protons.cxx +++ b/benchmarks/far_forward/scripts/hits_far_forward_protons.cxx @@ -19,6 +19,8 @@ R__LOAD_LIBRARY(libDD4pod.so) using ROOT::RDataFrame; using namespace ROOT::VecOps; +double local_x_offset = -833.3878326; + auto p_track = [](std::vector<eic::TrackParametersData> const& in) { std::vector<double> result; @@ -93,7 +95,7 @@ auto local_position = [](const std::vector<dd4pod::TrackerHitData>& hits) { //auto pos1 = cellid_converter.position(h.cellID); //result.push_back({pos0.x / 10.0 - pos1.x(), pos0.y / 10.0 - pos1.y()}); - result.push_back({pos0.x , pos0.y}); + result.push_back({pos0.x - local_x_offset, pos0.y}); } return result; }; @@ -146,7 +148,7 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.root") .Define("y_pos", y_pos, {"xy_hit_pos"}) ; - auto h_local_pos = df0.Histo2D({"h_local_pos", ";x [cm]; y [cm] ", 100, -1000.0, -700.0, 100, -8.0, 8.0}, "x_pos", "y_pos"); + auto h_local_pos = df0.Histo2D({"h_local_pos", ";x [mm]; y [mm] ", 100, -150.0, 150.0, 100, -100.0, 100.0}, "x_pos", "y_pos"); -- GitLab