Skip to content
Merged
1 change: 1 addition & 0 deletions sbndcode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "PDFastSimPVS.fcl"

#include "opticalsimparameterisations_sbnd.fcl"
#include "sbndopticalpath_tool.fcl"

BEGIN_PROLOG

Expand All @@ -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
Expand Down
11 changes: 11 additions & 0 deletions sbndcode/OpPathTool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
27 changes: 27 additions & 0 deletions sbndcode/OpPathTool/SBNDOpticalPath.h
Original file line number Diff line number Diff line change
@@ -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 <iostream>

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
4 changes: 4 additions & 0 deletions sbndcode/OpPathTool/SBNDOpticalPath_tool.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "sbndcode/OpPathTool/SBNDOpticalPath.h"
#include "art/Utilities/ToolMacros.h"

DEFINE_ART_CLASS_TOOL(phot::SBNDOpticalPath)
10 changes: 10 additions & 0 deletions sbndcode/OpPathTool/sbndopticalpath_tool.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// sbnd optical path tools

BEGIN_PROLOG

SBNDOpticalPath:
{
tool_type: SBNDOpticalPath
}

END_PROLOG
1 change: 1 addition & 0 deletions sbndcode/OpT0Finder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(
lardataobj::AnalysisBase
lardataobj::RecoBase
larsim::Simulation
larsim::OpticalPath
lardataobj::Simulation
larpandora::LArPandoraInterface
nusimdata::SimulationBase
Expand Down
6 changes: 5 additions & 1 deletion sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -104,6 +106,7 @@ class SBNDOpT0Finder : public art::EDProducer {
std::unique_ptr<phot::SemiAnalyticalModel> _semi_model;
fhicl::ParameterSet _vuv_params;
fhicl::ParameterSet _vis_params;
std::shared_ptr<phot::OpticalPath> _optical_path_tool;

::flashmatch::FlashMatchManager _mgr; ///< The flash matching manager
std::vector<flashmatch::FlashMatch_t> _result_v; ///< Matching result will be stored here
Expand Down Expand Up @@ -176,7 +179,8 @@ SBNDOpT0Finder::SBNDOpT0Finder(fhicl::ParameterSet const& p)

_vuv_params = p.get<fhicl::ParameterSet>("VUVHits");
_vis_params = p.get<fhicl::ParameterSet>("VIVHits");
_semi_model = std::make_unique<phot::SemiAnalyticalModel>(_vuv_params, _vis_params, true, false);
_optical_path_tool = std::shared_ptr<phot::OpticalPath>(art::make_tool<phot::OpticalPath>(p.get<fhicl::ParameterSet>("OpticalPathTool")));
_semi_model = std::make_unique<phot::SemiAnalyticalModel>(_vuv_params, _vis_params, _optical_path_tool, true, false);

_opflash_producer_v = p.get<std::vector<std::string>>("OpFlashProducers");
_opflash_ara_producer_v = p.get<std::vector<std::string>>("OpFlashAraProducers");
Expand Down