Skip to content

Commit 39da4b4

Browse files
Merge pull request #756 from pgreen135/feature/pgreen_optical_path_tool
Updates to semi-analytical light simulation: optical path tool
2 parents 45fff9a + 8db15c0 commit 39da4b4

8 files changed

Lines changed: 62 additions & 1 deletion

File tree

sbndcode/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ add_subdirectory(OpDetSim)
1616
add_subdirectory(OpDetReco)
1717
add_subdirectory(OpDetAnalyzer)
1818
add_subdirectory(OpT0Finder)
19+
add_subdirectory(OpPathTool)
1920
#add_subdirectory(PDS)
2021
#add_subdirectory(CosmicId)
2122
add_subdirectory(ShowerAna)

sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "PDFastSimPVS.fcl"
33

44
#include "opticalsimparameterisations_sbnd.fcl"
5+
#include "sbndopticalpath_tool.fcl"
56

67
BEGIN_PROLOG
78

@@ -19,6 +20,8 @@ sbnd_pdfastsim_par.SimulationLabel: "ionandscint:priorSCE"
1920
# independently for the TPB-delay time and the emission (fast and slow) decay times.
2021
sbnd_pdfastsim_par.ScintTimeTool.SlowDecayTime: 1300.0
2122

23+
sbnd_pdfastsim_par.OpticalPathTool: @local::SBNDOpticalPath
24+
2225
# Direct (VUV)
2326
sbnd_pdfastsim_par.VUVTiming: @local::sbnd_vuv_timing_parameterization
2427
sbnd_pdfastsim_par.VUVHits: @local::sbnd_vuv_RS100cm_hits_parameterization

sbndcode/OpPathTool/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include (phot::OpticalPath)
2+
3+
cet_build_plugin(SBNDOpticalPath phot::OpticalPath
4+
LIBRARIES PRIVATE
5+
larsim::OpticalPath
6+
larcoreobj::geo_vectors
7+
)
8+
9+
install_headers()
10+
install_fhicl()
11+
install_source()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SBND optical path tool
2+
3+
#ifndef SBNDOpticalPath_H
4+
#define SBNDOpticalPath_H
5+
6+
#include "art/Utilities/ToolMacros.h"
7+
#include "larsim/PhotonPropagation/OpticalPathTools/OpticalPath.h"
8+
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
9+
10+
#include <iostream>
11+
12+
namespace phot {
13+
class SBNDOpticalPath : public phot::OpticalPath {
14+
public:
15+
explicit SBNDOpticalPath(fhicl::ParameterSet const& ps) {};
16+
~SBNDOpticalPath() noexcept override = default;
17+
18+
const bool isOpDetVisible(geo::Point_t const& ScintPoint, geo::Point_t const& OpDetPoint) override {
19+
// special case for SBND
20+
// check x coordinate has same sign
21+
if ((ScintPoint.X() < 0.) != (OpDetPoint.X() < 0.)) return false;
22+
else return true;
23+
}
24+
};
25+
}
26+
27+
#endif
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "sbndcode/OpPathTool/SBNDOpticalPath.h"
2+
#include "art/Utilities/ToolMacros.h"
3+
4+
DEFINE_ART_CLASS_TOOL(phot::SBNDOpticalPath)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// sbnd optical path tools
2+
3+
BEGIN_PROLOG
4+
5+
SBNDOpticalPath:
6+
{
7+
tool_type: SBNDOpticalPath
8+
}
9+
10+
END_PROLOG

sbndcode/OpT0Finder/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set(
1212
lardataobj::AnalysisBase
1313
lardataobj::RecoBase
1414
larsim::Simulation
15+
larsim::OpticalPath
1516
lardataobj::Simulation
1617
larpandora::LArPandoraInterface
1718
nusimdata::SimulationBase

sbndcode/OpT0Finder/SBNDOpT0Finder_module.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "art/Framework/Principal/Handle.h"
1616
#include "art/Framework/Principal/Run.h"
1717
#include "art/Framework/Principal/SubRun.h"
18+
#include "art/Utilities/make_tool.h"
1819
#include "art_root_io/TFileService.h"
1920
#include "canvas/Utilities/InputTag.h"
2021
#include "canvas/Persistency/Common/Assns.h"
@@ -40,6 +41,7 @@
4041
#include "larcore/CoreUtils/ServiceUtil.h"
4142

4243
#include "larsim/PhotonPropagation/SemiAnalyticalModel.h"
44+
#include "larsim/PhotonPropagation/OpticalPathTools/OpticalPath.h"
4345
#include "larsim/Simulation/LArG4Parameters.h"
4446

4547
#include "larpandora/LArPandoraInterface/LArPandoraHelper.h"
@@ -104,6 +106,7 @@ class SBNDOpT0Finder : public art::EDProducer {
104106
std::unique_ptr<phot::SemiAnalyticalModel> _semi_model;
105107
fhicl::ParameterSet _vuv_params;
106108
fhicl::ParameterSet _vis_params;
109+
std::shared_ptr<phot::OpticalPath> _optical_path_tool;
107110

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

177180
_vuv_params = p.get<fhicl::ParameterSet>("VUVHits");
178181
_vis_params = p.get<fhicl::ParameterSet>("VIVHits");
179-
_semi_model = std::make_unique<phot::SemiAnalyticalModel>(_vuv_params, _vis_params, true, false);
182+
_optical_path_tool = std::shared_ptr<phot::OpticalPath>(art::make_tool<phot::OpticalPath>(p.get<fhicl::ParameterSet>("OpticalPathTool")));
183+
_semi_model = std::make_unique<phot::SemiAnalyticalModel>(_vuv_params, _vis_params, _optical_path_tool, true, false);
180184

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

0 commit comments

Comments
 (0)