Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 10:49:55 +02:00
parent 3a5407696b
commit 1a1316fea4
2180 changed files with 237880 additions and 59109 deletions
+10
View File
@@ -9,6 +9,16 @@ $Id: History 70524 2013-05-31 16:36:26Z gcosmo $
Package History file
--------------------
09 March 2017 - V.Ivanchenko - tag microbeam-V10-03-01
- PhysicsList, PhysicsListMessenger - removed obsolete way of
cut definition
- DetectorConstruction - thread safe definition of magnetic field
- SteppingAction - simplified implementation, added check on
alpha leaving the world volume
30 Dec 2016 - S.Incerti - tag microbeam-V10-03-00
- cleanup and relaxed step size constraints
07 Nov 2016 - S.Incerti - tag microbeam-V10-02-04
- correct warnings from clang compilers
+10 -16
View File
@@ -46,7 +46,7 @@ be turned on or off to deflect the beam on target;
6. A realistic human keratinocyte voxellized cell observed from confocal
microscopy and taking into account realistic nucleus and cytoplasm chemical
compositions
compositions.
---->2. EXPERIMENTAL SET-UP.
@@ -121,25 +121,21 @@ Ph. Moretto. Sep 2003.
Published in Nucl.Instrum.Meth.B210:92-97, 2003
------->3 VISUALIZATION
---->3 VISUALIZATION
The user can visualize the targeted cell by uncommenting the following line in
microbeam.mac:
#/control/execute vis.mac
The user can visualize the targeted cell thanks to the Qt interface.
---->4. HOW TO RUN THE EXAMPLE
The code should be compiled with cmake.
Put the 'phantom.dat' file into your build directory.
Run the example from your build directory with:
./microbeam microbeam.mac
or in interactive mode:
./microbeam
The macro file microbeam.mac is read by default.
The works in MT mode.
The example works in MT mode.
---->5. PHYSICS
@@ -157,7 +153,7 @@ cytoplasm by each incident alpha particle;
Voxel per incident alpha particle;
* final stopping (x,y,z) position of the incident
alpha particle within the irradiated medium (cell or culture medium)
alpha particle within the irradiated medium (cell or culture medium);
* stopping power dE/dx of the incident
alpha particle just before penetrating into the targeted cell;
@@ -169,10 +165,8 @@ These results can be easily analyzed using for example the provided ROOT macro
file plot.C; to do so :
* be sure to have ROOT installed on your machine
* be sure to be in the directory where the output ROOT files have been created
* copy plot.C into this directory
* launch ROOT by typing root
* under your ROOT session, type in : .X plot.C to execute the macro file
* do: root plot.C
* or under your ROOT session, type in : .X plot.C to execute the macro file
---------------------------------------------------------------------------
@@ -106,7 +106,7 @@ class CellParameterisation : public G4VPVParameterisation
const G4int,
const G4VPhysicalVolume *) const {}
G4int GetNoBoxes() {return fPhantomTotalPixels;}
G4int GetNoBoxes() const {return fPhantomTotalPixels;}
G4Material* ComputeMaterial(const G4int copyNo,
G4VPhysicalVolume* physVol,
@@ -114,27 +114,26 @@ class CellParameterisation : public G4VPVParameterisation
// NEW
G4int GetPhantomTotalPixels() {return fPhantomTotalPixels;}
G4int GetNucleusTotalPixels() {return fNucleusTotalPixels;}
G4int GetCytoplasmTotalPixels() {return fCytoplasmTotalPixels;}
G4double GetPixelSizeX() {return fDimCellBoxX;}
G4double GetPixelSizeY() {return fDimCellBoxY;}
G4double GetPixelSizeZ() {return fDimCellBoxZ;}
G4double GetCytoplasmMass() {return fCytoplasmMass;}
G4double GetNucleusMass() {return fNucleusMass;}
G4int GetPhantomTotalPixels() const {return fPhantomTotalPixels;}
G4int GetNucleusTotalPixels() const {return fNucleusTotalPixels;}
G4int GetCytoplasmTotalPixels() const {return fCytoplasmTotalPixels;}
G4double GetPixelSizeX() const {return fDimCellBoxX;}
G4double GetPixelSizeY() const {return fDimCellBoxY;}
G4double GetPixelSizeZ() const {return fDimCellBoxZ;}
G4double GetCytoplasmMass() const {return fCytoplasmMass;}
G4double GetNucleusMass() const {return fNucleusMass;}
G4ThreeVector GetVoxelThreeVector(G4int i) {return fMapCell[i];}
G4double GetMaterialVector(G4int i) {return fMaterial[i];}
G4double GetMassVector(G4int i) {return fMass[i];}
G4int GetTissueType(G4int i) {return fTissueType[i];}
G4ThreeVector GetVoxelThreeVector(G4int i) const {return fMapCell[i];}
G4double GetMaterialVector(G4int i) const {return fMaterial[i];}
G4double GetMassVector(G4int i) const {return fMass[i];}
G4int GetTissueType(G4int i) const {return fTissueType[i];}
//SINGLETON
// SINGLETON
static CellParameterisation * Instance()
{
return gInstance;
}
//
private:
@@ -152,10 +151,10 @@ class CellParameterisation : public G4VPVParameterisation
G4VisAttributes * fNucleusAttributes3;
G4VisAttributes * fCytoplasmAttributes3;
G4ThreeVector * fMapCell ; // VOXEL COORDINATES
G4double * fMaterial ; // MATERIAL
G4double * fMass ; // DENSITY REGION
G4int * fTissueType ; // DENSITY REGION
G4ThreeVector * fMapCell; // VOXEL COORDINATES
G4double * fMaterial; // MATERIAL
G4double * fMass; // DENSITY REGION
G4int * fTissueType; // DENSITY REGION
G4int fPhantomTotalPixels;
G4int fNucleusTotalPixels;
@@ -58,37 +58,36 @@ class DetectorConstruction : public G4VUserDetectorConstruction
public:
DetectorConstruction();
~DetectorConstruction();
virtual ~DetectorConstruction();
G4VPhysicalVolume* Construct();
virtual G4VPhysicalVolume* Construct();
void ConstructSDandField();
virtual void ConstructSDandField();
void SetMassNucleus(G4double mN){ fMassNucleus = mN;}
G4double GetMassNucleus(){return fMassNucleus;}
void SetMassNucleus(G4double mN) {fMassNucleus = mN;}
G4double GetMassNucleus() const {return fMassNucleus;}
void SetMassCytoplasm(G4double mC){ fMassCytoplasm = mC;}
G4double GetMassCytoplasm(){return fMassCytoplasm;}
void SetMassCytoplasm(G4double mC) {fMassCytoplasm = mC;}
G4double GetMassCytoplasm() const {return fMassCytoplasm;}
void SetNbOfPixelsInPhantom(G4int nP){ fNbOfPixelsInPhantom = nP;}
G4int GetNbOfPixelsInPhantom(){return fNbOfPixelsInPhantom;}
void SetNbOfPixelsInPhantom(G4int nP) {fNbOfPixelsInPhantom = nP;}
G4int GetNbOfPixelsInPhantom() const {return fNbOfPixelsInPhantom;}
// Returns the logical volumes
G4LogicalVolume* GetLogicalCollDetYoke() {return fLogicYoke2;};
G4LogicalVolume* GetLogicalIsobutane() {return fLogicBoiteIso;};
G4LogicalVolume* GetLogicalCollDetGap4() {return fLogic4Gap;};
G4LogicalVolume* GetLogicalPolyprop() {return fLogicBoite3;};
G4LogicalVolume* GetLogicalKgm() {return fLogicKgm;};
const G4LogicalVolume* GetLogicalCollDetYoke() const {return fLogicYoke2;};
const G4LogicalVolume* GetLogicalIsobutane() const {return fLogicBoiteIso;};
const G4LogicalVolume* GetLogicalCollDetGap4() const {return fLogic4Gap;};
const G4LogicalVolume* GetLogicalPolyprop() const {return fLogicBoite3;};
const G4LogicalVolume* GetLogicalKgm() const {return fLogicKgm;};
G4Material * GetNucleusMaterial1() {return fNucleusMaterial1;};
G4Material * GetNucleusMaterial2() {return fNucleusMaterial2;};
G4Material * GetNucleusMaterial3() {return fNucleusMaterial3;};
G4Material * GetCytoplasmMaterial1() {return fCytoplasmMaterial1;};
G4Material * GetCytoplasmMaterial2() {return fCytoplasmMaterial2;};
G4Material * GetCytoplasmMaterial3() {return fCytoplasmMaterial3;};
const G4Material * GetNucleusMaterial1() const {return fNucleusMaterial1;};
const G4Material * GetNucleusMaterial2() const {return fNucleusMaterial2;};
const G4Material * GetNucleusMaterial3() const {return fNucleusMaterial3;};
const G4Material * GetCytoplasmMaterial1() const {return fCytoplasmMaterial1;};
const G4Material * GetCytoplasmMaterial2() const {return fCytoplasmMaterial2;};
const G4Material * GetCytoplasmMaterial3() const {return fCytoplasmMaterial3;};
CellParameterisation * GetCellParameterisation() {return fMyCellParameterisation;};
const CellParameterisation * GetCellParameterisation() const
{return fMyCellParameterisation;};
private:
@@ -100,34 +99,34 @@ private:
G4double fDensityCytoplasm;
G4int fNbOfPixelsInPhantom;
G4double fWorldSizeXY;
G4double fWorldSizeZ;
G4double fCollObjSizeXY;
G4double fCollObjSizeZ;
G4double fWorldSizeXY;
G4double fWorldSizeZ;
G4double fCollObjSizeXY;
G4double fCollObjSizeZ;
G4double fCiblePositionX;
G4double fCiblePositionY;
G4double fCiblePositionZ;
G4double fCiblePositionX;
G4double fCiblePositionY;
G4double fCiblePositionZ;
G4double fLineAngle;
G4double fLineAngle;
// Materials
G4Material* fDefaultMaterial;
G4Material* fCollimatorMaterial;
G4Material* fBoiteMaterial;
G4Material* fCathodeMaterial;
G4Material* fVerreMaterial;
G4Material* fVerre2Material;
G4Material* fKgmMaterial;
G4Material* fBoite2Material;
G4Material* fBoite3Material;
G4Material* fNucleusMaterial1;
G4Material* fCytoplasmMaterial1;
G4Material* fNucleusMaterial2;
G4Material* fCytoplasmMaterial2;
G4Material* fNucleusMaterial3;
G4Material* fCytoplasmMaterial3;
G4Material* fDefaultMaterial;
G4Material* fCollimatorMaterial;
G4Material* fBoiteMaterial;
G4Material* fCathodeMaterial;
G4Material* fVerreMaterial;
G4Material* fVerre2Material;
G4Material* fKgmMaterial;
G4Material* fBoite2Material;
G4Material* fBoite3Material;
G4Material* fNucleusMaterial1;
G4Material* fCytoplasmMaterial1;
G4Material* fNucleusMaterial2;
G4Material* fCytoplasmMaterial2;
G4Material* fNucleusMaterial3;
G4Material* fCytoplasmMaterial3;
// Volumes
@@ -211,21 +210,9 @@ private:
CellParameterisation * fMyCellParameterisation;
//
// EM FIELD
static G4ThreadLocal EMField * fField;
G4FieldManager * fFieldMgr;
G4MagIntegratorStepper * fStepper;
G4EqMagElectricField * fEquation;
G4MagInt_Driver * fIntgrDriver;
G4ChordFinder * fChordFinder ;
// FROM NANOBEAM EX. TUNINGS
// G4PropagatorInField * fPropInField;
//
void DefineMaterials();
G4VPhysicalVolume* ConstructLine();
@@ -47,10 +47,10 @@ class EventAction : public G4UserEventAction
public:
EventAction(RunAction*);
~EventAction();
virtual ~EventAction();
void BeginOfEventAction(const G4Event*);
void EndOfEventAction(const G4Event*);
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
private:
@@ -50,25 +50,17 @@ public:
PhysicsList();
virtual ~PhysicsList();
void ConstructParticle();
virtual void ConstructParticle();
virtual void ConstructProcess();
void SetCuts();
void SetCutForGamma(G4double);
void SetCutForElectron(G4double);
void SetCutForPositron(G4double);
void AddPhysicsList(const G4String& name);
void ConstructProcess();
void AddStepMax();
G4StepLimiter* GetStepMaxProcess() {return fStepMaxProcess;};
private:
G4double fCutForGamma;
G4double fCutForElectron;
G4double fCutForPositron;
G4String fEmName;
G4VPhysicsConstructor* fEmPhysicsList;
G4VPhysicsConstructor* fDecPhysicsList;
@@ -78,7 +70,5 @@ private:
PhysicsListMessenger* fMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -49,24 +49,18 @@ class PhysicsListMessenger: public G4UImessenger
public:
PhysicsListMessenger(PhysicsList* );
~PhysicsListMessenger();
virtual ~PhysicsListMessenger();
void SetNewValue(G4UIcommand*, G4String);
virtual void SetNewValue(G4UIcommand*, G4String);
private:
PhysicsList* fPhysicsList;
G4UIdirectory* fPhysDir;
G4UIcmdWithADoubleAndUnit* fGammaCutCmd;
G4UIcmdWithADoubleAndUnit* fElectCutCmd;
G4UIcmdWithADoubleAndUnit* fProtoCutCmd;
G4UIcmdWithADoubleAndUnit* fAllCutCmd;
G4UIcmdWithAString* fListCmd;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -44,14 +44,14 @@ class G4Event;
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
~PrimaryGeneratorAction();
public:
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
void GeneratePrimaries(G4Event*);
virtual void GeneratePrimaries(G4Event*);
private:
G4ParticleGun* fParticleGun;
private:
G4ParticleGun* fParticleGun;
};
#endif
@@ -48,44 +48,43 @@ class RunAction : public G4UserRunAction
{
public:
RunAction(DetectorConstruction*);
~RunAction();
RunAction(const DetectorConstruction*);
virtual ~RunAction();
void BeginOfRunAction(const G4Run*);
void EndOfRunAction(const G4Run*);
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
void SetRndmFreq(G4int val) {fSaveRndm = val;}
G4int GetRndmFreq() {return fSaveRndm;}
void SetRndmFreq(G4int val) {fSaveRndm = val;}
G4int GetRndmFreq() const {return fSaveRndm;}
void AddDoseN(G4double dose){ fDoseN += dose;}
void SetDoseN(G4double dose){ fDoseN = dose;}
G4double GetDoseN(){return fDoseN;}
void AddDoseN(G4double dose) {fDoseN += dose;}
void SetDoseN(G4double dose) {fDoseN = dose;}
G4double GetDoseN() const {return fDoseN;}
void AddDoseC(G4double dose){ fDoseC += dose;}
void SetDoseC(G4double dose){ fDoseC = dose;}
G4double GetDoseC(){return fDoseC;}
void AddDoseC(G4double dose) {fDoseC += dose;}
void SetDoseC(G4double dose) {fDoseC = dose;}
G4double GetDoseC() const {return fDoseC;}
G4int GetNumEvent(){return fNumEvent;}
void SetNumEvent(G4int i){fNumEvent = i;}
G4int GetNumEvent() const {return fNumEvent;}
void SetNumEvent(G4int i) {fNumEvent = i;}
G4int GetNbOfHitsGas(){return fNbOfHitsGas;}
void AddNbOfHitsGas(){fNbOfHitsGas = fNbOfHitsGas+1;}
G4int GetNbOfHitsGas() const {return fNbOfHitsGas;}
void AddNbOfHitsGas() {fNbOfHitsGas = fNbOfHitsGas+1;}
void SetMassNucleus(G4double mN){ fMassNucleus = mN;}
G4double GetMassNucleus(){return fMassNucleus;}
void SetMassNucleus(G4double mN) {fMassNucleus = mN;}
G4double GetMassNucleus() const {return fMassNucleus;}
void SetMassCytoplasm(G4double mC){ fMassCytoplasm = mC;}
G4double GetMassCytoplasm(){return fMassCytoplasm;}
void SetMassCytoplasm(G4double mC) {fMassCytoplasm = mC;}
G4double GetMassCytoplasm() const {return fMassCytoplasm;}
void AddDoseBox(G4int i, G4double x){ fDose3DDose[i] +=x;}
G4double GetDoseBox(G4int i){ return fDose3DDose[i];}
void AddDoseBox(G4int i, G4double x) {fDose3DDose[i] +=x;}
G4double GetDoseBox(G4int i) const {return fDose3DDose[i];}
G4ThreeVector GetVectCell(G4int i) {return fMapVoxels[i];}
G4ThreeVector GetVectCell(G4int i) const {return fMapVoxels[i];}
private:
DetectorConstruction* fDetector;
CellParameterisation * fMyCellParameterisation;
const DetectorConstruction* fDetector;
G4int fSaveRndm;
G4int fNumEvent;
@@ -44,21 +44,19 @@
class SteppingAction : public G4UserSteppingAction
{
public:
SteppingAction(RunAction* ,DetectorConstruction*);
~SteppingAction();
public:
SteppingAction(RunAction* ,const DetectorConstruction*);
virtual ~SteppingAction();
void UserSteppingAction(const G4Step*);
virtual void UserSteppingAction(const G4Step*);
private:
RunAction* fRun;
DetectorConstruction* fDetector;
CellParameterisation * fMyCellParameterisation;
private:
RunAction* fRun;
const DetectorConstruction* fDetector;
const CellParameterisation * fMyCellParameterisation;
};
#endif
@@ -1,5 +1,3 @@
/tracking/storeTrajectory 1
/run/initialize
/process/inactivate nuclearStopping
+34 -121
View File
@@ -4,7 +4,7 @@
############################################
*************************************************************
Geant4 version Name: geant4-10-03-patch-01 (24-February-2017)
Geant4 version Name: geant4-10-03-ref-06 (30-June-2017)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
@@ -24,7 +24,7 @@
Material: H2O density: 1.000 g/cm3 RadL: 36.092 cm Nucl.Int.Length: 75.356 cm
Imean: 68.998 eV
Imean: 68.998 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1 A = 1.010 g/mole
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %
@@ -75,7 +75,7 @@
Material: Pl density: 21.400 g/cm3 RadL: 3.058 mm Nucl.Int.Length: 9.486 cm
Imean: 790.000 eV
Imean: 790.000 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Pt (Pt) Z = 78.0 N = 195 A = 195.090 g/mole
---> Isotope: Pt190 Z = 78 N = 190 A = 189.96 g/mole abundance: 0.014 %
@@ -102,7 +102,7 @@
Material: Polyprop density: 900.000 mg/cm3 RadL: 49.764 cm Nucl.Int.Length: 75.110 cm
Imean: 56.518 eV
Imean: 56.518 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Carbon (C) Z = 6.0 N = 12 A = 12.011 g/mole
---> Isotope: C12 Z = 6 N = 12 A = 12.00 g/mole abundance: 98.930 %
@@ -116,7 +116,7 @@
Material: Si3N4 density: 3.440 g/cm3 RadL: 7.644 cm Nucl.Int.Length: 28.008 cm
Imean: 128.337 eV
Imean: 128.337 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Silicon (Si) Z = 14.0 N = 28 A = 28.085 g/mole
---> Isotope: Si28 Z = 14 N = 28 A = 27.98 g/mole abundance: 92.230 %
@@ -131,7 +131,7 @@
Material: SiO2 density: 2.500 g/cm3 RadL: 10.819 cm Nucl.Int.Length: 38.343 cm
Imean: 125.663 eV
Imean: 125.663 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Silicon (Si) Z = 14.0 N = 28 A = 28.085 g/mole
---> Isotope: Si28 Z = 14 N = 28 A = 27.98 g/mole abundance: 92.230 %
@@ -147,7 +147,7 @@
Material: Laiton density: 8.500 g/cm3 RadL: 1.487 cm Nucl.Int.Length: 16.512 cm
Imean: 326.043 eV
Imean: 326.043 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Cuivre (Cu) Z = 29.0 N = 64 A = 63.546 g/mole
---> Isotope: Cu63 Z = 29 N = 63 A = 62.93 g/mole abundance: 69.170 %
@@ -164,7 +164,7 @@
Material: Cytoplasm1 density: 1.000 g/cm3 RadL: 36.091 cm Nucl.Int.Length: 75.366 cm
Imean: 69.016 eV
Imean: 69.016 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1 A = 1.010 g/mole
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %
@@ -179,7 +179,7 @@
Material: Cytoplasm2 density: 1.000 g/cm3 RadL: 36.185 cm Nucl.Int.Length: 75.569 cm
Imean: 69.752 eV
Imean: 69.752 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1 A = 1.010 g/mole
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %
@@ -208,7 +208,7 @@
Material: Cytoplasm3 density: 1.000 g/cm3 RadL: 36.091 cm Nucl.Int.Length: 75.366 cm
Imean: 69.016 eV
Imean: 69.016 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1 A = 1.010 g/mole
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %
@@ -223,7 +223,7 @@
Material: Nucleus1 density: 1.000 g/cm3 RadL: 36.185 cm Nucl.Int.Length: 75.569 cm
Imean: 69.752 eV
Imean: 69.752 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1 A = 1.010 g/mole
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %
@@ -252,7 +252,7 @@
Material: Nucleus2 density: 1.000 g/cm3 RadL: 36.185 cm Nucl.Int.Length: 75.569 cm
Imean: 69.752 eV
Imean: 69.752 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1 A = 1.010 g/mole
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %
@@ -281,7 +281,7 @@
Material: Nucleus3 density: 1.000 g/cm3 RadL: 36.185 cm Nucl.Int.Length: 75.569 cm
Imean: 69.752 eV
Imean: 69.752 eV temperature: 293.15 K pressure: 1.00 atm
---> Element: Hydrogen (H) Z = 1.0 N = 1 A = 1.010 g/mole
---> Isotope: H1 Z = 1 N = 1 A = 1.01 g/mole abundance: 99.989 %
@@ -317,7 +317,6 @@
==========> Voxel size Y (um)=0.35906
==========> Voxel size Z (um)=0.16281
PhysicsList::SetCuts:CutLength : 10 nm
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...
@@ -716,121 +715,31 @@ hPairProd: for pi- SubType= 4
Sampling table 12x1001 from 1.11656 GeV to 1 TeV
===== EM models for the G4Region DefaultRegionForTheWorld ======
hPairProd : Emin= 0 eV Emax= 1 TeV
========= Table of registered couples ==============================
Index : 0 used in the geometry : Yes
Material : Vacuum
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 1 used in the geometry : Yes
Material : Pl
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 2 used in the geometry : Yes
Material : Butane
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 3 used in the geometry : Yes
Material : Laiton
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 4 used in the geometry : Yes
Material : Si3N4
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 5 used in the geometry : Yes
Material : Air
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 6 used in the geometry : Yes
Material : Polyprop
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 7 used in the geometry : Yes
Material : H2O
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 8 used in the geometry : Yes
Material : Cytoplasm1
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 9 used in the geometry : Yes
Material : Nucleus1
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 10 used in the geometry : Yes
Material : Nucleus2
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 11 used in the geometry : Yes
Material : Cytoplasm2
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
Index : 12 used in the geometry : Yes
Material : SiO2
Range cuts : gamma 10 nm e- 10 nm e+ 10 nm proton 10 nm
Energy thresholds : gamma 990 eV e- 990 eV e+ 990 eV proton 1 eV
Region(s) which use this couple :
DefaultRegionForTheWorld
====================================================================
##### Create analysis manager 0x29eaa60
##### Create analysis manager 0x154dec0
Using Root analysis manager
All Ntuples have been created
-> Event # 1 generated
===> Sorry, the incident alpha particle has missed the targeted cell !
-> Event # 2 generated
===> Sorry, the incident alpha particle has missed the targeted cell !
===> The incident alpha particle has reached the targeted cell :
-----> total absorbed dose within Nucleus is (Gy) = 0.31436595880725
-----> total absorbed dose within Cytoplasm is (Gy) = 0.027585773498585
-> Event # 3 generated
===> Sorry, the incident alpha particle has missed the targeted cell !
===> The incident alpha particle has reached the targeted cell :
-----> total absorbed dose within Nucleus is (Gy) = 0.28094991961464
-----> total absorbed dose within Cytoplasm is (Gy) = 0.07113226903203
-> Event # 4 generated
===> Sorry, the incident alpha particle has missed the targeted cell !
===> The incident alpha particle has reached the targeted cell :
-----> total absorbed dose within Nucleus is (Gy) = 0.31521082337251
-----> total absorbed dose within Cytoplasm is (Gy) = 0.0519444271045
-> Event # 5 generated
===> The incident alpha particle has reached the targeted cell :
-----> total absorbed dose within Nucleus is (Gy) = 0.26027653312574
-----> total absorbed dose within Cytoplasm is (Gy) = 0.045289661672963
-----> total absorbed dose within Nucleus is (Gy) = 0.33775514908262
-----> total absorbed dose within Cytoplasm is (Gy) = 0.05092335583091
-> Event # 6 generated
===> Sorry, the incident alpha particle has missed the targeted cell !
@@ -839,17 +748,21 @@ All Ntuples have been created
===> Sorry, the incident alpha particle has missed the targeted cell !
-> Event # 8 generated
===> Sorry, the incident alpha particle has missed the targeted cell !
===> The incident alpha particle has reached the targeted cell :
-----> total absorbed dose within Nucleus is (Gy) = 0.29171468348048
-----> total absorbed dose within Cytoplasm is (Gy) = 0.026827784943745
-> Event # 9 generated
===> Sorry, the incident alpha particle has missed the targeted cell !
===> The incident alpha particle has reached the targeted cell :
-----> total absorbed dose within Nucleus is (Gy) = 0.32183120798728
-----> total absorbed dose within Cytoplasm is (Gy) = 0.043732080728164
-> Event # 10 generated
===> The incident alpha particle has reached the targeted cell :
-----> total absorbed dose within Nucleus is (Gy) = 0.33467520432143
-----> total absorbed dose within Cytoplasm is (Gy) = 0.036039698548268
-----> total absorbed dose within Nucleus is (Gy) = 0.2953272710055
-----> total absorbed dose within Cytoplasm is (Gy) = 0.04543035142464
-> Total number of particles detected by the gas detector : 2
-> Total number of particles detected by the gas detector : 7
Graphics systems deleted.
Visualization Manager deleting...
+1 -20
View File
@@ -32,7 +32,6 @@ c1->Divide(4,3);
// INTENSITY HISTOGRAMS
//*********************
FILE * fp = fopen("phantom.dat","r");
Float_t xVox, yVox, zVox, tmp, den, dose;
@@ -169,7 +168,7 @@ c1->cd(3); // axe YX
//
system ("rm -rf microbeam.root");
system ("hadd microbeam.root microbeam_*.root");
system ("hadd -O microbeam.root microbeam_*.root");
TFile f("microbeam.root");
@@ -258,7 +257,6 @@ c1->cd(9);
gaus->SetLineColor(6);
h2bis->Fit("gaus");
//**************
// RANGE IN CELL
//**************
@@ -298,24 +296,11 @@ for (Int_t i=0;i<nentries;i++)
c1->cd(10);
ntupleR->Draw("X2:Z2","abs(X2)<50","surf3");
gPad->SetLogz();
/*
htemp->GetXaxis()->SetLabelSize(0.025);
htemp->GetYaxis()->SetLabelSize(0.025);
htemp->GetZaxis()->SetLabelSize(0.025);
htemp->GetXaxis()->SetTitleSize(0.035);
htemp->GetYaxis()->SetTitleSize(0.035);
htemp->GetXaxis()->SetTitleOffset(1.4);
htemp->GetYaxis()->SetTitleOffset(1.4);
htemp->GetXaxis()->SetTitle("Z (µm)");
htemp->GetYaxis()->SetTitle("X (µm)");
htemp->SetTitle("Range in cell");
*/
//****************
// ENERGY DEPOSITS
//****************
gStyle->SetOptStat(0000);
gStyle->SetOptFit();
gStyle->SetPalette(1);
@@ -337,7 +322,6 @@ c1->cd(11);
histbis->GetYaxis()->SetTitle("X (um)");
histbis->SetTitle("Mean energy deposit -transverse- (z axis in eV)");
c1->cd(12);
TH2F *histter = new TH2F("histter","histter",50,-20,20,50,-20,20);
ntuple4->Draw("x*0.359060:(z+1500/0.162810+21)*0.162810>>histter","doseV","contz");
@@ -382,7 +366,6 @@ c1->cd(4);
h77->SetTitle("Beam X position on cell");
h77->SetFillColor(4);
h77->SetLineColor(4);
//gaus->SetLineColor(6);
h77->Fit("gaus");
c1->cd(8);
@@ -401,7 +384,5 @@ c1->cd(8);
h88->SetTitle("Beam Y position on cell");
h88->SetFillColor(4);
h88->SetLineColor(4);
//gaus->SetLineColor(6);
h88->Fit("gaus");
}
@@ -54,9 +54,7 @@ ActionInitialization::~ActionInitialization()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ActionInitialization::BuildForMaster() const
{
// No specific action for Master
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -70,6 +68,4 @@ void ActionInitialization::Build() const
SetUserAction(new EventAction(runAction));
SetUserAction(new SteppingAction(runAction,fDetectorConstruction));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
}
@@ -83,9 +83,9 @@ CellParameterisation::CellParameterisation
if (nlines == 0)
{
ncols = fscanf(fMap,"%i %i %i",&fPhantomTotalPixels,&fNucleusTotalPixels,&fCytoplasmTotalPixels);
fMapCell = new G4ThreeVector[fPhantomTotalPixels];
fMaterial = new G4double[fPhantomTotalPixels];
fMass = new G4double[fPhantomTotalPixels];
fMapCell = new G4ThreeVector[fPhantomTotalPixels];
fMaterial = new G4double[fPhantomTotalPixels];
fMass = new G4double[fPhantomTotalPixels];
fTissueType = new G4int[fPhantomTotalPixels];
}
@@ -151,8 +151,7 @@ CellParameterisation::CellParameterisation
}
}
//
//
if (std::abs(mat-2)<1.e-30) // NUCLEUS
{
@@ -225,27 +224,28 @@ CellParameterisation::~CellParameterisation()
void CellParameterisation::ComputeTransformation
(const G4int copyNo, G4VPhysicalVolume* physVol) const
{
G4ThreeVector
origin(
G4ThreeVector origin
(
fMapCell[copyNo].x()*fDimCellBoxX,
fMapCell[copyNo].y()*fDimCellBoxY,
fMapCell[copyNo].z()*fDimCellBoxZ);
fMapCell[copyNo].z()*fDimCellBoxZ
);
physVol->SetTranslation(origin);
physVol->SetTranslation(origin);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void CellParameterisation::ComputeDimensions
(G4Box& /*trackerChamber*/, const G4int /*copyNo*/, const G4VPhysicalVolume*) const
(G4Box&, const G4int, const G4VPhysicalVolume*) const
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4Material*
CellParameterisation::ComputeMaterial(const G4int copyNo,
G4VPhysicalVolume* physVol,
const G4VTouchable*)
G4VPhysicalVolume* physVol,
const G4VTouchable*)
{
if( fMaterial[copyNo] == 2 ) // fMaterial 2 is nucleus
{
@@ -38,7 +38,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ThreadLocal EMField* DetectorConstruction::fField = 0;
G4ThreadLocal EMField* DetectorConstruction::fField = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -652,11 +652,6 @@ G4VPhysicalVolume* DetectorConstruction::ConstructLine()
fLogicBoite->SetUserLimits(new G4UserLimits(10*mm));
*/
// relaxed
fLogicWorld->SetUserLimits(new G4UserLimits(1*mm));
fLogicVol->SetUserLimits(new G4UserLimits(1*mm));
fLogicBoite->SetUserLimits(new G4UserLimits(1*mm));
/*
logicPhantom->SetUserLimits (new G4UserLimits(0.5*micrometer));
logic1Gap->SetUserLimits (new G4UserLimits(5*micrometer));
@@ -674,6 +669,11 @@ G4VPhysicalVolume* DetectorConstruction::ConstructLine()
logicVerre2->SetUserLimits (new G4UserLimits(10*micrometer));
*/
// Relaxed
fLogicWorld->SetUserLimits(new G4UserLimits(10*mm));
fLogicVol->SetUserLimits(new G4UserLimits(10*mm));
fLogicBoite->SetUserLimits(new G4UserLimits(1*mm));
// VISUALISATION ATTRIBUTES (for phantom, see in Parameterisation class)
G4VisAttributes* simpleWorldVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0)); //White
@@ -736,13 +736,16 @@ void DetectorConstruction::ConstructSDandField()
{
if(!fField) fField = new EMField();
fEquation = new G4EqMagElectricField(fField);
fStepper = new G4ClassicalRK4 (fEquation,8);
fFieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
// relaxed
// fIntgrDriver = new G4MagInt_Driver(0.000001*mm,fStepper,fStepper->GetNumberOfVariables() );
fIntgrDriver = new G4MagInt_Driver(1*mm,fStepper,fStepper->GetNumberOfVariables() );
fChordFinder = new G4ChordFinder(fIntgrDriver);
G4EqMagElectricField* fEquation = new G4EqMagElectricField(fField);
G4MagIntegratorStepper* fStepper = new G4ClassicalRK4 (fEquation,8);
G4FieldManager* fFieldMgr =
G4TransportationManager::GetTransportationManager()->GetFieldManager();
// Relaxed
G4MagInt_Driver* fIntgrDriver =
new G4MagInt_Driver(1*mm,fStepper,fStepper->GetNumberOfVariables() );
G4ChordFinder* fChordFinder = new G4ChordFinder(fIntgrDriver);
fFieldMgr->SetChordFinder(fChordFinder);
fFieldMgr->SetDetectorField(fField);
+48 -41
View File
@@ -31,14 +31,21 @@
//
// If you use this example, please cite the following publication:
// Rad. Prot. Dos. 133 (2009) 2-11
//
// Based on purging magnet advanced example.
//
#include "EMField.hh"
#include "G4Exp.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
EMField::EMField()
{
}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void EMField::GetFieldValue(const double point[4], double *Bfield ) const
{
@@ -122,8 +129,8 @@ if ( (z >= limitMinEntrance) && (z < limitMaxEntrance) )
// - HEART OF SWITCHING MAGNET
if (
(z >= limitMaxEntrance)
&& (( x*x + (z -(beamStart+zS))*(z -(beamStart+zS)) < limitMinExit*limitMinExit))
(z >= limitMaxEntrance)
&& (( x*x + (z -(beamStart+zS))*(z -(beamStart+zS)) < limitMinExit*limitMinExit))
)
{
Bx=0;
@@ -134,11 +141,11 @@ if ( (z >= limitMinEntrance) && (z < limitMaxEntrance) )
// - EXIT OF SWITCHING MAGNET
if (
(z >= limitMaxEntrance)
&& (( x*x + (z -(beamStart+zS))*(z -(beamStart+zS))) >= limitMinExit*limitMinExit)
&& (( x*x + (z -(beamStart+zS))*(z -(beamStart+zS))) < limitMaxExit*limitMaxExit)
(z >= limitMaxEntrance)
&& (( x*x + (z -(beamStart+zS))*(z -(beamStart+zS))) >= limitMinExit*limitMinExit)
&& (( x*x + (z -(beamStart+zS))*(z -(beamStart+zS))) < limitMaxExit*limitMaxExit)
)
)
{
xcenter = 0;
@@ -307,7 +314,7 @@ if (z>=-1400*mm && z <-200*mm)
}
if ( z_local < -z2[i] )
if ( z_local < -z2[i] )
{
G0=0;
G1=0;
@@ -334,37 +341,37 @@ if (z>=-1400*mm && z <-200*mm)
if ( ((z_local>=-z2[i]) & (z_local<-z1[i])) || ((z_local>z1[i]) & (z_local<=z2[i])) )
{
vars = ( z_local - z1[i]) / a0[i] ;
if (z_local<-z1[i]) vars = ( - z_local - z1[i]) / a0[i] ;
vars = ( z_local - z1[i]) / a0[i] ;
if (z_local<-z1[i]) vars = ( - z_local - z1[i]) / a0[i] ;
P0 = c0[i]+c1[i]*vars+c2[i]*vars*vars;
P0 = c0[i]+c1[i]*vars+c2[i]*vars*vars;
P1 = c1[i]/a0[i]+2*c2[i]*(z_local-z1[i])/a0[i]/a0[i];
if (z_local<-z1[i]) P1 = -c1[i]/a0[i]+2*c2[i]*(z_local+z1[i])/a0[i]/a0[i];
P1 = c1[i]/a0[i]+2*c2[i]*(z_local-z1[i])/a0[i]/a0[i];
if (z_local<-z1[i]) P1 = -c1[i]/a0[i]+2*c2[i]*(z_local+z1[i])/a0[i]/a0[i];
P2 = 2*c2[i]/a0[i]/a0[i];
P2 = 2*c2[i]/a0[i]/a0[i];
cte = 1 + G4Exp(c0[i]);
cte = 1 + G4Exp(c0[i]);
K1 = -cte*P1*G4Exp(P0)/( (1+G4Exp(P0))*(1+G4Exp(P0)) );
K1 = -cte*P1*G4Exp(P0)/( (1+G4Exp(P0))*(1+G4Exp(P0)) );
K2 = -cte*G4Exp(P0)*(
P2/( (1+G4Exp(P0))*(1+G4Exp(P0)) )
+2*P1*K1/(1+G4Exp(P0))/cte
+P1*P1/(1+G4Exp(P0))/(1+G4Exp(P0))
);
K3 = -cte*G4Exp(P0)*(
(3*P2*P1+P1*P1*P1)/(1+G4Exp(P0))/(1+G4Exp(P0))
+4*K1*(P1*P1+P2)/(1+G4Exp(P0))/cte
+2*P1*(K1*K1/cte/cte+K2/(1+G4Exp(P0))/cte)
K2 = -cte*G4Exp(P0)*(
P2/( (1+G4Exp(P0))*(1+G4Exp(P0)) )
+2*P1*K1/(1+G4Exp(P0))/cte
+P1*P1/(1+G4Exp(P0))/(1+G4Exp(P0))
);
K3 = -cte*G4Exp(P0)*(
(3*P2*P1+P1*P1*P1)/(1+G4Exp(P0))/(1+G4Exp(P0))
+4*K1*(P1*P1+P2)/(1+G4Exp(P0))/cte
+2*P1*(K1*K1/cte/cte+K2/(1+G4Exp(P0))/cte)
);
G0 = gradient[i]*cte/(1+G4Exp(P0));
G1 = gradient[i]*K1;
G2 = gradient[i]*K2;
G3 = gradient[i]*K3;
G0 = gradient[i]*cte/(1+G4Exp(P0));
G1 = gradient[i]*K1;
G2 = gradient[i]*K2;
G3 = gradient[i]*K3;
}
@@ -468,11 +475,11 @@ if (z>=-1400*mm && z <-200*mm)
if
(
x <= slope1 * z + cte1
&& x >= slope3 * z + cte3
&& x <= slope4 * z + cte4
&& x >= slope2 * z + cte2
&& std::abs(y)<=electricPlateWidth1/2
x <= slope1 * z + cte1
&& x >= slope3 * z + cte3
&& x <= slope4 * z + cte4
&& x >= slope2 * z + cte2
&& std::abs(y)<=electricPlateWidth1/2
)
{
@@ -510,11 +517,11 @@ if (z>=-1400*mm && z <-200*mm)
if
(
x <= slope1 * z + cte1
&& x >= slope3 * z + cte3
&& x <= slope4 * z + cte4
&& x >= slope2 * z + cte2
&& std::abs(y)<=electricPlateSpacing2/2
x <= slope1 * z + cte1
&& x >= slope3 * z + cte3
&& x <= slope4 * z + cte4
&& x >= slope2 * z + cte2
&& std::abs(y)<=electricPlateSpacing2/2
)
{
@@ -46,7 +46,6 @@
#include "G4EmLivermorePhysics.hh"
#include "G4EmPenelopePhysics.hh"
#include "G4DecayPhysics.hh"
#include "G4LossTableManager.hh"
#include "G4ProcessManager.hh"
@@ -58,12 +57,6 @@
PhysicsList::PhysicsList() : G4VModularPhysicsList()
{
G4LossTableManager::Instance();
defaultCutValue = 0.01*micrometer;
fCutForGamma = defaultCutValue;
fCutForElectron = defaultCutValue;
fCutForPositron = defaultCutValue;
fMessenger = new PhysicsListMessenger(this);
SetVerboseLevel(1);
@@ -166,7 +159,6 @@ void PhysicsList::AddPhysicsList(const G4String& name)
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddStepMax()
@@ -191,45 +183,3 @@ void PhysicsList::AddStepMax()
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCuts()
{
if (verboseLevel >0){
G4cout << "PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
SetCutValue(fCutForGamma, "gamma");
SetCutValue(fCutForElectron, "e-");
SetCutValue(fCutForPositron, "e+");
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForGamma(G4double cut)
{
fCutForGamma = cut;
SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForElectron(G4double cut)
{
fCutForElectron = cut;
SetParticleCuts(fCutForElectron, G4Electron::Electron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForPositron(G4double cut)
{
fCutForPositron = cut;
SetParticleCuts(fCutForPositron, G4Positron::Positron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -46,34 +46,6 @@ PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
fPhysDir = new G4UIdirectory("/microbeam/phys/");
fPhysDir->SetGuidance("physics list commands");
fGammaCutCmd = new G4UIcmdWithADoubleAndUnit("/microbeam/phys/setGCut",this);
fGammaCutCmd->SetGuidance("Set gamma cut.");
fGammaCutCmd->SetParameterName("Gcut",false);
fGammaCutCmd->SetUnitCategory("Length");
fGammaCutCmd->SetRange("Gcut>0.0");
fGammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fElectCutCmd = new G4UIcmdWithADoubleAndUnit("/microbeam/phys/setECut",this);
fElectCutCmd->SetGuidance("Set electron cut.");
fElectCutCmd->SetParameterName("Ecut",false);
fElectCutCmd->SetUnitCategory("Length");
fElectCutCmd->SetRange("Ecut>0.0");
fElectCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fProtoCutCmd = new G4UIcmdWithADoubleAndUnit("/microbeam/phys/setPCut",this);
fProtoCutCmd->SetGuidance("Set positron cut.");
fProtoCutCmd->SetParameterName("Pcut",false);
fProtoCutCmd->SetUnitCategory("Length");
fProtoCutCmd->SetRange("Pcut>0.0");
fProtoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fAllCutCmd = new G4UIcmdWithADoubleAndUnit("/microbeam/phys/setCuts",this);
fAllCutCmd->SetGuidance("Set cut for all.");
fAllCutCmd->SetParameterName("cut",false);
fAllCutCmd->SetUnitCategory("Length");
fAllCutCmd->SetRange("cut>0.0");
fAllCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fListCmd = new G4UIcmdWithAString("/microbeam/phys/addPhysics",this);
fListCmd->SetGuidance("Add modula physics list.");
fListCmd->SetParameterName("PList",false);
@@ -84,10 +56,6 @@ PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
PhysicsListMessenger::~PhysicsListMessenger()
{
delete fGammaCutCmd;
delete fElectCutCmd;
delete fProtoCutCmd;
delete fAllCutCmd;
delete fListCmd;
delete fPhysDir;
}
@@ -97,23 +65,6 @@ PhysicsListMessenger::~PhysicsListMessenger()
void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if( command == fGammaCutCmd )
{ fPhysicsList->SetCutForGamma(fGammaCutCmd->GetNewDoubleValue(newValue));}
if( command == fElectCutCmd )
{ fPhysicsList->SetCutForElectron(fElectCutCmd->GetNewDoubleValue(newValue));}
if( command == fProtoCutCmd )
{ fPhysicsList->SetCutForPositron(fProtoCutCmd->GetNewDoubleValue(newValue));}
if( command == fAllCutCmd )
{
G4double cut = fAllCutCmd->GetNewDoubleValue(newValue);
fPhysicsList->SetCutForGamma(cut);
fPhysicsList->SetCutForElectron(cut);
fPhysicsList->SetCutForPositron(cut);
}
if( command == fListCmd )
{ fPhysicsList->AddPhysicsList(newValue);}
}
@@ -124,7 +124,3 @@ void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
fParticleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+14 -14
View File
@@ -40,7 +40,7 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
RunAction::RunAction(DetectorConstruction* det)
RunAction::RunAction(const DetectorConstruction* det)
:fDetector(det)
{
fSaveRndm = 0;
@@ -59,7 +59,7 @@ RunAction::~RunAction()
void RunAction::BeginOfRunAction(const G4Run*)
{
// Read phantom - Singleton
fMyCellParameterisation = CellParameterisation::Instance();
CellParameterisation* fMyCellParameterisation = CellParameterisation::Instance();
// Histograms
// Get/create analysis manager
@@ -126,10 +126,10 @@ void RunAction::BeginOfRunAction(const G4Run*)
// save Rndm status
if (fSaveRndm > 0)
{
CLHEP::HepRandom::showEngineStatus();
CLHEP::HepRandom::saveEngineStatus("beginOfRun.rndm");
}
{
CLHEP::HepRandom::showEngineStatus();
CLHEP::HepRandom::saveEngineStatus("beginOfRun.rndm");
}
fNumEvent = 0;
fNbOfHitsGas = 0;
@@ -147,8 +147,8 @@ void RunAction::BeginOfRunAction(const G4Run*)
for (G4int i=0; i<fNbOfPixels; i++)
{
fMapVoxels [i]=fMyCellParameterisation->GetVoxelThreeVector(i);
fDose3DDose[i]=0;
fMapVoxels [i]=fMyCellParameterisation->GetVoxelThreeVector(i);
fDose3DDose[i]=0;
}
}
@@ -172,12 +172,12 @@ void RunAction::EndOfRunAction(const G4Run* /*aRun*/)
v = fMapVoxels[i];
if ( (GetNumEvent()+1) !=0)
{
//Fill ntuple #5
man->FillNtupleDColumn(5,0,v.x());
man->FillNtupleDColumn(5,1,v.y());
man->FillNtupleDColumn(5,2,v.z());
man->FillNtupleDColumn(5,3,fDose3DDose[i]/(GetNumEvent()+1));
man->AddNtupleRow(5);
//Fill ntuple #5
man->FillNtupleDColumn(5,0,v.x());
man->FillNtupleDColumn(5,1,v.y());
man->FillNtupleDColumn(5,2,v.z());
man->FillNtupleDColumn(5,3,fDose3DDose[i]/(GetNumEvent()+1));
man->AddNtupleRow(5);
}
}
+113 -144
View File
@@ -45,14 +45,14 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
SteppingAction::SteppingAction(RunAction* run,DetectorConstruction* det)
SteppingAction::SteppingAction(RunAction* run,const DetectorConstruction* det)
:fRun(run),fDetector(det)
{ }
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
SteppingAction::~SteppingAction()
{ }
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -67,163 +67,132 @@ void SteppingAction::UserSteppingAction(const G4Step* aStep)
fMyCellParameterisation = CellParameterisation::Instance();
//
// Material : 1 is cytoplasm, 2 is nucleus
G4int matVoxelPRE = -1;
G4int matVoxelPOST = -1;
G4int tmp=-1;
tmp = aStep->GetPreStepPoint()->GetTouchableHandle()->GetReplicaNumber();
const G4StepPoint* preStep = aStep->GetPreStepPoint();
const G4StepPoint* postStep = aStep->GetPostStepPoint();
const G4Track* track = aStep->GetTrack();
const G4LogicalVolume* preVolume =
preStep->GetPhysicalVolume()->GetLogicalVolume();
const G4LogicalVolume* postVolume = nullptr;
if(postStep->GetPhysicalVolume())
{
postVolume = postStep->GetPhysicalVolume()->GetLogicalVolume();
}
const G4ParticleDefinition* particle =
track->GetDynamicParticle()->GetDefinition();
G4int preReplicaNumber = preStep->GetTouchableHandle()->GetReplicaNumber();
G4double edep = aStep->GetTotalEnergyDeposit();
if (tmp>0)
if (preReplicaNumber>0)
{
matVoxelPRE = fMyCellParameterisation->GetTissueType(tmp);
matVoxelPRE = fMyCellParameterisation->GetTissueType(preReplicaNumber);
}
if(postVolume)
{
G4int postReplicaNumber = postStep->GetTouchableHandle()->GetReplicaNumber();
if (postReplicaNumber>0)
{
matVoxelPOST = fMyCellParameterisation->GetTissueType(postReplicaNumber);
}
}
tmp = aStep->GetPostStepPoint()->GetTouchableHandle()->GetReplicaNumber();
if (tmp>0)
{
matVoxelPOST = fMyCellParameterisation->GetTissueType(tmp);
}
// COUNT GAS DETECTOR HITS
if ( ((aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalCollDetYoke())
&& (aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalIsobutane())
&& (aStep->GetTrack()->GetDynamicParticle()->GetDefinition() == G4Alpha::AlphaDefinition() ))
||
((aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalCollDetGap4())
&& (aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalIsobutane())
&& (aStep->GetTrack()->GetDynamicParticle()->GetDefinition() == G4Alpha::AlphaDefinition() ))
// COUNT GAS DETECTOR HITS
if (particle == G4Alpha::AlphaDefinition())
{
if(postVolume == fDetector->GetLogicalIsobutane() &&
((preVolume == fDetector->GetLogicalCollDetYoke())
||
(preVolume == fDetector->GetLogicalCollDetGap4())
||
(preVolume == fDetector->GetLogicalCollDetGap4())))
{
fRun->AddNbOfHitsGas();
}
// STOPPING POWER AND BEAM SPOT SIZE AT CELL ENTRANCE
if(preVolume == fDetector->GetLogicalPolyprop() &&
( (postVolume == fDetector->GetLogicalKgm()) ||
(matVoxelPOST == 1)) )
{
G4double deltaE = preStep->GetKineticEnergy()
- postStep->GetKineticEnergy();
if(deltaE > 0.0)
{
//Fill ntupleid=1
man->FillNtupleDColumn(1,0,preStep->GetKineticEnergy()/keV);
man->FillNtupleDColumn(1,1,deltaE*micrometer/(keV*aStep->GetStepLength()));
man->AddNtupleRow(1);
}
((aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalCollDetGap4())
&& (aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalIsobutane())
&& (aStep->GetTrack()->GetDynamicParticle()->GetDefinition() == G4Alpha::AlphaDefinition() ))
// Average dE over step suggested by Michel Maire
G4ThreeVector coord1 = preStep->GetPosition();
const G4AffineTransform transformation1 =
preStep->GetTouchable()->GetHistory()->GetTopTransform();
G4ThreeVector localPosition1 = transformation1.TransformPoint(coord1);
)
{
fRun->AddNbOfHitsGas();
}
// STOPPING POWER AND BEAM SPOT SIZE AT CELL ENTRANCE
G4ThreeVector coord2 = postStep->GetPosition();
const G4AffineTransform transformation2 =
postStep->GetTouchable()->GetHistory()->GetTopTransform();
G4ThreeVector localPosition2 = transformation2.TransformPoint(coord2);
if ( ((aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalPolyprop())
&& (aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalKgm())
&& (aStep->GetTrack()->GetDynamicParticle()->GetDefinition() == G4Alpha::AlphaDefinition() ))
||
((aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalPolyprop())
&& (matVoxelPOST == 1)
&& (aStep->GetTrack()->GetDynamicParticle()->GetDefinition() == G4Alpha::AlphaDefinition() ))
)
{
if( (aStep->GetPreStepPoint()->GetKineticEnergy() - aStep->GetPostStepPoint()->GetKineticEnergy() ) >0)
{
//Fill ntupleid=1
man->FillNtupleDColumn(1,0,aStep->GetPreStepPoint()->GetKineticEnergy()/keV);
man->FillNtupleDColumn(1,1,
(aStep->GetPreStepPoint()->GetKineticEnergy() -
aStep->GetPostStepPoint()->GetKineticEnergy())/
keV/(aStep->GetStepLength()/micrometer));
man->AddNtupleRow(1);
}
// Average dE over step suggested by Michel Maire
G4StepPoint* p1 = aStep->GetPreStepPoint();
G4ThreeVector coord1 = p1->GetPosition();
const G4AffineTransform transformation1 = p1->GetTouchable()->GetHistory()->GetTopTransform();
G4ThreeVector localPosition1 = transformation1.TransformPoint(coord1);
G4StepPoint* p2 = aStep->GetPostStepPoint();
G4ThreeVector coord2 = p2->GetPosition();
const G4AffineTransform transformation2 = p2->GetTouchable()->GetHistory()->GetTopTransform();
G4ThreeVector localPosition2 = transformation2.TransformPoint(coord2);
G4ThreeVector localPosition = localPosition1 + G4UniformRand()*(localPosition2-localPosition1);
G4ThreeVector localPosition =
localPosition1 + G4UniformRand()*(localPosition2-localPosition1);
// end
//Fill ntupleid=2
man->FillNtupleDColumn(2,0,localPosition.x()/micrometer);
man->FillNtupleDColumn(2,1,localPosition.y()/micrometer);
man->AddNtupleRow(2);
}
//Fill ntupleid=2
man->FillNtupleDColumn(2,0,localPosition.x()/micrometer);
man->FillNtupleDColumn(2,1,localPosition.y()/micrometer);
man->AddNtupleRow(2);
}
// ALPHA RANGE
// ALPHA RANGE
if (postStep->GetKineticEnergy() < eV &&
( (matVoxelPOST==1) ||
(postVolume == fDetector->GetLogicalKgm()) ||
(matVoxelPOST==2) ) )
{
//Fill ntupleid=3
man->FillNtupleDColumn(3,0,postStep->GetPosition().x()/micrometer);
man->FillNtupleDColumn(3,1,postStep->GetPosition().y()/micrometer);
man->FillNtupleDColumn(3,2,postStep->GetPosition().z()/micrometer);
man->AddNtupleRow(3);
}
// TOTAL DOSE DEPOSIT AND DOSE DEPOSIT WITHIN A PHANTOM VOXEL
// FOR ALL PARTICLES
}
if (
if (matVoxelPRE == 2)
{
G4double dose = (edep/joule)/(fRun->GetMassNucleus()/kg);
fRun->AddDoseN(dose);
fRun->AddDoseBox(preReplicaNumber, edep/eV);
}
else if (matVoxelPRE == 1)
{
G4double dose = (edep/joule)/(fRun->GetMassCytoplasm()/kg);
fRun->AddDoseC(dose);
fRun->AddDoseBox(preReplicaNumber, edep/eV);
}
(aStep->GetTrack()->GetDynamicParticle()->GetDefinition() == G4Alpha::AlphaDefinition())
&&
(aStep->GetTrack()->GetKineticEnergy()<1e-6)
&&
( (matVoxelPOST==1)
|| (aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == fDetector->GetLogicalKgm())
|| (matVoxelPOST==2) )
)
{
//Fill ntupleid=3
man->FillNtupleDColumn(3,0,
aStep->GetPostStepPoint()->GetPosition().x()/micrometer);
man->FillNtupleDColumn(3,1,
aStep->GetPostStepPoint()->GetPosition().y()/micrometer);
man->FillNtupleDColumn(3,2,
aStep->GetPostStepPoint()->GetPosition().z()/micrometer);
man->AddNtupleRow(3);
}
// TOTAL DOSE DEPOSIT AND DOSE DEPOSIT WITHIN A PHANTOM VOXEL
// FOR ALL PARTICLES
if (matVoxelPRE == 2)
{
G4double dose = (aStep->GetTotalEnergyDeposit()/joule)/(fRun->GetMassNucleus()/kg);
fRun->AddDoseN(dose);
G4ThreeVector v;
fRun->AddDoseBox(aStep->GetPreStepPoint()->GetTouchableHandle()->GetReplicaNumber(),
aStep->GetTotalEnergyDeposit()/eV);
}
if (matVoxelPRE == 1)
{
G4double dose = (aStep->GetTotalEnergyDeposit()/joule)/(fRun->GetMassCytoplasm()/kg);
fRun->AddDoseC(dose);
G4ThreeVector v;
fRun->AddDoseBox(aStep->GetPreStepPoint()->GetTouchableHandle()->GetReplicaNumber(),
aStep->GetTotalEnergyDeposit()/eV);
}
// PROTECTION AGAINST MSC LOOPS FOR e-
if ( aStep->GetTotalEnergyDeposit()/MeV<1e-25
&& aStep->GetTrack()->GetDefinition()==G4Electron::ElectronDefinition())
{
aStep->GetTrack()->SetTrackStatus(fStopAndKill);
/*
G4cout << "*** Warning *** : msc loop for "
<< aStep->GetTrack()->GetDefinition()->GetParticleName()
<< " in " <<
aStep->GetPostStepPoint()->GetTouchableHandle()->GetVolume()->GetName() << G4endl;
*/
}
// PROTECTION AGAINST POSSIBLE MSC LOOPS FOR e-
// if ( edep/MeV<1e-25 && particle == G4Electron::Electron())
// {
//aStep->GetTrack()->SetTrackStatus(fStopAndKill);
/*
G4cout << "*** Warning *** : msc loop for "
<< track->GetDefinition()->GetParticleName()
<< " in " <<
postPoint->GetTouchableHandle()->GetVolume()->GetName() << G4endl;
*/
// }
}