File indexing completed on 2025-01-18 09:58:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 #ifndef G4OPTICALMATERIALPROPERTIES
0047 #define G4OPTICALMATERIALPROPERTIES
0048
0049 #include "G4MaterialPropertyVector.hh"
0050
0051 #include <CLHEP/Units/PhysicalConstants.h>
0052
0053 #include <vector>
0054
0055 namespace G4OpticalMaterialProperties
0056 {
0057 void ConvertToEnergy(std::vector<G4double>& wavelength)
0058 {
0059 for (auto& val : wavelength) {
0060 val = CLHEP::h_Planck * CLHEP::c_light / (val / 1000.);
0061 }
0062 }
0063
0064 G4MaterialPropertyVector* GetRefractiveIndex(const G4String& material)
0065 {
0066 G4MaterialPropertyVector* v = nullptr;
0067 if (material == "Air") {
0068
0069
0070
0071
0072 std::vector<G4double> wl = {
0073 1.69, 1.675, 1.661, 1.646, 1.632, 1.617, 1.602, 1.588, 1.573,
0074 1.559, 1.544, 1.529, 1.515, 1.5, 1.486, 1.471, 1.456, 1.442,
0075 1.427, 1.413, 1.398, 1.383, 1.369, 1.354, 1.34, 1.325, 1.31,
0076 1.296, 1.281, 1.267, 1.252, 1.237, 1.223, 1.208, 1.194, 1.179,
0077 1.164, 1.15, 1.135, 1.121, 1.106, 1.091, 1.077, 1.062, 1.048,
0078 1.033, 1.018, 1.004, 0.9892, 0.9746, 0.96, 0.9454, 0.9308, 0.9162,
0079 0.9016, 0.887, 0.8724, 0.8578, 0.8432, 0.8286, 0.814, 0.7994, 0.7848,
0080 0.7702, 0.7556, 0.741, 0.7264, 0.7118, 0.6972, 0.6826, 0.668, 0.6534,
0081 0.6388, 0.6242, 0.6096, 0.595, 0.5804, 0.5658, 0.5512, 0.5366, 0.522,
0082 0.5074, 0.4928, 0.4782, 0.4636, 0.449, 0.4344, 0.4198, 0.4052, 0.3906,
0083 0.376, 0.3614, 0.3468, 0.3322, 0.3176, 0.303, 0.2884, 0.2738, 0.2592,
0084 0.2446, 0.23
0085 };
0086
0087 std::vector<G4double> ri = {
0088 1.0002731583221, 1.0002731680358, 1.0002731773414, 1.0002731875774,
0089 1.0002731973879, 1.0002732081845, 1.0002732192871, 1.000273229936,
0090 1.000273241664, 1.0002732529184, 1.0002732653197, 1.0002732780896,
0091 1.0002732903537, 1.0002733038787, 1.0002733168752, 1.0002733312162,
0092 1.000273346005, 1.0002733602287, 1.000273375938, 1.0002733910563,
0093 1.0002734077641, 1.0002734250218, 1.0002734416467, 1.000273460038,
0094 1.000273477767, 1.0002734973936, 1.0002735177028, 1.0002735373021,
0095 1.0002735590237, 1.0002735800022, 1.0002736032705, 1.0002736273968,
0096 1.0002736507265, 1.0002736766354, 1.0002737017104, 1.0002737295823,
0097 1.0002737585479, 1.0002737866205, 1.0002738178689, 1.0002738481835,
0098 1.0002738819616, 1.0002739171561, 1.0002739513533, 1.0002739895199,
0099 1.0002740266464, 1.0002740681302, 1.0002741114819, 1.0002741537295,
0100 1.0002742003794, 1.0002742485227, 1.0002742989071, 1.0002743516746,
0101 1.0002744069782, 1.0002744649838, 1.000274525871, 1.0002745898346,
0102 1.0002746570862, 1.0002747278561, 1.0002748023951, 1.0002748809769,
0103 1.0002749639005, 1.0002750514935, 1.0002751441149, 1.0002752421591,
0104 1.0002753460601, 1.0002754562966, 1.0002755733975, 1.0002756979483,
0105 1.0002758305987, 1.0002759720715, 1.0002761231724, 1.0002762848018,
0106 1.0002764579689, 1.0002766438078, 1.0002768435966, 1.0002770587802,
0107 1.0002772909975, 1.0002775421136, 1.0002778142591, 1.0002781098769,
0108 1.0002784317799, 1.0002787832208, 1.000279167979, 1.0002795904676,
0109 1.0002800558675, 1.0002805702966, 1.0002811410247, 1.000281776749,
0110 1.0002824879531, 1.0002832873764, 1.0002841906396, 1.0002852170881,
0111 1.0002863909483, 1.000287742941, 1.000289312581, 1.000291151532,
0112 1.0002933286388, 1.000295937727, 1.0002991101754, 1.0003030361805,
0113 1.0003080029552
0114 };
0115
0116 ConvertToEnergy(wl);
0117 v = new G4MaterialPropertyVector(wl, ri);
0118 }
0119 else if (material == "Water") {
0120
0121
0122
0123
0124 std::vector<G4double> wl = {
0125 1.129, 1.12, 1.11, 1.101, 1.091, 1.082, 1.072, 1.063, 1.053,
0126 1.044, 1.034, 1.025, 1.015, 1.006, 0.9964, 0.987, 0.9775, 0.968,
0127 0.9585, 0.9491, 0.9396, 0.9301, 0.9207, 0.9112, 0.9017, 0.8923, 0.8828,
0128 0.8733, 0.8638, 0.8544, 0.8449, 0.8354, 0.826, 0.8165, 0.807, 0.7976,
0129 0.7881, 0.7786, 0.7691, 0.7597, 0.7502, 0.7407, 0.7313, 0.7218, 0.7123,
0130 0.7029, 0.6934, 0.6839, 0.6744, 0.665, 0.6555, 0.646, 0.6366, 0.6271,
0131 0.6176, 0.6082, 0.5987, 0.5892, 0.5797, 0.5703, 0.5608, 0.5513, 0.5419,
0132 0.5324, 0.5229, 0.5135, 0.504, 0.4945, 0.485, 0.4756, 0.4661, 0.4566,
0133 0.4472, 0.4377, 0.4282, 0.4188, 0.4093, 0.3998, 0.3903, 0.3809, 0.3714,
0134 0.3619, 0.3525, 0.343, 0.3335, 0.3241, 0.3146, 0.3051, 0.2956, 0.2862,
0135 0.2767, 0.2672, 0.2578, 0.2483, 0.2388, 0.2294, 0.2199, 0.2104, 0.2009,
0136 0.1915, 0.182
0137 };
0138
0139 std::vector<G4double> ri = {
0140 1.3235601610672, 1.3236962786529, 1.3238469492274, 1.3239820826015,
0141 1.3241317601229, 1.3242660923031, 1.3244149850321, 1.3245487081924,
0142 1.3246970353146, 1.3248303521764, 1.3249783454392, 1.3251114708334,
0143 1.3252593763883, 1.3253925390161, 1.3255346928953, 1.3256740639273,
0144 1.3258151661284, 1.3259565897464, 1.326098409446, 1.3262392023332,
0145 1.32638204417, 1.3265255240887, 1.3266682080154, 1.3268132228682,
0146 1.3269591507928, 1.32710453999, 1.3272525883205, 1.3274018651452,
0147 1.3275524865531, 1.3277029655807, 1.3278566311755, 1.3280120256415,
0148 1.328167625867, 1.3283268916356, 1.3284883366632, 1.3286503921034,
0149 1.3288166823394, 1.3289856845931, 1.3291575989438, 1.3293307783594,
0150 1.3295091314406, 1.329691073075, 1.3298748828499, 1.3300647424335,
0151 1.330259008797, 1.3304558735667, 1.3306598562207, 1.3308692454666,
0152 1.3310844250714, 1.3313034432243, 1.3315313994219, 1.3317664745307,
0153 1.3320065870964, 1.3322573970809, 1.3325169923974, 1.3327831408348,
0154 1.3330622051201, 1.3333521716563, 1.3336538750639, 1.3339648469612,
0155 1.334292688017, 1.3346352438404, 1.3349898436519, 1.3353653263299,
0156 1.3357594410975, 1.3361692982684, 1.3366053508081, 1.3370652823778,
0157 1.3375512404603, 1.3380600434506, 1.3386051585073, 1.3391843066628,
0158 1.3397941348754, 1.34045134693, 1.3411539035636, 1.341898413271,
0159 1.3427061376724, 1.3435756703017, 1.3445141685829, 1.3455187528254,
0160 1.3466202523109, 1.3478194943997, 1.3491150472655, 1.350549622307,
0161 1.3521281492629, 1.3538529543346, 1.3557865447701, 1.3579431129972,
0162 1.3603615197762, 1.3630595401556, 1.3661548299831, 1.3696980785677,
0163 1.3737440834249, 1.3785121412586, 1.3841454790718, 1.3908241012126,
0164 1.399064758142, 1.4093866965284, 1.422764121467, 1.4407913910231,
0165 1.4679465862259
0166 };
0167
0168 ConvertToEnergy(wl);
0169 v = new G4MaterialPropertyVector(wl, ri);
0170 }
0171 else if (material == "PMMA") {
0172
0173
0174
0175
0176 std::vector<G4double> wl = {
0177 1.620, 1.608, 1.596, 1.584, 1.572, 1.560, 1.548, 1.536, 1.524, 1.512,
0178 1.500, 1.488, 1.476, 1.464, 1.452, 1.440, 1.428, 1.416, 1.404, 1.392,
0179 1.380, 1.368, 1.356, 1.344, 1.332, 1.320, 1.308, 1.296, 1.284, 1.272,
0180 1.260, 1.248, 1.236, 1.224, 1.212, 1.200, 1.188, 1.176, 1.164, 1.152,
0181 1.140, 1.128, 1.116, 1.104, 1.092, 1.080, 1.068, 1.056, 1.044, 1.032,
0182 1.020, 1.008, 0.996, 0.984, 0.972, 0.960, 0.948, 0.936, 0.924, 0.912,
0183 0.900, 0.888, 0.876, 0.864, 0.852, 0.840, 0.828, 0.816, 0.804, 0.792,
0184 0.780, 0.768, 0.756, 0.744, 0.732, 0.720, 0.708, 0.696, 0.684, 0.672,
0185 0.660, 0.648, 0.636, 0.624, 0.612, 0.600, 0.588, 0.576, 0.564, 0.552,
0186 0.540, 0.528, 0.516, 0.504, 0.492, 0.480, 0.468, 0.456, 0.444, 0.432,
0187 0.420
0188 };
0189
0190 std::vector<G4double> ri = {
0191 1.4805336370194, 1.4805958419707, 1.4806572042606, 1.4807177801532,
0192 1.4807776264012, 1.4808368002755, 1.4808953595962, 1.4809533627658,
0193 1.4810108688022, 1.4810679373753, 1.4811246288434, 1.4811810042925,
0194 1.4812371255769, 1.4812930553619, 1.4813488571684, 1.4814045954196,
0195 1.4814603354903, 1.4815161437579, 1.4815720876568, 1.4816282357347,
0196 1.4816846577124, 1.4817414245457, 1.4817986084914, 1.4818562831765,
0197 1.4819145236704, 1.4819734065613, 1.4820330100373, 1.4820934139706,
0198 1.4821547000072, 1.4822169516613, 1.4822802544152, 1.4823446958243,
0199 1.4824103656291, 1.4824773558724, 1.4825457610252, 1.4826156781186,
0200 1.482687206885, 1.4827604499074, 1.4828355127788, 1.4829125042715,
0201 1.4829915365184, 1.4830727252059, 1.483156189781, 1.4832420536723,
0202 1.4833304445284, 1.4834214944731, 1.483515340381, 1.4836121241751,
0203 1.483711993148, 1.4838151003112, 1.4839216047736, 1.4840316721549,
0204 1.4841454750362, 1.4842631934547, 1.4843850154458, 1.484511137641,
0205 1.4846417659288, 1.4847771161864, 1.4849174150935, 1.4850629010407,
0206 1.4852138251453, 1.4853704523922, 1.4855330629191, 1.4857019534694,
0207 1.4858774390395, 1.486059854753, 1.4862495580004, 1.4864469308883,
0208 1.4866523830528, 1.4868663548994, 1.4870893213462, 1.4873217961577,
0209 1.4875643369775, 1.4878175511839, 1.4880821027184, 1.4883587200625,
0210 1.4886482055708, 1.4889514464045, 1.4892694273501, 1.4896032458562,
0211 1.4899541296675, 1.4903234574922, 1.4907127831856, 1.491123863976,
0212 1.4915586932831, 1.4920195386642, 1.4925089853408, 1.4930299855674,
0213 1.4935859137206, 1.4941806263051, 1.494818524906, 1.4955046181841,
0214 1.4962445758678, 1.4970447626402, 1.4979122317605, 1.4988546454557,
0215 1.4998800687986, 1.5009965515508, 1.5022113611478, 1.5035296480805,
0216 1.5049521933717
0217 };
0218
0219
0220 ConvertToEnergy(wl);
0221 v = new G4MaterialPropertyVector(wl, ri);
0222 }
0223 else if (material == "Fused Silica") {
0224
0225
0226
0227
0228
0229
0230
0231
0232 std::vector<G4double> wl = {
0233 6.700, 6.472, 6.252, 6.039, 5.833, 5.635, 5.443, 5.258, 5.079,
0234 4.906, 4.739, 4.578, 4.422, 4.271, 4.126, 3.986, 3.850, 3.719,
0235 3.592, 3.470, 3.352, 3.238, 3.128, 3.021, 2.918, 2.819, 2.723,
0236 2.630, 2.541, 2.454, 2.371, 2.290, 2.212, 2.137, 2.064, 1.994,
0237 1.926, 1.861, 1.797, 1.736, 1.677, 1.620, 1.565, 1.512, 1.460,
0238 1.410, 1.362, 1.316, 1.271, 1.228, 1.186, 1.146, 1.107, 1.069,
0239 1.033, 0.9976, 0.9636, 0.9308, 0.8992, 0.8686, 0.8390, 0.8104, 0.7829,
0240 0.7562, 0.7305, 0.7056, 0.6816, 0.6584, 0.6360, 0.6143, 0.5934, 0.5732,
0241 0.5537, 0.5349, 0.5167, 0.4991, 0.4821, 0.4657, 0.4498, 0.4345, 0.4197,
0242 0.4055, 0.3917, 0.3783, 0.3655, 0.3530, 0.3410, 0.3294, 0.3182, 0.3074,
0243 0.2969, 0.2868, 0.2770, 0.2676, 0.2585, 0.2497, 0.2412, 0.2330, 0.2251,
0244 0.2174, 0.2100
0245 };
0246
0247 std::vector<G4double> ri = {
0248 1.1596494139777, 1.1973256716307, 1.2280888354422, 1.2537289561387,
0249 1.2753723963511, 1.2937460280032, 1.3096384003386, 1.3234105439689,
0250 1.3354823573874, 1.3461171232165, 1.3555262189157, 1.36388143366,
0251 1.3713701305288, 1.3780997735118, 1.3841208059058, 1.3895553417944,
0252 1.3945035722002, 1.3989819997456, 1.4030708962299, 1.4067782146466,
0253 1.4101696832452, 1.4132741569442, 1.416117293379, 1.4187459519934,
0254 1.4211544161909, 1.4233613684394, 1.4254044329951, 1.427296093753,
0255 1.4290287283802, 1.4306516985468, 1.4321372109342, 1.433529881253,
0256 1.4348196176837, 1.4360139618555, 1.4371349603433, 1.4381729429417,
0257 1.43914806608, 1.4400509385522, 1.4409133669095, 1.4417121733672,
0258 1.4424645759259, 1.4431739285381, 1.4438434020915, 1.4444759883488,
0259 1.4450861470109, 1.445664578157, 1.4462138519129, 1.4467363524093,
0260 1.4472455774929, 1.4477322458328, 1.4482096590065, 1.448668310738,
0261 1.4491214616538, 1.4495710901504, 1.4500069615101, 1.450447735732,
0262 1.4508853971281, 1.4513240787777, 1.4517653834747, 1.4522138205731,
0263 1.4526712743322, 1.4531396102638, 1.4536188536247, 1.4541161650842,
0264 1.4546298754538, 1.4551660299221, 1.4557246986958, 1.4563104080175,
0265 1.4569256013294, 1.4575758068817, 1.4582607881284, 1.4589865613939,
0266 1.4597562854765, 1.4605730794883, 1.4614449911601, 1.4623764385944,
0267 1.4633719346282, 1.4644360310913, 1.465580829975, 1.4668048202486,
0268 1.4681218218832, 1.4695286500209, 1.4710525123802, 1.4727046797948,
0269 1.4744682820342, 1.4763951298847, 1.4784676522483, 1.4807144415912,
0270 1.4831504333467, 1.4857914366574, 1.488683281387, 1.4918215034661,
0271 1.495262719426, 1.498999218542, 1.5031009629039, 1.5076095872199,
0272 1.5125721155558, 1.5180417677275, 1.5240789072975, 1.530846431063,
0273 1.5383576204905
0274 };
0275
0276
0277 ConvertToEnergy(wl);
0278 v = new G4MaterialPropertyVector(wl, ri);
0279 }
0280
0281 else {
0282 G4ExceptionDescription ed;
0283 ed << "Material " << material << " not found.";
0284 G4Exception("G4OpticalMaterialProperties::GetRefractiveIndex", "mat400", FatalException, ed);
0285 return nullptr;
0286 }
0287
0288 return v;
0289 }
0290
0291 G4MaterialPropertyVector* GetProperty(const G4String& key, const G4String& mat)
0292 {
0293 if (key == "RINDEX") {
0294 return GetRefractiveIndex(mat);
0295 }
0296
0297 G4ExceptionDescription ed;
0298 ed << "Property name " << key << " doesn't exist in optical properties data table.";
0299 G4Exception("G4OpticalMaterialProperties::GetProperty", "mat401", FatalException, ed);
0300 return nullptr;
0301 }
0302
0303 }
0304
0305 #endif