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

#include <GIDI_settings.hh>

Public Member Functions

 GIDI_settings_flux_order (int order)
 
 GIDI_settings_flux_order (int order, int length, double const *energies, double const *fluxes)
 
 GIDI_settings_flux_order (int order, std::vector< double > const &energies, std::vector< double > const &fluxes)
 
 GIDI_settings_flux_order (GIDI_settings_flux_order const &fluxOrder)
 
GIDI_settings_flux_orderoperator= (const GIDI_settings_flux_order &fluxOrder)
 
 ~GIDI_settings_flux_order ()
 
int getOrder (void) const
 
int size (void) const
 
double const * getEnergies (void) const
 
double const * getFluxes (void) const
 
void print (int valuesPerLine=10) const
 

Detailed Description

This class stores the flux for one Legendre order (see class GIDI_settings_flux).

Definition at line 92 of file GIDI_settings.hh.

Constructor & Destructor Documentation

◆ GIDI_settings_flux_order() [1/4]

GIDI_settings_flux_order::GIDI_settings_flux_order ( int order)
Parameters
orderThe Legendre order for this flux data.

Definition at line 15 of file GIDI_settings_flux.cc.

15 {
16
17 if( order < 0 ) throw 1;
18 mOrder = order;
19}

◆ GIDI_settings_flux_order() [2/4]

GIDI_settings_flux_order::GIDI_settings_flux_order ( int order,
int length,
double const * energies,
double const * fluxes )
Parameters
orderThe Legendre order for this flux data.
lengthThe number or values in energies and fluxes.
energiesList of energies where flux is given.
fluxesList of flux value for each energies value.

Definition at line 23 of file GIDI_settings_flux.cc.

23 {
24
25 initialize( order, length, energies, fluxes );
26}

◆ GIDI_settings_flux_order() [3/4]

GIDI_settings_flux_order::GIDI_settings_flux_order ( int order,
std::vector< double > const & energies,
std::vector< double > const & fluxes )
Parameters
orderThe Legendre order for this flux data.
energiesList of energies where flux is given.
fluxesList of flux value for each energies value.

Definition at line 30 of file GIDI_settings_flux.cc.

30 {
31
32 int length = (int) energies.size( );
33
34 if( length != (int) fluxes.size( ) ) throw 1;
35 initialize( order, length, &(energies[0]), &(fluxes[0]) );
36}

◆ GIDI_settings_flux_order() [4/4]

GIDI_settings_flux_order::GIDI_settings_flux_order ( GIDI_settings_flux_order const & fluxOrder)
Parameters
fluxOrderLegendre flux order to copy.

Definition at line 40 of file GIDI_settings_flux.cc.

40 {
41
42 initialize( fluxOrder.mOrder, fluxOrder.size( ), &(fluxOrder.mEnergies[0]), &(fluxOrder.mFluxes[0]) );
43}

◆ ~GIDI_settings_flux_order()

GIDI_settings_flux_order::~GIDI_settings_flux_order ( )

Definition at line 68 of file GIDI_settings_flux.cc.

68 {
69
70}

Member Function Documentation

◆ getEnergies()

double const * GIDI_settings_flux_order::getEnergies ( void ) const
inline

Definition at line 114 of file GIDI_settings.hh.

114{ return( &(mEnergies[0]) ); }

◆ getFluxes()

double const * GIDI_settings_flux_order::getFluxes ( void ) const
inline

Definition at line 115 of file GIDI_settings.hh.

115{ return( &(mFluxes[0]) ); }

◆ getOrder()

int GIDI_settings_flux_order::getOrder ( void ) const
inline

Definition at line 112 of file GIDI_settings.hh.

112{ return( mOrder ); }

Referenced by GIDI_settings_flux::addFluxOrder().

◆ operator=()

GIDI_settings_flux_order & GIDI_settings_flux_order::operator= ( const GIDI_settings_flux_order & fluxOrder)

Definition at line 59 of file GIDI_settings_flux.cc.

59 {
60 if ( this != &fluxOrder ) {
61 initialize( fluxOrder.mOrder, fluxOrder.size(), &(fluxOrder.mEnergies[0]), &(fluxOrder.mFluxes[0]) );
62 }
63 return *this;
64}

◆ print()

void GIDI_settings_flux_order::print ( int valuesPerLine = 10) const

Definition at line 74 of file GIDI_settings_flux.cc.

74 {
75
76 int nE = (int) mEnergies.size( );
77 bool printIndent = true;
78 char buffer[2 * 128];
79
80 std::cout << " ORDER: " << mOrder << std::endl;
81 for( int iE = 0; iE < nE; ++iE ) {
82 if( printIndent ) std::cout << " ";
83 printIndent = false;
84 snprintf( buffer, sizeof buffer, " %15.8e %15.8e", mEnergies[iE], mFluxes[iE] );
85 std::cout << buffer;
86 if( ( ( iE + 1 ) % valuesPerLine ) == 0 ) {
87 std::cout << std::endl;
88 printIndent = true;
89 }
90 }
91 if( nE % valuesPerLine ) std::cout << std::endl;
92}

◆ size()

int GIDI_settings_flux_order::size ( void ) const
inline

Definition at line 113 of file GIDI_settings.hh.

113{ return( (int) mEnergies.size( ) ); }

Referenced by GIDI_settings_flux_order(), and operator=().


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