Loading...
Searching...
No Matches
VRadiobiologicalQuantity.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26/// \file radiobiology/include/VRadiobiologicalQuantity.hh
27/// \brief Definition of the RadioBio::VRadiobiologicalQuantity class
28
29// This is a purely virtual class giving the framework for the
30// calculation of a radiobiological quantity.
31// Default quantities (inheriting from this class) are Dose,
32// LET and RBE.
33
34#ifndef RadiobiologyVRadiobiologicalQuantity_H
35#define RadiobiologyVRadiobiologicalQuantity_H 1
36
38
39#include <valarray>
40
41class G4VAccumulable;
42class G4UImessenger;
43
44namespace RadioBio
45{
46
47class VRadiobiologicalQuantity
48{
49 public:
51 {
53 G4Exception("VRadiobiologicalQuantity::VRadiobiologicalQuantity", "NotVoxelized",
54 FatalException,
55 "Trying to create a radiobiological quantity before voxelizing the detector!");
56
57 }
58
60 {
61 ;
62 }
63
64 // If this is false (set with macro), nothing happens
65 G4bool IsCalculationEnabled() const
66 {
68 }
69
70 // If this is true, calculation is over and values are updated
71 G4bool HasBeenCalculated() const
72 {
73 return fCalculated;
74 }
75
76 // Parameter setting
77 void SetCalculationEnabled(G4bool enabled)
78 {
79 fCalculationEnabled = enabled;
80 }
81
82 // Verbosity for output
83 void SetVerboseLevel(G4int level)
84 {
85 fVerboseLevel = level;
86 }
87 G4int GetVerboseLevel() const
88 {
89 return fVerboseLevel;
90 }
91
92 // Set path for output file
94 {
95 fPath = fN;
96 }
97
98 // Alias for matrix type
99 using array_type = std::valarray<G4double>;
100
101 // Update data from the accumulable
103
104 // Initialization
105 void virtual Initialize() = 0;
106
107 // Calculation
108 void virtual Compute() = 0;
109
110 // Clear accumulated data
111 void virtual Reset() = 0;
112
113 // Output to text files (called at the end of run)
114 void virtual Store() = 0;
115
116 // Some basic output to the screen
118 {
119 G4cout << "** Verbose level = " << fVerboseLevel << " **********************" << G4endl
120 << "** Initialized = " << (fInitialized ? "true *" : "false ")
121 << "********************" << G4endl << "** Saved = " << (fSaved ? "true *" : "false ")
122 << "**************************" << G4endl
123 << "** Calculation enabled = " << (fCalculationEnabled ? "true *" : "false ")
124 << "************" << G4endl << "*******************************************" << G4endl;
125 }
126 void virtual PrintParameters()
127 {
129 }
130
131 protected:
132 // Proper messenger
134
135 // Verbose Level
136 G4int fVerboseLevel = 1;
137
138 // Bool to see if class has been initialized
139 G4bool fInitialized = false;
140
141 // Bool to see if output has already been saved
142 G4bool fSaved = false;
143
144 // Bool to see if quantity has been calculated
145 G4bool fCalculated = false;
146
147 // Output paths
149
150 // Boolean for calculation
151 G4bool fCalculationEnabled = false;
152};
153
154} // namespace RadioBio
155
156#endif
Definition of the RadioBio::VoxelizedSensitiveDetector class.
virtual void AddFromAccumulable(G4VAccumulable *)=0
static VoxelizedSensitiveDetector * GetInstance()
Static method to retrieve a pointer to the only object existing in the simulation.

Applications | User Support | Publications | Collaboration