Class Output
Defined in File Output.h
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public Module
(Class Module)
Derived Types
public HDF5Output
(Class HDF5Output)public TextOutput
(Class TextOutput)
Class Documentation
-
class Output : public Module
Configurable output base class. The names of each quantity are provided in the table below. The left column corresponds to the labels of each quantity. They are printed in the output files either as comments (in a text file) or as columns (in a HDF5 file). The right columns are the names of each column for internal access. . D TrajectoryLengthColumn . SN SerialNumberColumn . ID CurrentIdColumn . E CurrentEnergyColumn . X/Y/Z CurrentPositionColumn . Px/Py/Pz CurrentDirectionColumn . SN0 SourceSerialNumberColumn . ID0 SourceIdColumn . E0 SourceEnergyColumn . X0/Y0/Z0 SourcePositionColumn . P0x/P0y/P0z SourceDirectionColumn . SN1 CreatedSerialNumberColumn . ID1 CreatedIdColumn . E1 CreatedEnergyColumn . X1/Y1/Z1 CreatedPositionColumn . P1x/P1y/P1z CreatedDirectionColumn . z RedshiftColumn . tag CandidateTagColumn . weight WeightColumn.
Some output types are pre-defined: . Trajectory1D . Trajectory3D . Event1D . Event3D . Everything They can be easily customised by enabling/disabling specific columns.
Subclassed by HDF5Output, TextOutput
Public Types
-
enum OutputColumn
Values:
-
enumerator TrajectoryLengthColumn
-
enumerator ColumnDensityColumn
-
enumerator RedshiftColumn
-
enumerator CurrentIdColumn
-
enumerator CurrentEnergyColumn
-
enumerator CurrentPositionColumn
-
enumerator CurrentDirectionColumn
-
enumerator SourceIdColumn
-
enumerator SourceEnergyColumn
-
enumerator SourcePositionColumn
-
enumerator SourceDirectionColumn
-
enumerator CreatedIdColumn
-
enumerator CreatedEnergyColumn
-
enumerator CreatedPositionColumn
-
enumerator CreatedDirectionColumn
-
enumerator CandidateTagColumn
-
enumerator SerialNumberColumn
-
enumerator WeightColumn
-
enumerator TrajectoryLengthColumn
Public Functions
-
std::string OutputTypeName(OutputType outputtype)
-
Output()
Default constructor. Output contains all the information available. Units of energy and length are, by default, EeV and Mpc. This can be changed with setEnergyScale and setLengthScale.
-
Output(OutputType outputType)
General constructor. Units of energy and length are, by default, EeV and Mpc. This can be changed with setEnergyScale and setLengthScale.
- Parameters:
outputType – type of output: Trajectory1D, Trajectory3D, Event1D, Event3D, Everything
-
void setEnergyScale(double scale)
Set energy scale.
- Parameters:
scale – energy scale (scale = 1 corresponds to 1 Joule)
-
void setLengthScale(double scale)
Set length scale.
- Parameters:
scale – length scale (scale = 1 corresponds to 1 meter)
-
void setOutputType(OutputType outputType)
Set type of output.
- Parameters:
outputType – type of output: Trajectory1D, Trajectory3D, Event1D, Event3D, Everything
-
void set(OutputColumn field, bool value)
Determines whether a given column will be displayed in the output.
- Parameters:
field – name of the field to be added/removed from output
value – boolean flag adding (true) or removing (false) the field
-
void enableProperty(const std::string &property, const Variant &defaultValue, const std::string &comment = "")
Add a property to output. Default value is required to assign a type in the output.
- Parameters:
property – string containing name of property
defaultValue – default value of property
comment – string with a comment
-
void enable(OutputColumn field)
Enable specific column in the output.
- Parameters:
field – name of the field to be enabled
-
void disable(OutputColumn field)
Disable specific column in the output.
- Parameters:
field – name of the field to be disabled
-
void enableAll()
Enable all fields. Essentially a wrapper for set(field, true).
-
void disableAll()
Disable all fields. Essentially a wrapper for set(field, false).
-
void set1D(bool value)
If true, output is of 1D type. 3D quantities such as vectors will be reduced to the relevant components (x, by default).
- Parameters:
value – boolean flag
-
size_t size() const
Returns the size of the output
-
virtual std::string getDescription() const
-
void setDescription(const std::string &description)
-
inline size_t addReference() const
-
inline size_t removeReference() const
-
inline int removeReferenceNoDelete() const
-
inline size_t getReferenceCount() const
Public Members
-
const std::string outputName
Protected Functions
-
void modify()
Protected Attributes
-
double lengthScale
-
double energyScale
-
std::bitset<64> fields
-
bool oneDimensional
-
mutable size_t count
-
mutable size_t _referenceCount
-
struct Property
-
enum OutputColumn