MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
volume_quantity.h
1#ifndef MIDSX_VOLUME_QUANTITY_H
2#define MIDSX_VOLUME_QUANTITY_H
3
4#include <memory>
5#include <string>
6#include <vector>
7#include "tally_data.h"
8#include "quantity.h"
9
13enum class VectorVolumeQuantityType {
14 EnergyDeposition,
15 IncidentEnergy
16};
17
18namespace VectorVolumeQuantityHelper {
19 std::string toString(VectorVolumeQuantityType type);
20}
21
25enum class CountVolumeQuantityType {
26 NumberOfPhotons,
27 NumberOfInteractions
28};
29
30namespace CountVolumeQuantityHelper {
31 std::string toString(CountVolumeQuantityType type);
32}
33
40public:
47 using ValueExtractor = std::function<double(const TempVolumeTallyData&)>;
48
54 explicit VectorVolumeQuantity(VectorVolumeQuantityType type);
55
63
69 void measure(TempVolumeTallyData& temp_volume_tally_data);
70
76 VectorVolumeQuantityType getType() const;
77 VectorValue& getTotalValues();
78 VectorValue& getPrimaryValues();
79 VectorValue& getSingleIncoherentScatterValues();
80 VectorValue& getSingleCoherentScatterValues();
81 VectorValue& getMultipleScatterValues();
82private:
83 VectorVolumeQuantityType type_;
84 bool totaled_ = false;
85 VectorValue total_values_;
86 VectorValue primary_values_;
87 VectorValue single_incoherent_scatter_values_;
88 VectorValue single_coherent_scatter_values_;
89 VectorValue multiple_scatter_values_;
90 ValueExtractor valueExtractor_;
91};
92
94public:
102 using ValueExtractor = std::function<bool(const TempVolumeTallyData&)>;
103
109 explicit CountVolumeQuantity(CountVolumeQuantityType type);
110
118
124 void measure(TempVolumeTallyData& temp_volume_tally_data);
125
131 CountVolumeQuantityType getType() const;
132 CountValue getTotalValues();
133 CountValue getPrimaryValues() const;
134 CountValue getSingleIncoherentScatterValues() const;
135 CountValue getSingleCoherentScatterValues() const;
136 CountValue getMultipleScatterValues() const;
137private:
138 CountVolumeQuantityType type_;
139 bool totaled_ = false;
140 CountValue total_values_;
141 CountValue primary_values_;
142 CountValue single_incoherent_scatter_values_;
143 CountValue single_coherent_scatter_values_;
144 CountValue multiple_scatter_values_;
145 ValueExtractor valueExtractor_;
146};
147
148#endif //MIDSX_VOLUME_QUANTITY_H
Class which represents a count quantity. Used by the Tally classes to store simulation data.
Definition quantity.h:37
std::function< bool(const TempVolumeTallyData &)> ValueExtractor
ValueExtractor is a function that extracts necessary values from a TempVolumeTallyData object for a C...
CountVolumeQuantity(CountVolumeQuantityType type)
Constructor for the CountVolumeQuantity class.
CountVolumeQuantityType getType() const
Returns the type of the CountVolumeQuantity.
CountVolumeQuantity operator+(const CountVolumeQuantity &other) const
Overloads the + operator for CountVolumeQuantity.
void measure(TempVolumeTallyData &temp_volume_tally_data)
Measures the CountVolumeQuantity for a TempVolumeTallyData object.
Class which represents a vector quantity. Used by the Tally classes to store simulation data.
Definition quantity.h:10
Class which represents a vector quantity for a volume tally.
VectorVolumeQuantity(VectorVolumeQuantityType type)
Constructor for the VectorVolumeQuantity class.
VectorVolumeQuantityType getType() const
Returns the type of the VectorVolumeQuantity.
VectorVolumeQuantity operator+(VectorVolumeQuantity &other) const
Overloads the + operator for VectorVolumeQuantity.
void measure(TempVolumeTallyData &temp_volume_tally_data)
Measures the VectorVolumeQuantity for a TempVolumeTallyData object.
std::function< double(const TempVolumeTallyData &)> ValueExtractor
ValueExtractor is a function that extracts necessary values from a TempVolumeTallyData object for a V...
Struct which represents the temporary data for a volume tally.
Definition tally_data.h:37