A Monte Carlo C++ code for radiative transport
Public Member Functions | List of all members
MCPP::Histogram Class Reference

The Histogram class provides a flexible live histogramming interface. More...

#include <MCPlusPlus/histogram.h>

+ Inheritance diagram for MCPP::Histogram:
+ Collaboration diagram for MCPP::Histogram:

Public Member Functions

void addMomentExponent (const double exponent)
 Add an exponent for spatial moment computation. More...
void appendCounts (const Histogram *rhs)
void dump () const
 Histogram (BaseObject *parent=NULL)
bool initialize ()
bool is1D () const
bool is2D () const
void run (const Walker *const buf, size_t bufSize)
void saveToFile (const char *fileName) const
void setBinSize (const double binSize1)
void setBinSize (const double binSize1, const double binSize2)
void setBinSize2 (const double binSize2)
void setDataDomain (const enum MCData type1, const enum MCData type2=DATA_NONE)
void setMax (const double max1)
void setMax (const double max1, const double max2)
void setMax2 (const double max2)
void setMin (const double min1)
void setMin (const double min1, const double min2)
void setMin2 (const double min2)
void setName (const char *name)
void setPhotonTypeFlags (int value)
void setScale (u_int64_t totalPhotons)
- Public Member Functions inherited from MCPP::BaseObject
 BaseObject (BaseObject *parent=NULL)
list< BaseObject * > childList () const
BaseObjectclone () const
 Returns a cloned instance of the current object. More...
void describe () const
 Prints a description of the object and its main properties. More...
bool hasAParent () const
bool inheritsRandom () const
 Determines whether or not the object derives from BaseRandom. More...
BaseObjectparent () const
 Returns a pointer to the parent object.
bool sanityCheck () const
 Performs a series of integrity checks on internal data to ensure that the object is properly initialized and ready to be used. More...
void setParent (BaseObject *parent)
 Makes the object a child of parent. More...
string typeName () const
 The class name of the object. More...
bool wasCloned () const
 Determines whether or not the object was cloned. More...

Additional Inherited Members

- Protected Member Functions inherited from MCPP::BaseObject
void addObjectToCheck (const BaseObject **const obj)
 Adds a BaseObject pointer to the list of objects to be checked. More...
void clearObjectsToCheck ()
void copyToInternalVariable (char **dest, const char *src)
void logMessage (const string &msg) const
 Logs a message to stderr. More...
void logMessage (const char *fmt,...) const
- Protected Attributes inherited from MCPP::BaseObject
bool _inheritsRandom
list< const BaseObject *const * > objectsToCheck

Detailed Description

The Histogram class provides a flexible live histogramming interface.

A single Histogram object describes a single 1D or 2D histogram of the simulated data. The histogram parameters such as bin size and range can be specified using the respective setter functions; an extra last bin keeps track of overflow counts. The data domain (i.e. exit time, space or angles) and photon type (e.g. transmitted, reflected, etc.) to be histogrammed must be specified through setDataDomain() and setPhotonTypeFlags() respectively.

Multiple Histograms can be added to a Simulation object and are performed live during the simulation; see Simulation::addHistogram().

Histograms can be assigned a name through setName() and are saved in a H5 file in a dataset with that name at the end of the simulation. When saved, data are scaled with the total number of simulated photons.

The following conditions must hold for a Histogram to be in a valid state:
  • data domain and photon type must be specified
  • a positive bin size must be specified
  • a valid upper limit for each axis must be specified. Minimum defaults to 0.
  • spatial variance can only be computed for 1D Histograms in the time domain

Member Function Documentation

◆ addMomentExponent()

void Histogram::addMomentExponent ( const double  exponent)

Add an exponent for spatial moment computation.

exponentTime-resolved spatial moments are computed as $ \langle | \rho |^p \rangle = \frac{1}{N}\sum_{n=1}^N |\rho_n(t)|^p$
Histogram must be 1D in the time domain

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