Spectrum Class Reference

#include <Spectrum.h>

Inheritance diagram for Spectrum:
AlphaSpectra BetaSpectra GammaSpectra NeutronSpectra origen_alphaspectra origen_betaspectra origen_gammaspectra origen_neutronspectra

Container for spectrum data. More...

Typedefs

typedef std::shared_ptr< SpectrumSP
 
typedef std::shared_ptr< const SpectrumSCP
 
typedef std::function< SP_Vec_Dbl(const Vec_Dbl &, const Vec_Int &, const Vec_Dbl &)> Integrator_t
 

Basic Methods

const Vec_Dblbounds () const
 return a const reference to bounds More...
 
void set_bounds (const Vec_Dbl &)
 set the bounds (copy operation) More...
 
const Vec_Dblintensity () const
 return a const reference to intensity More...
 
void set_intensity (const Vec_Dbl &)
 set the intensity (copy operation) More...
 

Comparison

bool match (const Spectrum &) const
 
bool operator== (const Spectrum &) const
 
static bool match (const Spectrum &, const Spectrum &)
 

Convenience Methods

double total_intensity () const
 
EnergyRange_t energy_range () const
 
double mean_energy () const
 
double total_energy_intensity () const
 
SP_Vec_Dbl newsp_energy_intensity () const
 

Memory-usage Variants of Other Methods

Vec_Dblnewptr_energy_intensity () const
 
SCP_Vec_Dbl scp_intensity () const
 return a shared (read-only) intensity pointer More...
 
SCP_Vec_Dbl scp_bounds () const
 return a shared (read-only) bounds pointer More...
 

Mapping Methods

bool map_intensity (const Vec_Dbl &new_bounds, Integrator_t integrator, Vec_Dbl *intensity, double wt=1.0, double tol=ETOL) const
 
bool map_intensity (const Vec_Dbl &new_bounds, Vec_Dbl *intensity, double wt=1.0, double tol=ETOL) const
 
void remap_intensity (Vec_Dbl *intensity, double wt=1.0) const
 
bool has_mapping_variables () const
 
void clear_mapping_variables () const
 
std::string print_bins () const
 

Additional Methods for Language Bindings (e.g. Fortran)

double bounds_at (size_t) const
 get element of bounds vector by index More...
 
double const * bounds_array () const
 return view of bounds vector More...
 
size_t bounds_size () const
 return size of bounds vector More...
 
bool has_bounds () const
 return whether the class has a non-null bounds More...
 
void get_bounds (Vec_Dbl &) const
 populate an existing Vec_Dbl with a copy of bounds More...
 
void manageptr_bounds (Vec_Dbl *&)
 set the bounds (ownership transfer) More...
 
void getptr_bounds (Vec_Dbl const *&) const
 retrieve pointer (read-only) to bounds More...
 
void get_bounds_array (size_t, double *) const
 get array of bounds vector (Fortran) More...
 
void set_bounds_array (size_t, double *)
 set bounds vector from array (Fortran) More...
 
double intensity_at (size_t) const
 get element of intensity vector by index More...
 
double const * intensity_array () const
 return view of intensity vector More...
 
size_t intensity_size () const
 return size of intensity vector More...
 
bool has_intensity () const
 return whether the class has a non-null intensity More...
 
void get_intensity (Vec_Dbl &) const
 populate an existing Vec_Dbl with a copy of intensity More...
 
void manageptr_intensity (Vec_Dbl *&)
 set the intensity (ownership transfer) More...
 
void getptr_intensity (Vec_Dbl const *&) const
 retrieve pointer (read-only) to intensity More...
 
void get_intensity_array (size_t, double *) const
 get array of intensity vector (Fortran) More...
 
void set_intensity_array (size_t, double *)
 set intensity vector from array (Fortran) More...
 

Static Helper Functions

returns true if the new and old bounds have the same min/max energy, i.e. the mapping will be conservative

static bool map_bins (const Vec_Dbl &old_bounds, const Vec_Dbl &new_bounds, Vec_Int *union_to_old, Vec_Int *union_to_new, Vec_Dbl *union_grid, double tol=ETOL)
 
static void map_intensity (const Vec_Dbl &old_bounds, const Vec_Dbl &new_bounds, const Vec_Int &union_to_old, const Vec_Int &union_to_new, const Vec_Dbl &union_grid, const Vec_Dbl &old_intensity, const Vec_Dbl &union_wts, Vec_Dbl *new_intensity, double wt=1.0)
 
static SP_Vec_Dbl computeUnionWts_1 (const Vec_Dbl &union_grid, const Vec_Int &union_to_old, const Vec_Dbl &old_flux)
 
static std::string print_bins (const Vec_Dbl &bounds, const Vec_Dbl &intensity)
 

Ctors/Dtors

 Spectrum ()
 
virtual ~Spectrum ()
 

Other

SP_Vec_Dbl b_bounds
 
SP_Vec_Dbl b_intensity
 
SP_Vec_Dbl b_new_bounds
 
SP_Vec_Dbl b_union_grid
 
SP_Vec_Int b_union_to_old
 
SP_Vec_Int b_union_to_new
 
SP_Vec_Dbl b_union_wts
 
void canonicalize_bounds ()
 
void canonicalize_intensity ()
 

Detailed Description

Container for spectrum data.

The Spectrum data container manages the energy bounds and the intensity for a single spectrum.

Both bounds and intensity are stored as shared pointers to std::vector<double>. This class has COW semantics.

Examples:
tstEmissionResource.cpp, tstEmissionSpectrum.cpp, tstGammaResource.cpp, tstGammaResourceIO.cpp, and tstSpectrum.cpp.

