G4OpticalSurface Class Reference

#include <G4OpticalSurface.hh>

Inheritance diagram for G4OpticalSurface:

G4SurfaceProperty

Public Member Functions

 G4OpticalSurface (const G4OpticalSurface &right)
G4OpticalSurfaceoperator= (const G4OpticalSurface &right)
G4int operator== (const G4OpticalSurface &right) const
G4int operator!= (const G4OpticalSurface &right) const
 G4OpticalSurface (const G4String &name, G4OpticalSurfaceModel model=glisur, G4OpticalSurfaceFinish finish=polished, G4SurfaceType type=dielectric_dielectric, G4double value=1.0)
virtual ~G4OpticalSurface ()
void SetType (const G4SurfaceType &type)
G4OpticalSurfaceFinish GetFinish () const
void SetFinish (const G4OpticalSurfaceFinish)
G4OpticalSurfaceModel GetModel () const
void SetModel (const G4OpticalSurfaceModel model)
G4double GetSigmaAlpha () const
void SetSigmaAlpha (const G4double s_a)
G4double GetPolish () const
void SetPolish (const G4double plsh)
G4MaterialPropertiesTableGetMaterialPropertiesTable () const
void SetMaterialPropertiesTable (G4MaterialPropertiesTable *anMPT)
void DumpInfo () const
void ReadFile (void)
G4double GetAngularDistributionValue (G4int, G4int, G4int)
G4int GetThetaIndexMax (void) const
G4int GetPhiIndexMax (void) const

Detailed Description

Definition at line 111 of file G4OpticalSurface.hh.


Constructor & Destructor Documentation

G4OpticalSurface::G4OpticalSurface ( const G4OpticalSurface right  ) 

Definition at line 117 of file G4OpticalSurface.cc.

References AngularDistribution, readFileHandle, and theMaterialPropertiesTable.

00118   : G4SurfaceProperty(right.theName,right.theType)
00119 {
00120        *this = right;
00121        this->theMaterialPropertiesTable = right.theMaterialPropertiesTable;
00122        this->AngularDistribution = right.AngularDistribution;
00123        this->readFileHandle = right.readFileHandle;
00124 }

G4OpticalSurface::G4OpticalSurface ( const G4String name,
G4OpticalSurfaceModel  model = glisur,
G4OpticalSurfaceFinish  finish = polished,
G4SurfaceType  type = dielectric_dielectric,
G4double  value = 1.0 
)

Definition at line 75 of file G4OpticalSurface.cc.

References dielectric_LUT, FatalException, G4Exception(), glisur, LUT, ReadFile(), and unified.

00080                                    : G4SurfaceProperty(name,type),
00081                                      theModel(model),
00082                                      theFinish(finish),
00083                                      theMaterialPropertiesTable(0)
00084 {
00085         if (model == glisur ){
00086                 polish = value;
00087                 sigma_alpha = 0.0;
00088         }
00089         else if ( model == unified ) {
00090                 sigma_alpha = value;
00091                 polish = 0.0;
00092         }
00093         else if ( model == LUT ) {
00094                 sigma_alpha = value;
00095                 polish = 0.0;
00096         }
00097         else {
00098                 G4Exception("G4OpticalSurface::G4OpticalSurface()", "mat309",
00099                             FatalException,
00100                             "Constructor called with INVALID model.");
00101         }
00102 
00103         AngularDistribution = NULL;
00104 
00105         if (type == dielectric_LUT) {
00106            AngularDistribution =
00107                        new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
00108            ReadFile();
00109         }
00110 }

G4OpticalSurface::~G4OpticalSurface (  )  [virtual]

Definition at line 112 of file G4OpticalSurface.cc.

00113 {
00114         if (AngularDistribution) delete AngularDistribution;
00115 }


Member Function Documentation

void G4OpticalSurface::DumpInfo (  )  const

Definition at line 139 of file G4OpticalSurface.cc.

References G4cout, G4endl, glisur, LUT, and G4SurfaceProperty::theType.

00140 {
00141 
00142         // Dump info for surface
00143 
00144         G4cout << 
00145         "  Surface type   = " << G4int(theType)   << G4endl <<
00146         "  Surface finish = " << G4int(theFinish) << G4endl <<
00147         "  Surface model  = " << G4int(theModel)  << G4endl;
00148 
00149         G4cout << G4endl;
00150 
00151         G4cout << "  Surface parameter " << G4endl;
00152         G4cout << "  ----------------- " << G4endl;
00153         if (theModel == glisur ){
00154                 G4cout << polish      << G4endl;
00155         }
00156         else if (theModel == LUT ){
00157                 G4cout << sigma_alpha << G4endl;
00158         }
00159         else {
00160                 G4cout << sigma_alpha << G4endl;
00161         }
00162         G4cout << G4endl;
00163 }

G4double G4OpticalSurface::GetAngularDistributionValue ( G4int  ,
G4int  ,
G4int   
) [inline]

