Hi @wsetterb , oh yeah, your post are helping me so much!
Reply on: Comments on the code
-
If you see, i don’t use the TeflonOpticalSurface
for the oil/water interfaces, i created a new G4OpticalSurface
called WaterOilOpticalSurface
…
-
I re-use the TeflonOpticalSurface
for the oil/teflon interface, maybe i did it wrong?
-
I didn’t know that, i will follow your advices.
Reply on: Ideas to try
It is my fault, i will describe briefly what I want to do: The idea is to write a simulation in order to make an estimation of absorbance of oil in the water. To do that, i create a integrating sphere where, for every energy, I shoot 1e6
optical photon inside it. For every run i store the number of optical photon died in my detector (it is a cilinder of Silicon put inside the integrating sphere with a diameter of 600 um). In that way I can make a spectrum of Absorbance = Ln(n_died_detector/1e6)
over the range of 250 - 400 nm
.
Having said that:
- I count the photon that arrives on the detector (Yellow disc in the pics, and yes, in the RunAction.cc I also count where all the photons died (water, oil, teflon or detector).
-
As you can see in the code I have already defined two surfaces, but from your answers I realised that there must be three and you have already given me an idea of how to do this. I will correct the code
-
Ok, but I have already done this correctly or am I wrong? Then, why in your WaterOpticalSurface
I can’t add the Transmittacne as you write for the OilOpticalSurface
?
But now I understand the correct way to use them, I hope!
Exactly, you said it right. This way I can set the various transmittance properties on each surface.
And of course, when this part of code is finish, i will post here for you and all the reader the preliminary results!
New code:
Here i will post the new code written thanks to your advices:
/*
You will need three G4OpticalSurfaces. One defines the transition into Teflon. One defines the transition into water.
The third defines the transition into oil. For this reason, You will need to call new G4LogicalBorderSurface six times in total:
once to define Teflon → water
once to define water → Teflon
once to define Teflon → oil
once to define oil → Teflon
once to define water → oil
once to define oil → water
The reason you call it six times is because the volume ordering matters.
*/
G4OpticalSurface* TeflonOpticalSurface = new G4OpticalSurface("TeflonSurface");
TeflonOpticalSurface->SetType(dielectric_dielectric);
TeflonOpticalSurface->SetModel(unified);
TeflonOpticalSurface->SetFinish(groundfrontpainted);
G4OpticalSurface* WaterOpticalSurface = new G4OpticalSurface("WaterSurface");
WaterOpticalSurface->SetType(dielectric_dielectric);
WaterOpticalSurface->SetModel(unified);
WaterOpticalSurface->SetFinish(groundfrontpainted);
/*G4LogicalBorderSurface* WaterTeflonSurface =*/ new
G4LogicalBorderSurface("LSB_WaterTeflonSurface", physSferaIntegratrice, physCilindro, TeflonOpticalSurface);
/*G4LogicalBorderSurface* TeflonWaterSurface =*/ new
G4LogicalBorderSurface("LSB_TeflonWaterSurface", physCilindro, physSferaIntegratrice, WaterOpticalSurface);
//define MPTs for Teflon and the interface _separately_
G4MaterialPropertiesTable* TEFLON_MPT = new G4MaterialPropertiesTable();
G4MaterialPropertiesTable* TeflonInterfaceMpt = new G4MaterialPropertiesTable();
//vettore energia relativo a 250 nm - 400 nm
std::vector<G4double> energy = {3.0995*eV, 3.1073*eV, 3.1151*eV, 3.1229*eV, 3.1308*eV, 3.1387*eV, 3.1467*eV, 3.1547*eV, 3.1628*eV, 3.1708*eV,
3.1790*eV, 3.1871*eV, 3.1954*eV, 3.2036*eV, 3.2119*eV, 3.2203*eV, 3.2286*eV, 3.2371*eV, 3.2455*eV, 3.2541*eV,
3.2626*eV, 3.2712*eV, 3.2799*eV, 3.2886*eV, 3.2973*eV, 3.3061*eV, 3.3150*eV, 3.3239*eV, 3.3328*eV, 3.3418*eV,
3.3508*eV, 3.3599*eV, 3.3690*eV, 3.3782*eV, 3.3874*eV, 3.3967*eV, 3.4060*eV, 3.4154*eV, 3.4249*eV, 3.4343*eV,
3.4439*eV, 3.4535*eV, 3.4631*eV, 3.4728*eV, 3.4826*eV, 3.4924*eV, 3.5023*eV, 3.5122*eV, 3.5222*eV, 3.5322*eV,
3.5423*eV, 3.5524*eV, 3.5626*eV, 3.5729*eV, 3.5832*eV, 3.5936*eV, 3.6041*eV, 3.6146*eV, 3.6251*eV, 3.6358*eV,
3.6465*eV, 3.6572*eV, 3.6680*eV, 3.6789*eV, 3.6899*eV, 3.7009*eV, 3.7120*eV, 3.7231*eV, 3.7343*eV, 3.7456*eV,
3.7570*eV, 3.7684*eV, 3.7799*eV, 3.7914*eV, 3.8031*eV, 3.8148*eV, 3.8265*eV, 3.8384*eV, 3.8503*eV, 3.8623*eV,
3.8744*eV, 3.8865*eV, 3.8987*eV, 3.9110*eV, 3.9234*eV, 3.9359*eV, 3.9484*eV, 3.9610*eV, 3.9737*eV, 3.9865*eV,
3.9994*eV, 4.0123*eV, 4.0253*eV, 4.0384*eV, 4.0516*eV, 4.0649*eV, 4.0783*eV, 4.0917*eV, 4.1053*eV, 4.1189*eV,
4.1327*eV, 4.1465*eV, 4.1604*eV, 4.1744*eV, 4.1885*eV, 4.2027*eV, 4.2170*eV, 4.2314*eV, 4.2459*eV, 4.2605*eV,
4.2752*eV, 4.2900*eV, 4.3049*eV, 4.3199*eV, 4.3350*eV, 4.3502*eV, 4.3655*eV, 4.3809*eV, 4.3965*eV, 4.4121*eV,
4.4279*eV, 4.4437*eV, 4.4597*eV, 4.4758*eV, 4.4920*eV, 4.5084*eV, 4.5248*eV, 4.5414*eV, 4.5581*eV, 4.5749*eV,
4.5919*eV, 4.6089*eV, 4.6261*eV, 4.6434*eV, 4.6609*eV, 4.6785*eV, 4.6962*eV, 4.7141*eV, 4.7321*eV, 4.7502*eV,
4.7685*eV, 4.7869*eV, 4.8054*eV, 4.8241*eV, 4.8430*eV, 4.8620*eV, 4.8811*eV, 4.9004*eV, 4.9198*eV, 4.9394*eV,
4.9592*eV};
//ref: https://aip.scitation.org/doi/10.1063/1.1808916
std::vector<G4double> trasmittance = {0.0101, 0.0101, 0.0103, 0.0103, 0.0103, 0.0103, 0.0104, 0.0104, 0.0107, 0.0107,
0.0107, 0.0107, 0.0107, 0.0108, 0.0108, 0.0108, 0.0108, 0.0109, 0.0109, 0.0109,
0.0109, 0.0112, 0.0112, 0.0112, 0.0112, 0.0112, 0.0113, 0.0113, 0.0113, 0.0113,
0.0115, 0.0115, 0.0115, 0.0115, 0.0115, 0.0116, 0.0116, 0.0116, 0.0116, 0.0117,
0.0117, 0.0117, 0.0117, 0.0117, 0.0117, 0.0120, 0.0120, 0.0120, 0.0120, 0.0120,
0.0121, 0.0121, 0.0123, 0.0123, 0.0124, 0.0124, 0.0124, 0.0124, 0.0127, 0.0127,
0.0127, 0.0128, 0.0128, 0.0129, 0.0129, 0.0130, 0.0130, 0.0132, 0.0132, 0.0132,
0.0133, 0.0133, 0.0134, 0.0134, 0.0136, 0.0136, 0.0137, 0.0137, 0.0137, 0.0137,
0.0140, 0.0140, 0.0140, 0.0141, 0.0141, 0.0142, 0.0142, 0.0144, 0.0144, 0.0145,
0.0145, 0.0146, 0.0146, 0.0146, 0.0149, 0.0149, 0.0150, 0.0150, 0.0152, 0.0152,
0.0158, 0.0158, 0.0161, 0.0161, 0.0171, 0.0179, 0.0179, 0.0188, 0.0188, 0.0200,
0.0200, 0.0210, 0.0210, 0.0220, 0.0220, 0.0232, 0.0248, 0.0248, 0.0256, 0.0256,
0.0273, 0.0273, 0.0286, 0.0286, 0.0296, 0.0296, 0.0311, 0.0311, 0.0324, 0.0339,
0.0339, 0.0352, 0.0352, 0.0372, 0.0372, 0.0380, 0.0380, 0.0398, 0.0398, 0.0414,
0.0427, 0.0427, 0.0441, 0.0441, 0.0457, 0.0457, 0.0473, 0.0473, 0.0482, 0.0482,
0.0492};
//ref: https://www.mdpi.com/2073-4360/12/8/1640
std::vector<G4double> rindex_teflon = {1.3570, 1.3570, 1.3570, 1.3570, 1.3570, 1.3600, 1.3600, 1.3600, 1.3630, 1.3630,
1.3630, 1.3630, 1.3630, 1.3630, 1.3630, 1.3630, 1.3630, 1.3630, 1.3630, 1.3630,
1.3630, 1.3660, 1.3660, 1.3630, 1.3630, 1.3660, 1.3660, 1.3660, 1.3710, 1.3710,
1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3740,
1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3740, 1.3750, 1.3750, 1.3750,
1.3760, 1.3760, 1.3790, 1.3790, 1.3820, 1.3820, 1.3820, 1.3820, 1.3820, 1.3820,
1.3820, 1.3820, 1.3820, 1.3820, 1.3820, 1.3820, 1.3820, 1.3880, 1.3880, 1.3900,
1.3900, 1.3900, 1.3900, 1.3900, 1.3900, 1.3900, 1.3900, 1.3900, 1.3930, 1.3930,
1.3930, 1.3930, 1.3930, 1.3940, 1.3940, 1.3940, 1.3960, 1.3960, 1.3960, 1.3980,
1.3980, 1.3980, 1.3990, 1.3990, 1.3990, 1.4040, 1.4070, 1.4070, 1.4070, 1.4070,
1.4070, 1.4070, 1.4070, 1.4070, 1.4100, 1.4100, 1.4150, 1.4180, 1.4180, 1.4180,
1.4180, 1.4180, 1.4180, 1.4180, 1.4180, 1.4180, 1.4180, 1.4200, 1.4230, 1.4230,
1.4230, 1.4230, 1.4230, 1.4230, 1.4260, 1.4260, 1.4290, 1.4290, 1.4310, 1.4340,
1.4340, 1.4340, 1.4340, 1.4370, 1.4370, 1.4420, 1.4420, 1.4420, 1.4420, 1.4420,
1.4420, 1.4420, 1.4450, 1.4450, 1.4480, 1.4480, 1.4510, 1.4510, 1.4510, 1.4510,
1.4530};
//valore messo al fine di non avere fotoni al di fuori della sfera
std::vector<G4double> absorption = {1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um, 1.0000*um,
1.0000*um};
/*
However, in case of a surface between two dielectrics, the result is not as the variable name suggests: The photons are absorbed
with a probability of 1 %−r, where r is the specified “reflectivity” value. The remaining photons are then reflected/refracted
according to the Fresnel equation. Thus, in this case, the REFLECTIVITY variable simulates something like absorbing dirt on the surface.
To specify the reflectivity of a surface between two dielectrics, the TRANSMITTANCE variable has to be used, where the reflectivity R
derives from the transmittance T by R = 1 % − T . One should also note that Geant4 does not perform any optical process at a surface
between two dielectrics that consist of the same material. Per tal motivo il parametro di riflettività non viene usato.
Si usa la trasmittanza. Il parametro di absorption lo tiri fuori dal grafico di assorbanza usando ROOT e https://apps.automeris.io/wpd/
*/
//only set RINDEX and ABSLENGTH for the material
TEFLON_MPT->AddProperty("RINDEX", energy, rindex_teflon);
TEFLON_MPT->AddProperty("ABSLENGTH", energy, absorption);
//these properties correspond to surfaces; set them separately.
//see https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/physicsProcess.html#id9
TeflonInterfaceMpt->AddProperty("TRANSMITTANCE", energy, trasmittance);
TeflonInterfaceMpt->AddProperty("RINDEX", energy, rindex_teflon);
//qui associ le proprietà del materiale
teflon_mat->SetMaterialPropertiesTable(TEFLON_MPT);
//here we set the properties to the table defined only for the interface
TeflonOpticalSurface->SetMaterialPropertiesTable(TeflonInterfaceMpt);
G4MaterialPropertiesTable* Water_MPT = new G4MaterialPropertiesTable();
G4MaterialPropertiesTable* WaterInterfaceMpt = new G4MaterialPropertiesTable();
//ref: https://refractiveindex.info/?shelf=main&book=H2O&page=Hale
std::vector<G4double> rindex_water = {1.3390, 1.3391, 1.3392, 1.3392, 1.3393, 1.3394, 1.3395, 1.3396, 1.3396, 1.3397,
1.3398, 1.3399, 1.3400, 1.3400, 1.3401, 1.3402, 1.3403, 1.3434, 1.3404, 1.3405,
1.3406, 1.3407, 1.3408, 1.3408, 1.3409, 1.3410, 1.3411, 1.3412, 1.3412, 1.3413,
1.3414, 1.3415, 1.3416, 1.3416, 1.3417, 1.3418, 1.3419, 1.3420, 1.3420, 1.3421,
1.3422, 1.3423, 1.3424, 1.3424, 1.3425, 1.3426, 1.3427, 1.3428, 1.3428, 1.3429,
1.3430, 1.3431, 1.3432, 1.3434, 1.3435, 1.3436, 1.3437, 1.3438, 1.3440, 1.3441,
1.3442, 1.3443, 1.3444, 1.3446, 1.3447, 1.3448, 1.3449, 1.3450, 1.3452, 1.3453,
1.3454, 1.3455, 1.3456, 1.3458, 1.3459, 1.3460, 1.3461, 1.3462, 1.3464, 1.3465,
1.3466, 1.3467, 1.3468, 1.3470, 1.3471, 1.3472, 1.3473, 1.3474, 1.3476, 1.3477,
1.3478, 1.3479, 1.3480, 1.3482, 1.3483, 1.3484, 1.3485, 1.3486, 1.3488, 1.3489,
1.3490, 1.3492, 1.3494, 1.3496, 1.3498, 1.3500, 1.3502, 1.3504, 1.3506, 1.3508,
1.3510, 1.3512, 1.3514, 1.3516, 1.3518, 1.3520, 1.3522, 1.3524, 1.3526, 1.3528,
1.3530, 1.3532, 1.3534, 1.3536, 1.3538, 1.3540, 1.3543, 1.3546, 1.3550, 1.3553,
1.3556, 1.3559, 1.3562, 1.3566, 1.3569, 1.3572, 1.3575, 1.3578, 1.3582, 1.3585,
1.3588, 1.3591, 1.3594, 1.3598, 1.3601, 1.3604, 1.3607, 1.3610, 1.3614, 1.3617,
1.3620};
//ref: https://sci-hub.ru/https://doi.org/10.1039/C5RA11502G
std::vector<G4double> absorption_water = {169.2437*m, 171.3565*m, 173.3922*m, 175.3392*m, 177.1855*m, 178.9191*m, 180.5284*m, 182.0019*m, 183.3286*m, 184.4981*m,
185.5008*m, 186.3279*m, 186.9718*m, 187.4259*m, 187.6853*m, 187.7459*m, 187.6056*m, 187.2635*m, 186.7204*m, 185.9783*m,
185.0412*m, 183.9140*m, 182.6033*m, 181.1166*m, 179.4627*m, 177.6512*m, 175.6927*m, 173.5981*m, 171.3789*m, 169.0471*m,
166.6146*m, 164.0935*m, 161.4955*m, 158.8324*m, 156.1154*m, 153.3555*m, 150.5630*m, 147.7477*m, 144.9188*m, 142.0850*m,
139.2541*m, 136.4334*m, 133.6296*m, 130.8485*m, 128.0956*m, 125.3755*m, 122.6924*m, 120.0499*m, 117.4511*m, 114.8986*m,
112.3945*m, 109.9407*m, 107.5384*m, 105.1887*m, 102.8924*m, 100.6498*m, 98.4612*m, 96.3264*m, 94.2454*m, 92.2177*m,
90.2426*m, 88.3197*m, 86.4480*m, 84.6266*m, 82.8546*m, 81.1310*m, 79.4546*m, 77.8243*m, 76.2389*m, 74.6973*m,
73.1983*m, 71.7405*m, 70.3228*m, 68.9440*m, 67.6029*m, 66.2981*m, 65.0286*m, 63.7931*m, 62.5905*m, 61.4196*m,
60.2794*m, 59.1686*m, 58.0863*m, 57.0314*m, 56.0028*m, 54.9996*m, 54.0207*m, 53.0653*m, 52.1324*m, 51.2211*m,
50.3305*m, 49.4598*m, 48.6082*m, 47.7749*m, 46.9592*m, 46.1602*m, 45.3773*m, 44.6097*m, 43.8569*m, 43.1182*m,
42.3929*m, 41.6805*m, 40.9804*m, 40.2920*m, 39.6149*m, 38.9486*m, 38.2924*m, 37.6461*m, 37.0092*m, 36.3812*m,
35.7618*m, 35.1506*m, 34.5473*m, 33.9515*m, 33.3630*m, 32.7814*m, 32.2065*m, 31.6380*m, 31.0758*m, 30.5195*m,
29.9691*m, 29.4244*m, 28.8852*m, 28.3514*m, 27.8229*m, 27.2996*m, 26.7814*m, 26.2682*m, 25.7600*m, 25.2567*m,
24.7584*m, 24.2650*m, 23.7765*m, 23.2930*m, 22.8144*m, 22.3408*m, 21.8723*m, 21.4088*m, 20.9505*m, 20.4973*m,
20.0495*m, 19.6070*m, 19.1699*m, 18.7383*m, 18.3122*m, 17.8918*m, 17.4771*m, 17.0682*m, 16.6652*m, 16.2682*m,
15.8771*m};
//ref: https://refractiveindex.info/?shelf=main&book=H2O&page=Hale
std::vector<G4double> trasmittance_water = {1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000,
1.0000};
Water_MPT->AddProperty("RINDEX", energy, rindex_water);
Water_MPT->AddProperty("ABSLENGTH", energy, absorption_water);
WaterInterfaceMpt->AddProperty("TRANSMITTANCE", energy, trasmittance_water);
WaterInterfaceMpt->AddProperty("RINDEX", energy, rindex_water);
water_mat->SetMaterialPropertiesTable(Water_MPT);
WaterOpticalSurface->SetMaterialPropertiesTable(WaterInterfaceMpt);
G4OpticalSurface* OilOpticalSurface = new G4OpticalSurface("OilSurface");
OilOpticalSurface->SetType(dielectric_dielectric);
OilOpticalSurface->SetModel(unified);
OilOpticalSurface->SetFinish(groundfrontpainted);
/*G4LogicalBorderSurface* TeflonOilSurface =*/ new
G4LogicalBorderSurface("LSB_TeflonOilSurface", physCilindro, physCalotta_Olio_oliva, OilOpticalSurface);
/*G4LogicalBorderSurface* OilTeflonSurface =*/ new
G4LogicalBorderSurface("LSB_OilTeflonSurface", physCalotta_Olio_oliva, physCilindro, TeflonOpticalSurface);
/*
Dato che è impossibile trovare ricerche in letteratura per quanto riguarda i parametri ottici dell'olio, essi sono stati
ricavati tramite diverse formule. L'indice di rifrazione tramite la formula di Cauchy, ref:
https://www.horiba.com/fra/scientific/technologies/spectroscopic-ellipsometry/cauchy-dispersion-module/ mentre i parametri
sono stati presi dalla ref https://www.worldscientific.com/doi/10.1142/S1793545821400101
La formula della transmittance è stata anch'essa ricavata mediante:
*/
std::vector<G4double> rindex_olio_oliva = {1.4114, 1.4115, 1.4116, 1.4118, 1.4119, 1.4120, 1.4121, 1.4122, 1.4124, 1.4125,
1.4126, 1.4127, 1.4129, 1.4130, 1.4131, 1.4133, 1.4134, 1.4135, 1.4137, 1.4138,
1.4139, 1.4141, 1.4142, 1.4143, 1.4145, 1.4146, 1.4148, 1.4149, 1.4150, 1.4152,
1.4153, 1.4155, 1.4156, 1.4158, 1.4159, 1.4161, 1.4162, 1.4164, 1.4165, 1.4167,
1.4169, 1.4170, 1.4172, 1.4173, 1.4175, 1.4177, 1.4178, 1.4180, 1.4182, 1.4183,
1.4185, 1.4187, 1.4189, 1.4190, 1.4192, 1.4194, 1.4196, 1.4198, 1.4199, 1.4201,
1.4203, 1.4205, 1.4207, 1.4209, 1.4211, 1.4213, 1.4215, 1.4217, 1.4219, 1.4221,
1.4223, 1.4225, 1.4227, 1.4229, 1.4231, 1.4233, 1.4236, 1.4238, 1.4240, 1.4242,
1.4244, 1.4247, 1.4249, 1.4251, 1.4254, 1.4256, 1.4258, 1.4261, 1.4263, 1.4266,
1.4268, 1.4270, 1.4273, 1.4276, 1.4278, 1.4281, 1.4283, 1.4286, 1.4289, 1.4291,
1.4294, 1.4297, 1.4300, 1.4302, 1.4305, 1.4308, 1.4311, 1.4314, 1.4317, 1.4320,
1.4323, 1.4326, 1.4329, 1.4332, 1.4335, 1.4338, 1.4341, 1.4345, 1.4348, 1.4351,
1.4355, 1.4358, 1.4361, 1.4365, 1.4368, 1.4372, 1.4375, 1.4379, 1.4382, 1.4386,
1.4390, 1.4394, 1.4397, 1.4401, 1.4405, 1.4409, 1.4413, 1.4417, 1.4421, 1.4425,
1.4429, 1.4433, 1.4438, 1.4442, 1.4446, 1.4451, 1.4455, 1.4460, 1.4464, 1.4469,
1.4473};
//ref: https://www.scielo.org.mx/scielo.php?pid=S1665-64232020000600333&script=sci_arttext
std::vector<G4double> absorption_olio_oliva = {0.3561*mm, 0.4272*mm, 0.4717*mm, 0.4613*mm, 0.4735*mm, 0.4831*mm, 0.4902*mm, 0.4970*mm, 0.5045*mm, 0.5136*mm,
0.5219*mm, 0.5297*mm, 0.5382*mm, 0.5467*mm, 0.5559*mm, 0.5637*mm, 0.5714*mm, 0.5790*mm, 0.5831*mm, 0.5882*mm,
0.5942*mm, 0.5981*mm, 0.6024*mm, 0.6050*mm, 0.6079*mm, 0.6124*mm, 0.6143*mm, 0.6180*mm, 0.6219*mm, 0.6242*mm,
0.6289*mm, 0.6321*mm, 0.6341*mm, 0.6361*mm, 0.6386*mm, 0.6435*mm, 0.6460*mm, 0.6456*mm, 0.6485*mm, 0.6494*mm,
0.6472*mm, 0.6452*mm, 0.6439*mm, 0.6382*mm, 0.6345*mm, 0.6333*mm, 0.6281*mm, 0.6169*mm, 0.6250*mm, 0.5879*mm,
0.5147*mm, 0.5107*mm, 0.5565*mm, 0.5865*mm, 0.5682*mm, 0.5571*mm, 0.5528*mm, 0.5459*mm, 0.5350*mm, 0.5252*mm,
0.5139*mm, 0.5040*mm, 0.4965*mm, 0.4880*mm, 0.4773*mm, 0.4619*mm, 0.4468*mm, 0.4367*mm, 0.4243*mm, 0.4092*mm,
0.3968*mm, 0.3871*mm, 0.3731*mm, 0.3687*mm, 0.3686*mm, 0.3621*mm, 0.3551*mm, 0.3529*mm, 0.3483*mm, 0.3372*mm,
0.3255*mm, 0.3160*mm, 0.3088*mm, 0.3040*mm, 0.3005*mm, 0.2958*mm, 0.2916*mm, 0.2888*mm, 0.2869*mm, 0.2885*mm,
0.2890*mm, 0.2846*mm, 0.2774*mm, 0.2714*mm, 0.2639*mm, 0.2570*mm, 0.2534*mm, 0.2503*mm, 0.2541*mm, 0.2427*mm,
0.2237*mm, 0.2433*mm, 0.2553*mm, 0.2514*mm, 0.2528*mm, 0.2530*mm, 0.2549*mm, 0.2564*mm, 0.2562*mm, 0.2571*mm,
0.2574*mm, 0.2579*mm, 0.2589*mm, 0.2592*mm, 0.2596*mm, 0.2599*mm, 0.2605*mm, 0.2617*mm, 0.2626*mm, 0.2632*mm,
0.2636*mm, 0.2639*mm, 0.2640*mm, 0.2641*mm, 0.2647*mm, 0.2650*mm, 0.2646*mm, 0.2648*mm, 0.2650*mm, 0.2650*mm,
0.2655*mm, 0.2656*mm, 0.2655*mm, 0.2656*mm, 0.2655*mm, 0.2657*mm, 0.2653*mm, 0.2650*mm, 0.2652*mm, 0.2634*mm,
0.2618*mm, 0.2611*mm, 0.2598*mm, 0.2597*mm, 0.2597*mm, 0.2599*mm, 0.2603*mm, 0.2603*mm, 0.2646*mm, 0.2592*mm,
0.2467*mm};
std::vector<G4double> trasmittance_olio_oliva = {0.9106, 0.9106, 0.9106, 0.9105, 0.9105, 0.9104, 0.9104, 0.9104, 0.9103, 0.9103,
0.9102, 0.9102, 0.9102, 0.9101, 0.9101, 0.9100, 0.9100, 0.9100, 0.9099, 0.9099,
0.9098, 0.9098, 0.9097, 0.9097, 0.9097, 0.9096, 0.9096, 0.9095, 0.9095, 0.9094,
0.9094, 0.9093, 0.9093, 0.9092, 0.9092, 0.9091, 0.9091, 0.9090, 0.9090, 0.9089,
0.9089, 0.9088, 0.9088, 0.9087, 0.9087, 0.9086, 0.9086, 0.9085, 0.9085, 0.9084,
0.9084, 0.9083, 0.9082, 0.9082, 0.9081, 0.9081, 0.9080, 0.9080, 0.9079, 0.9078,
0.9078, 0.9077, 0.9077, 0.9076, 0.9075, 0.9075, 0.9074, 0.9073, 0.9073, 0.9072,
0.9071, 0.9071, 0.9070, 0.9069, 0.9069, 0.9068, 0.9067, 0.9067, 0.9066, 0.9065,
0.9065, 0.9064, 0.9063, 0.9062, 0.9062, 0.9061, 0.9060, 0.9059, 0.9059, 0.9058,
0.9057, 0.9056, 0.9055, 0.9055, 0.9054, 0.9053, 0.9052, 0.9051, 0.9050, 0.9049,
0.9049, 0.9048, 0.9047, 0.9046, 0.9045, 0.9044, 0.9043, 0.9042, 0.9041, 0.9040,
0.9039, 0.9038, 0.9037, 0.9036, 0.9035, 0.9034, 0.9033, 0.9032, 0.9031, 0.9030,
0.9029, 0.9028, 0.9027, 0.9026, 0.9025, 0.9024, 0.9022, 0.9021, 0.9020, 0.9019,
0.9018, 0.9016, 0.9015, 0.9014, 0.9013, 0.9011, 0.9010, 0.9009, 0.9008, 0.9006,
0.9005, 0.9004, 0.9002, 0.9001, 0.8999, 0.8998, 0.8997, 0.8995, 0.8994, 0.8992,
0.8991};
G4MaterialPropertiesTable* Olio_MPT = new G4MaterialPropertiesTable();
G4MaterialPropertiesTable* OlioInterfaceMpt = new G4MaterialPropertiesTable();
Olio_MPT->AddProperty("RINDEX", energy, rindex_olio_oliva);
Olio_MPT->AddProperty("ABSLENGTH", energy, absorption_olio_oliva);
OlioInterfaceMpt->AddProperty("TRANSMITTANCE", energy, trasmittance_olio_oliva);
OlioInterfaceMpt->AddProperty("RINDEX", energy, rindex_olio_oliva);
Olio_Oliva->SetMaterialPropertiesTable(Olio_MPT);
OilOpticalSurface->SetMaterialPropertiesTable(OlioInterfaceMpt);
/*
Terza ed ultima interfaccia, si ri-usano le già definite G4OPticalSurface per l'acqua ed olio
*/
/*G4LogicalBorderSurface* OilWaterSurface =*/ new
G4LogicalBorderSurface("LSB_OilWaterSurface", physCalotta_Olio_oliva, physSferaIntegratrice, WaterOpticalSurface);
/*G4LogicalBorderSurface* WaterOilSurface =*/ new
G4LogicalBorderSurface("LSB_WaterOIlSurface", physSferaIntegratrice, physCalotta_Olio_oliva, OilOpticalSurface);
What do you think? Is everything ok?
-
I don’t know where set the attribute polished
, which is the right surface?
-
Then, the whole order are correct? I see in the distribution that photon never die in the oil and teflon (vol_ID = 0 detector, 1 oil, 2 water and 3 for teflon) this is wrong and strange:
I suppose that the error(s) is somewhere in one or more G4LogicalSurface
, but where? If i put Polished
and not groundfrontpainted
in the OilOpticalSurface
now the photons go through the oil surface:
they enter and are absorbed:
This is correct, I think, but I don’t understand why If I put groundfrontpainted
the photons don’t go in the oil (this is wrong):
Thanks for your time and patient, your post are really saving me! I Understanding better how to use GEANT4 