Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -47,5 +47,3 @@ class B1ActionInitialization : public G4VUserActionInitialization
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -45,14 +45,13 @@ class B1DetectorConstruction : public G4VUserDetectorConstruction
|
||||
virtual ~B1DetectorConstruction();
|
||||
|
||||
virtual G4VPhysicalVolume* Construct();
|
||||
|
||||
|
||||
G4LogicalVolume* GetScoringVolume() const { return fScoringVolume; }
|
||||
|
||||
protected:
|
||||
G4LogicalVolume* fScoringVolume;
|
||||
G4LogicalVolume* fScoringVolume;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -41,18 +41,16 @@ class B1EventAction : public G4UserEventAction
|
||||
public:
|
||||
B1EventAction();
|
||||
virtual ~B1EventAction();
|
||||
|
||||
|
||||
virtual void BeginOfEventAction(const G4Event* event);
|
||||
virtual void EndOfEventAction(const G4Event* event);
|
||||
|
||||
void AddEdep(G4double edep) { fEdep += edep; }
|
||||
|
||||
private:
|
||||
G4double fEdep;
|
||||
G4double fEdep;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
#ifndef B1PrimaryGeneratorAction_h
|
||||
#define B1PrimaryGeneratorAction_h 1
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4ParticleGun;
|
||||
@@ -40,28 +40,26 @@ class G4Box;
|
||||
|
||||
/// The primary generator action class with particle gun.
|
||||
///
|
||||
/// The default kinematic is a 6 MeV gamma, randomly distribued
|
||||
/// The default kinematic is a 6 MeV gamma, randomly distribued
|
||||
/// in front of the phantom across 80% of the (X,Y) phantom size.
|
||||
|
||||
class B1PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
B1PrimaryGeneratorAction();
|
||||
B1PrimaryGeneratorAction();
|
||||
virtual ~B1PrimaryGeneratorAction();
|
||||
|
||||
// method from the base class
|
||||
virtual void GeneratePrimaries(G4Event*);
|
||||
|
||||
virtual void GeneratePrimaries(G4Event*);
|
||||
|
||||
// method to access particle gun
|
||||
const G4ParticleGun* GetParticleGun() const { return fParticleGun; }
|
||||
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun; // pointer a to G4 gun class
|
||||
G4ParticleGun* fParticleGun; // pointer a to G4 gun class
|
||||
G4Box* fEnvelopeBox;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -46,19 +46,18 @@ class B1Run : public G4Run
|
||||
|
||||
// method from the base class
|
||||
virtual void Merge(const G4Run*);
|
||||
|
||||
void AddEdep (G4double edep);
|
||||
|
||||
void AddEdep(G4double edep);
|
||||
|
||||
// get methods
|
||||
G4double GetEdep() const { return fEdep; }
|
||||
G4double GetEdep() const { return fEdep; }
|
||||
G4double GetEdep2() const { return fEdep2; }
|
||||
|
||||
private:
|
||||
G4double fEdep;
|
||||
G4double fEdep2;
|
||||
G4double fEdep;
|
||||
G4double fEdep2;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class G4LogicalVolume;
|
||||
|
||||
/// Run action class
|
||||
///
|
||||
/// In EndOfRunAction(), it calculates the dose in the selected volume
|
||||
/// In EndOfRunAction(), it calculates the dose in the selected volume
|
||||
/// from the energy deposit accumulated via stepping and event actions.
|
||||
/// The computed dose is then printed on the screen.
|
||||
|
||||
@@ -50,10 +50,9 @@ class B1RunAction : public G4UserRunAction
|
||||
|
||||
virtual G4Run* GenerateRun();
|
||||
virtual void BeginOfRunAction(const G4Run*);
|
||||
virtual void EndOfRunAction(const G4Run*);
|
||||
virtual void EndOfRunAction(const G4Run*);
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class B1EventAction;
|
||||
class G4LogicalVolume;
|
||||
|
||||
/// Stepping action class
|
||||
///
|
||||
///
|
||||
|
||||
class B1SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
@@ -50,7 +50,7 @@ class B1SteppingAction : public G4UserSteppingAction
|
||||
virtual void UserSteppingAction(const G4Step*);
|
||||
|
||||
private:
|
||||
B1EventAction* fEventAction;
|
||||
B1EventAction* fEventAction;
|
||||
G4LogicalVolume* fScoringVolume;
|
||||
};
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
|
||||
#include "G4VUserVisAction.hh"
|
||||
|
||||
class UVA_VisAction: public G4VUserVisAction {
|
||||
virtual void Draw();
|
||||
class UVA_VisAction : public G4VUserVisAction
|
||||
{
|
||||
virtual void Draw();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Fo
|
||||
|
||||
|
||||
**************************************************************
|
||||
Geant4 version Name: geant4-11-02-patch-02 (21-June-2024)
|
||||
Geant4 version Name: geant4-11-02-ref-06 (28-June-2024)
|
||||
Copyright : Geant4 Collaboration
|
||||
References : NIM A 506 (2003), 250-303
|
||||
: IEEE-TNS 53 (2006), 270-278
|
||||
@@ -43,14 +43,21 @@ Registered graphics systems are:
|
||||
RayTracerX (RayTracerX)
|
||||
Qt3D (Qt3D)
|
||||
TOOLSSG_X11_GLES (TSG_X11_GLES, TSGX11, TSG_XT_GLES_FALLBACK)
|
||||
TOOLSSG_X11_ZB (TSG_X11_ZB, TSGX11ZB)
|
||||
TOOLSSG_XT_GLES (TSG_XT_GLES, TSGXt, TSG_QT_GLES_FALLBACK)
|
||||
TOOLSSG_XT_ZB (TSG_XT_ZB, TSGXtZB)
|
||||
TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG)
|
||||
TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
|
||||
Default graphics system is: TSG_OFFSCREEN (based on batch session).
|
||||
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).
|
||||
Note: Parameters specified on the command line will override these defaults.
|
||||
Use "vis/open" without parameters to get these defaults.
|
||||
You may choose a graphics system (driver) with a parameter of
|
||||
the command "/vis/open" or "/vis/sceneHandler/create",
|
||||
or you may omit the driver parameter and choose at run time:
|
||||
- by argument in the construction of G4VisExecutive
|
||||
- by environment variable "G4VIS_DEFAULT_DRIVER"
|
||||
- by entry in "~/.g4session"
|
||||
- by build flags.
|
||||
- Note: This feature is not allowed in batch mode.
|
||||
For further information see "examples/basic/B1/exampleB1.cc"
|
||||
and "vis.mac".
|
||||
|
||||
Registering model factories...
|
||||
|
||||
@@ -244,7 +251,7 @@ eBrem: for e+ XStype:4 SubType=3
|
||||
eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai
|
||||
eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai
|
||||
|
||||
annihil: for e+ XStype:2 SubType=5 BuildTable=0
|
||||
annihil: for e+ XStype:2 SubType=5 AtRestModel:Simple BuildTable=0
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
eplus2gg : Emin= 0 eV Emax= 100 TeV
|
||||
|
||||
@@ -805,7 +812,7 @@ Min energy per nucleon for multifragmentation 200 GeV
|
||||
Limit excitation energy for Fermi BreakUp 20 MeV
|
||||
Level density (1/MeV) 0.075
|
||||
Use simple level density model 1
|
||||
Use discrete excitation energy of the residual 1
|
||||
Use discrete excitation energy of the residual 0
|
||||
Time limit for long lived isomeres 1 ns
|
||||
Isomer production flag 1
|
||||
Internal e- conversion flag 1
|
||||
@@ -1072,7 +1079,7 @@ Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolu
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 5
|
||||
User=0.000000s Real=0.001576s Sys=0.000000s
|
||||
User=0.000000s Real=0.001834s Sys=0.000000s
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 5 gamma of 6 MeV
|
||||
@@ -1183,21 +1190,22 @@ Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolu
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 1
|
||||
User=0.000000s Real=0.000718s Sys=0.000000s
|
||||
User=0.000000s Real=0.000811s Sys=0.000000s
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 1 proton of 210 MeV
|
||||
Dose in scoring volume : 9.973684661820265 picoGy +- 0 picoGy
|
||||
Dose in scoring volume : 9.973684663160896 picoGy +- 0 picoGy
|
||||
------------------------------------------------------------
|
||||
|
||||
Graphics systems deleted.
|
||||
Visualization Manager deleting...
|
||||
G4 kernel has come to Quit state.
|
||||
UserDetectorConstruction deleted.
|
||||
UserPhysicsList deleted.
|
||||
UserActionInitialization deleted.
|
||||
UserWorkerInitialization deleted.
|
||||
UserWorkerThreadInitialization deleted.
|
||||
Deleting G4Run (id:1)
|
||||
UserDetectorConstruction deleted 0x14b5fe0
|
||||
UserPhysicsList deleted 0x14b7200
|
||||
UserActionInitialization deleted 0x1672070
|
||||
UserWorkerInitialization deleted 0
|
||||
UserWorkerThreadInitialization deleted 0
|
||||
UserRunAction deleted.
|
||||
UserPrimaryGenerator deleted.
|
||||
RunManager is deleting RunManagerKernel.
|
||||
@@ -1211,16 +1219,14 @@ G4RNGHelper object is deleted.
|
||||
Pool ID '20G4NavigationLevelRep', size : 0.00769 MB
|
||||
Pool ID '24G4ReferenceCountedHandleIvE', size : 0.000961 MB
|
||||
Pool ID '17G4DynamicParticle', size : 0.00192 MB
|
||||
Pool ID '16G4SmartVoxelNode', size : 0.000961 MB
|
||||
Pool ID '17G4SmartVoxelProxy', size : 0.000961 MB
|
||||
Pool ID '7G4Event', size : 0.000961 MB
|
||||
Pool ID '15G4PrimaryVertex', size : 0.000961 MB
|
||||
Pool ID '17G4PrimaryParticle', size : 0.000961 MB
|
||||
Pool ID '7G4Track', size : 0.00288 MB
|
||||
Pool ID '18G4TouchableHistory', size : 0.000961 MB
|
||||
Pool ID '15G4CountedObjectIvE', size : 0.000961 MB
|
||||
Number of memory pools allocated: 11 of which, static: 0
|
||||
Dynamic pools deleted: 11 / Total memory freed: 0.02 MB
|
||||
Number of memory pools allocated: 9 of which, static: 0
|
||||
Dynamic pools deleted: 9 / Total memory freed: 0.018 MB
|
||||
============================================================
|
||||
G4Allocator objects are deleted.
|
||||
UImanager deleted.
|
||||
|
||||
@@ -11,7 +11,7 @@ Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Fo
|
||||
|
||||
|
||||
**************************************************************
|
||||
Geant4 version Name: geant4-11-02-patch-02 (21-June-2024)
|
||||
Geant4 version Name: geant4-11-02-ref-06 (28-June-2024)
|
||||
Copyright : Geant4 Collaboration
|
||||
References : NIM A 506 (2003), 250-303
|
||||
: IEEE-TNS 53 (2006), 270-278
|
||||
@@ -43,14 +43,21 @@ Registered graphics systems are:
|
||||
RayTracerX (RayTracerX)
|
||||
Qt3D (Qt3D)
|
||||
TOOLSSG_X11_GLES (TSG_X11_GLES, TSGX11, TSG_XT_GLES_FALLBACK)
|
||||
TOOLSSG_X11_ZB (TSG_X11_ZB, TSGX11ZB)
|
||||
TOOLSSG_XT_GLES (TSG_XT_GLES, TSGXt, TSG_QT_GLES_FALLBACK)
|
||||
TOOLSSG_XT_ZB (TSG_XT_ZB, TSGXtZB)
|
||||
TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG)
|
||||
TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
|
||||
Default graphics system is: TSG_OFFSCREEN (based on batch session).
|
||||
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).
|
||||
Note: Parameters specified on the command line will override these defaults.
|
||||
Use "vis/open" without parameters to get these defaults.
|
||||
You may choose a graphics system (driver) with a parameter of
|
||||
the command "/vis/open" or "/vis/sceneHandler/create",
|
||||
or you may omit the driver parameter and choose at run time:
|
||||
- by argument in the construction of G4VisExecutive
|
||||
- by environment variable "G4VIS_DEFAULT_DRIVER"
|
||||
- by entry in "~/.g4session"
|
||||
- by build flags.
|
||||
- Note: This feature is not allowed in batch mode.
|
||||
For further information see "examples/basic/B1/exampleB1.cc"
|
||||
and "vis.mac".
|
||||
|
||||
Registering model factories...
|
||||
|
||||
@@ -244,7 +251,7 @@ eBrem: for e+ XStype:4 SubType=3
|
||||
eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai
|
||||
eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai
|
||||
|
||||
annihil: for e+ XStype:2 SubType=5 BuildTable=0
|
||||
annihil: for e+ XStype:2 SubType=5 AtRestModel:Simple BuildTable=0
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
eplus2gg : Emin= 0 eV Emax= 100 TeV
|
||||
|
||||
@@ -805,7 +812,7 @@ Min energy per nucleon for multifragmentation 200 GeV
|
||||
Limit excitation energy for Fermi BreakUp 20 MeV
|
||||
Level density (1/MeV) 0.075
|
||||
Use simple level density model 1
|
||||
Use discrete excitation energy of the residual 1
|
||||
Use discrete excitation energy of the residual 0
|
||||
Time limit for long lived isomeres 1 ns
|
||||
Isomer production flag 1
|
||||
Internal e- conversion flag 1
|
||||
@@ -890,11 +897,11 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 1000
|
||||
User=0.030000s Real=0.037456s Sys=0.000000s
|
||||
User=0.030000s Real=0.028701s Sys=0.000000s
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 1000 gamma of 6 MeV
|
||||
Dose in scoring volume : 45.9908 picoGy +- 4.00657 picoGy
|
||||
Dose in scoring volume : 38.2775 picoGy +- 3.69149 picoGy
|
||||
------------------------------------------------------------
|
||||
|
||||
#
|
||||
@@ -965,21 +972,22 @@ Index : 3 used in the geometry : Yes
|
||||
Run terminated.
|
||||
Run Summary
|
||||
Number of events processed : 1000
|
||||
User=0.250000s Real=0.273167s Sys=0.000000s
|
||||
User=0.250000s Real=0.252469s Sys=0.010000s
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 1000 proton of 210 MeV
|
||||
Dose in scoring volume : 5.21379 nanoGy +- 146.477 picoGy
|
||||
Dose in scoring volume : 5.00878 nanoGy +- 146.537 picoGy
|
||||
------------------------------------------------------------
|
||||
|
||||
Graphics systems deleted.
|
||||
Visualization Manager deleting...
|
||||
G4 kernel has come to Quit state.
|
||||
UserDetectorConstruction deleted.
|
||||
UserPhysicsList deleted.
|
||||
UserActionInitialization deleted.
|
||||
UserWorkerInitialization deleted.
|
||||
UserWorkerThreadInitialization deleted.
|
||||
Deleting G4Run (id:1)
|
||||
UserDetectorConstruction deleted 0x962fe0
|
||||
UserPhysicsList deleted 0x964200
|
||||
UserActionInitialization deleted 0xb1f070
|
||||
UserWorkerInitialization deleted 0
|
||||
UserWorkerThreadInitialization deleted 0
|
||||
UserRunAction deleted.
|
||||
UserPrimaryGenerator deleted.
|
||||
RunManager is deleting RunManagerKernel.
|
||||
@@ -987,24 +995,22 @@ G4SDManager deleted.
|
||||
EventManager deleted.
|
||||
Units table cleared.
|
||||
TransportationManager deleted.
|
||||
Total navigation history collections cleaned: 13
|
||||
Total navigation history collections cleaned: 12
|
||||
G4RNGHelper object is deleted.
|
||||
================== Deleting memory pools ===================
|
||||
Pool ID '20G4NavigationLevelRep', size : 0.0183 MB
|
||||
Pool ID '20G4NavigationLevelRep', size : 0.0173 MB
|
||||
Pool ID '24G4ReferenceCountedHandleIvE', size : 0.000961 MB
|
||||
Pool ID '17G4DynamicParticle', size : 0.00385 MB
|
||||
Pool ID '16G4SmartVoxelNode', size : 0.000961 MB
|
||||
Pool ID '17G4SmartVoxelProxy', size : 0.000961 MB
|
||||
Pool ID '17G4DynamicParticle', size : 0.00577 MB
|
||||
Pool ID '7G4Event', size : 0.000961 MB
|
||||
Pool ID '15G4PrimaryVertex', size : 0.000961 MB
|
||||
Pool ID '17G4PrimaryParticle', size : 0.000961 MB
|
||||
Pool ID '7G4Track', size : 0.00769 MB
|
||||
Pool ID '7G4Track', size : 0.0106 MB
|
||||
Pool ID '18G4TouchableHistory', size : 0.00192 MB
|
||||
Pool ID '15G4CountedObjectIvE', size : 0.000961 MB
|
||||
Pool ID '10G4Fragment', size : 0.00192 MB
|
||||
Pool ID '17G4ReactionProduct', size : 0.00192 MB
|
||||
Number of memory pools allocated: 13 of which, static: 0
|
||||
Dynamic pools deleted: 13 / Total memory freed: 0.042 MB
|
||||
Number of memory pools allocated: 11 of which, static: 0
|
||||
Dynamic pools deleted: 11 / Total memory freed: 0.044 MB
|
||||
============================================================
|
||||
G4Allocator objects are deleted.
|
||||
UImanager deleted.
|
||||
|
||||
@@ -28,21 +28,19 @@
|
||||
/// \brief Implementation of the B1ActionInitialization class
|
||||
|
||||
#include "B1ActionInitialization.hh"
|
||||
|
||||
#include "B1EventAction.hh"
|
||||
#include "B1PrimaryGeneratorAction.hh"
|
||||
#include "B1RunAction.hh"
|
||||
#include "B1EventAction.hh"
|
||||
#include "B1SteppingAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1ActionInitialization::B1ActionInitialization()
|
||||
: G4VUserActionInitialization()
|
||||
{}
|
||||
B1ActionInitialization::B1ActionInitialization() : G4VUserActionInitialization() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1ActionInitialization::~B1ActionInitialization()
|
||||
{}
|
||||
B1ActionInitialization::~B1ActionInitialization() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -57,11 +55,11 @@ void B1ActionInitialization::Build() const
|
||||
{
|
||||
SetUserAction(new B1PrimaryGeneratorAction);
|
||||
SetUserAction(new B1RunAction);
|
||||
|
||||
|
||||
B1EventAction* eventAction = new B1EventAction;
|
||||
SetUserAction(eventAction);
|
||||
|
||||
|
||||
SetUserAction(new B1SteppingAction(eventAction));
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -29,158 +29,145 @@
|
||||
|
||||
#include "B1DetectorConstruction.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Cons.hh"
|
||||
#include "G4Orb.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4Trd.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Orb.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Sphere.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Trd.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1DetectorConstruction::B1DetectorConstruction()
|
||||
: G4VUserDetectorConstruction(),
|
||||
fScoringVolume(0)
|
||||
{ }
|
||||
B1DetectorConstruction::B1DetectorConstruction() : G4VUserDetectorConstruction(), fScoringVolume(0)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1DetectorConstruction::~B1DetectorConstruction()
|
||||
{ }
|
||||
B1DetectorConstruction::~B1DetectorConstruction() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume* B1DetectorConstruction::Construct()
|
||||
{
|
||||
{
|
||||
// Get nist material manager
|
||||
G4NistManager* nist = G4NistManager::Instance();
|
||||
|
||||
|
||||
// Envelope parameters
|
||||
//
|
||||
G4double env_sizeXY = 20*cm, env_sizeZ = 30*cm;
|
||||
G4double env_sizeXY = 20 * cm, env_sizeZ = 30 * cm;
|
||||
G4Material* env_mat = nist->FindOrBuildMaterial("G4_WATER");
|
||||
|
||||
|
||||
// Option to switch on/off checking of volumes overlaps
|
||||
//
|
||||
G4bool checkOverlaps = true;
|
||||
|
||||
//
|
||||
//
|
||||
// World
|
||||
//
|
||||
G4double world_sizeXY = 1.2*env_sizeXY;
|
||||
G4double world_sizeZ = 1.2*env_sizeZ;
|
||||
G4double world_sizeXY = 1.2 * env_sizeXY;
|
||||
G4double world_sizeZ = 1.2 * env_sizeZ;
|
||||
G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
|
||||
|
||||
G4Box* solidWorld =
|
||||
new G4Box("World", //its name
|
||||
0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //its size
|
||||
|
||||
G4LogicalVolume* logicWorld =
|
||||
new G4LogicalVolume(solidWorld, //its solid
|
||||
world_mat, //its material
|
||||
"World"); //its name
|
||||
|
||||
G4VPhysicalVolume* physWorld =
|
||||
new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
logicWorld, //its logical volume
|
||||
"World", //its name
|
||||
0, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
|
||||
//
|
||||
|
||||
G4Box* solidWorld =
|
||||
new G4Box("World", // its name
|
||||
0.5 * world_sizeXY, 0.5 * world_sizeXY, 0.5 * world_sizeZ); // its size
|
||||
|
||||
G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, // its solid
|
||||
world_mat, // its material
|
||||
"World"); // its name
|
||||
|
||||
G4VPhysicalVolume* physWorld = new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicWorld, // its logical volume
|
||||
"World", // its name
|
||||
0, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Envelope
|
||||
//
|
||||
G4Box* solidEnv =
|
||||
new G4Box("Envelope", //its name
|
||||
0.5*env_sizeXY, 0.5*env_sizeXY, 0.5*env_sizeZ); //its size
|
||||
|
||||
G4LogicalVolume* logicEnv =
|
||||
new G4LogicalVolume(solidEnv, //its solid
|
||||
env_mat, //its material
|
||||
"Envelope"); //its name
|
||||
|
||||
new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
logicEnv, //its logical volume
|
||||
"Envelope", //its name
|
||||
logicWorld, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
|
||||
//
|
||||
//
|
||||
G4Box* solidEnv = new G4Box("Envelope", // its name
|
||||
0.5 * env_sizeXY, 0.5 * env_sizeXY, 0.5 * env_sizeZ); // its size
|
||||
|
||||
G4LogicalVolume* logicEnv = new G4LogicalVolume(solidEnv, // its solid
|
||||
env_mat, // its material
|
||||
"Envelope"); // its name
|
||||
|
||||
new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(), // at (0,0,0)
|
||||
logicEnv, // its logical volume
|
||||
"Envelope", // its name
|
||||
logicWorld, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Shape 1
|
||||
//
|
||||
//
|
||||
G4Material* shape1_mat = nist->FindOrBuildMaterial("G4_A-150_TISSUE");
|
||||
G4ThreeVector pos1 = G4ThreeVector(0, 2*cm, -7*cm);
|
||||
|
||||
// Conical section shape
|
||||
G4double shape1_rmina = 0.*cm, shape1_rmaxa = 2.*cm;
|
||||
G4double shape1_rminb = 0.*cm, shape1_rmaxb = 4.*cm;
|
||||
G4double shape1_hz = 3.*cm;
|
||||
G4double shape1_phimin = 0.*deg, shape1_phimax = 360.*deg;
|
||||
G4Cons* solidShape1 =
|
||||
new G4Cons("Shape1",
|
||||
shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb, shape1_hz,
|
||||
shape1_phimin, shape1_phimax);
|
||||
|
||||
G4LogicalVolume* logicShape1 =
|
||||
new G4LogicalVolume(solidShape1, //its solid
|
||||
shape1_mat, //its material
|
||||
"Shape1"); //its name
|
||||
|
||||
new G4PVPlacement(0, //no rotation
|
||||
pos1, //at position
|
||||
logicShape1, //its logical volume
|
||||
"Shape1", //its name
|
||||
logicEnv, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
G4ThreeVector pos1 = G4ThreeVector(0, 2 * cm, -7 * cm);
|
||||
|
||||
// Conical section shape
|
||||
G4double shape1_rmina = 0. * cm, shape1_rmaxa = 2. * cm;
|
||||
G4double shape1_rminb = 0. * cm, shape1_rmaxb = 4. * cm;
|
||||
G4double shape1_hz = 3. * cm;
|
||||
G4double shape1_phimin = 0. * deg, shape1_phimax = 360. * deg;
|
||||
G4Cons* solidShape1 = new G4Cons("Shape1", shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb,
|
||||
shape1_hz, shape1_phimin, shape1_phimax);
|
||||
|
||||
//
|
||||
G4LogicalVolume* logicShape1 = new G4LogicalVolume(solidShape1, // its solid
|
||||
shape1_mat, // its material
|
||||
"Shape1"); // its name
|
||||
|
||||
new G4PVPlacement(0, // no rotation
|
||||
pos1, // at position
|
||||
logicShape1, // its logical volume
|
||||
"Shape1", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
//
|
||||
// Shape 2
|
||||
//
|
||||
G4Material* shape2_mat = nist->FindOrBuildMaterial("G4_BONE_COMPACT_ICRU");
|
||||
G4ThreeVector pos2 = G4ThreeVector(0, -1*cm, 7*cm);
|
||||
G4ThreeVector pos2 = G4ThreeVector(0, -1 * cm, 7 * cm);
|
||||
|
||||
// Trapezoid shape
|
||||
G4double shape2_dxa = 12 * cm, shape2_dxb = 12 * cm;
|
||||
G4double shape2_dya = 10 * cm, shape2_dyb = 16 * cm;
|
||||
G4double shape2_dz = 6 * cm;
|
||||
G4Trd* solidShape2 = new G4Trd("Shape2", // its name
|
||||
0.5 * shape2_dxa, 0.5 * shape2_dxb, 0.5 * shape2_dya,
|
||||
0.5 * shape2_dyb, 0.5 * shape2_dz); // its size
|
||||
|
||||
G4LogicalVolume* logicShape2 = new G4LogicalVolume(solidShape2, // its solid
|
||||
shape2_mat, // its material
|
||||
"Shape2"); // its name
|
||||
|
||||
new G4PVPlacement(0, // no rotation
|
||||
pos2, // at position
|
||||
logicShape2, // its logical volume
|
||||
"Shape2", // its name
|
||||
logicEnv, // its mother volume
|
||||
false, // no boolean operation
|
||||
0, // copy number
|
||||
checkOverlaps); // overlaps checking
|
||||
|
||||
// Trapezoid shape
|
||||
G4double shape2_dxa = 12*cm, shape2_dxb = 12*cm;
|
||||
G4double shape2_dya = 10*cm, shape2_dyb = 16*cm;
|
||||
G4double shape2_dz = 6*cm;
|
||||
G4Trd* solidShape2 =
|
||||
new G4Trd("Shape2", //its name
|
||||
0.5*shape2_dxa, 0.5*shape2_dxb,
|
||||
0.5*shape2_dya, 0.5*shape2_dyb, 0.5*shape2_dz); //its size
|
||||
|
||||
G4LogicalVolume* logicShape2 =
|
||||
new G4LogicalVolume(solidShape2, //its solid
|
||||
shape2_mat, //its material
|
||||
"Shape2"); //its name
|
||||
|
||||
new G4PVPlacement(0, //no rotation
|
||||
pos2, //at position
|
||||
logicShape2, //its logical volume
|
||||
"Shape2", //its name
|
||||
logicEnv, //its mother volume
|
||||
false, //no boolean operation
|
||||
0, //copy number
|
||||
checkOverlaps); //overlaps checking
|
||||
|
||||
// Set Shape2 as scoring volume
|
||||
//
|
||||
fScoringVolume = logicShape2;
|
||||
|
||||
//
|
||||
//always return the physical World
|
||||
// always return the physical World
|
||||
//
|
||||
return physWorld;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
/// \brief Implementation of the B1EventAction class
|
||||
|
||||
#include "B1EventAction.hh"
|
||||
|
||||
#include "B1Run.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
@@ -35,31 +36,25 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction::B1EventAction()
|
||||
: G4UserEventAction(),
|
||||
fEdep(0.)
|
||||
{}
|
||||
B1EventAction::B1EventAction() : G4UserEventAction(), fEdep(0.) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1EventAction::~B1EventAction()
|
||||
{}
|
||||
B1EventAction::~B1EventAction() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::BeginOfEventAction(const G4Event*)
|
||||
{
|
||||
{
|
||||
fEdep = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1EventAction::EndOfEventAction(const G4Event*)
|
||||
{
|
||||
{
|
||||
// accumulate statistics in B1Run
|
||||
B1Run* run
|
||||
= static_cast<B1Run*>(
|
||||
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
|
||||
B1Run* run = static_cast<B1Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
|
||||
run->AddEdep(fEdep);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,34 +29,31 @@
|
||||
|
||||
#include "B1PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1PrimaryGeneratorAction::B1PrimaryGeneratorAction()
|
||||
: G4VUserPrimaryGeneratorAction(),
|
||||
fParticleGun(0),
|
||||
fEnvelopeBox(0)
|
||||
: G4VUserPrimaryGeneratorAction(), fParticleGun(0), fEnvelopeBox(0)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
// default particle kinematic
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="gamma");
|
||||
G4ParticleDefinition* particle = particleTable->FindParticle(particleName = "gamma");
|
||||
fParticleGun->SetParticleDefinition(particle);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
fParticleGun->SetParticleEnergy(6.*MeV);
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
|
||||
fParticleGun->SetParticleEnergy(6. * MeV);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -70,45 +67,41 @@ B1PrimaryGeneratorAction::~B1PrimaryGeneratorAction()
|
||||
|
||||
void B1PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of ecah event
|
||||
// this function is called at the begining of ecah event
|
||||
//
|
||||
|
||||
// In order to avoid dependence of PrimaryGeneratorAction
|
||||
// on DetectorConstruction class we get Envelope volume
|
||||
// from G4LogicalVolumeStore.
|
||||
|
||||
|
||||
G4double envSizeXY = 0;
|
||||
G4double envSizeZ = 0;
|
||||
|
||||
if (!fEnvelopeBox)
|
||||
{
|
||||
G4LogicalVolume* envLV
|
||||
= G4LogicalVolumeStore::GetInstance()->GetVolume("Envelope");
|
||||
if ( envLV ) fEnvelopeBox = dynamic_cast<G4Box*>(envLV->GetSolid());
|
||||
if (!fEnvelopeBox) {
|
||||
G4LogicalVolume* envLV = G4LogicalVolumeStore::GetInstance()->GetVolume("Envelope");
|
||||
if (envLV) fEnvelopeBox = dynamic_cast<G4Box*>(envLV->GetSolid());
|
||||
}
|
||||
|
||||
if ( fEnvelopeBox ) {
|
||||
envSizeXY = fEnvelopeBox->GetXHalfLength()*2.;
|
||||
envSizeZ = fEnvelopeBox->GetZHalfLength()*2.;
|
||||
}
|
||||
else {
|
||||
if (fEnvelopeBox) {
|
||||
envSizeXY = fEnvelopeBox->GetXHalfLength() * 2.;
|
||||
envSizeZ = fEnvelopeBox->GetZHalfLength() * 2.;
|
||||
}
|
||||
else {
|
||||
G4ExceptionDescription msg;
|
||||
msg << "Envelope volume of box shape not found.\n";
|
||||
msg << "Envelope volume of box shape not found.\n";
|
||||
msg << "Perhaps you have changed geometry.\n";
|
||||
msg << "The gun will be place at the center.";
|
||||
G4Exception("B1PrimaryGeneratorAction::GeneratePrimaries()",
|
||||
"MyCode0002",JustWarning,msg);
|
||||
G4Exception("B1PrimaryGeneratorAction::GeneratePrimaries()", "MyCode0002", JustWarning, msg);
|
||||
}
|
||||
|
||||
G4double size = 0.8;
|
||||
G4double x0 = size * envSizeXY * (G4UniformRand()-0.5);
|
||||
G4double y0 = size * envSizeXY * (G4UniformRand()-0.5);
|
||||
G4double size = 0.8;
|
||||
G4double x0 = size * envSizeXY * (G4UniformRand() - 0.5);
|
||||
G4double y0 = size * envSizeXY * (G4UniformRand() - 0.5);
|
||||
G4double z0 = -0.5 * envSizeZ;
|
||||
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(x0, y0, z0));
|
||||
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -31,36 +31,29 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1Run::B1Run()
|
||||
: G4Run(),
|
||||
fEdep(0.),
|
||||
fEdep2(0.)
|
||||
{}
|
||||
B1Run::B1Run() : G4Run(), fEdep(0.), fEdep2(0.) {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1Run::~B1Run()
|
||||
{}
|
||||
|
||||
B1Run::~B1Run() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1Run::Merge(const G4Run* run)
|
||||
{
|
||||
const B1Run* localRun = static_cast<const B1Run*>(run);
|
||||
fEdep += localRun->fEdep;
|
||||
fEdep += localRun->fEdep;
|
||||
fEdep2 += localRun->fEdep2;
|
||||
|
||||
G4Run::Merge(run);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1Run::AddEdep (G4double edep)
|
||||
{
|
||||
fEdep += edep;
|
||||
fEdep2 += edep*edep;
|
||||
G4Run::Merge(run);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1Run::AddEdep(G4double edep)
|
||||
{
|
||||
fEdep += edep;
|
||||
fEdep2 += edep * edep;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -28,51 +28,50 @@
|
||||
/// \brief Implementation of the B1RunAction class
|
||||
|
||||
#include "B1RunAction.hh"
|
||||
#include "B1PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "B1DetectorConstruction.hh"
|
||||
#include "B1PrimaryGeneratorAction.hh"
|
||||
#include "B1Run.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1RunAction::B1RunAction()
|
||||
: G4UserRunAction()
|
||||
{
|
||||
B1RunAction::B1RunAction() : G4UserRunAction()
|
||||
{
|
||||
// add new units for dose
|
||||
//
|
||||
const G4double milligray = 1.e-3*gray;
|
||||
const G4double microgray = 1.e-6*gray;
|
||||
const G4double nanogray = 1.e-9*gray;
|
||||
const G4double picogray = 1.e-12*gray;
|
||||
|
||||
new G4UnitDefinition("milligray", "milliGy" , "Dose", milligray);
|
||||
new G4UnitDefinition("microgray", "microGy" , "Dose", microgray);
|
||||
new G4UnitDefinition("nanogray" , "nanoGy" , "Dose", nanogray);
|
||||
new G4UnitDefinition("picogray" , "picoGy" , "Dose", picogray);
|
||||
//
|
||||
const G4double milligray = 1.e-3 * gray;
|
||||
const G4double microgray = 1.e-6 * gray;
|
||||
const G4double nanogray = 1.e-9 * gray;
|
||||
const G4double picogray = 1.e-12 * gray;
|
||||
|
||||
new G4UnitDefinition("milligray", "milliGy", "Dose", milligray);
|
||||
new G4UnitDefinition("microgray", "microGy", "Dose", microgray);
|
||||
new G4UnitDefinition("nanogray", "nanoGy", "Dose", nanogray);
|
||||
new G4UnitDefinition("picogray", "picoGy", "Dose", picogray);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1RunAction::~B1RunAction()
|
||||
{}
|
||||
B1RunAction::~B1RunAction() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4Run* B1RunAction::GenerateRun()
|
||||
{
|
||||
return new B1Run;
|
||||
return new B1Run;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1RunAction::BeginOfRunAction(const G4Run*)
|
||||
{
|
||||
//inform the runManager to save random number seed
|
||||
{
|
||||
// inform the runManager to save random number seed
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(false);
|
||||
}
|
||||
|
||||
@@ -82,56 +81,53 @@ void B1RunAction::EndOfRunAction(const G4Run* run)
|
||||
{
|
||||
G4int nofEvents = run->GetNumberOfEvent();
|
||||
if (nofEvents == 0) return;
|
||||
|
||||
|
||||
const B1Run* b1Run = static_cast<const B1Run*>(run);
|
||||
|
||||
// Compute dose
|
||||
//
|
||||
G4double edep = b1Run->GetEdep();
|
||||
G4double edep = b1Run->GetEdep();
|
||||
G4double edep2 = b1Run->GetEdep2();
|
||||
G4double rms = edep2 - edep*edep/nofEvents;
|
||||
if (rms > 0.) rms = std::sqrt(rms); else rms = 0.;
|
||||
G4double rms = edep2 - edep * edep / nofEvents;
|
||||
if (rms > 0.)
|
||||
rms = std::sqrt(rms);
|
||||
else
|
||||
rms = 0.;
|
||||
|
||||
const B1DetectorConstruction* detectorConstruction
|
||||
= static_cast<const B1DetectorConstruction*>
|
||||
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
const B1DetectorConstruction* detectorConstruction = static_cast<const B1DetectorConstruction*>(
|
||||
G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
G4double mass = detectorConstruction->GetScoringVolume()->GetMass();
|
||||
G4double dose = edep/mass;
|
||||
G4double rmsDose = rms/mass;
|
||||
G4double dose = edep / mass;
|
||||
G4double rmsDose = rms / mass;
|
||||
|
||||
// Run conditions
|
||||
// note: There is no primary generator action object for "master"
|
||||
// run manager for multi-threaded mode.
|
||||
const B1PrimaryGeneratorAction* generatorAction
|
||||
= static_cast<const B1PrimaryGeneratorAction*>
|
||||
(G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
|
||||
const B1PrimaryGeneratorAction* generatorAction = static_cast<const B1PrimaryGeneratorAction*>(
|
||||
G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction());
|
||||
G4String runCondition;
|
||||
if (generatorAction)
|
||||
{
|
||||
if (generatorAction) {
|
||||
const G4ParticleGun* particleGun = generatorAction->GetParticleGun();
|
||||
runCondition += particleGun->GetParticleDefinition()->GetParticleName();
|
||||
runCondition += " of ";
|
||||
G4double particleEnergy = particleGun->GetParticleEnergy();
|
||||
runCondition += G4BestUnit(particleEnergy,"Energy");
|
||||
runCondition += G4BestUnit(particleEnergy, "Energy");
|
||||
}
|
||||
|
||||
|
||||
// Print
|
||||
//
|
||||
//
|
||||
if (IsMaster()) {
|
||||
G4cout
|
||||
<< "\n--------------------End of Global Run-----------------------";
|
||||
G4cout << "\n--------------------End of Global Run-----------------------";
|
||||
}
|
||||
else {
|
||||
G4cout
|
||||
<< "\n--------------------End of Local Run------------------------";
|
||||
G4cout << "\n--------------------End of Local Run------------------------";
|
||||
}
|
||||
|
||||
G4cout
|
||||
<< "\n The run consists of " << nofEvents << " "<< runCondition
|
||||
<< "\n Dose in scoring volume : "
|
||||
<< G4BestUnit(dose,"Dose") << " +- " << G4BestUnit(rmsDose,"Dose")
|
||||
<< "\n------------------------------------------------------------\n"
|
||||
<< G4endl;
|
||||
|
||||
G4cout << "\n The run consists of " << nofEvents << " " << runCondition
|
||||
<< "\n Dose in scoring volume : " << G4BestUnit(dose, "Dose") << " +- "
|
||||
<< G4BestUnit(rmsDose, "Dose")
|
||||
<< "\n------------------------------------------------------------\n"
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -28,50 +28,45 @@
|
||||
/// \brief Implementation of the B1SteppingAction class
|
||||
|
||||
#include "B1SteppingAction.hh"
|
||||
#include "B1EventAction.hh"
|
||||
#include "B1DetectorConstruction.hh"
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "B1DetectorConstruction.hh"
|
||||
#include "B1EventAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Step.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1SteppingAction::B1SteppingAction(B1EventAction* eventAction)
|
||||
: G4UserSteppingAction(),
|
||||
fEventAction(eventAction),
|
||||
fScoringVolume(0)
|
||||
: G4UserSteppingAction(), fEventAction(eventAction), fScoringVolume(0)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B1SteppingAction::~B1SteppingAction()
|
||||
{}
|
||||
B1SteppingAction::~B1SteppingAction() {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B1SteppingAction::UserSteppingAction(const G4Step* step)
|
||||
{
|
||||
if (!fScoringVolume) {
|
||||
const B1DetectorConstruction* detectorConstruction
|
||||
= static_cast<const B1DetectorConstruction*>
|
||||
(G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
fScoringVolume = detectorConstruction->GetScoringVolume();
|
||||
if (!fScoringVolume) {
|
||||
const B1DetectorConstruction* detectorConstruction = static_cast<const B1DetectorConstruction*>(
|
||||
G4RunManager::GetRunManager()->GetUserDetectorConstruction());
|
||||
fScoringVolume = detectorConstruction->GetScoringVolume();
|
||||
}
|
||||
|
||||
// get volume of the current step
|
||||
G4LogicalVolume* volume
|
||||
= step->GetPreStepPoint()->GetTouchableHandle()
|
||||
->GetVolume()->GetLogicalVolume();
|
||||
|
||||
G4LogicalVolume* volume =
|
||||
step->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume();
|
||||
|
||||
// check if we are in scoring volume
|
||||
if (volume != fScoringVolume) return;
|
||||
|
||||
// collect energy deposited in this step
|
||||
G4double edepStep = step->GetTotalEnergyDeposit();
|
||||
fEventAction->AddEdep(edepStep);
|
||||
fEventAction->AddEdep(edepStep);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -30,35 +30,33 @@
|
||||
|
||||
#include "UVA_VisAction.hh"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4Orb.hh"
|
||||
#include "G4SubtractionSolid.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Text.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Orb.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4SubtractionSolid.hh"
|
||||
#include "G4Text.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void UVA_VisAction::Draw() {
|
||||
void UVA_VisAction::Draw()
|
||||
{
|
||||
G4VVisManager* pVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if (pVisManager) {
|
||||
|
||||
// A simple logo...
|
||||
G4Orb orb("my_logo_orb", 5*cm);
|
||||
G4Box box("my_cut_box", 5*cm, 5*cm, 5*cm);
|
||||
G4SubtractionSolid logo("my_logo", &orb, &box,
|
||||
G4Translate3D(-3*cm,3*cm,3*cm));
|
||||
G4Orb orb("my_logo_orb", 5 * cm);
|
||||
G4Box box("my_cut_box", 5 * cm, 5 * cm, 5 * cm);
|
||||
G4SubtractionSolid logo("my_logo", &orb, &box, G4Translate3D(-3 * cm, 3 * cm, 3 * cm));
|
||||
G4VisAttributes va1(G4Colour::Red());
|
||||
va1.SetForceSolid(true);
|
||||
pVisManager->Draw(logo,va1,G4Translate3D(-15*cm,-20*cm,25*cm));
|
||||
pVisManager->Draw(logo, va1, G4Translate3D(-15 * cm, -20 * cm, 25 * cm));
|
||||
|
||||
G4Text text("My beautiful logo");
|
||||
G4VisAttributes va2(G4Colour::Magenta());
|
||||
text.SetVisAttributes(va2);
|
||||
text.SetScreenSize(12.);
|
||||
pVisManager->Draw(text,G4Translate3D(-16*cm,-18*cm,25*cm));
|
||||
|
||||
pVisManager->Draw(text, G4Translate3D(-16 * cm, -18 * cm, 25 * cm));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,29 +26,26 @@
|
||||
/// \file visualization/userVisAction/userVisAction.cc
|
||||
/// \brief Main program of the visualization/userVisAction example
|
||||
|
||||
#include "B1DetectorConstruction.hh"
|
||||
#include "B1ActionInitialization.hh"
|
||||
|
||||
#include "G4RunManagerFactory.hh"
|
||||
|
||||
#include "G4UImanager.hh"
|
||||
#include "B1DetectorConstruction.hh"
|
||||
#include "QBBC.hh"
|
||||
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "UVA_VisAction.hh"
|
||||
|
||||
#include "Randomize.hh"
|
||||
#include "G4RunManagerFactory.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4UIExecutive.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
int main(int argc,char** argv)
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
// Detect interactive mode (if no arguments) and define UI session
|
||||
//
|
||||
G4UIExecutive* ui = 0;
|
||||
if ( argc == 1 ) {
|
||||
if (argc == 1) {
|
||||
ui = new G4UIExecutive(argc, argv);
|
||||
}
|
||||
|
||||
@@ -78,20 +75,19 @@ int main(int argc,char** argv)
|
||||
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
// Register User Vis Action with optional extent
|
||||
visManager->RegisterRunDurationUserVisAction
|
||||
("My nice logo",
|
||||
new UVA_VisAction,
|
||||
G4VisExtent(-20*cm,-10*cm,-25*cm,-15*cm,20*cm,40*cm));
|
||||
visManager->RegisterRunDurationUserVisAction(
|
||||
"My nice logo", new UVA_VisAction,
|
||||
G4VisExtent(-20 * cm, -10 * cm, -25 * cm, -15 * cm, 20 * cm, 40 * cm));
|
||||
visManager->Initialize();
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
|
||||
if ( ! ui ) {
|
||||
if (!ui) {
|
||||
// batch mode
|
||||
G4String command = "/control/execute ";
|
||||
G4String fileName = argv[1];
|
||||
UImanager->ApplyCommand(command+fileName);
|
||||
UImanager->ApplyCommand(command + fileName);
|
||||
}
|
||||
else {
|
||||
// interactive mode
|
||||
|
||||
@@ -11,7 +11,7 @@ Environment variable "G4FORCE_RUN_MANAGER_TYPE" enabled with value == Serial. Fo
|
||||
|
||||
|
||||
**************************************************************
|
||||
Geant4 version Name: geant4-11-02-patch-02 (21-June-2024)
|
||||
Geant4 version Name: geant4-11-02-ref-06 (28-June-2024)
|
||||
Copyright : Geant4 Collaboration
|
||||
References : NIM A 506 (2003), 250-303
|
||||
: IEEE-TNS 53 (2006), 270-278
|
||||
@@ -43,14 +43,21 @@ Registered graphics systems are:
|
||||
RayTracerX (RayTracerX)
|
||||
Qt3D (Qt3D)
|
||||
TOOLSSG_X11_GLES (TSG_X11_GLES, TSGX11, TSG_XT_GLES_FALLBACK)
|
||||
TOOLSSG_X11_ZB (TSG_X11_ZB, TSGX11ZB)
|
||||
TOOLSSG_XT_GLES (TSG_XT_GLES, TSGXt, TSG_QT_GLES_FALLBACK)
|
||||
TOOLSSG_XT_ZB (TSG_XT_ZB, TSGXtZB)
|
||||
TOOLSSG_QT_GLES (TSG_QT_GLES, TSGQt, TSG)
|
||||
TOOLSSG_QT_ZB (TSG_QT_ZB, TSGQtZB)
|
||||
Default graphics system is: TSG_OFFSCREEN (based on batch session).
|
||||
Default window size hint is: 600x600-0+0 (based on G4VisManager initialisation).
|
||||
Note: Parameters specified on the command line will override these defaults.
|
||||
Use "vis/open" without parameters to get these defaults.
|
||||
You may choose a graphics system (driver) with a parameter of
|
||||
the command "/vis/open" or "/vis/sceneHandler/create",
|
||||
or you may omit the driver parameter and choose at run time:
|
||||
- by argument in the construction of G4VisExecutive
|
||||
- by environment variable "G4VIS_DEFAULT_DRIVER"
|
||||
- by entry in "~/.g4session"
|
||||
- by build flags.
|
||||
- Note: This feature is not allowed in batch mode.
|
||||
For further information see "examples/basic/B1/exampleB1.cc"
|
||||
and "vis.mac".
|
||||
|
||||
Registering model factories...
|
||||
|
||||
@@ -234,7 +241,7 @@ eBrem: for e+ XStype:4 SubType=3
|
||||
eBremSB : Emin= 0 eV Emax= 1 GeV ModifiedTsai
|
||||
eBremLPM : Emin= 1 GeV Emax= 100 TeV ModifiedTsai
|
||||
|
||||
annihil: for e+ XStype:2 SubType=5 BuildTable=0
|
||||
annihil: for e+ XStype:2 SubType=5 AtRestModel:Simple BuildTable=0
|
||||
===== EM models for the G4Region DefaultRegionForTheWorld ======
|
||||
eplus2gg : Emin= 0 eV Emax= 100 TeV
|
||||
|
||||
@@ -795,7 +802,7 @@ Min energy per nucleon for multifragmentation 200 GeV
|
||||
Limit excitation energy for Fermi BreakUp 20 MeV
|
||||
Level density (1/MeV) 0.075
|
||||
Use simple level density model 1
|
||||
Use discrete excitation energy of the residual 1
|
||||
Use discrete excitation energy of the residual 0
|
||||
Time limit for long lived isomeres 1 ns
|
||||
Isomer production flag 1
|
||||
Internal e- conversion flag 1
|
||||
@@ -819,7 +826,7 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 1000 gamma of 6 MeV
|
||||
Dose in scoring volume : 45.9908 picoGy +- 4.00657 picoGy
|
||||
Dose in scoring volume : 38.2775 picoGy +- 3.69149 picoGy
|
||||
------------------------------------------------------------
|
||||
|
||||
### Run 1 starts.
|
||||
@@ -836,7 +843,7 @@ See commands in /vis/modeling/trajectories/ for other options.
|
||||
|
||||
--------------------End of Global Run-----------------------
|
||||
The run consists of 1000 proton of 210 MeV
|
||||
Dose in scoring volume : 5.21379 nanoGy +- 146.477 picoGy
|
||||
Dose in scoring volume : 5.00878 nanoGy +- 146.537 picoGy
|
||||
------------------------------------------------------------
|
||||
|
||||
Graphics systems deleted.
|
||||
|
||||
Reference in New Issue
Block a user