From 982f29bba1e16086c6b6c082a07a12bc7877effc Mon Sep 17 00:00:00 2001 From: Stephen Fegan Date: Tue, 10 Oct 2023 17:40:48 +0200 Subject: [PATCH] Add helper function to make trivial progagator --- include/simulation/vcl_iact_array.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/simulation/vcl_iact_array.hpp b/include/simulation/vcl_iact_array.hpp index bf2a911b..c48f0eb2 100644 --- a/include/simulation/vcl_iact_array.hpp +++ b/include/simulation/vcl_iact_array.hpp @@ -250,6 +250,7 @@ template class alignas(VCLArchitecture::vec_bytes) VCL CALIN_TYPEALIAS(FocalPlaneRayPropagator, calin::simulation::vcl_ray_propagator::VCLFocalPlaneRayPropagator); CALIN_TYPEALIAS(DaviesCottonVCLFocalPlaneRayPropagator, calin::simulation::vcl_ray_propagator::DaviesCottonVCLFocalPlaneRayPropagator); + CALIN_TYPEALIAS(TrivialVCLFocalPlaneRayPropagator, calin::simulation::vcl_ray_propagator::TrivialVCLFocalPlaneRayPropagator); VCLIACTArray(calin::simulation::atmosphere::LayeredRefractiveAtmosphere* atm, const calin::simulation::detector_efficiency::AtmosphericAbsorption& atm_abs, @@ -288,6 +289,11 @@ template class alignas(VCLArchitecture::vec_bytes) VCL const std::string& propagator_name, SplinePEAmplitudeGenerator* pe_generator = nullptr, bool adopt_pe_processor = false, bool adopt_pe_generator = false); + TrivialVCLFocalPlaneRayPropagator* add_trivial_propagator(PEProcessor* pe_processor, + const DetectionEfficiency& detector_efficiency, const AngularEfficiency& fp_angular_efficiency, + const std::string& propagator_name, SplinePEAmplitudeGenerator* pe_generator = nullptr, + bool adopt_pe_processor = false, bool adopt_pe_generator = false); + void point_telescope_az_el_phi_deg(unsigned iscope, double az_deg, double el_deg, double phi_deg); void point_telescope_az_el_deg(unsigned iscope, double az_deg, double el_deg); @@ -565,6 +571,27 @@ VCLIACTArray::add_davies_cotton_propagator( adopt_pe_generator); } +template +calin::simulation::vcl_ray_propagator::TrivialVCLFocalPlaneRayPropagator* +VCLIACTArray::add_trivial_propagator(PEProcessor* pe_processor, + const DetectionEfficiency& detector_efficiency, const AngularEfficiency& fp_angular_efficiency, + const std::string& propagator_name, SplinePEAmplitudeGenerator* pe_generator, + bool adopt_pe_processor, bool adopt_pe_generator) +{ + auto* propagator = new calin::simulation::vcl_ray_propagator::TrivialVCLFocalPlaneRayPropagator( + this->rng_, ref_index_, /* adopt_rng= */ false); + + auto* bandwidth_manager = new VCLDCBandwidthManager( + &atm_abs_, detector_efficiency, fp_angular_efficiency, zobs_, + config_.detector_energy_lo(), config_.detector_energy_hi(), + config_.detector_energy_bin_width(), propagator_name); + + add_propagator(propagator, pe_processor, bandwidth_manager, pe_generator, propagator_name, + /* adopt_propagator = */ true, adopt_pe_processor, adopt_pe_generator); + + return propagator; +} + template void VCLIACTArray:: point_telescope_az_el_phi_deg(unsigned iscope, double az_deg, double el_deg, double phi_deg)