diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-06-17 14:51:40 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-06-17 14:51:40 -0400 |
commit | 34ff4d6c734e5adf3aa8a0e7ca89031effdb1489 (patch) | |
tree | 8e3ed0a692117b3eb38d6d89029f9cae42f2ede0 /src/materials.h | |
parent | 870236b3c4950762a73247c68023a8dee6e14a7b (diff) | |
download | chroma-34ff4d6c734e5adf3aa8a0e7ca89031effdb1489.tar.gz chroma-34ff4d6c734e5adf3aa8a0e7ca89031effdb1489.tar.bz2 chroma-34ff4d6c734e5adf3aa8a0e7ca89031effdb1489.zip |
visually tested optics code. added models of the inner and outer meshes for the 12" hamamatsu and sno pmts. ratdb.py is able to parse ratdb files. chromaticity.py provides a function to map wavelength -> rgb color. lbne detector model now includes an outer black cylinder and pmts with a glass layer and photocathode/reflective surfaces.
Diffstat (limited to 'src/materials.h')
-rw-r--r-- | src/materials.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/materials.h b/src/materials.h index 47b7d22..77c9f43 100644 --- a/src/materials.h +++ b/src/materials.h @@ -6,15 +6,6 @@ __device__ float max_wavelength; __device__ float wavelength_step; __device__ unsigned int wavelength_size; -enum -{ - INIT = -1, - MAX_DEPTH_REACHED, - NO_HIT, - BULK_ABSORB, - SURFACE_ABSORB -}; - struct Material { float *refractive_index; @@ -40,10 +31,9 @@ __device__ float interp_property(const float &x, const float *fp) if (x > max_wavelength) return fp[wavelength_size-1]; - unsigned int jl = (x-min_wavelength)/wavelength_step; - float xl = min_wavelength + jl*wavelength_step; + int jl = (x-min_wavelength)/wavelength_step; - return xl + (x-xl)*(fp[jl+1]-fp[jl])/wavelength_step; + return fp[jl] + (x-(min_wavelength + jl*wavelength_step))*(fp[jl+1]-fp[jl])/wavelength_step; } extern "C" |