Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UCNMaterialPropertiesTable Class Reference

#include <G4UCNMaterialPropertiesTable.hh>

+ Inheritance diagram for G4UCNMaterialPropertiesTable:

Public Member Functions

 G4UCNMaterialPropertiesTable ()
 
virtual ~G4UCNMaterialPropertiesTable ()
 
G4doubleGetMicroRoughnessTable ()
 
G4doubleGetMicroRoughnessTransTable ()
 
void LoadMicroRoughnessTables (G4double *, G4double *, G4double *, G4double *)
 
void InitMicroRoughnessTables ()
 
void ComputeMicroRoughnessTables ()
 
G4double GetMRIntProbability (G4double, G4double)
 
G4double GetMRMaxProbability (G4double, G4double)
 
void SetMRMaxProbability (G4double, G4double, G4double)
 
G4double GetMRProbability (G4double, G4double, G4double, G4double, G4double)
 
G4double GetMRIntTransProbability (G4double, G4double)
 
G4double GetMRMaxTransProbability (G4double, G4double)
 
void SetMRMaxTransProbability (G4double, G4double, G4double)
 
G4double GetMRTransProbability (G4double, G4double, G4double, G4double, G4double)
 
G4bool ConditionsValid (G4double E, G4double VFermi, G4double theta_i)
 
G4bool TransConditionsValid (G4double E, G4double VFermi, G4double theta_i)
 
void SetMicroRoughnessParameters (G4double, G4double, G4int, G4int, G4double, G4double, G4double, G4double, G4int, G4int, G4double)
 
G4double GetRMS () const
 
G4double GetCorrLen () const
 
- Public Member Functions inherited from G4MaterialPropertiesTable
 G4MaterialPropertiesTable ()
 
virtual ~G4MaterialPropertiesTable ()
 
void AddConstProperty (const G4String &key, G4double PropertyValue)
 
void AddConstProperty (const char *key, G4double PropertyValue)
 
G4MaterialPropertyVectorAddProperty (const G4String &key, const std::vector< G4double > &photonEnergies, const std::vector< G4double > &propertyValues)
 
