Introduction to GEANT4

From UCL HEP PBT Wiki

Jump to: navigation, search
m
m
 
Line 152: Line 152:
* ConstructParticles() : Define all necessary particles;   
* ConstructParticles() : Define all necessary particles;   
-
* ConstructProcesses() : Define all necessary processes and assign them to proper particles;
+
* ConstructProcesses() : Define all necessary processes and assign them to corresponding particles;
* SetCuts() : Define production thresholds in terms of range;  
* SetCuts() : Define production thresholds in terms of range;  
Line 235: Line 235:
</pre>   
</pre>   
    
    
-
 
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
void MyPhysicsList::ConstructGeneral() {  
void MyPhysicsList::ConstructGeneral() {  
Line 259: Line 258:
This is the full [http://geant4.cern.ch/support/proc_mod_catalog/particles/ list] of physics processes available for every  particle. Finally, in method SetCuts() you can define cuts on the particles:
This is the full [http://geant4.cern.ch/support/proc_mod_catalog/particles/ list] of physics processes available for every  particle. Finally, in method SetCuts() you can define cuts on the particles:
-
 
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
Line 272: Line 270:
SetCutValue(defaultCutValue, "e-");  
SetCutValue(defaultCutValue, "e-");  
</pre>
</pre>
 +
 +
See the [[Computed tomography]] tutorial to learn more about simple physics lists .
=== <span style="color:#000080"> Detailed physics lists </span> ===  
=== <span style="color:#000080"> Detailed physics lists </span> ===  
-
If you want to build more realistic physics list you have to use the class <span style="color:#ff0000"> G4VModularPhysicsList </span>. For example, the photon from the example above can undergo compton scattering apart from conversion. In <span style="color:#ff0000"> G4VModularPhysicsList </span> you can group the physics processes into separate modules: EM physics, hadronic physics, decay physics etc.  
+
If you want to build more realistic physics list you have to use the class <span style="color:#ff0000"> G4VModularPhysicsList </span>. In <span style="color:#ff0000"> G4VModularPhysicsList </span> you can group the physics processes into separate modules which are already pre-build physics list and later chose one of those modules.  
<u> Simple example of class <span style="color:#ff0000"> MyPhysicsList </span> </u>:
<u> Simple example of class <span style="color:#ff0000"> MyPhysicsList </span> </u>:
Line 370: Line 370:
</pre>
</pre>
    
    
 +
See the [[Monoenergetic proton pencil beam]] tutorial to learn more about detailed physics lists.
 +
=== <span style="color:#000080"> Pre-packaged physics lists </span> ===
=== <span style="color:#000080"> Pre-packaged physics lists </span> ===
Line 387: Line 389:
For example, if you want to simulate clinical proton beam of energy 150 MeV you can use pre-packaged physics list e.g. QGSP_BIC, QGSP_BERT and FTFP_BERT. If you are interested in Bragg curve physics, use a physics list ending in "EMV" or "EMX" e.g. QGSP_BERT_EMV.  
For example, if you want to simulate clinical proton beam of energy 150 MeV you can use pre-packaged physics list e.g. QGSP_BIC, QGSP_BERT and FTFP_BERT. If you are interested in Bragg curve physics, use a physics list ending in "EMV" or "EMX" e.g. QGSP_BERT_EMV.  
-
 
-
=== <span style="color:#000080"> Building your own physics list </span> ===
 
-
 
-
See Computed tomography tutorial.
 
   
   
== <span style="color:#000080"> Generate primary particles </span> ==  
== <span style="color:#000080"> Generate primary particles </span> ==  
Line 451: Line 449:
[http://geant4.web.cern.ch/geant4/UserDocumentation/Doxygen/examples_doc/html/group__extended__common__primaryGenerator.html Here] you can find how to implement MyPrimaryGeneratorAction class in your code.
[http://geant4.web.cern.ch/geant4/UserDocumentation/Doxygen/examples_doc/html/group__extended__common__primaryGenerator.html Here] you can find how to implement MyPrimaryGeneratorAction class in your code.
 +
 +
The [[Monoenergetic photon pencil beam]] example uses the '''G4ParticleGun''' class. The [[Proton beam with realistic geometry]] tutorial uses '''G4GeneralParticleSource'''. 
    
    
== <span style="color:#000080"> Optional user classes </span> ==
== <span style="color:#000080"> Optional user classes </span> ==
Line 476: Line 476:
=== <span style="color:#000080"> Step </span> ===
=== <span style="color:#000080"> Step </span> ===
-
Step has two points and information about the particle e.g. energy loss on the step. A step is represented by <span style="color:#ff0000"> G4Step </span> and <span style="color:#ff0000"> G4StepPoint </span> classes. <span style="color:#ff0000"> G4UserSteppingAction </span> is optional class where you can kill, suspend, postpone a track.  
+
Step is defined by two points, it contains also information about the particle e.g. energy loss on the step. A step is represented by <span style="color:#ff0000"> G4Step </span> and <span style="color:#ff0000"> G4StepPoint </span> classes. <span style="color:#ff0000"> G4UserSteppingAction </span> is optional class where you can kill, suspend, postpone a track.  
-
Status is attached to each <span style="color:#ff0000"> G4StepPoint </span> to show how step was determined. You can use ''PostStepPoint'' to get status of current step and ''PreStepPoint'' to get status of previous step. For example to get the x coordinate of a step you do the following:
+
Status is attached to each <span style="color:#ff0000"> G4StepPoint </span> to show how step was determined. You can use ''PostStepPoint'' to get status of current step and ''PreStepPoint'' to get status of previous step. For example to get the "x" coordinate of a step you do the following:
<pre style="color: #800000; background-color: #dcdcdc">
<pre style="color: #800000; background-color: #dcdcdc">
Line 488: Line 488:
=== <span style="color:#000080"> Trajectory </span> ===
=== <span style="color:#000080"> Trajectory </span> ===
-
Trajectories are represented by classes <span style="color:#ff0000"> G4Trajectory </span> and <span style="color:#ff0000"> G4TrajectoryPoint </span>. <span style="color:#ff0000"> G4Trajectory </span> class copies some of the <span style="color:#ff0000"> G4Track </span> class information. <span style="color:#ff0000"> G4TrajectoryPoint </span> is the class which copies some of <span style="color:#ff0000"> G4Step </span> information.
+
Trajectories are represented by classes <span style="color:#ff0000"> G4Trajectory </span> and <span style="color:#ff0000"> G4TrajectoryPoint </span>. <span style="color:#ff0000"> G4Trajectory </span> class copies some of the <span style="color:#ff0000"> G4Track </span> class information. <span style="color:#ff0000"> G4TrajectoryPoint </span> is the class which copies some of the <span style="color:#ff0000"> G4Step </span> information.

Latest revision as of 17:00, 4 September 2014

Personal tools