G4OpticalSurface =================== G4DAE surface -------------- :: __dd__Geometry__PoolDetails__NearPoolSurfaces__NearPoolCoverSurface __dd__Geometry__AdDetails__AdSurfacesAll__RSOilSurface __dd__Geometry__AdDetails__AdSurfacesAll__ESRAirSurfaceTop __dd__Geometry__AdDetails__AdSurfacesAll__ESRAirSurfaceBot __dd__Geometry__AdDetails__AdSurfacesAll__SSTOilSurface __dd__Geometry__AdDetails__AdSurfacesAll__AdCableTraySurface __dd__Geometry__AdDetails__AdSurfacesNear__SSTWaterSurfaceNear1 __dd__Geometry__AdDetails__AdSurfacesNear__SSTWaterSurfaceNear2 __dd__Geometry__PoolDetails__PoolSurfacesAll__PmtMtTopRingSurface __dd__Geometry__PoolDetails__PoolSurfacesAll__PmtMtBaseRingSurface __dd__Geometry__PoolDetails__PoolSurfacesAll__PmtMtRib1Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__PmtMtRib2Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__PmtMtRib3Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__LegInIWSTubSurface __dd__Geometry__PoolDetails__PoolSurfacesAll__TablePanelSurface __dd__Geometry__PoolDetails__PoolSurfacesAll__SupportRib1Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__SupportRib5Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__SlopeRib1Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__SlopeRib5Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__ADVertiCableTraySurface __dd__Geometry__PoolDetails__PoolSurfacesAll__ShortParCableTraySurface __dd__Geometry__PoolDetails__NearPoolSurfaces__NearInnInPiperSurface __dd__Geometry__PoolDetails__NearPoolSurfaces__NearInnOutPiperSurface __dd__Geometry__PoolDetails__NearPoolSurfaces__NearIWSCurtainSurface __dd__Geometry__PoolDetails__PoolSurfacesAll__LegInOWSTubSurface __dd__Geometry__PoolDetails__NearPoolSurfaces__UnistrutRib6Surface __dd__Geometry__PoolDetails__NearPoolSurfaces__UnistrutRib7Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__UnistrutRib3Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__UnistrutRib5Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__UnistrutRib4Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__UnistrutRib1Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__UnistrutRib2Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__UnistrutRib8Surface __dd__Geometry__PoolDetails__PoolSurfacesAll__UnistrutRib9Surface __dd__Geometry__PoolDetails__NearPoolSurfaces__TopShortCableTraySurface __dd__Geometry__PoolDetails__PoolSurfacesAll__TopCornerCableTraySurface __dd__Geometry__PoolDetails__PoolSurfacesAll__VertiCableTraySurface __dd__Geometry__PoolDetails__NearPoolSurfaces__NearOutInPiperSurface __dd__Geometry__PoolDetails__NearPoolSurfaces__NearOutOutPiperSurface __dd__Geometry__PoolDetails__NearPoolSurfaces__NearOWSLinerSurface __dd__Geometry__PoolDetails__PoolSurfacesAll__LegInDeadTubSurface __dd__Geometry__PoolDetails__NearPoolSurfaces__NearDeadLinerSurface Maybe should translate the finish into Chroma via setting * `reflect_specular` for finish 0 (polished) * `reflect_diffuse` for finish 3 (ground) `materials/include/G4OpticalSurface.hh`:: 132 133 G4OpticalSurface(const G4String& name, 134 G4OpticalSurfaceModel model = glisur, 135 G4OpticalSurfaceFinish finish = polished, 136 G4SurfaceType type = dielectric_dielectric, 137 G4double value = 1.0); 138 // Constructor of an optical surface object. 139 `materials/include/G4SurfaceProperty.hh`:: 66 enum G4SurfaceType 67 { 68 dielectric_metal, // dielectric-metal interface 69 dielectric_dielectric, // dielectric-dielectric interface 70 dielectric_LUT, // dielectric-Look-Up-Table interface 71 firsov, // for Firsov Process 72 x_ray // for x-ray mirror process 73 }; Geant4 Surface --------------- `processes/optical/src/G4OpBoundaryProcess.cc` DAE/GDML persisted -------------------- * glisur value **Polish** * non-glisur value **SigmaAlpha** :: 242 /* 243 * Create opticalsurface element with attributes from G4OpticalSurface* 244 * append to first argument element 245 * 246 * from G4GDMLWriteSolids::OpticalSurfaceWrite 247 */ 248 void G4DAEWriteStructure:: 249 OpticalSurfaceWrite(xercesc::DOMElement* targetElement, 250 const G4OpticalSurface* const surf) 251 { 252 xercesc::DOMElement* optElement = NewElement("opticalsurface"); 253 G4OpticalSurfaceModel smodel = surf->GetModel(); 254 G4double sval = (smodel==glisur) ? surf->GetPolish() : surf->GetSigmaAlpha(); 255 256 optElement->setAttributeNode(NewNCNameAttribute("name", surf->GetName())); 257 optElement->setAttributeNode(NewAttribute("model", smodel)); 258 optElement->setAttributeNode(NewAttribute("finish", surf->GetFinish())); 259 optElement->setAttributeNode(NewAttribute("type", surf->GetType())); 260 optElement->setAttributeNode(NewAttribute("value", sval)); 261 262 G4MaterialPropertiesTable* ptable = surf->GetMaterialPropertiesTable(); 263 PropertyWrite( optElement, ptable ); 264 265 targetElement->appendChild(optElement); 266 } Chroma Surface ---------------- :: __device__ int propagate_at_surface(Photon &p, State &s, curandState &rng, Geometry *geometry, bool use_weights=false) { Surface *surface = geometry->surfaces[s.surface_index]; if (surface->model == SURFACE_COMPLEX) return propagate_complex(p, s, rng, surface, use_weights); else if (surface->model == SURFACE_WLS) return propagate_at_wls(p, s, rng, surface, use_weights); else { // use default surface model: do a combination of specular and // diffuse reflection, detection, and absorption based on relative // probabilties // since the surface properties are interpolated linearly, we are // guaranteed that they still sum to 1.0. float detect = interp_property(surface, p.wavelength, surface->detect); float absorb = interp_property(surface, p.wavelength, surface->absorb); float reflect_diffuse = interp_property(surface, p.wavelength, surface->reflect_diffuse); float reflect_specular = interp_property(surface, p.wavelength, surface->reflect_specular);