Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI_doubleDifferentialCrossSection.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include "GIDI.hpp"
11#include <HAPI.hpp>
12
13namespace GIDI {
14
16
17/* *********************************************************************************************************//**
18 * Returns the name of the DebyeWallerIntegral child in *a_node*, independent of the GNDS format.
19 *
20 * @param a_node [in] The **HAPI::Node** whose child are checked.
21 ***********************************************************************************************************/
22
23static char const *getDebyeWallerIntegralName( HAPI::Node const &a_node ) {
24
25 HAPI::Node const &node = a_node.child( GIDI_DebyeWallerIntegralChars );
26 if( node.empty( ) ) return( GIDI_DebyeWallerChars );
27
29}
30
31/* *********************************************************************************************************//**
32 * Returns the boundAtomCrossSection child in *a_node*, independent of the GNDS format.
33 *
34 * @param a_node [in] The **HAPI::Node** whose child are checked.
35 ***********************************************************************************************************/
36
37static char const *getBoundAtomCrossSectionName( HAPI::Node const &a_node ) {
38
39 HAPI::Node const &node = a_node.child( GIDI_boundAtomCrossSectionChars );
40 if( node.empty( ) ) return( GIDI_characteristicCrossSectionChars );
41
43}
44
45/*! \class Base
46 * Base class inherited by DoubleDifferentialCrossSection forms.
47 */
48
49/* *********************************************************************************************************//**
50 * @param a_node [in] The **HAPI::Node** to be parsed and used to construct the Base.
51 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
52 * @param a_type [in] The FormType for the DoubleDifferentialCrossSection form.
53 * @param a_parent [in] The parent GIDI::Suite.
54 ***********************************************************************************************************/
55
56Base::Base( HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_parent ) :
57 Form( a_node, a_setupInfo, a_type, a_parent ) {
58
59}
60
61/*! \class CoherentPhotoAtomicScattering
62 * This is the **coherentPhotonScattering** style class.
63 */
64
65/* *********************************************************************************************************//**
66 * @param a_construction [in] Used to pass user options for parsing.
67 * @param a_node [in] The **HAPI::Node** to be parsed.
68 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
69 * @param a_pops [in] A PoPI::Database instance used to get particle indices and possibly other particle information.
70 * @param a_internalPoPs [in] The *internal* PoPI::Database instance used to get particle indices and possibly other particle information.
71 * This is the <**PoPs**> node under the <**reactionSuite**> node.
72 * @param a_parent [in] The parent GIDI::Suite.
73 ***********************************************************************************************************/
74
76 SetupInfo &a_setupInfo, LUPI_maybeUnused PoPI::Database const &a_pops, LUPI_maybeUnused PoPI::Database const &a_internalPoPs, Suite *a_parent ) :
77 Base( a_node, a_setupInfo, FormType::coherentPhotonScattering, a_parent ),
78 m_formFactor( data1dParse( a_construction, a_node.child( GIDI_formFactorChars ).first_child( ), a_setupInfo, nullptr ) ),
79 m_realAnomalousFactor( data1dParseAllowEmpty( a_construction, a_node.child( GIDI_realAnomalousFactorChars ).first_child( ), a_setupInfo, nullptr ) ),
80 m_imaginaryAnomalousFactor( data1dParseAllowEmpty( a_construction, a_node.child( GIDI_imaginaryAnomalousFactorChars ).first_child( ), a_setupInfo, nullptr ) ) {
81
82}
83
84/* *********************************************************************************************************//**
85 ***********************************************************************************************************/
86
88
89 delete m_formFactor;
90 delete m_realAnomalousFactor;
91 delete m_imaginaryAnomalousFactor;
92}
93
94/*! \class IncoherentPhotoAtomicScattering
95 * This is the **incoherentPhotonScattering** class.
96 */
97
98/* *********************************************************************************************************//**
99 * @param a_construction [in] Used to pass user options for parsing.
100 * @param a_node [in] The **HAPI::Node** to be parsed.
101 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
102 * @param a_pops [in] A PoPI::Database instance used to get particle indices and possibly other particle information.
103 * @param a_internalPoPs [in] The *internal* PoPI::Database instance used to get particle indices and possibly other particle information.
104 * This is the <**PoPs**> node under the <**reactionSuite**> node.
105 * @param a_parent [in] The parent GIDI::Suite.
106 ***********************************************************************************************************/
107
109 SetupInfo &a_setupInfo, LUPI_maybeUnused PoPI::Database const &a_pops, LUPI_maybeUnused PoPI::Database const &a_internalPoPs, Suite *a_parent ) :
110 Base( a_node, a_setupInfo, FormType::incoherentPhotonScattering, a_parent ),
111 m_scatteringFactor( nullptr ) {
112
113 HAPI::Node const scatteringFactorChild = a_node.child( GIDI_scatteringFactorChars );
114 if( scatteringFactorChild.empty( ) ) {
115 m_scatteringFactor = data1dParse( a_construction, a_node.first_child( ), a_setupInfo, nullptr ); }
116 else {
117 m_scatteringFactor = data1dParse( a_construction, scatteringFactorChild.first_child( ), a_setupInfo, nullptr );
118 }
119}
120
121/* *********************************************************************************************************//**
122 ***********************************************************************************************************/
123
125
126 delete m_scatteringFactor;
127}
128
129/*! \class IncoherentPhotoAtomicScattering
130 * This is the **incoherentPhotonScattering** class.
131 */
132
133/* *********************************************************************************************************//**
134 * @param a_construction [in] Used to pass user options for parsing.
135 * @param a_node [in] The **HAPI::Node** to be parsed.
136 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
137 * @param a_pops [in] A PoPI::Database instance used to get particle indices and possibly other particle information.
138 * @param a_internalPoPs [in] The *internal* PoPI::Database instance used to get particle indices and possibly other particle information.
139 * This is the <**PoPs**> node under the <**reactionSuite**> node.
140 * @param a_parent [in] The parent GIDI::Suite.
141 ***********************************************************************************************************/
142
144 SetupInfo &a_setupInfo, LUPI_maybeUnused PoPI::Database const &a_pops, LUPI_maybeUnused PoPI::Database const &a_internalPoPs, Suite *a_parent ) :
145 Base( a_node, a_setupInfo, FormType::incoherentBoundToFreePhotonScattering, a_parent ),
146 m_ComptonProfile( nullptr ) {
147
148 HAPI::Node const ComptonProfileChild = a_node.child( GIDI_ComptonProfileChars );
149 m_ComptonProfile = data1dParse( a_construction, ComptonProfileChild.first_child( ), a_setupInfo, nullptr );
150}
151
152/* *********************************************************************************************************//**
153 ***********************************************************************************************************/
154
159
161
162/*! \class S_table
163 * This class represents a **GNDS** cumulative scattering factor **S_table** instance which is a function of temperaure
164 * \f$T\f$ and energy \f$E\f$ as \f$S(T,E)\f$.
165 */
166
167/* *********************************************************************************************************//**
168 * @param a_construction [in] Used to pass user options for parsing.
169 * @param a_node [in] The **HAPI::Node** to be parsed.
170 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
171 ***********************************************************************************************************/
172
173S_table::S_table( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo ) :
174 Form( a_node, a_setupInfo, FormType::generic, nullptr ),
175 m_function2d( data2dParse( a_construction, a_node.first_child( ), a_setupInfo, nullptr ) ) {
176
177 m_function2d->setAncestor( this );
178}
179
180/* *********************************************************************************************************//**
181 ***********************************************************************************************************/
182
184
185 delete m_function2d;
186
187}
188
189/*! \class CoherentElastic
190 * This is the **CoherentElastic** class.
191 */
192
193/* *********************************************************************************************************//**
194 * @param a_construction [in] Used to pass user options for parsing.
195 * @param a_node [in] The **HAPI::Node** to be parsed.
196 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
197 * @param a_pops [in] A PoPI::Database instance used to get particle indices and possibly other particle information.
198 * @param a_internalPoPs [in] The *internal* PoPI::Database instance used to get particle indices and possibly other particle information.
199 * This is the **PoPs** node under the **reactionSuite** node.
200 * @param a_parent [in] The parent GIDI::Suite.
201 ***********************************************************************************************************/
202
203CoherentElastic::CoherentElastic( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo,
204 LUPI_maybeUnused PoPI::Database const &a_pops, LUPI_maybeUnused PoPI::Database const &a_internalPoPs, Suite *a_parent ) :
205 Base( a_node, a_setupInfo, FormType::coherentElastic, a_parent ),
206 m_S_table( a_construction, a_node.child( GIDI_S_tableChars ), a_setupInfo ) {
207
208 m_S_table.setAncestor( this );
209}
210
211/* *********************************************************************************************************//**
212 ***********************************************************************************************************/
213
217
218/*! \class DebyeWallerIntegral
219 * This class represents a **GNDS** Debye-Waller integral **DebyeWallerIntegral** which is a function of temperaure \f$T\f$ as \f$W'(T)\f$.
220 */
221
222/* *********************************************************************************************************//**
223 * @param a_construction [in] Used to pass user options for parsing.
224 * @param a_node [in] The **HAPI::Node** to be parsed.
225 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
226 ***********************************************************************************************************/
227
228DebyeWallerIntegral::DebyeWallerIntegral( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo ) :
229 Form( a_node, a_setupInfo, FormType::generic, nullptr ),
230 m_function1d( data1dParse( a_construction, a_node.first_child( ), a_setupInfo, nullptr ) ) {
231
232 m_function1d->setAncestor( this );
233}
234
235/* *********************************************************************************************************//**
236 ***********************************************************************************************************/
237
239
240 delete m_function1d;
241}
242
243/*! \class IncoherentElastic
244 * This is the **IncoherentElastic** class.
245 */
246
247/* *********************************************************************************************************//**
248 * @param a_construction [in] Used to pass user options for parsing.
249 * @param a_node [in] The **HAPI::Node** to be parsed.
250 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
251 * @param a_pops [in] A PoPI::Database instance used to get particle indices and possibly other particle information.
252 * @param a_internalPoPs [in] The *internal* PoPI::Database instance used to get particle indices and possibly other particle information.
253 * This is the <**PoPs**> node under the <**reactionSuite**> node.
254 * @param a_parent [in] The parent GIDI::Suite.
255 ***********************************************************************************************************/
256
257IncoherentElastic::IncoherentElastic( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo,
258 LUPI_maybeUnused PoPI::Database const &a_pops, LUPI_maybeUnused PoPI::Database const &a_internalPoPs, Suite *a_parent ) :
259 Base( a_node, a_setupInfo, FormType::incoherentElastic, a_parent ),
260 m_boundAtomCrossSection( a_node.child( getBoundAtomCrossSectionName( a_node ) ), a_setupInfo ),
261 m_DebyeWallerIntegral( a_construction, a_node.child( getDebyeWallerIntegralName( a_node ) ), a_setupInfo ) {
262
263 m_boundAtomCrossSection.setAncestor( this );
264 m_DebyeWallerIntegral.setAncestor( this );
265}
266
267/* *********************************************************************************************************//**
268 ***********************************************************************************************************/
269
273
274/*! \class Options
275 * This is the **options** class.
276 */
277
278/* *********************************************************************************************************//**
279 * @param a_construction [in] Used to pass user options for parsing.
280 * @param a_node [in] The **HAPI::Node** to be parsed.
281 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
282 ***********************************************************************************************************/
283
284Options::Options( LUPI_maybeUnused Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo ) :
285 Form( a_node, a_setupInfo, FormType::generic, nullptr ),
286 m_calculatedAtThermal( strcmp( a_node.attribute_as_string( GIDI_calculatedAtThermalChars ).c_str( ), GIDI_trueChars ) == 0 ),
287 m_asymmetric( strcmp( a_node.attribute_as_string( GIDI_asymmetricChars ).c_str( ), GIDI_trueChars ) == 0 ) {
288
289}
290
291/* *********************************************************************************************************//**
292 ***********************************************************************************************************/
293
295
296}
297
298/*! \class T_effective
299 * This class represents a **GNDS** **T_effective** which is a function of temperaure \f$T_{\rm eff}(T)\f$.
300 */
301
302/* *********************************************************************************************************//**
303 * @param a_construction [in] Used to pass user options for parsing.
304 * @param a_node [in] The **HAPI::Node** to be parsed.
305 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
306 ***********************************************************************************************************/
307
308T_effective::T_effective( LUPI_maybeUnused Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo ) :
309 Form( a_node, a_setupInfo, FormType::generic, nullptr ),
310 m_function1d( data1dParseAllowEmpty( a_construction, a_node.first_child( ), a_setupInfo, nullptr ) ) {
311
312 if( m_function1d != nullptr ) m_function1d->setAncestor( this );
313}
314
315/* *********************************************************************************************************//**
316 ***********************************************************************************************************/
317
319
320 delete m_function1d;
321}
322
323/*! \class ScatteringAtom
324 * This is the **scatteringAtom** class.
325 */
326
327/* *********************************************************************************************************//**
328 * @param a_construction [in] Used to pass user options for parsing.
329 * @param a_node [in] The **HAPI::Node** to be parsed.
330 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
331 ***********************************************************************************************************/
332
333ScatteringAtom::ScatteringAtom( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo ) :
334 Form( a_node, a_setupInfo, FormType::generic, nullptr ),
335 m_mass( a_node.child( GIDI_massChars ), a_setupInfo ),
336 m_freeAtomCrossSection( a_node.child( GIDI_freeAtomCrossSectionChars ), a_setupInfo ),
337 m_e_critical( a_node.child( GIDI_e_criticalChars ), a_setupInfo ),
338 m_e_max( a_node.child( GIDI_e_maxChars ), a_setupInfo ),
339 m_T_effective( a_construction, a_node.child( GIDI_T_effectiveChars ), a_setupInfo ) {
340
341 m_mass.setAncestor( this );
342 m_freeAtomCrossSection.setAncestor( this );
343 m_e_critical.setAncestor( this );
344 m_e_max.setAncestor( this );
345 m_T_effective.setAncestor( this );
346
347}
348
349/* *********************************************************************************************************//**
350 ***********************************************************************************************************/
351
355
356/*! \class S_alpha_beta
357 * This class represents a **GNDS** **S_alpha_beta** which is \f$S(T,\alpha,\beta)\f$.
358 */
359
360/* *********************************************************************************************************//**
361 * @param a_construction [in] Used to pass user options for parsing.
362 * @param a_node [in] The **HAPI::Node** to be parsed.
363 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
364 ***********************************************************************************************************/
365
366S_alpha_beta::S_alpha_beta( LUPI_maybeUnused Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo ) :
367 Form( a_node, a_setupInfo, FormType::generic, nullptr ),
368 m_function3d( nullptr ) { // data3dParse( a_construction, a_node.first_child( ), a_setupInfo, nullptr ) )
369
370// FIXME BRB
371// m_function3d->setAncestor( this );
372}
373
374/* *********************************************************************************************************//**
375 ***********************************************************************************************************/
376
378
379 delete m_function3d;
380}
381
382/*! \class IncoherentInelastic
383 * This is the **IncoherentInelastic** class.
384 */
385
386/* *********************************************************************************************************//**
387 * @param a_construction [in] Used to pass user options for parsing.
388 * @param a_node [in] The **HAPI::Node** to be parsed.
389 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
390 * @param a_pops [in] A PoPI::Database instance used to get particle indices and possibly other particle information.
391 * @param a_internalPoPs [in] The *internal* PoPI::Database instance used to get particle indices and possibly other particle information.
392 * This is the <**PoPs**> node under the <**reactionSuite**> node.
393 * @param a_parent [in] The parent GIDI::Suite.
394 ***********************************************************************************************************/
395
397 PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent ) :
398 Base( a_node, a_setupInfo, FormType::incoherentInelastic, a_parent ),
399 m_options( a_construction, a_node.child( GIDI_optionsChars ), a_setupInfo ),
400 m_scatteringAtoms( a_construction, GIDI_scatteringAtomsChars, GIDI_labelChars, a_node, a_setupInfo, a_pops, a_internalPoPs, parseScatteringAtom, nullptr ),
401 m_S_alpha_beta( a_construction, a_node.child( GIDI_S_alpha_betaChars ), a_setupInfo ) {
402
403 m_options.setAncestor( this );
404 m_scatteringAtoms.setAncestor( this );
405 m_S_alpha_beta.setAncestor( this );
406}
407
408/* *********************************************************************************************************//**
409 ***********************************************************************************************************/
410
414
415} // End namespace n_ThermalNeutronScatteringLaw.
416
417} // End namespace DoubleDifferentialCrossSection.
418
419} // End namespace GIDI.
#define GIDI_calculatedAtThermalChars
Definition GIDI.hpp:429
#define GIDI_scatteringFactorChars
Definition GIDI.hpp:326
#define GIDI_imaginaryAnomalousFactorChars
Definition GIDI.hpp:325
#define GIDI_e_criticalChars
Definition GIDI.hpp:334
#define GIDI_S_tableChars
Definition GIDI.hpp:322
#define GIDI_trueChars
Definition GIDI.hpp:409
#define GIDI_ComptonProfileChars
Definition GIDI.hpp:327
#define GIDI_T_effectiveChars
Definition GIDI.hpp:336
#define GIDI_realAnomalousFactorChars
Definition GIDI.hpp:324
#define GIDI_scatteringAtomsChars
Definition GIDI.hpp:365
#define GIDI_DebyeWallerIntegralChars
Definition GIDI.hpp:330
#define GIDI_formFactorChars
Definition GIDI.hpp:323
#define GIDI_DebyeWallerChars
Definition GIDI.hpp:331
#define GIDI_S_alpha_betaChars
Definition GIDI.hpp:321
#define GIDI_labelChars
Definition GIDI.hpp:438
#define GIDI_asymmetricChars
Definition GIDI.hpp:430
#define GIDI_freeAtomCrossSectionChars
Definition GIDI.hpp:333
#define GIDI_e_maxChars
Definition GIDI.hpp:335
#define GIDI_massChars
Definition GIDI.hpp:332
#define GIDI_optionsChars
Definition GIDI.hpp:320
#define GIDI_characteristicCrossSectionChars
Definition GIDI.hpp:329
#define GIDI_boundAtomCrossSectionChars
Definition GIDI.hpp:328
#define LUPI_maybeUnused
Base(HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_parent)
CoherentPhotoAtomicScattering(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent)
IncoherentBoundToFreePhotoAtomicScattering(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent)
IncoherentPhotoAtomicScattering(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent)
CoherentElastic(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent)
DebyeWallerIntegral(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo)
IncoherentElastic(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent)
IncoherentInelastic(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, Suite *a_parent)
Options(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo)
S_alpha_beta(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo)
S_table(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo)
ScatteringAtom(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo)
T_effective(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo)
Form(FormType a_type)
Definition GIDI_form.cc:25
bool empty() const
Definition HAPI_Node.cc:150
Node first_child() const
Definition HAPI_Node.cc:82
Node child(const char *name) const
Definition HAPI_Node.cc:72
Definition GIDI.hpp:32
Functions::Function1dForm * data1dParse(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *parent)
FormType
Definition GIDI.hpp:118
@ incoherentBoundToFreePhotonScattering
Definition GIDI.hpp:135
@ incoherentInelastic
Definition GIDI.hpp:136
@ incoherentPhotonScattering
Definition GIDI.hpp:135
@ coherentPhotonScattering
Definition GIDI.hpp:135
@ incoherentElastic
Definition GIDI.hpp:136
Functions::Function2dForm * data2dParse(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *parent)
Form * parseScatteringAtom(Construction::Settings const &a_construction, Suite *a_parent, HAPI::Node const &a_node, SetupInfo &a_setupInfo, PoPI::Database const &a_pops, PoPI::Database const &a_internalPoPs, std::string const &a_name, Styles::Suite const *a_styles)
Functions::Function1dForm * data1dParseAllowEmpty(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *a_parent)