File indexing completed on 2026-01-07 10:01:43
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
0022
0023
0024
0025
0026
0027
0028
0029
0030 class ScintillationParams final : public ParamsDataInterface<ScintillationData>
0031 {
0032 public:
0033
0034
0035 using SPConstParticles = std::shared_ptr<ParticleParams const>;
0036
0037
0038
0039 struct Input
0040 {
0041 std::vector<double> resolution_scale;
0042
0043
0044 std::vector<ImportMaterialScintSpectrum> materials;
0045
0046
0047 std::vector<ImportParticleScintSpectrum> particles;
0048
0049 std::vector<ScintParticleId> pid_to_scintpid;
0050
0051 explicit operator bool() const
0052 {
0053 return (pid_to_scintpid.empty() == particles.empty())
0054 && !resolution_scale.empty()
0055 && (materials.empty() != particles.empty());
0056 }
0057 };
0058
0059 public:
0060
0061 static std::shared_ptr<ScintillationParams>
0062 from_import(ImportData const& data, SPConstParticles particle_params);
0063
0064
0065 explicit ScintillationParams(Input const& input);
0066
0067
0068 HostRef const& host_ref() const final { return mirror_.host_ref(); }
0069
0070
0071 DeviceRef const& device_ref() const final { return mirror_.device_ref(); }
0072
0073 private:
0074
0075 CollectionMirror<ScintillationData> mirror_;
0076 };
0077
0078
0079 }