G4MaterialPropertyVectorAddProperty (const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
 
void AddProperty (const G4String &key, G4MaterialPropertyVector *opv)
 
void AddProperty (const char *key, G4MaterialPropertyVector *opv)
 
void RemoveConstProperty (const G4String &key)
 
void RemoveConstProperty (const char *key)
 
void RemoveProperty (const G4String &key)
 
void RemoveProperty (const char *key)
 
G4double GetConstProperty (const G4String &key) const
 
G4double GetConstProperty (const char *key) const
 
G4double GetConstProperty (const G4int index) const
 
G4bool ConstPropertyExists (const G4String &key) const
 
G4bool ConstPropertyExists (const char *key) const
 
G4bool ConstPropertyExists (const G4int index) const
 
G4MaterialPropertyVectorGetProperty (const char *key, G4bool warning=false)
 
G4MaterialPropertyVectorGetProperty (const G4String &key, G4bool warning=false)
 
G4MaterialPropertyVectorGetProperty (const G4int index, G4bool warning=false)
 
void AddEntry (const G4String &key, G4double aPhotonEnergy, G4double aPropertyValue)
 
void AddEntry (const char *key, G4double aPhotonEnergy, G4double aPropertyValue)
 
G4int GetConstPropertyIndex (const G4String &key, G4bool warning=false) const
 
G4int GetPropertyIndex (const G4String &key, G4bool warning=false) const
 
std::vector< G4StringGetMaterialPropertyNames () const
 
std::vector< G4StringGetMaterialConstPropertyNames () const
 
void DumpTable ()
 
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > * GetPropertiesMap ()
 
std::map< G4String, G4double, std::less< G4String > > * GetPropertiesCMap ()
 
const std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > > * GetPropertyMap () const
 
const std::map< G4int, G4double, std::less< G4int > > * GetConstPropertyMap () const
 

Detailed Description

Definition at line 51 of file G4UCNMaterialPropertiesTable.hh.

Constructor & Destructor Documentation

◆ G4UCNMaterialPropertiesTable()

G4UCNMaterialPropertiesTable::G4UCNMaterialPropertiesTable ( )

Definition at line 53 of file G4UCNMaterialPropertiesTable.cc.

55{
56 theMicroRoughnessTable = nullptr;
57 maxMicroRoughnessTable = nullptr;
58 theMicroRoughnessTransTable = nullptr;
59 maxMicroRoughnessTransTable = nullptr;
60
61 theta_i_min = 0.*degree;
62 theta_i_max = 90.*degree;
63
64 Emin = 0.e-9*eV;
65 Emax = 1000.e-9*eV;
66
67 no_theta_i = 90;
68 noE = 100;
69
70 theta_i_step = (theta_i_max-theta_i_min)/(no_theta_i-1);
71 E_step = (Emax-Emin)/(noE-1);
72
73 b = 1*nm;
74 w = 30*nm;
75
76 AngCut = 0.01*degree;
77}

◆ ~G4UCNMaterialPropertiesTable()

G4UCNMaterialPropertiesTable::~G4UCNMaterialPropertiesTable ( )
virtual

Definition at line 79 of file G4UCNMaterialPropertiesTable.cc.

80{
81 if (theMicroRoughnessTable) delete theMicroRoughnessTable;
82 if (maxMicroRoughnessTable) delete maxMicroRoughnessTable;
83 if (theMicroRoughnessTransTable) delete theMicroRoughnessTransTable;
84 if (maxMicroRoughnessTransTable) delete maxMicroRoughnessTransTable;
85}

Member Function Documentation

◆ ComputeMicroRoughnessTables()

void G4UCNMaterialPropertiesTable::ComputeMicroRoughnessTables ( )

Definition at line 141 of file G4UCNMaterialPropertiesTable.cc.

142{
143// Reads the parameters for the mr-probability computation from the
144// corresponding material properties and stores it in the appropriate
145// variables
146
147 b = GetConstProperty("MR_RRMS");
148 G4double b2 = b*b;
149 w = GetConstProperty("MR_CORRLEN");
150 G4double w2 = w*w;
151
152 no_theta_i = G4int(GetConstProperty("MR_NBTHETA")+0.1);
153 //G4cout << "no_theta: " << no_theta_i << G4endl;
154 noE = G4int(GetConstProperty("MR_NBE")+0.1);
155 //G4cout << "noE: " << noE << G4endl;
156
157 theta_i_min = GetConstProperty("MR_THETAMIN");
158 theta_i_max = GetConstProperty("MR_THETAMAX");
159 Emin = GetConstProperty("MR_EMIN");
160 Emax = GetConstProperty("MR_EMAX");
161 G4int AngNoTheta = G4int(GetConstProperty("MR_ANGNOTHETA")+0.1);
162 G4int AngNoPhi = G4int(GetConstProperty("MR_ANGNOPHI")+0.1);
163 AngCut = GetConstProperty("MR_ANGCUT");
164
165 // The Fermi potential was saved in neV by P.F.
166
167 G4double fermipot = GetConstProperty("FERMIPOT")*(1.e-9*eV);
168
169 //G4cout << "Fermipot: " << fermipot/(1.e-9*eV) << "neV" << G4endl;
170
171 G4double theta_i, E;
172
173 // Calculates the increment in theta_i in the lookup-table
174 theta_i_step = (theta_i_max-theta_i_min)/(no_theta_i-1);
175
176 //G4cout << "theta_i_step: " << theta_i_step << G4endl;
177
178 // Calculates the increment in energy in the lookup-table
179 E_step = (Emax-Emin)/(noE-1);
180
181 // Runs the lookup-table memory allocation
183
184 G4int counter = 0;
185
186 //G4cout << "Calculating Microroughnesstables...";
187
188 // Writes the mr-lookup-tables to files for immediate control
189
190 std::ofstream dateir("MRrefl.dat",std::ios::out);
191 std::ofstream dateit("MRtrans.dat",std::ios::out);
192
193 //G4cout << theMicroRoughnessTable << G4endl;
194
195 for (theta_i=theta_i_min; theta_i<=theta_i_max+1e-6; theta_i+=theta_i_step) {
196 // Calculation for each cell in the lookup-table
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);
202
203 *(theMicroRoughnessTransTable+counter) =
205 IntIminus(E, fermipot, theta_i, AngNoTheta, AngNoPhi,
206 b2, w2, maxMicroRoughnessTransTable+counter,
207 AngCut);
208
209 dateir << *(theMicroRoughnessTable+counter) << G4endl;
210 dateit << *(theMicroRoughnessTransTable+counter) << G4endl;
211
212 counter++;
213
214 //G4cout << counter << G4endl;
215 }
216 }
217
218 dateir.close();
219 dateit.close();
220
221 // Writes the mr-lookup-tables to files for immediate control
222
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);
226
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) {
229
230 // tests the GetXXProbability functions by writing the entries
231 // of the lookup tables to files
232
233 dateic << GetMRIntProbability(theta_i,E) << G4endl;
234 dateimr << GetMRMaxProbability(theta_i,E) << G4endl;
235 dateimt << GetMRMaxTransProbability(theta_i,E) << G4endl;
236 }
237 }
238
239 dateic.close();
240 dateimr.close();
241 dateimt.close();
242}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4double GetConstProperty(const G4String &key) const
G4double GetMRMaxTransProbability(G4double, G4double)
G4double GetMRMaxProbability(G4double, G4double)
G4double GetMRIntProbability(G4double, G4double)
static G4UCNMicroRoughnessHelper * GetInstance()

