Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI_primaryGamma2d.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
15namespace Functions {
16
17/*! \class PrimaryGamma2d
18 * Class for the GNDS <**primaryGamma**> node.
19 */
20
21/* *********************************************************************************************************//**
22 * @param a_construction [in] Used to pass user options to the constructor.
23 * @param a_node [in] The **HAPI::Node** to be parsed and used to construct the XYs2d.
24 * @param a_setupInfo [in] Information create my the Protare constructor to help in parsing.
25 * @param a_parent [in] The parent GIDI::Suite.
26 ***********************************************************************************************************/
27
28PrimaryGamma2d::PrimaryGamma2d( Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *a_parent ) :
29 Function2dForm( a_construction, a_node, a_setupInfo, FormType::primaryGamma2d, a_parent ),
30 m_domainMin( a_node.attribute( GIDI_domainMinChars ).as_double( ) ),
31 m_domainMax( a_node.attribute( GIDI_domainMaxChars ).as_double( ) ),
32 m_value( a_node.attribute( GIDI_valueChars ).as_double( ) ),
33 m_finalState( a_node.attribute_as_string( GIDI_finalStateChars ) ) {
34
35}
36
37/* *********************************************************************************************************//**
38 ***********************************************************************************************************/
39
43
44/* *********************************************************************************************************//**
45 * The value of the primary gamma energy at the projectile energy *a_x2*.
46 *
47 * @param a_x2 [in] The projectile's energy.
48 * @param a_x1 [in] Unknown.
49 * @return Fix me.
50 ***********************************************************************************************************/
51
52double PrimaryGamma2d::evaluate( LUPI_maybeUnused double a_x2, LUPI_maybeUnused double a_x1 ) const {
53
54// FIXME - Do we need to check domain?
55#if !defined(__NVCC__) && !defined(__HIP__)
56 throw Exception( "PrimaryGamma2d::evaluate: not implemented." );
57#endif
58 return( m_value );
59}
60
61/* *********************************************************************************************************//**
62 * Fills the argument *a_writeInfo* with the XML lines that represent *this*. Recursively enters each sub-node.
63 *
64 * @param a_writeInfo [in/out] Instance containing incremental indentation and other information and stores the appended lines.
65 * @param a_indent [in] The amount to indent *this* node.
66 * @param a_embedded [in] If *true*, *this* function is embedded in a higher dimensional function.
67 * @param a_inRegions [in] This is not used in this method.
68 ***********************************************************************************************************/
69
70void PrimaryGamma2d::toXMLList_func( GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, LUPI_maybeUnused bool a_embedded, LUPI_maybeUnused bool a_inRegions ) const {
71
72 std::string indent2 = a_writeInfo.incrementalIndent( a_indent );
73 std::string attributes = a_writeInfo.addAttribute( GIDI_valueChars, LUPI::Misc::doubleToShortestString( value( ) ) );
74
77 a_writeInfo.addNodeStarter( a_indent, moniker( ), attributes );
78
79 axes( ).toXMLList( a_writeInfo, indent2 );
80
81 a_writeInfo.addNodeEnder( moniker( ) );
82}
83
84} // End namespace Functions.
85
86} // End namespace GIDI.
#define GIDI_finalStateChars
Definition GIDI.hpp:448
#define GIDI_valueChars
Definition GIDI.hpp:445
#define GIDI_domainMaxChars
Definition GIDI.hpp:447
#define GIDI_domainMinChars
Definition GIDI.hpp:446
#define LUPI_maybeUnused
void toXMLList(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent="") const
Definition GIDI_axes.cc:113
Function2dForm(std::string const &a_moniker, FormType a_type, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
Definition GIDI_form.cc:476
Axes const & axes() const
Definition GIDI.hpp:1012
double evaluate(double a_x2, double a_x1) const
void toXMLList_func(GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, bool a_embedded, bool a_inRegions) const
PrimaryGamma2d(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *a_parent)
std::string const & moniker() const
Definition GUPI.hpp:102
std::string attribute() const
Definition GUPI.hpp:107
void addNodeEnder(std::string const &a_moniker)
Definition GUPI.hpp:59
std::string incrementalIndent(std::string const &indent)
Definition GUPI.hpp:52
void addNodeStarter(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:55
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition GUPI.hpp:60
Definition GIDI.hpp:32
FormType
Definition GIDI.hpp:118
std::string doubleToShortestString(double a_value, int a_significantDigits=15, int a_favorEFormBy=0)
Definition LUPI_misc.cc:349