From 3c80f2a5bf1aed62b96a592ea60d99b474ef9baf Mon Sep 17 00:00:00 2001 From: Patrick Green Date: Wed, 16 Jul 2025 06:44:39 -0500 Subject: [PATCH 1/5] change needed for updated SemiAnalyticalModel constructor --- sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc b/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc index 786e3b59d..bd45d3d81 100644 --- a/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc +++ b/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc @@ -15,6 +15,7 @@ #include "art/Framework/Principal/Handle.h" #include "art/Framework/Principal/Run.h" #include "art/Framework/Principal/SubRun.h" +#include "art/Utilities/make_tool.h" #include "art_root_io/TFileService.h" #include "canvas/Utilities/InputTag.h" #include "canvas/Persistency/Common/Assns.h" @@ -40,6 +41,7 @@ #include "larcore/CoreUtils/ServiceUtil.h" #include "larsim/PhotonPropagation/SemiAnalyticalModel.h" +#include "larsim/PhotonPropagation/OpticalPathTools/OpticalPath.h" #include "larsim/Simulation/LArG4Parameters.h" #include "larpandora/LArPandoraInterface/LArPandoraHelper.h" @@ -104,6 +106,7 @@ class SBNDOpT0Finder : public art::EDProducer { std::unique_ptr _semi_model; fhicl::ParameterSet _vuv_params; fhicl::ParameterSet _vis_params; + std::shared_ptr _optical_path_tool; ::flashmatch::FlashMatchManager _mgr; ///< The flash matching manager std::vector _result_v; ///< Matching result will be stored here @@ -176,7 +179,8 @@ SBNDOpT0Finder::SBNDOpT0Finder(fhicl::ParameterSet const& p) _vuv_params = p.get("VUVHits"); _vis_params = p.get("VIVHits"); - _semi_model = std::make_unique(_vuv_params, _vis_params, true, false); + _optical_path_tool = std::shared_ptr(std::move(art::make_tool(p.get("OpticalPathTool")))); + _semi_model = std::make_unique(_vuv_params, _vis_params, _optical_path_tool, true, false); _opflash_producer_v = p.get>("OpFlashProducers"); _opflash_ara_producer_v = p.get>("OpFlashAraProducers"); From 03525bf17aeca7e647cf3abcd1ebd5910fffdabd Mon Sep 17 00:00:00 2001 From: Patrick Green Date: Wed, 16 Jul 2025 08:47:00 -0500 Subject: [PATCH 2/5] implementing sbnd case of optical path tool for semi-analytical model --- sbndcode/CMakeLists.txt | 1 + .../LArSoftConfigurations/PDFastSim_sbnd.fcl | 3 +++ sbndcode/OpPathTool/CMakeLists.txt | 10 +++++++ sbndcode/OpPathTool/SBNDOpticalPath.h | 27 +++++++++++++++++++ sbndcode/OpPathTool/SBNDOpticalPath_tool.cc | 4 +++ sbndcode/OpPathTool/sbndopticalpath_tool.fcl | 10 +++++++ 6 files changed, 55 insertions(+) create mode 100644 sbndcode/OpPathTool/CMakeLists.txt create mode 100644 sbndcode/OpPathTool/SBNDOpticalPath.h create mode 100644 sbndcode/OpPathTool/SBNDOpticalPath_tool.cc create mode 100644 sbndcode/OpPathTool/sbndopticalpath_tool.fcl diff --git a/sbndcode/CMakeLists.txt b/sbndcode/CMakeLists.txt index 07f557b81..bab00c846 100644 --- a/sbndcode/CMakeLists.txt +++ b/sbndcode/CMakeLists.txt @@ -16,6 +16,7 @@ add_subdirectory(OpDetSim) add_subdirectory(OpDetReco) add_subdirectory(OpDetAnalyzer) add_subdirectory(OpT0Finder) +add_subdirectory(OpPathTool) #add_subdirectory(PDS) #add_subdirectory(CosmicId) add_subdirectory(ShowerAna) diff --git a/sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl b/sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl index d9a85121c..9a29cdf9f 100644 --- a/sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl +++ b/sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl @@ -2,6 +2,7 @@ #include "PDFastSimPVS.fcl" #include "opticalsimparameterisations_sbnd.fcl" +#include "sbndopticalpath_tool.fcl" BEGIN_PROLOG @@ -19,6 +20,8 @@ sbnd_pdfastsim_par.SimulationLabel: "ionandscint:priorSCE" # independently for the TPB-delay time and the emission (fast and slow) decay times. sbnd_pdfastsim_par.ScintTimeTool.SlowDecayTime: 1300.0 +sbnd_pdfastsim_par.OpticalPathTool: @local::SBNDOpticalPath + # Direct (VUV) sbnd_pdfastsim_par.VUVTiming: @local::sbnd_vuv_timing_parameterization sbnd_pdfastsim_par.VUVHits: @local::sbnd_vuv_RS100cm_hits_parameterization diff --git a/sbndcode/OpPathTool/CMakeLists.txt b/sbndcode/OpPathTool/CMakeLists.txt new file mode 100644 index 000000000..e913e0929 --- /dev/null +++ b/sbndcode/OpPathTool/CMakeLists.txt @@ -0,0 +1,10 @@ +include (phot::OpticalPath) + +cet_build_plugin(SBNDOpticalPath phot::OpticalPath + LIBRARIES PRIVATE + larcoreobj::geo_vectors +) + +install_headers() +install_fhicl() +install_source() \ No newline at end of file diff --git a/sbndcode/OpPathTool/SBNDOpticalPath.h b/sbndcode/OpPathTool/SBNDOpticalPath.h new file mode 100644 index 000000000..85d96f477 --- /dev/null +++ b/sbndcode/OpPathTool/SBNDOpticalPath.h @@ -0,0 +1,27 @@ +// SBND optical path tool + +#ifndef SBNDOpticalPath_H +#define SBNDOpticalPath_H + +#include "art/Utilities/ToolMacros.h" +#include "larsim/PhotonPropagation/OpticalPathTools/OpticalPath.h" +#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h" + +#include + +namespace phot { + class SBNDOpticalPath : public phot::OpticalPath { + public: + explicit SBNDOpticalPath(fhicl::ParameterSet const& ps) {}; + ~SBNDOpticalPath() noexcept override = default; + + const bool isOpDetVisible(geo::Point_t const& ScintPoint, geo::Point_t const& OpDetPoint) override { + // special case for SBND + // check x coordinate has same sign or is close to zero + if ((ScintPoint.X() < 0.) != (OpDetPoint.X() < 0.)) return false; + else return true; + } + }; +} + +#endif \ No newline at end of file diff --git a/sbndcode/OpPathTool/SBNDOpticalPath_tool.cc b/sbndcode/OpPathTool/SBNDOpticalPath_tool.cc new file mode 100644 index 000000000..65686cf93 --- /dev/null +++ b/sbndcode/OpPathTool/SBNDOpticalPath_tool.cc @@ -0,0 +1,4 @@ +#include "sbndcode/OpPathTool/SBNDOpticalPath.h" +#include "art/Utilities/ToolMacros.h" + +DEFINE_ART_CLASS_TOOL(phot::SBNDOpticalPath) \ No newline at end of file diff --git a/sbndcode/OpPathTool/sbndopticalpath_tool.fcl b/sbndcode/OpPathTool/sbndopticalpath_tool.fcl new file mode 100644 index 000000000..950eda427 --- /dev/null +++ b/sbndcode/OpPathTool/sbndopticalpath_tool.fcl @@ -0,0 +1,10 @@ +// sbnd optical path tools + +BEGIN_PROLOG + +SBNDOpticalPath: +{ + tool_type: SBNDOpticalPath +} + +END_PROLOG \ No newline at end of file From 5d64c1d0c6d319fd7b2e8f5f3aafcda048421ed2 Mon Sep 17 00:00:00 2001 From: Patrick Green Date: Mon, 21 Jul 2025 07:53:15 -0500 Subject: [PATCH 3/5] clarifying comment --- sbndcode/OpPathTool/SBNDOpticalPath.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbndcode/OpPathTool/SBNDOpticalPath.h b/sbndcode/OpPathTool/SBNDOpticalPath.h index 85d96f477..8a077946d 100644 --- a/sbndcode/OpPathTool/SBNDOpticalPath.h +++ b/sbndcode/OpPathTool/SBNDOpticalPath.h @@ -17,11 +17,11 @@ namespace phot { const bool isOpDetVisible(geo::Point_t const& ScintPoint, geo::Point_t const& OpDetPoint) override { // special case for SBND - // check x coordinate has same sign or is close to zero + // check x coordinate has same sign if ((ScintPoint.X() < 0.) != (OpDetPoint.X() < 0.)) return false; else return true; } }; } -#endif \ No newline at end of file +#endif From d31ba7cdb3edac0475f215951fc58b18177f0026 Mon Sep 17 00:00:00 2001 From: Patrick Green Date: Sun, 17 Aug 2025 01:25:51 -0500 Subject: [PATCH 4/5] removing std::move call and adding larsim::OpticalPath to CMakeLists --- sbndcode/OpPathTool/CMakeLists.txt | 1 + sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sbndcode/OpPathTool/CMakeLists.txt b/sbndcode/OpPathTool/CMakeLists.txt index e913e0929..24d09a42c 100644 --- a/sbndcode/OpPathTool/CMakeLists.txt +++ b/sbndcode/OpPathTool/CMakeLists.txt @@ -2,6 +2,7 @@ include (phot::OpticalPath) cet_build_plugin(SBNDOpticalPath phot::OpticalPath LIBRARIES PRIVATE + larsim::OpticalPath larcoreobj::geo_vectors ) diff --git a/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc b/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc index bd45d3d81..c14b5cf4d 100644 --- a/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc +++ b/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc @@ -179,7 +179,7 @@ SBNDOpT0Finder::SBNDOpT0Finder(fhicl::ParameterSet const& p) _vuv_params = p.get("VUVHits"); _vis_params = p.get("VIVHits"); - _optical_path_tool = std::shared_ptr(std::move(art::make_tool(p.get("OpticalPathTool")))); + _optical_path_tool = std::shared_ptr(art::make_tool(p.get("OpticalPathTool"))); _semi_model = std::make_unique(_vuv_params, _vis_params, _optical_path_tool, true, false); _opflash_producer_v = p.get>("OpFlashProducers"); From 656c6990aebde2c27edc456655096697356b28ca Mon Sep 17 00:00:00 2001 From: Patrick Green Date: Mon, 15 Sep 2025 08:16:50 -0500 Subject: [PATCH 5/5] adding larsim::OpticalPath to OpT0Finder cmakelists --- sbndcode/OpT0Finder/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sbndcode/OpT0Finder/CMakeLists.txt b/sbndcode/OpT0Finder/CMakeLists.txt index f0790cc88..a3edf3f6b 100644 --- a/sbndcode/OpT0Finder/CMakeLists.txt +++ b/sbndcode/OpT0Finder/CMakeLists.txt @@ -12,6 +12,7 @@ set( lardataobj::AnalysisBase lardataobj::RecoBase larsim::Simulation + larsim::OpticalPath lardataobj::Simulation larpandora::LArPandoraInterface nusimdata::SimulationBase