Referenced by SetMicroRoughnessParameters().

◆ ConditionsValid()

G4bool G4UCNMaterialPropertiesTable::ConditionsValid ( G4double  E,
G4double  VFermi,
G4double  theta_i 
)

Definition at line 413 of file G4UCNMaterialPropertiesTable.cc.

416{
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);
419
420 //G4cout << " Energy: " << E/(1.e-9*eV) << "neV"
421 // << " VFermi: " << VFermi/(1.e-9*eV) << "neV"
422 // << " theta: " << theta_i/degree << "degree" << G4endl;
423
424 //G4cout << " Conditions - 2*b*k*cos(theta): " << 2*b*k*cos(theta_i)
425 // << ", 2*b*kl: " << 2*b*k_l << G4endl;
426
427 // see eq. 17 of the Steyerl paper
428
429 if (2*b*k*std::cos(theta_i) < 1 && 2*b*k_l < 1) return true;
430 else return false;
431}

◆ GetCorrLen()

G4double G4UCNMaterialPropertiesTable::GetCorrLen ( ) const
inline

Definition at line 181 of file G4UCNMaterialPropertiesTable.hh.

181{return w;}

◆ GetMicroRoughnessTable()

G4double * G4UCNMaterialPropertiesTable::GetMicroRoughnessTable ( )

Definition at line 87 of file G4UCNMaterialPropertiesTable.cc.

88{
89 return theMicroRoughnessTable;
90}

Referenced by G4UCNBoundaryProcess::PostStepDoIt().

◆ GetMicroRoughnessTransTable()

G4double * G4UCNMaterialPropertiesTable::GetMicroRoughnessTransTable ( )

Definition at line 92 of file G4UCNMaterialPropertiesTable.cc.

93{
94 return theMicroRoughnessTransTable;
95}

◆ GetMRIntProbability()

G4double G4UCNMaterialPropertiesTable::GetMRIntProbability ( G4double  theta_i,
G4double  Energy 
)

Definition at line 244 of file G4UCNMaterialPropertiesTable.cc.

246{
247 if (!theMicroRoughnessTable) {
248 G4cout << "Do not have theMicroRoughnessTable" << G4endl;
249 return 0.;
250 }
251
252 // if theta_i or energy outside the range for which the lookup table is
253 // calculated, the probability is set to zero
254
255 //G4cout << "theta_i: " << theta_i/degree << "degree"
256 // << " theta_i_min: " << theta_i_min/degree << "degree"
257 // << " theta_i_max: " << theta_i_max/degree << "degree"
258 // << " Energy: " << Energy/(1.e-9*eV) << "neV"
259 // << " Emin: " << Emin/(1.e-9*eV) << "neV"
260 // << " Emax: " << Emax/(1.e-9*eV) << "neV" << G4endl;
261
262 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
263 return 0.;
264
265 // Determines the nearest cell in the lookup table which contains
266 // the probability
267
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);
270
271 // lookup table is onedimensional (1 row), energy is in rows,
272 // theta_i in columns
273
274 //G4cout << "E_pos: " << E_pos << " theta_i_pos: " << theta_i_pos << G4endl;
275 //G4cout << "Probability: " << *(theMicroRoughnessTable+E_pos+theta_i_pos*(noE-1)) << G4endl;
276
277 return *(theMicroRoughnessTable+E_pos+theta_i_pos*(noE - 1));
278}
G4GLOB_DLL std::ostream G4cout

