From 66c654a3be38d96e68fe8fd8f6a2482d6232c982 Mon Sep 17 00:00:00 2001 From: ascarabo Date: Mon, 9 Jun 2025 16:29:25 +0200 Subject: [PATCH] add PVz histograms Fixed formatting patch generated by https://gitlab.cern.ch/lhcb/Allen/-/jobs/57210069 fix --- device/PV/beamlinePV/include/pv_beamline_cleanup.cuh | 10 ++++++++++ device/PV/beamlinePV/src/pv_beamline_cleanup.cu | 12 ++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/device/PV/beamlinePV/include/pv_beamline_cleanup.cuh b/device/PV/beamlinePV/include/pv_beamline_cleanup.cuh index 6f58f633b35..6e03895f893 100644 --- a/device/PV/beamlinePV/include/pv_beamline_cleanup.cuh +++ b/device/PV/beamlinePV/include/pv_beamline_cleanup.cuh @@ -42,6 +42,8 @@ namespace pv_beamline_cleanup { Allen::Monitoring::Histogram<>::DeviceType, Allen::Monitoring::Histogram<>::DeviceType, Allen::Monitoring::Histogram<>::DeviceType, + Allen::Monitoring::Histogram<>::DeviceType, + Allen::Monitoring::Histogram<>::DeviceType, Allen::Monitoring::Histogram<>::DeviceType); struct pv_beamline_cleanup_t : public DeviceAlgorithm, Parameters { @@ -65,6 +67,14 @@ namespace pv_beamline_cleanup { Allen::Monitoring::Histogram<> m_histogram_pv_x {this, "pv_x", "pv_x", {1000u, -2.f, 2.f}}; Allen::Monitoring::Histogram<> m_histogram_pv_y {this, "pv_y", "pv_y", {1000u, -2.f, 2.f}}; Allen::Monitoring::Histogram<> m_histogram_pv_z {this, "pv_z", "pv_z", {2000u, -600.f, 200.f}}; + Allen::Monitoring::Histogram<> m_histogram_pv_z_only_pp {this, + "pv_z_only_pp", + "pv_z_only_pp", + {2000u, -200.f, 200.f}}; + Allen::Monitoring::Histogram<> m_histogram_pv_z_only_smog {this, + "pv_z_only_smog", + "pv_z_only_smog", + {2000u, -600.f, -200.f}}; Allen::Monitoring::Histogram<> m_histogram_n_smogpvs {this, "n_smog2_PVs", "n_smog2_PVs", {10, -0.5f, 9.5f}}; }; } // namespace pv_beamline_cleanup diff --git a/device/PV/beamlinePV/src/pv_beamline_cleanup.cu b/device/PV/beamlinePV/src/pv_beamline_cleanup.cu index 5f73f435710..828a89b8c71 100644 --- a/device/PV/beamlinePV/src/pv_beamline_cleanup.cu +++ b/device/PV/beamlinePV/src/pv_beamline_cleanup.cu @@ -37,7 +37,9 @@ void pv_beamline_cleanup::pv_beamline_cleanup_t::operator()( m_histogram_n_smogpvs.data(context), m_histogram_pv_x.data(context), m_histogram_pv_y.data(context), - m_histogram_pv_z.data(context)); + m_histogram_pv_z.data(context), + m_histogram_pv_z_only_pp.data(context), + m_histogram_pv_z_only_smog.data(context)); } __device__ void pv_beamline_cleanup::sort_pvs_by_z(PV::Vertex* final_vertices, unsigned n_vertices) @@ -80,7 +82,9 @@ __global__ void pv_beamline_cleanup::pv_beamline_cleanup( Allen::Monitoring::Histogram<>::DeviceType dev_n_smogpvs_histo, Allen::Monitoring::Histogram<>::DeviceType dev_pv_x_histo, Allen::Monitoring::Histogram<>::DeviceType dev_pv_y_histo, - Allen::Monitoring::Histogram<>::DeviceType dev_pv_z_histo) + Allen::Monitoring::Histogram<>::DeviceType dev_pv_z_histo, + Allen::Monitoring::Histogram<>::DeviceType dev_pv_z_only_pp_histo, + Allen::Monitoring::Histogram<>::DeviceType dev_pv_z_only_smog_histo) { __shared__ unsigned tmp_number_vertices[1]; @@ -121,6 +125,10 @@ __global__ void pv_beamline_cleanup::pv_beamline_cleanup( if (-200 < vertex1.position.z && vertex1.position.z < 200) { dev_pv_x_histo.increment(vertex1.position.x); dev_pv_y_histo.increment(vertex1.position.y); + dev_pv_z_only_pp_histo.increment(vertex1.position.z); + } + if (-600 < vertex1.position.z && vertex1.position.z <= -200) { + dev_pv_z_only_smog_histo.increment(vertex1.position.z); } if (vertex1.position.z < BeamlinePVConstants::Common::SMOG2_pp_separation) atomicAdd(tmp_number_SMOG_vertices, 1); -- GitLab