From a2867698818803c31346cd6949b4e94e126fd467 Mon Sep 17 00:00:00 2001
From: clantz <clantz@gitlab.cern.ch>
Date: Thu, 15 Aug 2019 18:03:58 -0500
Subject: [PATCH] Got tunable surfaces working

---
 run1.mac                    | 12 +++++++++++-
 src/DetectorConstruction.cc |  8 +++++---
 surface.mac                 |  2 +-
 3 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/run1.mac b/run1.mac
index a3ed1a0..e5e896d 100644
--- a/run1.mac
+++ b/run1.mac
@@ -17,6 +17,16 @@
 
 /gps/particle opticalphoton
 
+#Set reflective surface properties
+/lightGuide/surfaceModel unified
+/lightGuide/surfaceType dielectric_metal
+/lightGuide/surfaceFinish ground
+/lightGuide/surfaceSigmaAlpha .01
+/lightGuide/surfaceProperty SPECULARLOBECONSTANT 0.000002 1.0 0.000008 1.0
+/lightGuide/surfaceProperty SPECULARSPIKECONSTANT 0.000002 0.99 0.000008 0.99
+/lightGuide/surfaceProperty BACKSCATTERCONSTANT 0.000002 .05 0.000008 .05
+/lightGuide/surfaceProperty REFLECTIVITY 0.000002 .99 0.000008 .99
+
 # the beam energy is in gaussian profile
 /gps/ene/type Gauss
 /gps/ene/mono 3.4 eV
@@ -59,6 +69,6 @@
 ##############################################################
 ##############################################################
 # number of events
-/run/beamOn 10000000
+/run/beamOn 5000000
 ##############################################################
 ##############################################################
diff --git a/src/DetectorConstruction.cc b/src/DetectorConstruction.cc
index d39ef2c..89a8831 100644
--- a/src/DetectorConstruction.cc
+++ b/src/DetectorConstruction.cc
@@ -177,7 +177,11 @@ G4VPhysicalVolume* DetectorConstruction::Construct(){
                                  m_physWorld,
                                  cad_physical,
                                  materials->AlSurface );
-    (void)alumLSS;
+   G4LogicalBorderSurface* alumLSS1 =
+     new G4LogicalBorderSurface("AlSurface",
+                                cad_physical,
+                                m_physWorld,
+                                materials->AlSurface );
 
   }else{
     //Create a trapezoidal air light guide made of aluminum sheet
@@ -239,8 +243,6 @@ G4VPhysicalVolume* DetectorConstruction::Construct(){
                                 m_physWorld,
                                 physLightGuide,
                                 materials->AlSurface );
-    (void)alumLSS1;
-    (void)alumLSS2;
 
   }//end else
 
diff --git a/surface.mac b/surface.mac
index 40e8c3c..ca22382 100644
--- a/surface.mac
+++ b/surface.mac
@@ -21,7 +21,7 @@
 /gun/particle opticalphoton
 /gun/energy 3 eV
 /gun/position 0 0 0 cm
-/gun/direction 1 0 0 
+/gun/direction 1 0 0
 /opnovice2/gun/optPhotonPolar
 #
 
-- 
GitLab