File indexing completed on 2025-12-15 10:11:00
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include "corecel/Types.hh"
0010 #include "corecel/data/CollectionMirror.hh"
0011 #include "corecel/data/ParamsDataInterface.hh"
0012 #include "celeritas/io/ImportOpticalMaterial.hh"
0013
0014 #include "ScintillationData.hh"
0015
0016 namespace celeritas
0017 {
0018 class ParticleParams;
0019 struct ImportData;
0020
0021 namespace optical
0022 {
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 class ScintillationParams final : public ParamsDataInterface<ScintillationData>
0034 {
0035 public:
0036
0037
0038 using SPConstParticles = std::shared_ptr<ParticleParams const>;
0039 using ScintillationDataCRef = HostCRef<ScintillationData>;
0040
0041
0042
0043 struct Input
0044 {
0045 using VecOptMatId = std::vector<OptMatId>;
0046 using VecSPId = std::vector<ScintillationParticleId>;
0047
0048 std::vector<double> resolution_scale;
0049
0050
0051 std::vector<ImportMaterialScintSpectrum> materials;
0052
0053
0054 VecSPId pid_to_scintpid;
0055
0056 std::vector<ImportParticleScintSpectrum> particles;
0057
0058 explicit operator bool() const
0059 {
0060 return (pid_to_scintpid.empty() == particles.empty())
0061 && !resolution_scale.empty()
0062 && (materials.empty() != particles.empty());
0063 }
0064 };
0065
0066 public:
0067
0068 static std::shared_ptr<ScintillationParams>
0069 from_import(ImportData const& data, SPConstParticles particle_params);
0070
0071
0072 explicit ScintillationParams(Input const& input);
0073
0074
0075 HostRef const& host_ref() const final { return mirror_.host_ref(); }
0076
0077
0078 DeviceRef const& device_ref() const final { return mirror_.device_ref(); }
0079
0080 private:
0081
0082 CollectionMirror<ScintillationData> mirror_;
0083 };
0084
0085
0086 }
0087 }