00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00031
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00048
00049 #include "globals.hh"
00050 #include "G4MaterialPropertiesTable.hh"
00051 #include "G4PhysicalConstants.hh"
00052
00054
00056
00057 G4MaterialPropertiesTable::G4MaterialPropertiesTable()
00058 {
00059 }
00060
00062
00064
00065 G4MaterialPropertiesTable::~G4MaterialPropertiesTable()
00066 {
00067 MPTiterator i;
00068 for (i = MPT.begin(); i != MPT.end(); ++i)
00069 {
00070 delete (*i).second;
00071 }
00072 MPT.clear();
00073 MPTC.clear();
00074 }
00075
00077
00079
00080 void G4MaterialPropertiesTable::DumpTable()
00081 {
00082 MPTiterator i;
00083 for (i = MPT.begin(); i != MPT.end(); ++i)
00084 {
00085 G4cout << (*i).first << G4endl;
00086 if ( (*i).second != 0 )
00087 {
00088 (*i).second->DumpValues();
00089 }
00090 else
00091 {
00092 G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat204",
00093 JustWarning, "NULL Material Property Vector Pointer.");
00094 }
00095 }
00096 MPTCiterator j;
00097 for (j = MPTC.begin(); j != MPTC.end(); ++j)
00098 {
00099 G4cout << j->first << G4endl;
00100 if ( j->second != 0 )
00101 {
00102 G4cout << j->second << G4endl;
00103 }
00104 else
00105 {
00106 G4Exception("G4MaterialPropertiesTable::DumpTable()", "mat202",
00107 JustWarning, "No Material Constant Property.");
00108 }
00109 }
00110 }
00111
00112 G4MaterialPropertyVector* G4MaterialPropertiesTable::SetGROUPVEL()
00113 {
00114
00115
00116 G4MaterialPropertyVector *rindex = this->GetProperty("RINDEX");
00117 if (rindex==0) { return 0; }
00118
00119
00120
00121 if ( rindex->GetVectorLength() == 0 ) { return 0; }
00122
00123
00124
00125 G4MaterialPropertyVector* groupvel = new G4MaterialPropertyVector();
00126
00127 this->AddProperty( "GROUPVEL", groupvel );
00128
00129
00130
00131
00132 G4double E0 = rindex->Energy(0);
00133 G4double n0 = (*rindex)[0];
00134
00135 if (E0 <= 0.)
00136 {
00137 G4Exception("G4MaterialPropertiesTable::SetGROUPVEL()", "mat205",
00138 FatalException, "Optical Photon Energy <= 0");
00139 }
00140
00141 if ( rindex->GetVectorLength() >= 2 )
00142 {
00143
00144
00145
00146 G4double E1 = rindex->Energy(1);
00147 G4double n1 = (*rindex)[1];
00148
00149 if (E1 <= 0.)
00150 {
00151 G4Exception("G4MaterialPropertiesTable::SetGROUPVEL()", "mat205",
00152 FatalException, "Optical Photon Energy <= 0");
00153 }
00154
00155 G4double vg;
00156
00157
00158
00159 vg = c_light/(n0+(n1-n0)/std::log(E1/E0));
00160
00161
00162
00163 if((vg<0) || (vg>c_light/n0)) { vg = c_light/n0; }
00164
00165 groupvel->InsertValues( E0, vg );
00166
00167
00168
00169
00170 for (size_t i = 2; i < rindex->GetVectorLength(); i++)
00171 {
00172 vg = c_light/( 0.5*(n0+n1)+(n1-n0)/std::log(E1/E0));
00173
00174
00175
00176 if((vg<0) || (vg>c_light/(0.5*(n0+n1)))) { vg = c_light/(0.5*(n0+n1)); }
00177 groupvel->InsertValues( 0.5*(E0+E1), vg );
00178
00179
00180
00181 E0 = E1;
00182 n0 = n1;
00183 E1 = rindex->Energy(i);
00184 n1 = (*rindex)[i];
00185
00186 if (E1 <= 0.)
00187 {
00188 G4Exception("G4MaterialPropertiesTable::SetGROUPVEL()", "mat205",
00189 FatalException, "Optical Photon Energy <= 0");
00190 }
00191 }
00192
00193
00194
00195 vg = c_light/(n1+(n1-n0)/std::log(E1/E0));
00196
00197
00198
00199 if((vg<0) || (vg>c_light/n1)) { vg = c_light/n1; }
00200 groupvel->InsertValues( E1, vg );
00201 }
00202 else
00203 {
00204 groupvel->InsertValues( E0, c_light/n0 );
00205 }
00206
00207 return groupvel;
00208 }