Referenced by ComputeMicroRoughnessTables().

◆ GetMRIntTransProbability()

G4double G4UCNMaterialPropertiesTable::GetMRIntTransProbability ( G4double  theta_i,
G4double  Energy 
)

Definition at line 280 of file G4UCNMaterialPropertiesTable.cc.

282{
283 if (!theMicroRoughnessTransTable) return 0.;
284
285 // if theta_i or energy outside the range for which the lookup table
286 // is calculated, the probability is set to zero
287
288 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
289 return 0.;
290
291 // Determines the nearest cell in the lookup table which contains
292 // the probability
293
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);
296
297 // lookup table is onedimensional (1 row), energy is in rows,
298 // theta_i in columns
299
300 return *(theMicroRoughnessTransTable+E_pos+theta_i_pos*(noE - 1));
301}

◆ GetMRMaxProbability()

G4double G4UCNMaterialPropertiesTable::GetMRMaxProbability ( G4double  theta_i,
G4double  Energy 
)

Definition at line 303 of file G4UCNMaterialPropertiesTable.cc.

305{
306 if (!maxMicroRoughnessTable) return 0.;
307
308 // if theta_i or energy outside the range for which the lookup table
309 // is calculated, the probability is set to zero
310
311 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
312 return 0.;
313
314 // Determines the nearest cell in the lookup table which contains
315 // the probability
316
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);
319
320 // lookup table is onedimensional (1 row), energy is in rows,
321 // theta_i in columns
322
323 return *(maxMicroRoughnessTable+E_pos+theta_i_pos*noE);
324}

Referenced by ComputeMicroRoughnessTables().

◆ GetMRMaxTransProbability()

G4double G4UCNMaterialPropertiesTable::GetMRMaxTransProbability ( G4double  theta_i,
G4double  Energy 
)

Definition at line 349 of file G4UCNMaterialPropertiesTable.cc.

351{
352 if (!maxMicroRoughnessTransTable) return 0.;
353
354 // if theta_i or energy outside the range for which the lookup table
355 // is calculated, the probability is set to zero
356
357 if (theta_i<theta_i_min || theta_i>theta_i_max || Energy<Emin || Energy>Emax)
358 return 0.;
359
360 // Determines the nearest cell in the lookup table which contains
361 // the probability
362
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);
365
366 // lookup table is onedimensional (1 row), energy is in rows,
367 // theta_i in columns
368
369 return *(maxMicroRoughnessTransTable+E_pos+theta_i_pos*noE);
370}

Referenced by ComputeMicroRoughnessTables().

◆ GetMRProbability()

G4double G4UCNMaterialPropertiesTable::GetMRProbability ( G4double  theta_i,
G4double  Energy,
G4double  fermipot,
G4double  theta_o,
G4double  phi_o 
)

Definition at line 395 of file G4UCNMaterialPropertiesTable.cc.

399{
401 ProbIplus(Energy, fermipot, theta_i, theta_o, phi_o, b, w, AngCut);
402}

◆ GetMRTransProbability()

G4double G4UCNMaterialPropertiesTable::GetMRTransProbability ( G4double  theta_i,
G4double  Energy,
G4double  fermipot,
G4double  theta_o,
G4double  phi_o 
)

Definition at line 404 of file G4UCNMaterialPropertiesTable.cc.

408{
410 ProbIminus(Energy, fermipot,theta_i, theta_o, phi_o, b, w, AngCut);
411}

◆ GetRMS()

G4double G4UCNMaterialPropertiesTable::GetRMS ( ) const
inline

Definition at line 180 of file G4UCNMaterialPropertiesTable.hh.

180{return b;}

◆ InitMicroRoughnessTables()

void G4UCNMaterialPropertiesTable::InitMicroRoughnessTables ( )

Definition at line 109 of file G4UCNMaterialPropertiesTable.cc.

