Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:25

0001 // map Geant4 surface enum values to strings
0002 //
0003 
0004 #include <string>
0005 #include <vector>
0006 #include "Geant4/G4OpticalSurface.hh"
0007 
0008 namespace surfaceEnum {
0009 
0010   // reverse enumerators
0011   // FIXME: maybe there is a better way from within Geant4, but after a first look,
0012   // there isn't one; these string vectors have been adapted from enums in
0013   // `G4*Surface*.hh` headers
0014   const std::vector<std::string> Type = {
0015     "dielectric_metal",
0016     "dielectric_dielectric",
0017     "dielectric_LUT",
0018     "dielectric_LUTDAVIS",
0019     "dielectric_dichroic",
0020     "firsov",
0021     "x_ray"
0022   };
0023   const std::vector<std::string> Model = {
0024     "glisur",
0025     "unified",
0026     "LUT",
0027     "DAVIS",
0028     "dichroic"
0029   };
0030   const std::vector<std::string> Finish = {
0031     "polished",
0032     "polishedfrontpainted",
0033     "polishedbackpainted",
0034     "ground",
0035     "groundfrontpainted",
0036     "groundbackpainted",
0037     "polishedlumirrorair",
0038     "polishedlumirrorglue",
0039     "polishedair",
0040     "polishedteflonair",
0041     "polishedtioair",
0042     "polishedtyvekair",
0043     "polishedvm2000air",
0044     "polishedvm2000glue",
0045     "etchedlumirrorair",
0046     "etchedlumirrorglue",
0047     "etchedair",
0048     "etchedteflonair",
0049     "etchedtioair",
0050     "etchedtyvekair",
0051     "etchedvm2000air",
0052     "etchedvm2000glue",
0053     "groundlumirrorair",
0054     "groundlumirrorglue",
0055     "groundair",
0056     "groundteflonair",
0057     "groundtioair",
0058     "groundtyvekair",
0059     "groundvm2000air",
0060     "groundvm2000glue",
0061     "Rough_LUT",
0062     "RoughTeflon_LUT",
0063     "RoughESR_LUT",
0064     "RoughESRGrease_LUT",
0065     "Polished_LUT",
0066     "PolishedTeflon_LUT",
0067     "PolishedESR_LUT",
0068     "PolishedESRGrease_LUT",
0069     "Detector_LUT"
0070   };
0071 
0072   // accessors
0073   static std::string GetType(G4OpticalSurface   *surf) { return Type[int(surf->GetType())];     }
0074   static std::string GetModel(G4OpticalSurface  *surf) { return Model[int(surf->GetModel())];   }
0075   static std::string GetFinish(G4OpticalSurface *surf) { return Finish[int(surf->GetFinish())]; }
0076 }