Member Typedef Documentation

typedef std::shared_ptr<Spectrum> SP
typedef std::shared_ptr<const Spectrum> SCP
typedef std::function<SP_Vec_Dbl( const Vec_Dbl &, const Vec_Int &, const Vec_Dbl & )> Integrator_t

Constructor & Destructor Documentation

Spectrum ( )
virtual ~Spectrum ( )
inlinevirtual

Member Function Documentation

const Vec_Dbl & bounds ( ) const

return a const reference to bounds

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

Invalid if this instance of Spectrum goes out of scope.

Referenced by Spectrum::operator==(), and StateSetIO_bof::write().

void set_bounds ( const Vec_Dbl bounds)
const Vec_Dbl & intensity ( ) const

return a const reference to intensity

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

Invalid if this instance of Spectrum goes out of scope.

Referenced by Spectrum::operator==(), and StateSetIO_bof::write().

void set_intensity ( const Vec_Dbl intensity)

set the intensity (copy operation)

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

Referenced by FakeFactory::newspStateSet_10nuclide(), StateSetIO_s62b::read(), StateSetIO_s61::read(), StateSetIO_bof::read(), GammaResourceIO_cimg::read(), and FakeFactory::StateSet_random1().

bool match ( const Spectrum a,
const Spectrum b 
)
static

References Spectrum::b_bounds.

double total_intensity ( ) const
EnergyRange_t energy_range ( ) const
double mean_energy ( ) const
double total_energy_intensity ( ) const
SP_Vec_Dbl newsp_energy_intensity ( ) const
Vec_Dbl * newptr_energy_intensity ( ) const
SCP_Vec_Dbl scp_intensity ( ) const

return a shared (read-only) intensity pointer

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

SCP_Vec_Dbl scp_bounds ( ) const

return a shared (read-only) bounds pointer

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

bool map_intensity ( const Vec_Dbl new_bounds,
Integrator_t  integrator,
Vec_Dbl intensity,
double  wt = 1.0,
double  tol = ETOL 
) const
bool map_intensity ( const Vec_Dbl new_bounds,
Vec_Dbl intensity,
double  wt = 1.0,
double  tol = ETOL 
) const
Vec_Dbl::value_type bounds_at ( size_t  i) const

get element of bounds vector by index

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

Examples:
tstGammaResourceIO.cpp.

Referenced by TEST().

Vec_Dbl::value_type const * bounds_array ( ) const

return view of bounds vector

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

Referenced by StateSetIO_s62b::write().

size_t bounds_size ( ) const

return size of bounds vector

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

Referenced by Spectrum::canonicalize_intensity().

bool has_bounds ( ) const

return whether the class has a non-null bounds

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

void get_bounds ( Vec_Dbl bounds) const

populate an existing Vec_Dbl with a copy of bounds

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

void manageptr_bounds ( Vec_Dbl *&  bounds)

set the bounds (ownership transfer)

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

void getptr_bounds ( Vec_Dbl const *&  bounds) const

retrieve pointer (read-only) to bounds

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

void get_bounds_array ( size_t  ,
double *   
) const

get array of bounds vector (Fortran)

void set_bounds_array ( size_t  ,
double *   
)

set bounds vector from array (Fortran)

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

Vec_Dbl::value_type intensity_at ( size_t  i) const

get element of intensity vector by index

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

Vec_Dbl::value_type const * intensity_array ( ) const

return view of intensity vector

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

Referenced by StateSetIO_s62b::write().

size_t intensity_size ( ) const

return size of intensity vector

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

Referenced by NeutronSpectra::is_consistent(), Spectrum::newptr_energy_intensity(), EmissionSpectrum::num_continuous(), and NeutronSpectra::resum().

bool has_intensity ( ) const

return whether the class has a non-null intensity

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

Referenced by Spectrum::total_intensity().

void get_intensity ( Vec_Dbl intensity) const

populate an existing Vec_Dbl with a copy of intensity

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

void manageptr_intensity ( Vec_Dbl *&  intensity)

set the intensity (ownership transfer)

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

void getptr_intensity ( Vec_Dbl const *&  intensity) const

retrieve pointer (read-only) to intensity

Auto-generated from macro #ORIGEN_ACCESSORS_SP_OBJECT().

void get_intensity_array ( size_t  ,
double *   
) const

get array of intensity vector (Fortran)

void set_intensity_array ( size_t  ,
double *   
)

set intensity vector from array (Fortran)

Auto-generated from macro #ORIGEN_ACCESSORS_SP_VECTOR().

bool map_bins ( const Vec_Dbl old_bounds,
const Vec_Dbl new_bounds,
Vec_Int union_to_old,
Vec_Int union_to_new,
Vec_Dbl union_grid,
double  tol = ETOL 
)
static
void map_intensity ( const Vec_Dbl old_bounds,
const Vec_Dbl new_bounds,
const Vec_Int union_to_old,
const Vec_Int union_to_new,
const Vec_Dbl union_grid,
const Vec_Dbl old_intensity,
const Vec_Dbl union_wts,
Vec_Dbl new_intensity,
double  wt = 1.0 
)
static
SP_Vec_Dbl computeUnionWts_1 ( const Vec_Dbl union_grid,
const Vec_Int union_to_old,
const Vec_Dbl old_flux 
)
static

Referenced by Spectrum::map_intensity().

std::string print_bins ( const Vec_Dbl bounds,
const Vec_Dbl intensity 
)
static
void canonicalize_bounds ( )
protected
void canonicalize_intensity ( )
protected

Member Data Documentation


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