Definition at line 224 of file G4OpticalSurface.hh.

00227 {
00228   return AngularDistribution[angleIncident+
00229                              thetaIndex*incidentIndexMax+
00230                              phiIndex*thetaIndexMax*incidentIndexMax];
00231 }

G4OpticalSurfaceFinish G4OpticalSurface::GetFinish (  )  const [inline]

Definition at line 153 of file G4OpticalSurface.hh.

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite(), and G4OpBoundaryProcess::PostStepDoIt().

00153 { return theFinish; }

G4MaterialPropertiesTable* G4OpticalSurface::GetMaterialPropertiesTable (  )  const [inline]

Definition at line 174 of file G4OpticalSurface.hh.

00175                                        { return theMaterialPropertiesTable; }

G4OpticalSurfaceModel G4OpticalSurface::GetModel (  )  const [inline]

Definition at line 158 of file G4OpticalSurface.hh.

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite(), and G4OpBoundaryProcess::PostStepDoIt().

00158 { return theModel; }

G4int G4OpticalSurface::GetPhiIndexMax ( void   )  const [inline]

Definition at line 192 of file G4OpticalSurface.hh.

00192 { return phiIndexMax; } 

G4double G4OpticalSurface::GetPolish (  )  const [inline]

Definition at line 169 of file G4OpticalSurface.hh.

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite().

00169 { return polish; }

G4double G4OpticalSurface::GetSigmaAlpha (  )  const [inline]

Definition at line 164 of file G4OpticalSurface.hh.

Referenced by G4GDMLWriteSolids::OpticalSurfaceWrite().

00164 { return sigma_alpha; }

G4int G4OpticalSurface::GetThetaIndexMax ( void   )  const [inline]

Definition at line 191 of file G4OpticalSurface.hh.

00191 { return thetaIndexMax; }

G4int G4OpticalSurface::operator!= ( const G4OpticalSurface right  )  const

Definition at line 131 of file G4OpticalSurface.cc.

00132 {
00133         return (this != (G4OpticalSurface *) &right);
00134 }

G4OpticalSurface & G4OpticalSurface::operator= ( const G4OpticalSurface right  ) 

Definition at line 54 of file G4OpticalSurface.cc.

References AngularDistribution, polish, readFileHandle, sigma_alpha, theFinish, theMaterialPropertiesTable, theModel, G4SurfaceProperty::theName, and G4SurfaceProperty::theType.

00055 {
00056   if (this != &right)
00057     {
00058       theName                    = right.theName;
00059       theType                    = right.theType;
00060       theModel                   = right.theModel;
00061       theFinish                  = right.theFinish;
00062       sigma_alpha                = right.sigma_alpha;
00063       polish                     = right.polish;
00064       theMaterialPropertiesTable = right.theMaterialPropertiesTable;
00065       AngularDistribution        = right.AngularDistribution;
00066       readFileHandle             = right.readFileHandle;
00067      } 
00068   return *this;
00069 }

G4int G4OpticalSurface::operator== ( const G4OpticalSurface right  )  const

Definition at line 126 of file G4OpticalSurface.cc.

00127 {
00128         return (this == (G4OpticalSurface *) &right);
00129 }

void G4OpticalSurface::ReadFile ( void   ) 

Definition at line 185 of file G4OpticalSurface.cc.

References etchedlumirrorair, etchedlumirrorglue, etchedteflonair, etchedtioair, etchedtyvekair, etchedvm2000air, etchedvm2000glue, FatalException, G4cout, G4endl, G4Exception(), groundlumirrorair, groundlumirrorglue, groundteflonair, groundtioair, groundtyvekair, groundvm2000air, groundvm2000glue, polishedlumirrorair, polishedlumirrorglue, polishedteflonair, polishedtioair, polishedtyvekair, polishedvm2000air, and polishedvm2000glue.

Referenced by G4OpticalSurface(), SetFinish(), and SetType().

00186 {
00187   G4String readFileName = " ";
00188 
00189   if (theFinish == polishedlumirrorglue) {
00190      readFileName = "PolishedLumirrorGlue.dat";
00191   }
00192   else if (theFinish == polishedlumirrorair) {
00193      readFileName = "PolishedLumirror.dat";
00194   }
00195   else if (theFinish == polishedteflonair) {
00196      readFileName = "PolishedTeflon.dat";
00197   }
00198   else if (theFinish == polishedtioair) {
00199      readFileName = "PolishedTiO.dat";
00200   }
00201   else if (theFinish == polishedtyvekair) {
00202      readFileName = "PolishedTyvek.dat";
00203   }
00204   else if (theFinish == polishedvm2000glue) {
00205      readFileName = "PolishedVM2000Glue.dat";
00206   }
00207   else if (theFinish == polishedvm2000air) {
00208      readFileName = "PolishedVM2000.dat";
00209   }
00210   else if (theFinish == etchedlumirrorglue) {
00211      readFileName = "EtchedLumirrorGlue.dat";
00212   }
00213   else if (theFinish == etchedlumirrorair) {
00214      readFileName = "EtchedLumirror.dat";
00215   }
00216   else if (theFinish == etchedteflonair) {
00217      readFileName = "EtchedTeflon.dat";
00218   }
00219   else if (theFinish == etchedtioair) {
00220      readFileName = "EtchedTiO.dat";
00221   }
00222   else if (theFinish == etchedtyvekair) {
00223      readFileName = "EtchedTyvek.dat";
00224   }
00225   else if (theFinish == etchedvm2000glue) {
00226      readFileName = "EtchedVM2000Glue.dat";
00227   }
00228   else if (theFinish == etchedvm2000air) {
00229      readFileName = "EtchedVM2000.dat";
00230   }
00231   else if (theFinish == groundlumirrorglue) {
00232      readFileName = "GroundLumirrorGlue.dat";
00233   }
00234   else if (theFinish == groundlumirrorair) {
00235      readFileName = "GroundLumirror.dat";
00236   }
00237   else if (theFinish == groundteflonair) {
00238      readFileName = "GroundTeflon.dat";
00239   }
00240   else if (theFinish == groundtioair) {
00241      readFileName = "GroundTiO.dat";
00242   }
00243   else if (theFinish == groundtyvekair) {
00244      readFileName = "GroundTyvek.dat";
00245   }
00246   else if (theFinish == groundvm2000glue) {
00247      readFileName = "GroundVM2000Glue.dat";
00248   }
00249   else if (theFinish == groundvm2000air) {
00250      readFileName = "GroundVM2000.dat";
00251   }
00252 
00253   if (readFileName == " ") return;
00254 
00255   char* path = getenv("G4REALSURFACEDATA");
00256   if (!path) {
00257      G4String excep =
00258         "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
00259      G4Exception("G4OpticalSurface::ReadFile()", "mat310",
00260                  FatalException, excep);
00261      return;
00262   }
00263   G4String pathString(path);
00264 
00265   readFileName = pathString + "/" + readFileName;
00266 
00267   readFileHandle = fopen(readFileName,"r");
00268 
00269   if (readFileHandle) {
00270      G4int ncols;
00271      G4int idxmax = incidentIndexMax*thetaIndexMax*phiIndexMax;
00272      for (G4int i = 0; i<idxmax; i++) {
00273        ncols = fscanf(readFileHandle,"%6f", &AngularDistribution[i]);
00274        if (ncols < 0) break;
00275      }
00276      if (ncols >= 0) {
00277         G4cout << "LUT - data file: " << readFileName << " read in! " << G4endl;
00278      }
00279      else {
00280         G4String excep = "LUT - data file: "+ readFileName +" not read propery";
00281         G4Exception("G4OpticalSurface::ReadFile()", "mat312",
00282                     FatalException, excep);
00283         return;
00284      }
00285   }
00286   else {
00287      G4String excep = "LUT - data file: " + readFileName + " not found";
00288      G4Exception("G4OpticalSurface::ReadFile()", "mat311",
00289                  FatalException, excep);
00290      return;
00291   }
00292   fclose(readFileHandle);
00293 }

void G4OpticalSurface::SetFinish ( const   G4OpticalSurfaceFinish  ) 

Definition at line 175 of file G4OpticalSurface.cc.

References dielectric_LUT, ReadFile(), and G4SurfaceProperty::theType.

00176 {
00177   theFinish = finish;
00178   if (theType == dielectric_LUT) {
00179      if (!AngularDistribution) AngularDistribution =
00180                        new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
00181      ReadFile();
00182   }
00183 }

void G4OpticalSurface::SetMaterialPropertiesTable ( G4MaterialPropertiesTable anMPT  )  [inline]

Definition at line 179 of file G4OpticalSurface.hh.

00180                                        { theMaterialPropertiesTable = anMPT; }

void G4OpticalSurface::SetModel ( const G4OpticalSurfaceModel  model  )  [inline]

Definition at line 160 of file G4OpticalSurface.hh.

00161                                                       { theModel = model; }

void G4OpticalSurface::SetPolish ( const G4double  plsh  )  [inline]

Definition at line 171 of file G4OpticalSurface.hh.

00171 { polish=plsh; }

void G4OpticalSurface::SetSigmaAlpha ( const G4double  s_a  )  [inline]

Definition at line 166 of file G4OpticalSurface.hh.

00166 { sigma_alpha = s_a; }

void G4OpticalSurface::SetType ( const G4SurfaceType type  ) 

Reimplemented from G4SurfaceProperty.

Definition at line 165 of file G4OpticalSurface.cc.

References dielectric_LUT, ReadFile(), and G4SurfaceProperty::theType.

00166 {
00167   theType = type;
00168   if (type == dielectric_LUT) {
00169      if (!AngularDistribution) AngularDistribution =
00170                        new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
00171      ReadFile();
00172   }
00173 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:47 2013 for Geant4 by  doxygen 1.4.7