110{
111 G4int NEdim = 0;
112 G4int Nthetadim = 0;
113
114 // Checks if the number of angles is available and stores it
115
116 if (ConstPropertyExists("MR_NBTHETA"))
117 Nthetadim = G4int(GetConstProperty("MR_NBTHETA")+0.1);
118
119 // Checks if the number of energies is available and stores it
120
121 if (ConstPropertyExists("MR_NBE"))
122 NEdim = G4int(GetConstProperty("MR_NBE")+0.1);
123
124 //G4cout << "thetadim: " << Nthetadim << " , Edim: " << NEdim << G4endl;
125
126 // If both dimensions of the lookup-table are non-trivial:
127 // delete old tables if existing and allocate memory for new tables
128
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];
138 }
139}
G4bool ConstPropertyExists(const G4String &key) const

Referenced by ComputeMicroRoughnessTables().

◆ LoadMicroRoughnessTables()

void G4UCNMaterialPropertiesTable::LoadMicroRoughnessTables ( G4double pMicroRoughnessTable,
G4double pmaxMicroRoughnessTable,
G4double pMicroRoughnessTransTable,
G4double pmaxMicroRoughnessTransTable 
)

Definition at line 97 of file G4UCNMaterialPropertiesTable.cc.

102{
103 theMicroRoughnessTable = pMicroRoughnessTable;
104 maxMicroRoughnessTable = pmaxMicroRoughnessTable;
105 theMicroRoughnessTransTable = pMicroRoughnessTransTable;
106 maxMicroRoughnessTransTable = pmaxMicroRoughnessTransTable;
107}

◆ SetMicroRoughnessParameters()

void G4UCNMaterialPropertiesTable::SetMicroRoughnessParameters ( G4double  ww,
G4double  bb,
G4int  no_theta,
G4int  no_E,
G4double  theta_min,
G4double  theta_max,
G4double  E_min,
G4double  E_max,
G4int  AngNoTheta,
G4int  AngNoPhi,
G4double  AngularCut 
)

Definition at line 453 of file G4UCNMaterialPropertiesTable.cc.

460{
461 //G4cout << "Setting Microroughness Parameters...";
462
463 // Removes an existing RMS roughness
464 if (ConstPropertyExists("MR_RRMS")) RemoveConstProperty("MR_RRMS");
465
466 // Adds a new RMS roughness
467 AddConstProperty("MR_RRMS", bb);
468
469 //G4cout << "b: " << bb << G4endl;
470
471 // Removes an existing correlation length
472 if (ConstPropertyExists("MR_CORRLEN")) RemoveConstProperty("MR_CORRLEN");
473
474 // Adds a new correlation length
475 AddConstProperty("MR_CORRLEN", ww);
476
477 //G4cout << "w: " << ww << G4endl;
478
479 // Removes an existing number of thetas
480 if (ConstPropertyExists("MR_NBTHETA")) RemoveConstProperty("MR_NBTHETA");
481
482 // Adds a new number of thetas
483 AddConstProperty("MR_NBTHETA", (G4double)no_theta);
484
485 //G4cout << "no_theta: " << no_theta << G4endl;
486
487 // Removes an existing number of Energies
488 if (ConstPropertyExists("MR_NBE")) RemoveConstProperty("MR_NBE");
489
490 // Adds a new number of Energies
491 AddConstProperty("MR_NBE", (G4double)no_E);
492
493 //G4cout << "no_E: " << no_E << G4endl;
494
495 // Removes an existing minimum theta
496 if (ConstPropertyExists("MR_THETAMIN")) RemoveConstProperty("MR_THETAMIN");
497
498 // Adds a new minimum theta
499 AddConstProperty("MR_THETAMIN", theta_min);
500
501 //G4cout << "theta_min: " << theta_min << G4endl;
502
503 // Removes an existing maximum theta
504 if (ConstPropertyExists("MR_THETAMAX")) RemoveConstProperty("MR_THETAMAX");
505
506 // Adds a new maximum theta
507 AddConstProperty("MR_THETAMAX", theta_max);
508
509 //G4cout << "theta_max: " << theta_max << G4endl;
510
511 // Removes an existing minimum energy
512 if (ConstPropertyExists("MR_EMIN")) RemoveConstProperty("MR_EMIN");
513
514 // Adds a new minimum energy
515 AddConstProperty("MR_EMIN", E_min);
516
517 //G4cout << "Emin: " << E_min << G4endl;
518
519 // Removes an existing maximum energy
520 if (ConstPropertyExists("MR_EMAX")) RemoveConstProperty("MR_EMAX");
521
522 // Adds a new maximum energy
523 AddConstProperty("MR_EMAX", E_max);
524
525 //G4cout << "Emax: " << E_max << G4endl;
526
527 // Removes an existing Theta angle number
528 if(ConstPropertyExists("MR_ANGNOTHETA"))RemoveConstProperty("MR_ANGNOTHETA");
529
530 // Adds a new Theta angle number
531 AddConstProperty("MR_ANGNOTHETA", (G4double)AngNoTheta);
532
533 //G4cout << "AngNoTheta: " << AngNoTheta << G4endl;
534
535 // Removes an existing Phi angle number
536 if (ConstPropertyExists("MR_ANGNOPHI")) RemoveConstProperty("MR_ANGNOPHI");
537
538 // Adds a new Phi angle number
539 AddConstProperty("MR_ANGNOPHI", (G4double)AngNoPhi);
540
541 //G4cout << "AngNoPhi: " << AngNoPhi << G4endl;
542
543 // Removes an existing angular cut
544 if (ConstPropertyExists("MR_ANGCUT")) RemoveConstProperty("MR_ANGCUT");
545
546 // Adds a new angle number
547 AddConstProperty("MR_ANGCUT", AngularCut);
548
549 //G4cout << "AngularCut: " << AngularCut/degree << "degree" << G4endl;
550
551 // Starts the lookup table calculation
552
554
555 //G4cout << " *** DONE! ***" << G4endl;
556}
void AddConstProperty(const G4String &key, G4double PropertyValue)
void RemoveConstProperty(const G4String &key)

