56 theMicroRoughnessTable =
nullptr;
57 maxMicroRoughnessTable =
nullptr;
58 theMicroRoughnessTransTable =
nullptr;
59 maxMicroRoughnessTransTable =
nullptr;
61 theta_i_min = 0.*degree;
62 theta_i_max = 90.*degree;
70 theta_i_step = (theta_i_max-theta_i_min)/(no_theta_i-1);
71 E_step = (Emax-Emin)/(noE-1);
81 if (theMicroRoughnessTable)
delete theMicroRoughnessTable;
82 if (maxMicroRoughnessTable)
delete maxMicroRoughnessTable;
83 if (theMicroRoughnessTransTable)
delete theMicroRoughnessTransTable;
84 if (maxMicroRoughnessTransTable)
delete maxMicroRoughnessTransTable;
89 return theMicroRoughnessTable;
94 return theMicroRoughnessTransTable;
100 G4double* pMicroRoughnessTransTable,
101 G4double* pmaxMicroRoughnessTransTable)
103 theMicroRoughnessTable = pMicroRoughnessTable;
104 maxMicroRoughnessTable = pmaxMicroRoughnessTable;
105 theMicroRoughnessTransTable = pMicroRoughnessTransTable;
106 maxMicroRoughnessTransTable = pmaxMicroRoughnessTransTable;
129 if (Nthetadim*NEdim > 0) {
130 if (theMicroRoughnessTable)
delete theMicroRoughnessTable;
131 theMicroRoughnessTable =
new G4double[Nthetadim*NEdim];
132 if (maxMicroRoughnessTable)
delete maxMicroRoughnessTable;
133 maxMicroRoughnessTable =
new G4double[Nthetadim*NEdim];
134 if (theMicroRoughnessTransTable)
delete theMicroRoughnessTransTable;
135 theMicroRoughnessTransTable =
new G4double[Nthetadim*NEdim];
136 if (maxMicroRoughnessTransTable)
delete maxMicroRoughnessTransTable;
137 maxMicroRoughnessTransTable =
new G4double[Nthetadim*NEdim];
174 theta_i_step = (theta_i_max-theta_i_min)/(no_theta_i-1);
179 E_step = (Emax-Emin)/(noE-1);
190 std::ofstream dateir(
"MRrefl.dat",std::ios::out);
191 std::ofstream dateit(
"MRtrans.dat",std::ios::out);
195 for (theta_i=theta_i_min; theta_i<=theta_i_max+1e-6; theta_i+=theta_i_step) {
197 for (E=Emin; E<=Emax; E+=E_step) {
198 *(theMicroRoughnessTable+counter) =
200 IntIplus(E, fermipot, theta_i, AngNoTheta, AngNoPhi,
201 b2, w2, maxMicroRoughnessTable+counter, AngCut);
203 *(theMicroRoughnessTransTable+counter) =
205 IntIminus(E, fermipot, theta_i, AngNoTheta, AngNoPhi,
206 b2, w2, maxMicroRoughnessTransTable+counter,
209 dateir << *(theMicroRoughnessTable+counter) <<
G4endl;
210 dateit << *(theMicroRoughnessTransTable+counter) <<
G4endl;
223 std::ofstream dateic(
"MRcheck.dat",std::ios::out);
224 std::ofstream dateimr(
"MRmaxrefl.dat",std::ios::out);
225 std::ofstream dateimt(
"MRmaxtrans.dat",std::ios::out);
227 for (theta_i=theta_i_min; theta_i<=theta_i_max+1e-6; theta_i+=theta_i_step) {
228 for (E=Emin; E<=Emax; E+=E_step) {
247 if (!theMicroRoughnessTable) {
248 G4cout <<
"Do not have theMicroRoughnessTable" <<
G4endl;
262 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
268 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
269 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
277 return *(theMicroRoughnessTable+E_pos+theta_i_pos*(noE - 1));
283 if (!theMicroRoughnessTransTable)
return 0.;
288 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
294 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
295 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
300 return *(theMicroRoughnessTransTable+E_pos+theta_i_pos*(noE - 1));
306 if (!maxMicroRoughnessTable)
return 0.;
311 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
317 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
318 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
323 return *(maxMicroRoughnessTable+E_pos+theta_i_pos*noE);
329 if (maxMicroRoughnessTable) {
331 if (theta_i<theta_i_min || theta_i>theta_i_max ||
332 Energy<Emin || Energy>Emax) {
338 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
339 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
344 *(maxMicroRoughnessTable+E_pos+theta_i_pos*noE) = value;
352 if (!maxMicroRoughnessTransTable)
return 0.;
357 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
363 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
364 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
369 return *(maxMicroRoughnessTransTable+E_pos+theta_i_pos*noE);
375 if (maxMicroRoughnessTransTable) {
377 if (theta_i<theta_i_min || theta_i>theta_i_max ||
378 Energy<Emin || Energy>Emax) {
384 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
385 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
390 *(maxMicroRoughnessTransTable+E_pos+theta_i_pos*noE) = value;
401 ProbIplus(Energy, fermipot, theta_i, theta_o, phi_o, b, w, AngCut);
410 ProbIminus(Energy, fermipot,theta_i, theta_o, phi_o, b, w, AngCut);
417 G4double k = std::sqrt(2*neutron_mass_c2*E / hbarc_squared);
418 G4double k_l = std::sqrt(2*neutron_mass_c2*VFermi / hbarc_squared);
429 if (2*b*k*std::cos(theta_i) < 1 && 2*b*k_l < 1)
return true;
437 G4double k2 = 2*neutron_mass_c2*E / hbarc_squared;
438 G4double k_l2 = 2*neutron_mass_c2*VFermi / hbarc_squared;
440 if (E*(std::cos(theta_i)*std::cos(theta_i)) < VFermi)
return false;
449 if (2*b*std::sqrt(kS2)*std::cos(theta_i) < 1 && 2*b*std::sqrt(k_l2) < 1)
return true;
G4GLOB_DLL std::ostream G4cout
G4bool ConstPropertyExists(const G4String &key) const
void AddConstProperty(const G4String &key, G4double PropertyValue)
G4double GetConstProperty(const G4String &key) const
void RemoveConstProperty(const G4String &key)
G4double GetMRMaxTransProbability(G4double, G4double)
void SetMicroRoughnessParameters(G4double, G4double, G4int, G4int, G4double, G4double, G4double, G4double, G4int, G4int, G4double)
G4double GetMRProbability(G4double, G4double, G4double, G4double, G4double)
G4bool ConditionsValid(G4double E, G4double VFermi, G4double theta_i)
void LoadMicroRoughnessTables(G4double *, G4double *, G4double *, G4double *)
virtual ~G4UCNMaterialPropertiesTable()
G4bool TransConditionsValid(G4double E, G4double VFermi, G4double theta_i)
void SetMRMaxProbability(G4double, G4double, G4double)
G4UCNMaterialPropertiesTable()
G4double * GetMicroRoughnessTable()
void SetMRMaxTransProbability(G4double, G4double, G4double)
G4double GetMRIntTransProbability(G4double, G4double)
void ComputeMicroRoughnessTables()
G4double GetMRMaxProbability(G4double, G4double)
G4double GetMRTransProbability(G4double, G4double, G4double, G4double, G4double)
G4double GetMRIntProbability(G4double, G4double)
void InitMicroRoughnessTables()
G4double * GetMicroRoughnessTransTable()
static G4UCNMicroRoughnessHelper * GetInstance()