Changeset 1230 for trunk/examples/advanced/hadrontherapy/include
- Timestamp:
- Jan 8, 2010, 3:02:48 PM (14 years ago)
- Location:
- trunk/examples/advanced/hadrontherapy/include
- Files:
-
- 23 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/hadrontherapy/include/Decay.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyDetectorMessenger.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the INFN, Catania, Italy 36 // (b) INFN Section of Genova, Genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // $Id: HadrontherapyDetectorMessenger.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 // ============================== -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyAnalysisManager.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // ---------------------------------------------------------------------------- 27 // $Id: HadrontherapyAnalysisManager.hh; May 2005 28 // ---------------------------------------------------------------------------- 29 // GEANT 4 - Hadrontherapy example 30 // ---------------------------------------------------------------------------- 31 // Code developed by: 32 // 33 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 34 // 35 // (a) Laboratori Nazionali del Sud 36 // of the INFN, Catania, Italy 37 // (b) INFN Section of Genova, Genova, Italy 38 // 39 // * cirrone@lns.infn.it 40 // ---------------------------------------------------------------------------- 41 42 #ifdef G4ANALYSIS_USE 26 // HadrontherapyAnalysisManager.hh; May 2005 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 28 43 29 #ifndef HADRONTHERAPYANALYSISMANAGER_HH 44 30 #define HADRONTHERAPYANALYSISMANAGER_HH 1 45 31 46 32 #include "globals.hh" 47 # include <AIDA/AIDA.h> 33 34 #ifdef ANALYSIS_USE ///< If we use analysis 35 36 #ifdef G4ANALYSIS_USE ///< If analysis is done via AIDA 37 #include <AIDA/AIDA.h> 48 38 49 39 namespace AIDA{ 50 class ITree; 40 class ITree; 51 41 class IAnalysisFactory; 52 42 class ITreeFactory; 53 43 } 54 44 #endif 45 46 #ifdef G4ANALYSIS_USE_ROOT ///< If analysis is done directly with ROOT 47 #include "TROOT.h" 48 #include "TFile.h" 49 #include "TNtuple.h" 50 #include "TH1F.h" 51 #endif 52 53 /** 54 * Messenger class for analysis-settings for HadronTherapyAnalysisManager 55 */ 56 class HadrontherapyAnalysisFileMessenger; 57 58 /** 59 * A class for connecting the simulation to an analysis package. 60 */ 55 61 class HadrontherapyAnalysisManager 56 62 { 57 63 private: 64 /** 65 * Analysis manager is a singleton object (there is only one instance). 66 * The pointer to this object is available through the use of the method getInstance(); 67 * 68 * @see getInstance 69 */ 58 70 HadrontherapyAnalysisManager(); 59 71 60 72 public: 61 73 ~HadrontherapyAnalysisManager(); 74 75 /** 76 * Get the pointer to the analysis manager. 77 */ 78 static HadrontherapyAnalysisManager* getInstance(); 79 80 /** 81 * Book the histograms and ntuples in an AIDA or ROOT file. 82 */ 83 void book(); 84 /** 85 * Set name for the analysis file .root (used by macro) 86 */ 87 void SetAnalysisFileName(G4String); 62 88 63 static HadrontherapyAnalysisManager* getInstance(); 64 65 void book(); 66 // Book the histograms and ntuples in a .hbk file 67 68 void FillEnergyDeposit(G4int voxelXId, G4int voxelYId, G4int voxelZId, 89 /** 90 * Fill the ntuple with the energy deposit in the phantom 91 */ 92 void FillEnergyDeposit(G4int voxelXId, G4int voxelYId, G4int voxelZId, 69 93 G4double energyDeposit); 70 // Fill the ntuple with the energy deposit in the phantom 71 72 void BraggPeak(G4int, G4double); 73 // Fill 1D histogram with the Bragg peak in the phantom 94 95 void BraggPeak(G4int, G4double); ///< Fill 1D histogram with the Bragg peak in the phantom 74 96 75 97 void SecondaryProtonEnergyDeposit(G4int slice, G4double energy); 76 // Fill 1D histogram with the energy deposit of secondary protons98 ///< Fill 1D histogram with the energy deposit of secondary protons 77 99 78 100 void SecondaryNeutronEnergyDeposit(G4int slice, G4double energy); 79 // Fill 1D histogram with the energy deposit of secondary neutrons101 ///< Fill 1D histogram with the energy deposit of secondary neutrons 80 102 81 103 void SecondaryAlphaEnergyDeposit(G4int slice, G4double energy); 82 // Fill 1D histogram with the energy deposit of secondary alpha particles104 ///< Fill 1D histogram with the energy deposit of secondary alpha particles 83 105 84 106 void SecondaryGammaEnergyDeposit(G4int slice, G4double energy); 85 // Fill 1D histogram with the energy deposit of secondary gamma107 ///< Fill 1D histogram with the energy deposit of secondary gamma 86 108 87 109 void SecondaryElectronEnergyDeposit(G4int slice, G4double energy); 88 // Fill 1D histogram with the energy deposit of secondary electrons110 ///< Fill 1D histogram with the energy deposit of secondary electrons 89 111 90 112 void SecondaryTritonEnergyDeposit(G4int slice, G4double energy); 91 // Fill 1D histogram with the energy deposit of secondary tritons113 ///< Fill 1D histogram with the energy deposit of secondary tritons 92 114 93 115 void SecondaryDeuteronEnergyDeposit(G4int slice, G4double energy); 94 // Fill 1D histogram with the energy deposit of secondary deuterons116 ///< Fill 1D histogram with the energy deposit of secondary deuterons 95 117 96 118 void SecondaryPionEnergyDeposit(G4int slice, G4double energy); 97 // Fill 1D histogram with the energy deposit of secondary pions119 ///< Fill 1D histogram with the energy deposit of secondary pions 98 120 99 121 void electronEnergyDistribution(G4double secondaryParticleKineticEnergy); 100 // Energy distribution of secondary electrons originated in the phantom122 ///< Energy distribution of secondary electrons originated in the phantom 101 123 102 124 void gammaEnergyDistribution(G4double secondaryParticleKineticEnergy); 103 // Energy distribution of secondary gamma originated in the phantom125 ///< Energy distribution of secondary gamma originated in the phantom 104 126 105 127 void deuteronEnergyDistribution(G4double secondaryParticleKineticEnergy); 106 // Energy distribution of secondary deuterons originated in the phantom128 ///< Energy distribution of secondary deuterons originated in the phantom 107 129 108 130 void tritonEnergyDistribution(G4double secondaryParticleKineticEnergy); 109 // Energy distribution of secondary tritons originated in the phantom131 ///< Energy distribution of secondary tritons originated in the phantom 110 132 111 133 void alphaEnergyDistribution(G4double secondaryParticleKineticEnergy); 112 // Energy distribution of secondary alpha originated in the phantom 134 ///< Energy distribution of secondary alpha originated in the phantom 135 136 void heliumEnergy(G4double secondaryParticleKineticEnergy); 137 ///< Energy distribution of the helium (He3 and alpha) particles after the phantom 138 139 void hydrogenEnergy(G4double secondaryParticleKineticEnergy); 140 ///< Energy distribution of the hydrogen (proton, d, t) particles after the phantom 141 142 void fillFragmentTuple(G4int A, G4double Z, G4double energy, G4double posX, G4double posY, G4double posZ); 143 ///< Energy ntuple 113 144 114 145 void genericIonInformation(G4int, G4double, G4int, G4double); 115 146 147 void ThintargetBeamDisp(G4double,G4double); 148 149 void startNewEvent(); 150 ///< Tell the analysis manager that a new event is starting 151 152 void setGeometryMetaData(G4double, G4double, G4double); 153 ///< from the detector construction information about the geometry can be written as metadata 154 155 void setBeamMetaData(G4double, G4double); 156 ///< metadata about the beam can be written this way 157 116 158 void finish(); 117 // Close the .hbk file with the histograms and the ntuples 159 ///< Close the .hbk file with the histograms and the ntuples 160 161 void flush(); 162 163 #ifdef G4ANALYSIS_USE_ROOT 164 private: 165 TH1F *createHistogram1D(const TString name, const TString title, int bins, double xmin, double xmax) { 166 TH1F *histo = new TH1F(name, title, bins, xmin, xmax); 167 histo->SetLineWidth(2); 168 return histo; 169 } 170 #endif 118 171 119 172 private: 120 173 static HadrontherapyAnalysisManager* instance; 174 HadrontherapyAnalysisFileMessenger* fMess; 175 G4String analysisFileName; 176 #ifdef G4ANALYSIS_USE 121 177 AIDA::IAnalysisFactory* aFact; 122 AIDA::ITree* theTree; 178 AIDA::ITree* theTree; 123 179 AIDA::IHistogramFactory *histFact; 124 180 AIDA::ITupleFactory *tupFact; … … 129 185 AIDA::IHistogram1D *h5; 130 186 AIDA::IHistogram1D *h6; 131 AIDA::IHistogram1D *h7; 132 AIDA::IHistogram1D *h8; 187 AIDA::IHistogram1D *h7; 188 AIDA::IHistogram1D *h8; 133 189 AIDA::IHistogram1D *h9; 134 190 AIDA::IHistogram1D *h10; 135 191 AIDA::IHistogram1D *h11; 136 AIDA::IHistogram1D *h12; 137 AIDA::IHistogram1D *h13; 192 AIDA::IHistogram1D *h12; 193 AIDA::IHistogram1D *h13; 138 194 AIDA::IHistogram1D *h14; 195 AIDA::IHistogram1D *h15; 196 AIDA::IHistogram1D *h16; 139 197 AIDA::ITuple *ntuple; 140 198 AIDA::ITuple *ionTuple; 199 AIDA::ITuple *fragmentTuple; 200 #endif 201 #ifdef G4ANALYSIS_USE_ROOT 202 TFile *theTFile; 203 TH1F *histo1; 204 TH1F *histo2; 205 TH1F *histo3; 206 TH1F *histo4; 207 TH1F *histo5; 208 TH1F *histo6; 209 TH1F *histo7; 210 TH1F *histo8; 211 TH1F *histo9; 212 TH1F *histo10; 213 TH1F *histo11; 214 TH1F *histo12; 215 TH1F *histo13; 216 TH1F *histo14; 217 TH1F *histo15; 218 TH1F *histo16; 219 220 TNtuple *theROOTNtuple; 221 TNtuple *theROOTIonTuple; 222 TNtuple *fragmentNtuple; // fragments 223 TNtuple *metaData; 224 #endif 225 G4long eventCounter; // Simulation metadata 226 G4double detectorDistance; 227 G4double phantomDepth; 228 G4double beamEnergy; 229 G4double energyError; 230 G4double phantomCenterDistance; 141 231 }; 142 232 #endif 143 #endif 144 233 234 #endif 235 -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyDetectorConstruction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyDetectorConstruction.hh; Version 4.0 May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the INFN, Catania, Italy 36 // (b) INFN Section of Genova, Genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyDetectorConstruction.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy// 40 28 41 29 #ifndef HadrontherapyDetectorConstruction_H 42 30 #define HadrontherapyDetectorConstruction_H 1 43 31 32 #include "G4Box.hh" 44 33 #include "globals.hh" 45 #include "G4VUserDetectorConstruction.hh" 34 #include "G4VisAttributes.hh" 35 #include "G4LogicalVolume.hh" 36 #include "G4UnitsTable.hh" 46 37 47 38 class G4VPhysicalVolume; 48 39 class G4LogicalVolume; 49 class HadrontherapyPhantomROGeometry; 50 class HadrontherapyBeamLine; 40 class HadrontherapyDetectorROGeometry; 51 41 class HadrontherapyDetectorMessenger; 52 class HadrontherapyModulator; 53 class HadrontherapyPhantomSD; 54 class HadrontherapyMaterial; 42 class HadrontherapyDetectorSD; 43 class HadrontherapyMatrix; 55 44 56 class HadrontherapyDetectorConstruction : public G4VUserDetectorConstruction45 class HadrontherapyDetectorConstruction 57 46 { 58 47 public: 59 48 60 HadrontherapyDetectorConstruction( );49 HadrontherapyDetectorConstruction(G4VPhysicalVolume*); 61 50 62 51 ~HadrontherapyDetectorConstruction(); 63 52 64 G4VPhysicalVolume* Construct();65 53 66 54 private: 67 55 68 void ConstructBeamLine(); 69 // This method allows to define the beam line geometry in the 70 // experimental set-up 56 void ConstructPhantom(); 57 void ConstructDetector(); 58 void ConstructSensitiveDetector(G4ThreeVector position_respect_to_WORLD); 59 60 public: 61 // Get detector position relative to WORLD 62 inline G4ThreeVector GetDetectorToWorldPosition() 63 { 64 return phantomPosition + detectorPosition; 65 } 66 ///////////////////////////////////////////////////////////////////////////// 67 // Get displacement between phantom and detector by detector position, phantom and detector sizes 68 inline G4ThreeVector GetDetectorToPhantomPosition() 69 { 70 return G4ThreeVector(phantomSizeX - detectorSizeX + detectorPosition.getX(), 71 phantomSizeY - detectorSizeY + detectorPosition.getY(), 72 phantomSizeZ - detectorSizeZ + detectorPosition.getZ() 73 ); 74 } 71 75 72 void ConstructPhantom(); 73 // This method allows to define the phantom geometry in the 74 // experimental set-up 75 76 void ConstructSensitiveDetector(); 77 // The sensitive detector is associated to the phantom volume 76 ///////////////////////////////////////////////////////////////////////////// 77 // Calculate (and set) detector position by displacement, phantom and detector sizes 78 inline void SetDetectorPosition() 79 { 80 // Adjust detector position 81 detectorPosition.setX(detectorToPhantomPosition.getX() - phantomSizeX + detectorSizeX); 82 detectorPosition.setY(detectorToPhantomPosition.getY() - phantomSizeY + detectorSizeY); 83 detectorPosition.setZ(detectorToPhantomPosition.getZ() - phantomSizeZ + detectorSizeZ); 84 85 if (detectorPhysicalVolume) detectorPhysicalVolume -> SetTranslation(detectorPosition); 86 } 87 ///////////////////////////////////////////////////////////////////////////// 88 // Check whether detector is inside phantom 89 inline bool IsInside(G4double detectorHalfX, 90 G4double detectorHalfY, 91 G4double detectorHalfZ, 92 G4double phantomHalfX, 93 G4double phantomHalfY, 94 G4double phantomHalfZ, 95 G4ThreeVector detectorToPhantomPosition) 96 { 97 // Dimensions check... X Y and Z 98 // Firstly check what dimension we are modifying 99 if (detectorHalfX > 0. && phantomHalfX > 0. && detectorToPhantomPosition.getX() >=0.) 100 { 101 if (detectorHalfX > phantomHalfX) 102 { 103 G4cout << "Error: Detector X dimension must be smaller or equal to the corrispondent of the phantom" << G4endl; 104 return false; 105 } 106 if ( 2*(phantomHalfX - detectorHalfX) < detectorToPhantomPosition.getX()) 107 { 108 G4cout << "Error: X dimension doesn't fit with detector to phantom relative position" << G4endl; 109 return false; 110 } 111 } 78 112 79 public: 113 if (detectorHalfY > 0. && phantomHalfY > 0.&& detectorToPhantomPosition.getY() >=0.) 114 { 115 if (detectorHalfY > phantomHalfY) 116 { 117 G4cout << "Error: Detector Y dimension must be smaller or equal to the corrispondent of the phantom" << G4endl; 118 return false; 119 } 120 if ( 2*(phantomHalfY - detectorHalfY) < detectorToPhantomPosition.getY()) 121 { 122 G4cout << "Error: Y dimension doesn't fit with detector to phantom relative position" << G4endl; 123 return false; 124 } 125 } 80 126 81 void SetModulatorAngle(G4double angle); 82 // This method allows moving the modulator through UI commands 127 if (detectorHalfZ > 0. && phantomHalfZ > 0.&& detectorToPhantomPosition.getZ() >=0.) 128 { 129 if (detectorHalfZ > phantomHalfZ) 130 { 131 G4cout << "Error: Detector Z dimension must be smaller or equal to the corrispondent of the phantom" << G4endl; 132 return false; 133 } 134 if ( 2*(phantomHalfZ - detectorHalfZ) < detectorToPhantomPosition.getZ()) 135 { 136 G4cout << "Error: Z dimension doesn't fit with detector to phantom relative position" << G4endl; 137 return false; 138 } 139 } 140 /* 141 G4cout << "Displacement between Phantom and Detector is: "; 142 G4cout << "DX= "<< G4BestUnit(detectorToPhantomPosition.getX(),"Length") << 143 "DY= "<< G4BestUnit(detectorToPhantomPosition.getY(),"Length") << 144 "DZ= "<< G4BestUnit(detectorToPhantomPosition.getZ(),"Length") << G4endl; 145 */ 146 return true; 147 } 148 ///////////////////////////////////////////////////////////////////////////// 83 149 84 void SetRangeShifterXPosition(G4double translation); 85 // This method allows to move the Range Shifter along 86 // the X axis through UI commands 150 G4bool SetNumberOfVoxelBySize(G4double sizeX, G4double sizeY, G4double sizeZ); 151 G4bool SetDetectorSize(G4double sizeX, G4double sizeY, G4double sizeZ); 152 G4bool SetPhantomSize(G4double sizeX, G4double sizeY, G4double sizeZ); 153 G4bool SetPhantomPosition(G4ThreeVector); 154 G4bool SetDetectorToPhantomPosition(G4ThreeVector DetectorToPhantomPosition); 155 G4LogicalVolume* GetDetectorLogicalVolume(){ return detectorLogicalVolume;} 87 156 88 void SetRangeShifterXSize(G4double halfSize);89 // This method allows to change the size of the range shifter along90 // the X axis through UI command.91 157 92 void SetFirstScatteringFoilSize(G4double halfSize); 93 // This method allows to change the size of the first scattering foil 94 // along the X axis through UI command. 158 private: 95 159 96 void SetSecondScatteringFoilSize (G4double halfSize); 97 // This method allows to change the size of the second scattering foil 98 // along the X axis through UI command. 160 HadrontherapyDetectorMessenger* detectorMessenger; 99 161 100 void SetOuterRadiusStopper (G4double value); 101 // This method allows to change the size of the outer radius of the stopper 102 // through UI command. 162 G4VisAttributes* skyBlue; 163 G4VisAttributes* red; 103 164 104 void SetInnerRadiusFinalCollimator (G4double value); 105 // This method allows to change the size of the inner radius of the 106 // final collimator through UI command. 165 G4VPhysicalVolume* motherPhys; 107 166 108 void SetRSMaterial(G4String material);109 // This method allows to change the material110 // of the range shifter through UI command.167 HadrontherapyDetectorSD* detectorSD; // Pointer to sensitive detector 168 HadrontherapyDetectorROGeometry* detectorROGeometry; // Pointer to ROGeometry 169 HadrontherapyMatrix* matrix; 111 170 112 G4 double ComputeVoxelSize() {return phantomSizeX/numberOfVoxelsAlongX;};113 // Returns the size of the voxel along the X axis114 115 private: 171 G4VPhysicalVolume* phantomPhysicalVolume; 172 G4LogicalVolume* phantomLogicalVolume; 173 G4LogicalVolume* detectorLogicalVolume; 174 G4VPhysicalVolume* detectorPhysicalVolume; 116 175 117 HadrontherapyPhantomSD* phantomSD; // Pointer to sensitive detector118 119 HadrontherapyPhantomROGeometry* phantomROGeometry; // Pointer to ROGeometry120 121 HadrontherapyBeamLine* beamLine; // Pointer to the beam line122 // geometry component123 124 HadrontherapyModulator* modulator; // Pointer to the modulator125 // geometry component126 127 G4VPhysicalVolume* physicalTreatmentRoom;128 G4VPhysicalVolume* patientPhysicalVolume;129 G4LogicalVolume* phantomLogicalVolume;130 G4VPhysicalVolume* phantomPhysicalVolume;131 132 HadrontherapyDetectorMessenger* detectorMessenger;133 HadrontherapyMaterial* material;134 135 176 G4double phantomSizeX; 136 177 G4double phantomSizeY; 137 178 G4double phantomSizeZ; 138 179 180 G4double detectorSizeX; 181 G4double detectorSizeY; 182 G4double detectorSizeZ; 183 184 G4ThreeVector phantomPosition, detectorPosition, detectorToPhantomPosition; // phantom center, detector center, detector to phantom relative position 185 186 G4double sizeOfVoxelAlongX; 187 G4double sizeOfVoxelAlongY; 188 G4double sizeOfVoxelAlongZ; 189 139 190 G4int numberOfVoxelsAlongX; 140 191 G4int numberOfVoxelsAlongY; 141 192 G4int numberOfVoxelsAlongZ; 193 194 G4Box* phantom; 195 G4Box* detector; 196 142 197 }; 143 198 #endif -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyDetectorMessenger.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyDetectorMessenger.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the INFN, Catania, Italy 36 // (b) INFN Section of Genova, Genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyDetectorMessenger.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy// 28 40 29 #ifndef HadrontherapyDetectorMessenger_h 41 30 #define HadrontherapyDetectorMessenger_h 1 … … 48 37 class G4UIcmdWithADoubleAndUnit; 49 38 class G4UIcmdWithAString; 39 class G4UIcmdWith3VectorAndUnit; 50 40 51 41 class HadrontherapyDetectorMessenger: public G4UImessenger … … 55 45 ~HadrontherapyDetectorMessenger(); 56 46 57 47 void SetNewValue(G4UIcommand*, G4String); 58 48 59 49 private: 60 50 61 // Pointer to the detector component51 // Pointer to the phantom/detector 62 52 HadrontherapyDetectorConstruction* hadrontherapyDetector; 63 64 G4UIdirectory* modulatorDir; // Control of the modulator65 G4UIdirectory* beamLineDir; // Control of the beam line66 67 G4UIdirectory* rangeShifterDir;68 // Control of the range shifter component of the beam line69 53 70 G4UIdirectory* firstScatteringFoilDir; 71 // Control of the first scattering foil component of the beam line 72 73 G4UIdirectory* secondScatteringFoilDir; 74 // Control of the first scattering foil component of the beam line 75 76 G4UIdirectory* rangeStopperDir; 77 // Control of the range stopper component of the beam line 78 79 G4UIdirectory* finalCollimatorDir; 80 // Control of the final collimator component of the beam line 81 82 G4UIcmdWithADoubleAndUnit* modulatorAngleCmd; 83 // UI command to rotate the modulator wheel 54 G4UIdirectory *changeThePhantomDir, *changeTheDetectorDir; 84 55 85 G4UIcmdWithAString* rangeShifterMatCmd; 86 // UI command to set the material of the rangeShifter component of 87 // the beam line 88 89 G4UIcmdWithADoubleAndUnit* rangeShifterXSizeCmd; 90 // UI command to set half of the X size of the rangeShifter component of 91 // the beam line 92 93 G4UIcmdWithADoubleAndUnit* rangeShifterXPositionCmd; 94 // UI command to change the X position of the rangeShifter component of 95 // the beam line 96 97 G4UIcmdWithADoubleAndUnit* firstScatteringFoilXSizeCmd; 98 // UI command to set half X size of the first scattering foil of 99 // the beam line 100 101 G4UIcmdWithADoubleAndUnit* secondScatteringFoilXSizeCmd; 102 // UI command to set half X size of the second scattering foil 103 // the beam line 104 105 G4UIcmdWithADoubleAndUnit* outerRadiusStopperCmd; 106 // UI command to set the outer radius of the range stopper component of 107 // the beam line 108 109 G4UIcmdWithADoubleAndUnit* innerRadiusFinalCollimatorCmd; 110 // UI command to set the inner radius of the final collimator component of 111 // the beam line 56 G4UIcmdWith3VectorAndUnit *changeThePhantomSizeCmd, 57 *changeThePhantomPositionCmd, 58 *changeTheDetectorSizeCmd, 59 *changeTheDetectorToPhantomPositionCmd, 60 *changeTheDetectorVoxelCmd; 112 61 }; 113 62 #endif -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyDummySD.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // ---------------------------------------------------------------------------- 27 // GEANT 4 - Hadrontherapy example 28 // ---------------------------------------------------------------------------- 29 // Code developed by: 30 // 31 // G.A.P. Cirrone(a)*, G. Candiano, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 32 // 33 // (a) Laboratori Nazionali del Sud 34 // of the National Institute for Nuclear Physics, Catania, Italy 35 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 36 // 37 // * cirrone@lns.infn.it 38 // -------------------------------------------------------------- 26 // HadrontherapyDummySD.hh 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 39 28 40 29 #ifndef HadrontherapyDummySD_h -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyEventAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyEventAction.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, G. Candiano, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the National Institute for Nuclear Physics, Catania, Italy 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // -------------------------------------------------------------- 26 // HadrontherapyEventAction.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 #ifndef HadrontherapyEventAction_h … … 46 34 47 35 class HadrontherapyMatrix; 36 class HadrontherapyEventActionMessenger; 48 37 49 38 class HadrontherapyEventAction : public G4UserEventAction 50 39 { 51 40 public: 52 HadrontherapyEventAction( HadrontherapyMatrix*);41 HadrontherapyEventAction(); 53 42 ~HadrontherapyEventAction(); 54 43 … … 56 45 void BeginOfEventAction(const G4Event*); 57 46 void EndOfEventAction(const G4Event*); 58 47 48 void SetPrintModulo(G4int val) 49 { 50 printModulo = val; 51 }; 52 53 void SetDrawFlag(G4String val) 54 { 55 drawFlag = val; 56 }; 57 59 58 private: 60 59 G4String drawFlag; //Visualisation flag 61 60 G4int hitsCollectionID; 62 61 HadrontherapyMatrix *matrix; 62 G4int printModulo; 63 HadrontherapyEventActionMessenger* pointerEventMessenger; 63 64 }; 64 65 -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyMatrix.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyMatrix.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the National Institute for Nuclear Physics, Catania, Italy 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyMatrix.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 #ifndef HadrontherapyMatrix_H … … 43 31 44 32 #include "globals.hh" 33 #include <vector> 45 34 46 35 // The information: energy deposit and position in the phantom … … 49 38 class HadrontherapyMatrix 50 39 { 40 private: 41 HadrontherapyMatrix(G4int voxelX, G4int voxelY, G4int voxelZ); //<--- this is supposed to be a singleton 42 51 43 public: 52 HadrontherapyMatrix(); 44 53 45 ~HadrontherapyMatrix(); 46 // Get object instance only 47 static HadrontherapyMatrix* getInstance(); 48 // Make & Get instance 49 static HadrontherapyMatrix* getInstance(G4int nX, G4int nY, G4int nZ); 50 51 void flush(); 54 52 55 53 void Initialize(); 56 54 // All the elements of the matrix are initialised to zero 57 55 58 56 void Fill(G4int i, G4int j, G4int k, G4double energyDeposit); 59 57 // The matrix is filled with the energy deposit … … 64 62 // Store the information of the matrix in a ntuple and in 65 63 // a 1D Histogram 64 65 inline G4int Index(G4int i, G4int j, G4int k){ return (i * numberVoxelY + j) * numberVoxelZ + k; } 66 // Get a unique index from a three dimensional voxel information 66 67 67 68 private: 69 70 static HadrontherapyMatrix* instance; 68 71 G4int numberVoxelX; 69 72 G4int numberVoxelY; -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyParticles.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyParticles.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the National Institute for Nuclear Physics, Catania, Italy 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyParticles.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 #ifndef HADRONTHERAPYPARTICLES_HH -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyPhysicsList.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyPhysicsList.hh,v 1.0 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the National Institute for Nuclear Physics, Catania, Italy 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 40 #ifndef HADRONTHERAPYPHYSICSLIST_H 41 #define HADRONTHERAPYPHYSICSLIST_H 1 26 // HadrontherapyPhysicsList.hh 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 28 29 #ifndef HadrontherapyPhysicsList_h 30 #define HadrontherapyPhysicsList_h 1 42 31 43 32 #include "G4VModularPhysicsList.hh" 33 #include "G4EmConfigurator.hh" 44 34 #include "globals.hh" 45 35 36 class G4VPhysicsConstructor; 37 class HadrontherapyStepMax; 46 38 class HadrontherapyPhysicsListMessenger; 47 39 … … 49 41 { 50 42 public: 43 51 44 HadrontherapyPhysicsList(); 52 45 virtual ~HadrontherapyPhysicsList(); 53 46 54 virtual void SetCuts(); 55 void AddPhysicsList(const G4String& name); 56 47 void ConstructParticle(); 48 49 void SetCuts(); 50 void SetCutForGamma(G4double); 51 void SetCutForElectron(G4double); 52 void SetCutForPositron(G4double); 53 54 void AddPhysicsList(const G4String& name); 55 void ConstructProcess(); 56 57 void AddStepMax(); 58 HadrontherapyStepMax* GetStepMaxProcess() {return stepMaxProcess;}; 59 void AddPackage(const G4String& name); 60 57 61 private: 58 G4bool decayIsRegistered;59 G4bool emElectronIsRegistered;60 G4bool emPositronIsRegistered;61 G4bool emPhotonIsRegistered;62 G4bool emIonIsRegistered;63 G4bool emMuonIsRegistered;64 G4bool hadrElasticHadronIonIsRegistered;65 G4bool hadrInelasticPionIsRegistered;66 G4bool hadrInelasticIonIsRegistered;67 G4bool hadrInelasticProtonNeutronIsRegistered;68 G4bool hadrAtRestMuonIsRegistered;69 62 70 HadrontherapyPhysicsListMessenger* messenger; 63 G4EmConfigurator em_config; 64 65 G4double cutForGamma; 66 G4double cutForElectron; 67 G4double cutForPositron; 68 69 G4bool helIsRegisted; 70 G4bool bicIsRegisted; 71 G4bool biciIsRegisted; 72 G4bool locIonIonInelasticIsRegistered; 73 G4bool radioactiveDecayIsRegisted; 74 75 G4String emName; 76 G4VPhysicsConstructor* emPhysicsList; 77 G4VPhysicsConstructor* decPhysicsList; 78 std::vector<G4VPhysicsConstructor*> hadronPhys; 79 80 HadrontherapyStepMax* stepMaxProcess; 81 82 HadrontherapyPhysicsListMessenger* pMessenger; 71 83 }; 72 84 73 85 #endif 74 75 76 -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyPhysicsListMessenger.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyPhisicsListMessenger.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the National Institute for Nuclear Physics, Catania, Italy 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyPhysicsListsMessenger.hh 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 #ifndef H ADRONTHERAPYPHYSICSLISTMESSENGER_HH42 #define H ADRONTHERAPYPHYSICSLISTMESSENGER_HH129 #ifndef HadrontherapyPhysicsListMessenger_h 30 #define HadrontherapyPhysicsListMessenger_h 1 43 31 44 32 #include "globals.hh" … … 47 35 class HadrontherapyPhysicsList; 48 36 class G4UIdirectory; 49 class G4UIcmdWithoutParameter;50 class G4UIcmdWithADouble;51 37 class G4UIcmdWithADoubleAndUnit; 52 class G4UIcmdWithABool;53 38 class G4UIcmdWithAString; 54 39 55 class HadrontherapyPhysicsListMessenger: public G4UImessenger { 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 56 41 57 public: 42 class HadrontherapyPhysicsListMessenger: public G4UImessenger 43 { 44 public: 58 45 59 HadrontherapyPhysicsListMessenger(HadrontherapyPhysicsList* physList); 46 HadrontherapyPhysicsListMessenger(HadrontherapyPhysicsList* ); 47 ~HadrontherapyPhysicsListMessenger(); 48 49 void SetNewValue(G4UIcommand*, G4String); 50 51 private: 60 52 61 ~HadrontherapyPhysicsListMessenger();62 63 void SetNewValue(G4UIcommand*, G4String);64 65 private: 66 67 HadrontherapyPhysicsList* physicsList;68 G4UI directory* listDir;69 G4UIcmdWithAString* p hysicsListCmd;53 HadrontherapyPhysicsList* pPhysicsList; 54 55 G4UIdirectory* physDir; 56 G4UIcmdWithADoubleAndUnit* gammaCutCmd; 57 G4UIcmdWithADoubleAndUnit* electCutCmd; 58 G4UIcmdWithADoubleAndUnit* protoCutCmd; 59 G4UIcmdWithADoubleAndUnit* allCutCmd; 60 G4UIcmdWithAString* pListCmd; 61 G4UIcmdWithAString* packageListCmd; 70 62 }; 63 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 65 72 66 #endif 73 67 74 75 76 77 78 79 80 -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyPrimaryGeneratorAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyPrimaryGeneratorAction.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the National Institute for Nuclear Physics, Catania, Italy 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyPrimaryGeneratorAction.hh; May 2005 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 #ifndef HadrontherapyPrimaryGeneratorAction_h … … 68 56 void SetsigmaMomentumY(G4double); 69 57 void SetsigmaMomentumZ(G4double); 58 G4double GetmeanKineticEnergy(void); 70 59 71 60 private: -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyPrimaryGeneratorMessenger.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyPrimaryGeneratorMessenger.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the National Institute for Nuclear Physics, Catania, Italy 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyPrimaryGeneratorMessenger.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 #ifndef HadrontherapyPrimaryGeneratorMessenger_h -
trunk/examples/advanced/hadrontherapy/include/HadrontherapyRunAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyRunAction.hh,v 3.0, September 2004; 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the INFN, Catania, Italy 36 // (b) INFN Section of Genova, Genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyRunAction.hh 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 #ifndef HadrontherapyRunAction_h … … 51 39 class HadrontherapyRunMessenger; 52 40 class HadrontherapyFactory; 53 class HadrontherapyFactoryIr;54 class HadrontherapyFactoryI;55 56 57 41 58 42 class HadrontherapyRunAction : public G4UserRunAction -
trunk/examples/advanced/hadrontherapy/include/HadrontherapySteppingAction.hh
r807 r1230 24 24 // ******************************************************************** 25 25 // 26 // $Id: HadrontherapyProtonSteppingAction.hh; May 2005 27 // ---------------------------------------------------------------------------- 28 // GEANT 4 - Hadrontherapy example 29 // ---------------------------------------------------------------------------- 30 // Code developed by: 31 // 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 33 // 34 // (a) Laboratori Nazionali del Sud 35 // of the INFN, Catania, Italy 36 // (b) INFN Section of Genova, Genova, Italy 37 // 38 // * cirrone@lns.infn.it 39 // ---------------------------------------------------------------------------- 26 // HadrontherapyProtonSteppingAction.hh; 27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy 40 28 41 29 #ifndef HadrontherapySteppingAction_h
Note: See TracChangeset
for help on using the changeset viewer.