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 delete theMicroRoughnessTable;
82 delete maxMicroRoughnessTable;
83 delete theMicroRoughnessTransTable;
84 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;
133 if (Nthetadim*NEdim > 0) {
134 delete theMicroRoughnessTable;
135 theMicroRoughnessTable =
new G4double[Nthetadim * NEdim];
136 delete maxMicroRoughnessTable;
137 maxMicroRoughnessTable =
new G4double[Nthetadim * NEdim];
138 delete theMicroRoughnessTransTable;
139 theMicroRoughnessTransTable =
new G4double[Nthetadim * NEdim];
140 delete maxMicroRoughnessTransTable;
141 maxMicroRoughnessTransTable =
new G4double[Nthetadim * NEdim];
178 theta_i_step = (theta_i_max-theta_i_min)/(no_theta_i-1);
183 E_step = (Emax-Emin)/(noE-1);
194 std::ofstream dateir(
"MRrefl.dat",std::ios::out);
195 std::ofstream dateit(
"MRtrans.dat",std::ios::out);
199 for (theta_i=theta_i_min; theta_i<=theta_i_max+1e-6; theta_i+=theta_i_step) {
201 for (E=Emin; E<=Emax; E+=E_step) {
202 *(theMicroRoughnessTable+counter) =
204 IntIplus(E, fermipot, theta_i, AngNoTheta, AngNoPhi,
205 b2, w2, maxMicroRoughnessTable+counter, AngCut);
207 *(theMicroRoughnessTransTable+counter) =
209 IntIminus(E, fermipot, theta_i, AngNoTheta, AngNoPhi,
210 b2, w2, maxMicroRoughnessTransTable+counter,
213 dateir << *(theMicroRoughnessTable+counter) <<
G4endl;
214 dateit << *(theMicroRoughnessTransTable+counter) <<
G4endl;
227 std::ofstream dateic(
"MRcheck.dat",std::ios::out);
228 std::ofstream dateimr(
"MRmaxrefl.dat",std::ios::out);
229 std::ofstream dateimt(
"MRmaxtrans.dat",std::ios::out);
231 for (theta_i=theta_i_min; theta_i<=theta_i_max+1e-6; theta_i+=theta_i_step) {
232 for (E=Emin; E<=Emax; E+=E_step) {
251 if(theMicroRoughnessTable ==
nullptr)
253 G4cout <<
"Do not have theMicroRoughnessTable" <<
G4endl;
267 if(theta_i < theta_i_min || theta_i > theta_i_max || Energy < Emin ||
276 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
277 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
285 return *(theMicroRoughnessTable+E_pos+theta_i_pos*(noE - 1));
291 if(theMicroRoughnessTransTable ==
nullptr)
299 if(theta_i < theta_i_min || theta_i > theta_i_max || Energy < Emin ||
308 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
309 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
314 return *(theMicroRoughnessTransTable+E_pos+theta_i_pos*(noE - 1));
320 if(maxMicroRoughnessTable ==
nullptr)
328 if(theta_i < theta_i_min || theta_i > theta_i_max || Energy < Emin ||
337 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
338 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
343 return *(maxMicroRoughnessTable+E_pos+theta_i_pos*noE);
349 if(maxMicroRoughnessTable !=
nullptr)
351 if(theta_i < theta_i_min || theta_i > theta_i_max || Energy < Emin ||
359 G4int theta_i_pos =
G4int((theta_i - theta_i_min) / theta_i_step + 0.5);
360 G4int E_pos =
G4int((Energy - Emin) / E_step + 0.5);
365 *(maxMicroRoughnessTable + E_pos + theta_i_pos * noE) = value;
373 if(maxMicroRoughnessTransTable ==
nullptr)
381 if(theta_i < theta_i_min || theta_i > theta_i_max || Energy < Emin ||
390 G4int theta_i_pos =
G4int((theta_i-theta_i_min)/theta_i_step+0.5);
391 G4int E_pos =
G4int((Energy-Emin)/E_step+0.5);
396 return *(maxMicroRoughnessTransTable+E_pos+theta_i_pos*noE);
402 if(maxMicroRoughnessTransTable !=
nullptr)
404 if(theta_i < theta_i_min || theta_i > theta_i_max || Energy < Emin ||
412 G4int theta_i_pos =
G4int((theta_i - theta_i_min) / theta_i_step + 0.5);
413 G4int E_pos =
G4int((Energy - Emin) / E_step + 0.5);
418 *(maxMicroRoughnessTransTable + E_pos + theta_i_pos * noE) = value;
429 ProbIplus(Energy, fermipot, theta_i, theta_o, phi_o, b, w, AngCut);
438 ProbIminus(Energy, fermipot,theta_i, theta_o, phi_o, b, w, AngCut);
445 G4double k = std::sqrt(2*neutron_mass_c2*E / hbarc_squared);
446 G4double k_l = std::sqrt(2*neutron_mass_c2*VFermi / hbarc_squared);
457 return 2 * b * k * std::cos(theta_i) < 1 && 2 * b * k_l < 1;
464 G4double k2 = 2*neutron_mass_c2*E / hbarc_squared;
465 G4double k_l2 = 2*neutron_mass_c2*VFermi / hbarc_squared;
467 if(E * (std::cos(theta_i) * std::cos(theta_i)) < VFermi)
479 return 2 * b * std::sqrt(kS2) * std::cos(theta_i) < 1 &&
480 2 * b * std::sqrt(k_l2) < 1;
G4GLOB_DLL std::ostream G4cout
void AddConstProperty(const G4String &key, G4double propertyValue, G4bool createNewKey=false)
G4bool ConstPropertyExists(const G4String &key) const
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 *)
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)
~G4UCNMaterialPropertiesTable() override
void InitMicroRoughnessTables()
G4double * GetMicroRoughnessTransTable()
static G4UCNMicroRoughnessHelper * GetInstance()