◆ SetMRMaxProbability()

void G4UCNMaterialPropertiesTable::SetMRMaxProbability ( G4double  theta_i,
G4double  Energy,
G4double  value 
)

Definition at line 326 of file G4UCNMaterialPropertiesTable.cc.

328{
329 if (maxMicroRoughnessTable) {
330
331 if (theta_i<theta_i_min || theta_i>theta_i_max ||
332 Energy<Emin || Energy>Emax) {
333 } else {
334
335 // Determines the nearest cell in the lookup table which contains
336 // the probability
337
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);
340
341 // lookup table is onedimensional (1 row), energy is in rows,
342 // theta_i in columns
343
344 *(maxMicroRoughnessTable+E_pos+theta_i_pos*noE) = value;
345 }
346 }
347}

◆ SetMRMaxTransProbability()

void G4UCNMaterialPropertiesTable::SetMRMaxTransProbability ( G4double  theta_i,
G4double  Energy,
G4double  value 
)

Definition at line 372 of file G4UCNMaterialPropertiesTable.cc.

374{
375 if (maxMicroRoughnessTransTable) {
376
377 if (theta_i<theta_i_min || theta_i>theta_i_max ||
378 Energy<Emin || Energy>Emax) {
379 } else {
380
381 // Determines the nearest cell in the lookup table which contains
382 // the probability
383
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);
386
387 // lookup table is onedimensional (1 row), energy is in rows,
388 // theta_i in columns
389
390 *(maxMicroRoughnessTransTable+E_pos+theta_i_pos*noE) = value;
391 }
392 }
393}

◆ TransConditionsValid()

G4bool G4UCNMaterialPropertiesTable::TransConditionsValid ( G4double  E,
G4double  VFermi,
G4double  theta_i 
)

Definition at line 433 of file G4UCNMaterialPropertiesTable.cc.

436{
437 G4double k2 = 2*neutron_mass_c2*E / hbarc_squared;
438 G4double k_l2 = 2*neutron_mass_c2*VFermi / hbarc_squared;
439
440 if (E*(std::cos(theta_i)*std::cos(theta_i)) < VFermi) return false;
441
442 G4double kS2 = k_l2 - k2;
443
444 //G4cout << "Conditions; 2bk' cos(theta): " << 2*b*sqrt(kS2)*cos(theta_i) <<
445 // ", 2bk_l: " << 2*b*sqrt(k_l2) << G4endl;
446
447 // see eq. 18 of the Steyerl paper
448
449 if (2*b*std::sqrt(kS2)*std::cos(theta_i) < 1 && 2*b*std::sqrt(k_l2) < 1) return true;
450 else return false;
451}

The documentation for this class was generated from the following files: