| 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: G4OpticalSurface.cc,v 1.12 2008/12/11 10:23:54 gcosmo Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $
|
|---|
| 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | ////////////////////////////////////////////////////////////////////////
|
|---|
| 32 | // Optical Surface Class Implementation
|
|---|
| 33 | ////////////////////////////////////////////////////////////////////////
|
|---|
| 34 | //
|
|---|
| 35 | // File: G4OpticalSurface.cc
|
|---|
| 36 | // Description: An optical surface class for use in G4OpBoundaryProcess
|
|---|
| 37 | // Version: 2.0
|
|---|
| 38 | // Created: 1997-06-26
|
|---|
| 39 | // Author: Peter Gumplinger
|
|---|
| 40 | // mail: gum@triumf.ca
|
|---|
| 41 | //
|
|---|
| 42 | ////////////////////////////////////////////////////////////////////////
|
|---|
| 43 |
|
|---|
| 44 | #include "G4ios.hh"
|
|---|
| 45 | #include "globals.hh"
|
|---|
| 46 | #include "G4OpticalSurface.hh"
|
|---|
| 47 |
|
|---|
| 48 | /////////////////////////
|
|---|
| 49 | // Class Implementation
|
|---|
| 50 | /////////////////////////
|
|---|
| 51 |
|
|---|
| 52 | //////////////
|
|---|
| 53 | // Operators
|
|---|
| 54 | //////////////
|
|---|
| 55 |
|
|---|
| 56 | const G4OpticalSurface&
|
|---|
| 57 | G4OpticalSurface::operator=(const G4OpticalSurface& right)
|
|---|
| 58 | {
|
|---|
| 59 | if (this != &right)
|
|---|
| 60 | {
|
|---|
| 61 | theName = right.GetName();
|
|---|
| 62 | theModel = right.theModel;
|
|---|
| 63 | theFinish = right.theFinish;
|
|---|
| 64 | theType = right.GetType();
|
|---|
| 65 | sigma_alpha = right.sigma_alpha;
|
|---|
| 66 | polish = right.polish;
|
|---|
| 67 | theMaterialPropertiesTable = right.theMaterialPropertiesTable;
|
|---|
| 68 | }
|
|---|
| 69 | return *this;
|
|---|
| 70 | }
|
|---|
| 71 |
|
|---|
| 72 | /////////////////
|
|---|
| 73 | // Constructors
|
|---|
| 74 | /////////////////
|
|---|
| 75 |
|
|---|
| 76 | G4OpticalSurface::G4OpticalSurface(const G4String& name,
|
|---|
| 77 | G4OpticalSurfaceModel model,
|
|---|
| 78 | G4OpticalSurfaceFinish finish,
|
|---|
| 79 | G4SurfaceType type,
|
|---|
| 80 | G4double value)
|
|---|
| 81 | : G4SurfaceProperty(name,type),
|
|---|
| 82 | theModel(model),
|
|---|
| 83 | theFinish(finish),
|
|---|
| 84 | theMaterialPropertiesTable(0)
|
|---|
| 85 | {
|
|---|
| 86 | if (model == glisur ){
|
|---|
| 87 | polish = value;
|
|---|
| 88 | sigma_alpha = 0.0;
|
|---|
| 89 | }
|
|---|
| 90 | else if ( model == unified ) {
|
|---|
| 91 | sigma_alpha = value;
|
|---|
| 92 | polish = 0.0;
|
|---|
| 93 | }
|
|---|
| 94 | else {
|
|---|
| 95 | G4Exception("G4OpticalSurface::G4OpticalSurface ==> "
|
|---|
| 96 | "Constructor called with INVALID model.");
|
|---|
| 97 | }
|
|---|
| 98 | }
|
|---|
| 99 |
|
|---|
| 100 | G4OpticalSurface::G4OpticalSurface()
|
|---|
| 101 | : G4SurfaceProperty()
|
|---|
| 102 | {
|
|---|
| 103 | }
|
|---|
| 104 |
|
|---|
| 105 | G4OpticalSurface::~G4OpticalSurface()
|
|---|
| 106 | {
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|
| 109 | G4OpticalSurface::G4OpticalSurface(const G4OpticalSurface &right)
|
|---|
| 110 | : G4SurfaceProperty(right.GetName())
|
|---|
| 111 | {
|
|---|
| 112 | *this = right;
|
|---|
| 113 | }
|
|---|
| 114 |
|
|---|
| 115 | G4int G4OpticalSurface::operator==(const G4OpticalSurface &right) const
|
|---|
| 116 | {
|
|---|
| 117 | return (this == (G4OpticalSurface *) &right);
|
|---|
| 118 | }
|
|---|
| 119 |
|
|---|
| 120 | G4int G4OpticalSurface::operator!=(const G4OpticalSurface &right) const
|
|---|
| 121 | {
|
|---|
| 122 | return (this != (G4OpticalSurface *) &right);
|
|---|
| 123 | }
|
|---|
| 124 | ////////////
|
|---|
| 125 | // Methods
|
|---|
| 126 | ////////////
|
|---|
| 127 |
|
|---|
| 128 | void G4OpticalSurface::DumpInfo() const
|
|---|
| 129 | {
|
|---|
| 130 |
|
|---|
| 131 | // Dump info for surface
|
|---|
| 132 |
|
|---|
| 133 | G4cout <<
|
|---|
| 134 | " Surface type = " << G4int(theType) << G4endl <<
|
|---|
| 135 | " Surface finish = " << G4int(theFinish) << G4endl <<
|
|---|
| 136 | " Surface model = " << G4int(theModel) << G4endl;
|
|---|
| 137 |
|
|---|
| 138 | G4cout << G4endl;
|
|---|
| 139 |
|
|---|
| 140 | G4cout << " Surface parameter " << G4endl;
|
|---|
| 141 | G4cout << " ----------------- " << G4endl;
|
|---|
| 142 | if (theModel == glisur ){
|
|---|
| 143 | G4cout << polish << G4endl;
|
|---|
| 144 | }
|
|---|
| 145 | else {
|
|---|
| 146 | G4cout << sigma_alpha << G4endl;
|
|---|
| 147 | }
|
|---|
| 148 | G4cout << G4endl;
|
|---|
| 149 | }
|
|---|