File indexing completed on 2025-02-23 09:22:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef RadiobiologyVRadiobiologicalQuantity_H
0035 #define RadiobiologyVRadiobiologicalQuantity_H 1
0036
0037 #include "VoxelizedSensitiveDetector.hh"
0038
0039 #include <valarray>
0040
0041 class G4VAccumulable;
0042 class G4UImessenger;
0043
0044 namespace RadioBio
0045 {
0046
0047 class VRadiobiologicalQuantity
0048 {
0049 public:
0050 VRadiobiologicalQuantity()
0051 {
0052 if (VoxelizedSensitiveDetector::GetInstance() == 0)
0053 G4Exception("VRadiobiologicalQuantity::VRadiobiologicalQuantity", "NotVoxelized",
0054 FatalException,
0055 "Trying to create a radiobiological quantity before voxelizing the detector!");
0056 }
0057
0058 virtual ~VRadiobiologicalQuantity() { ; }
0059
0060
0061 G4bool IsCalculationEnabled() const { return fCalculationEnabled; }
0062
0063
0064 G4bool HasBeenCalculated() const { return fCalculated; }
0065
0066
0067 void SetCalculationEnabled(G4bool enabled) { fCalculationEnabled = enabled; }
0068
0069
0070 void SetVerboseLevel(G4int level) { fVerboseLevel = level; }
0071 G4int GetVerboseLevel() const { return fVerboseLevel; }
0072
0073
0074 void SetPath(G4String fN) { fPath = fN; }
0075
0076
0077 using array_type = std::valarray<G4double>;
0078
0079
0080 void virtual AddFromAccumulable(G4VAccumulable*) = 0;
0081
0082
0083 void virtual Initialize() = 0;
0084
0085
0086 void virtual Compute() = 0;
0087
0088
0089 void virtual Reset() = 0;
0090
0091
0092 void virtual Store() = 0;
0093
0094
0095 void PrintVirtualParameters()
0096 {
0097 G4cout << "** Verbose level = " << fVerboseLevel << " **********************" << G4endl
0098 << "** Initialized = " << (fInitialized ? "true *" : "false ")
0099 << "********************" << G4endl << "** Saved = " << (fSaved ? "true *" : "false ")
0100 << "**************************" << G4endl
0101 << "** Calculation enabled = " << (fCalculationEnabled ? "true *" : "false ")
0102 << "************" << G4endl << "*******************************************" << G4endl;
0103 }
0104 void virtual PrintParameters() { PrintVirtualParameters(); }
0105
0106 protected:
0107
0108 G4UImessenger* fMessenger = nullptr;
0109
0110
0111 G4int fVerboseLevel = 1;
0112
0113
0114 G4bool fInitialized = false;
0115
0116
0117 G4bool fSaved = false;
0118
0119
0120 G4bool fCalculated = false;
0121
0122
0123 G4String fPath;
0124
0125
0126 G4bool fCalculationEnabled = false;
0127 };
0128
0129 }
0130
0131 #endif