Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:45

0001 #pragma once
0002 /**
0003 sproplist.h
0004 ===================
0005 
0006 For MATERIAL the property default constants 
0007 are taken from  GMaterialLib::defineDefaults
0008 
0009 For SURFACE setting the prop values::
0010 
0011     (detect, absorb, reflect_specular, reflect_diffuse
0012 
0013 requires access to optical surface type, 
0014 if not already present need to add metadata 
0015 to the surface NPFold/NP to carry that info.   
0016 
0017 
0018 Nov 1 2023 : Increase default ABSLENGTH RAYLEIGH 1e6 -> 1e12 mm 
0019 ------------------------------------------------------------------
0020 
0021 Increase default ABSLENGTH RAYLEIGH from 1e6 to 1e12
0022 due to notes/issues/G4CXTest_raindrop_shakedown.rst
0023 This is relevant to simple tests where it is common 
0024 not to define ABSLENGTH and RAYLEIGH properties. 
0025 
0026 **/
0027 
0028 #include "sprop.h"
0029 
0030 struct sproplist
0031 {
0032     static constexpr const char* MATERIAL = R"(
0033     0 0 RINDEX          1
0034     0 1 ABSLENGTH       1e12
0035     0 2 RAYLEIGH        1e12
0036     0 3 REEMISSIONPROB  0.
0037     1 0 GROUPVEL        299.792458
0038     1 1 SPARE11         0.
0039     1 2 SPARE12         0.
0040     1 3 SPARE13         0.
0041     )" ;
0042     // default GROUPVEL set to c_light_mm_per_ns, see U4PhysicalConstants.h 
0043 
0044     static constexpr const char* SURFACE = R"(
0045     0 0 EFFICIENCY      -2
0046     0 1 SPARE01         -2
0047     0 2 REFLECTIVITY    -2
0048     0 3 SPARE03         -2
0049     1 0 SPARE10         -2
0050     1 1 SPARE11         -2
0051     1 2 SPARE12         -2
0052     1 3 SPARE13         -2
0053     )" ;   
0054 
0055     static const sproplist* Material() ; 
0056     static const sproplist* Surface() ; 
0057 
0058     std::vector<sprop> PROP ; 
0059     sproplist(const char* spec ); 
0060 
0061     std::string desc() const ; 
0062     void getNames(std::vector<std::string>& pnames, const char* skip_prefix="SPARE") const ; 
0063     const sprop* findProp(const char* pname) const ; 
0064     const sprop* get(int g, int p) const ; 
0065 };
0066 
0067 inline const sproplist* sproplist::Material() // static
0068 {
0069     return new sproplist(MATERIAL) ; 
0070 }
0071 inline const sproplist* sproplist::Surface() // static
0072 {
0073     return new sproplist(SURFACE) ; 
0074 }
0075 
0076 inline sproplist::sproplist(const char* spec)
0077 {
0078     sprop::Parse(PROP, spec); 
0079 }
0080 inline std::string sproplist::desc() const 
0081 {
0082     return sprop::Desc(PROP); 
0083 }
0084 inline void sproplist::getNames(std::vector<std::string>& pnames, const char* skip_prefix ) const 
0085 {
0086     sprop::GetNames(pnames, PROP, skip_prefix);  
0087 }
0088 inline const sprop* sproplist::findProp(const char* pname) const 
0089 {
0090     return sprop::FindProp(PROP, pname); 
0091 }
0092 inline const sprop* sproplist::get(int g, int v) const 
0093 {
0094     return sprop::Find(PROP, g, v) ; 
0095 }
0096 
0097