Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
GIDI::Functions::Xs_pdf_cdf1d Class Reference

#include <GIDI.hpp>

Inheritance diagram for GIDI::Functions::Xs_pdf_cdf1d:

Public Member Functions

 Xs_pdf_cdf1d ()
 Xs_pdf_cdf1d (Axes const &a_axes, ptwXY_interpolation a_interpolation, std::vector< double > const &a_Xs, std::vector< double > const &a_pdf, std::vector< double > const &a_cdf, int a_index=0, double a_outerDomainValue=0.0)
 Xs_pdf_cdf1d (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, Suite *a_parent)
 ~Xs_pdf_cdf1d ()
Xs_pdf_cdf1doperator= (Xs_pdf_cdf1d const &a_rhs)
double domainMin () const
double domainMax () const
std::vector< double > const & Xs () const
std::vector< double > const & pdf () const
std::vector< double > const & cdf () const
double evaluate (double a_x1) const
XYs1dasXYs1d (bool a_asLinlin, double a_accuray, double a_lowerEps, double a_upperEps) const
void toXMLList_func (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent, bool a_embedded, bool a_inRegions) const
Public Member Functions inherited from GIDI::Functions::Function1dForm
 Function1dForm (std::string const &a_moniker, FormType a_type, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 Function1dForm (std::string const &a_moniker, FormType a_type, Axes const &a_axes, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 Function1dForm (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_suite=nullptr)
 Function1dForm (Function1dForm const &a_form)
 ~Function1dForm ()
Function1dFormoperator= (Function1dForm const &a_rhs)
virtual void mapToXsAndAdd (std::size_t a_offset, std::vector< double > const &a_Xs, std::vector< double > &a_results, double a_scaleFactor) const
virtual void write (FILE *a_file, std::string const &a_format) const
void print (std::string const &a_format) const
Public Member Functions inherited from GIDI::Functions::FunctionForm
 FunctionForm (std::string const &a_moniker, FormType a_type, int a_dimension, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 FunctionForm (std::string const &a_moniker, FormType a_type, int a_dimension, Axes const &a_axes, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
 FunctionForm (Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, int a_dimension, Suite *a_suite=nullptr)
 FunctionForm (FunctionForm const &a_form)
 ~FunctionForm ()
FunctionFormoperator= (FunctionForm const &a_rhs)
int dimension () const
int index () const
double outerDomainValue () const
void setOuterDomainValue (double a_outerDomainValue)
Axes const & axes () const
Axesaxes ()
ptwXY_interpolation interpolation () const
void setInterpolation (ptwXY_interpolation a_interpolation)
std::string interpolationString () const
void toXMLList (GUPI::WriteInfo &a_writeInfo, std::string const &a_indent) const
Public Member Functions inherited from GIDI::Form
 Form (FormType a_type)
 Form (std::string const &a_moniker, FormType a_type, std::string const &a_label)
 Form (HAPI::Node const &a_node, SetupInfo &a_setupInfo, FormType a_type, Suite *a_suite=nullptr)
 Form (Form const &a_form)
virtual ~Form ()
Formoperator= (Form const &a_rhs)
Suiteparent () const
std::string const & label () const
void setLabel (std::string const &a_label)
virtual std::string actualMoniker () const
std::string const & keyName () const
void setKeyName (std::string const &a_keyName)
std::string const & keyValue () const
virtual void setKeyValue (std::string const &a_keyName) const
FormType type () const
Form const * sibling (std::string a_label) const
GUPI::AncestryfindInAncestry3 (LUPI_maybeUnused std::string const &a_item)
GUPI::Ancestry const * findInAncestry3 (LUPI_maybeUnused std::string const &a_item) const
std::string xlinkItemKey () const
Public Member Functions inherited from GUPI::Ancestry
 Ancestry (std::string const &a_moniker, std::string const &a_attribute="")
virtual ~Ancestry ()
Ancestryoperator= (Ancestry const &a_ancestry)
std::string const & moniker () const
void setMoniker (std::string const &a_moniker)
Ancestryancestor ()
Ancestry const * ancestor () const
void setAncestor (Ancestry *a_ancestor)
std::string attribute () const
Ancestryroot ()
Ancestry const * root () const
bool isChild (Ancestry *a_instance)
bool isParent (Ancestry *a_parent)
bool isRoot () const
AncestryfindInAncestry (std::string const &a_href)
Ancestry const * findInAncestry (std::string const &a_href) const
virtual AncestryfindInAncestry3 (std::string const &a_item)=0
virtual Ancestry const * findInAncestry3 (std::string const &a_item) const =0
virtual LUPI_HOST void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
std::string toXLink () const
void printXML () const

Additional Inherited Members

Static Public Member Functions inherited from GUPI::Ancestry
static std::string buildXLinkItemKey (std::string const &a_name, std::string const &a_key)

Detailed Description

Class for the GNDS <xs_pdf_cdf1d> node.

Definition at line 1292 of file GIDI.hpp.

Constructor & Destructor Documentation

◆ Xs_pdf_cdf1d() [1/3]

GIDI::Functions::Xs_pdf_cdf1d::Xs_pdf_cdf1d ( )

Definition at line 28 of file GIDI_xs_pdf_cdf1d.cc.

28 :
30
31}
#define GIDI_xs_pdf_cdf1dChars
Definition GIDI.hpp:295
Function1dForm(std::string const &a_moniker, FormType a_type, ptwXY_interpolation a_interpolation, int a_index, double a_outerDomainValue)
Definition GIDI_form.cc:348
@ ptwXY_interpolationLinLin
Definition ptwXY.h:37

Referenced by operator=().

◆ Xs_pdf_cdf1d() [2/3]

GIDI::Functions::Xs_pdf_cdf1d::Xs_pdf_cdf1d ( Axes const & a_axes,
ptwXY_interpolation a_interpolation,
std::vector< double > const & a_Xs,
std::vector< double > const & a_pdf,
std::vector< double > const & a_cdf,
int a_index = 0,
double a_outerDomainValue = 0.0 )
Parameters
a_axes[in] The axes to copy for this.
a_interpolation[in] The interpolation flag.
a_index[in] If imbedded in a two dimensional function, the index of this instance.
a_outerDomainValue[in] If imbedded in a two dimensional function, the domain value for x2.
a_Xs[in] List of x1 values.
a_pdf[in] The pdf evaluated at the x1 values.
a_cdf[in] The pdf evaluated at the x1 values.

Definition at line 44 of file GIDI_xs_pdf_cdf1d.cc.

45 :
46 Function1dForm( GIDI_xs_pdf_cdf1dChars, FormType::xs_pdf_cdf1d, a_axes, a_interpolation, a_index, a_outerDomainValue ),
47 m_xs( a_Xs ),
48 m_pdf( a_pdf ),
49 m_cdf( a_cdf ) {
50
51}

◆ Xs_pdf_cdf1d() [3/3]

GIDI::Functions::Xs_pdf_cdf1d::Xs_pdf_cdf1d ( Construction::Settings const & a_construction,
HAPI::Node const & a_node,
SetupInfo & a_setupInfo,
Suite * a_parent )
Parameters
a_construction[in] Used to pass user options to the constructor.
a_node[in] The HAPI::Node to be parsed and used to construct the XYs2d.
a_setupInfo[in] Information create my the Protare constructor to help in parsing.
a_parent[in] The parent GIDI::Suite.

Definition at line 61 of file GIDI_xs_pdf_cdf1d.cc.

61 :
62 Function1dForm( a_construction, a_node, a_setupInfo, FormType::xs_pdf_cdf1d, a_parent ) {
63
64 nf_Buffer<double> buffer;
65 parseValuesOfDoubles( a_construction, a_node.child( GIDI_xsChars ).child( GIDI_valuesChars ), a_setupInfo, buffer );
66 m_xs = buffer.vector();
67 parseValuesOfDoubles( a_construction, a_node.child( GIDI_pdfChars ).child( GIDI_valuesChars ), a_setupInfo, buffer );
68 m_pdf = buffer.vector();
69 parseValuesOfDoubles( a_construction, a_node.child( GIDI_cdfChars ).child( GIDI_valuesChars ), a_setupInfo, buffer );
70 m_cdf = buffer.vector();
71}
#define GIDI_valuesChars
Definition GIDI.hpp:260
#define GIDI_xsChars
#define GIDI_pdfChars
#define GIDI_cdfChars
void parseValuesOfDoubles(Construction::Settings const &a_construction, HAPI::Node const &a_node, SetupInfo &a_setupInfo, nf_Buffer< double > &a_vector)
Definition GIDI_misc.cc:88

◆ ~Xs_pdf_cdf1d()

GIDI::Functions::Xs_pdf_cdf1d::~Xs_pdf_cdf1d ( )

Definition at line 76 of file GIDI_xs_pdf_cdf1d.cc.

76 {
77
78}

Member Function Documentation

◆ asXYs1d()

XYs1d * GIDI::Functions::Xs_pdf_cdf1d::asXYs1d ( bool a_asLinlin,
double a_accuray,
double a_lowerEps,
double a_upperEps ) const
virtual

This methods returns an XYs1d representation of the pdf of this. The calling function owns the created instance and is responible for freeing it.

Parameters
a_asLinlin[in] This argument is not used but retained to make the methods API at same as other asXYs1d functions.
a_accuracy[in] This argument is not used but retained to make the methods API at same as other asXYs1d functions.
a_lowerEps[in] This argument is not used but retained to make the methods API at same as other asXYs1d functions.
a_upperEps[in] This argument is not used but retained to make the methods API at same as other asXYs1d functions.
Returns
A pointer to an XYs1d instance that must be freed by the calling function.

Reimplemented from GIDI::Functions::Function1dForm.

Definition at line 124 of file GIDI_xs_pdf_cdf1d.cc.

124 {
125
126 return( new XYs1d( axes( ), ptwXY_interpolationLinLin, m_xs, m_pdf ) );
127}
Axes const & axes() const
Definition GIDI.hpp:1012

Referenced by evaluate().

◆ cdf()

std::vector< double > const & GIDI::Functions::Xs_pdf_cdf1d::cdf ( ) const
inline

Returns the value of the m_cdf member.

Definition at line 1313 of file GIDI.hpp.

Referenced by operator=().

◆ domainMax()

double GIDI::Functions::Xs_pdf_cdf1d::domainMax ( ) const
inlinevirtual

Returns the value of the domainMax.

Implements GIDI::Functions::FunctionForm.

Definition at line 1309 of file GIDI.hpp.

◆ domainMin()

double GIDI::Functions::Xs_pdf_cdf1d::domainMin ( ) const
inlinevirtual

Returns the value of the domainMin.

Implements GIDI::Functions::FunctionForm.

Definition at line 1308 of file GIDI.hpp.

◆ evaluate()

double GIDI::Functions::Xs_pdf_cdf1d::evaluate ( double a_x1) const
virtual

◆ operator=()

Xs_pdf_cdf1d & GIDI::Functions::Xs_pdf_cdf1d::operator= ( Xs_pdf_cdf1d const & a_rhs)

The assignment operator. This method sets the members of this to those of a_rhs except for those not set by base classes.

Parameters
a_rhs[in] Instance whose member are used to set the members of this.

Definition at line 87 of file GIDI_xs_pdf_cdf1d.cc.

87 {
88
89 if( this != &a_rhs ) {
91 m_xs = a_rhs.Xs( );
92 m_pdf = a_rhs.pdf( );
93 m_cdf = a_rhs.cdf( );
94 }
95
96 return( *this );
97}
Function1dForm & operator=(Function1dForm const &a_rhs)
Definition GIDI_form.cc:405

◆ pdf()

std::vector< double > const & GIDI::Functions::Xs_pdf_cdf1d::pdf ( ) const
inline

Returns the value of the m_pdf member.

Definition at line 1312 of file GIDI.hpp.

Referenced by operator=().

◆ toXMLList_func()

void GIDI::Functions::Xs_pdf_cdf1d::toXMLList_func ( GUPI::WriteInfo & a_writeInfo,
std::string const & a_indent,
bool a_embedded,
bool a_inRegions ) const
virtual

Fills the argument a_writeInfo with the XML lines that represent this. Recursively enters each sub-node.

Parameters
a_writeInfo[in/out] Instance containing incremental indentation and other information and stores the appended lines.
a_indent[in] The amount to indent this node.
a_embedded[in] If true, this function is embedded in a higher dimensional function.
a_inRegions[in] If true, this is in a Regions1d container.

Reimplemented from GIDI::Functions::FunctionForm.

Definition at line 138 of file GIDI_xs_pdf_cdf1d.cc.

138 {
139
140 std::string attributes;
141
142 if( a_embedded ) {
144 else {
145 if( a_inRegions ) {
146 attributes = a_writeInfo.addAttribute( GIDI_indexChars, intToString( index( ) ) ); }
147 else {
148 if( label( ) != "" ) attributes = a_writeInfo.addAttribute( GIDI_labelChars, label( ) );
149 }
150 }
151
153
154 std::string xml = a_writeInfo.nodeStarter( a_indent, moniker( ), attributes );
155 xml += nodeWithValuesToDoubles( a_writeInfo, GIDI_xsChars, m_xs );
156 xml += nodeWithValuesToDoubles( a_writeInfo, GIDI_pdfChars, m_pdf );
157 xml += nodeWithValuesToDoubles( a_writeInfo, GIDI_cdfChars, m_cdf );
158 xml += a_writeInfo.nodeEnder( moniker( ) );
159
160 a_writeInfo.push_back( xml );
161}
#define GIDI_outerDomainValueChars
Definition GIDI.hpp:436
#define GIDI_interpolationChars
Definition GIDI.hpp:434
#define GIDI_labelChars
Definition GIDI.hpp:438
#define GIDI_indexChars
Definition GIDI.hpp:437
std::string const & label() const
Definition GIDI.hpp:658
std::string interpolationString() const
Definition GIDI.hpp:1017
double outerDomainValue() const
Definition GIDI.hpp:1010
ptwXY_interpolation interpolation() const
Definition GIDI.hpp:1015
std::string const & moniker() const
Definition GUPI.hpp:102
void push_back(std::string const &a_line)
Definition GUPI.hpp:53
std::string nodeEnder(std::string const &a_moniker)
Definition GUPI.hpp:64
std::string nodeStarter(std::string const &indent, std::string const &a_moniker, std::string const &a_attributes="")
Definition GUPI.hpp:62
std::string addAttribute(std::string const &a_name, std::string const &a_value) const
Definition GUPI.hpp:60
std::string nodeWithValuesToDoubles(GUPI::WriteInfo &a_writeInfo, std::string const &a_nodeName, std::vector< double > const &a_values)
Definition GIDI_misc.cc:391
std::string intToString(int a_value)
Definition GIDI_misc.cc:415
std::string doubleToShortestString(double a_value, int a_significantDigits=15, int a_favorEFormBy=0)
Definition LUPI_misc.cc:349

Referenced by evaluate().

◆ Xs()

std::vector< double > const & GIDI::Functions::Xs_pdf_cdf1d::Xs ( ) const
inline

Returns the value of the m_xs member.

Definition at line 1311 of file GIDI.hpp.

Referenced by operator=().


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