Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
RadioBio::Manager Class Reference

#include <Doxymodules_medical.h>

Public Member Functions

 ~Manager ()
 
void InitializeAll ()
 
void ComputeAll ()
 
void ResetAll ()
 
void StoreAll ()
 
void PrintParameters ()
 
void DigestAccumulables ()
 
bool Register (VRadiobiologicalQuantity *, G4String)
 
VRadiobiologicalQuantityGetQuantity (G4String)
 

Static Public Member Functions

static ManagerCreateInstance ()
 
static ManagerGetInstance ()
 

Private Member Functions

 Manager ()=default
 

Private Attributes

std::map< G4String, VRadiobiologicalQuantity * > fQuantities = {}
 

Static Private Attributes

static ManagerfInstance = nullptr
 

Detailed Description

Definition at line 137 of file Doxymodules_medical.h.

Constructor & Destructor Documentation

◆ Manager()

RadioBio::Manager::Manager ( )
privatedefault

◆ ~Manager()

RadioBio::Manager::~Manager ( )

Definition at line 71 of file Manager.cc.

72{
73 for (auto q : fQuantities)
74 delete q.second;
75}
std::map< G4String, VRadiobiologicalQuantity * > fQuantities
Definition Manager.hh:78

Member Function Documentation

◆ CreateInstance()

Manager * RadioBio::Manager::CreateInstance ( )
static

Definition at line 49 of file Manager.cc.

50{
51 if (fInstance) {
52 G4Exception("RadioBioManager::createInstance", "RecreatingRadioBioManager", FatalException,
53 "Creating another, new, instance of RadioBioManager");
54 delete fInstance;
55 }
56
57 fInstance = new Manager();
58 return fInstance;
59}
static Manager * fInstance
Definition Manager.hh:80

◆ GetInstance()

Manager * RadioBio::Manager::GetInstance ( )
static

Definition at line 63 of file Manager.cc.

64{
65 return fInstance;
66}

◆ InitializeAll()

void RadioBio::Manager::InitializeAll ( )

Definition at line 79 of file Manager.cc.

80{
81
82 std::lock_guard<std::mutex> lock(init_mutex);
83 for (auto const& q : fQuantities)
84 (q.second)->Initialize();
85}
std::mutex init_mutex
Definition Manager.cc:38
void Initialize()
Definition errProp.cc:100

◆ ComputeAll()

void RadioBio::Manager::ComputeAll ( )

Definition at line 89 of file Manager.cc.

90{
91 for (auto const& q : fQuantities)
92 (q.second)->Compute();
93}

◆ ResetAll()

void RadioBio::Manager::ResetAll ( )

Definition at line 97 of file Manager.cc.

98{
99 for (auto const& q : fQuantities)
100 (q.second)->Reset();
101}

◆ StoreAll()

void RadioBio::Manager::StoreAll ( )

Definition at line 105 of file Manager.cc.

106{
107 for (auto const& q : fQuantities)
108 (q.second)->Store();
109}

◆ PrintParameters()

void RadioBio::Manager::PrintParameters ( )

Definition at line 120 of file Manager.cc.

121{
122 G4cout << "*******************************************" << G4endl
123 << "*** right now registered quantities are ***" << G4endl;
124 for (auto const& q : fQuantities)
125 G4cout << "*** " << q.first;
126 G4cout << "*** but their calculation might be not ****" << G4endl
127 << "*** active. Ask for parameters of each ****" << G4endl
128 << "*******************************************" << G4endl;
129}

◆ DigestAccumulables()

void RadioBio::Manager::DigestAccumulables ( )

Definition at line 133 of file Manager.cc.

134{
135 for (auto q : fQuantities) {
136 // Hook in the accumulable manager the one named as the quantity (eg "Dose")
137 G4VAccumulable* GenAcc = G4AccumulableManager::Instance()->GetAccumulable(q.first);
138
139 if (!GenAcc) {
140 G4Exception("RadioBioManager::AddFromAccumulable", "NoAccumulable", FatalException, q.first);
141 }
142
143 // If calculation is not set enabled, exit
144 if (!q.second->IsCalculationEnabled()) continue;
145
146 // Add from the accumulable.
147 q.second->AddFromAccumulable(GenAcc);
148 }
149}

◆ Register()

bool RadioBio::Manager::Register ( VRadiobiologicalQuantity q,
G4String  name 
)

Definition at line 153 of file Manager.cc.

154{
155 if (q == nullptr) {
156 G4Exception("RadioBioManager::Register", "RegisteringNullptr", JustWarning,
157 "Asking to register a quantity with null pointer!");
158 return false;
159 }
160
161 if (fQuantities.find(name) != fQuantities.end()) {
162 G4Exception("RadioBioManager::Register", "RegisteringSameQuantity", FatalException,
163 "Registering two radiobiological quantities with the same name!");
164 return false;
165 }
166 fQuantities[name] = q;
167 return true;
168}

◆ GetQuantity()

VRadiobiologicalQuantity * RadioBio::Manager::GetQuantity ( G4String  str)

Definition at line 113 of file Manager.cc.

114{
115 return fQuantities.find(str)->second;
116}

Member Data Documentation

◆ fQuantities

std::map<G4String, VRadiobiologicalQuantity*> RadioBio::Manager::fQuantities = {}
private

Definition at line 78 of file Manager.hh.

78{};

◆ fInstance

Manager* RadioBio::Manager::fInstance = nullptr
inlinestaticprivate

Definition at line 80 of file Manager.hh.


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

Applications | User Support | Publications | Collaboration