diff --git a/sbndcode/CMakeLists.txt b/sbndcode/CMakeLists.txt index 7712f07cd..2827cd1af 100755 --- 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..24d09a42c --- /dev/null +++ b/sbndcode/OpPathTool/CMakeLists.txt @@ -0,0 +1,11 @@ +include (phot::OpticalPath) + +cet_build_plugin(SBNDOpticalPath phot::OpticalPath + LIBRARIES PRIVATE + larsim::OpticalPath + 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..8a077946d --- /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 + if ((ScintPoint.X() < 0.) != (OpDetPoint.X() < 0.)) return false; + else return true; + } + }; +} + +#endif 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 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 diff --git a/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc b/sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc index 786e3b59d..c14b5cf4d 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(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");