$Id: README,v 1.22 2009/11/21 22:02:51 maire Exp $
-------------------------------------------------------------------

     =========================================================
     Geant4 - an Object-Oriented Toolkit for Simulation in HEP
     =========================================================

                            TestEm7 
                            -------

     How to produce a Bragg curve in a water phantom.
     How to compute the dose in small 'test volumes' called tallies.
     How to define a maximum step size.
	
 1- GEOMETRY DEFINITION
 
     The geometry consists of a single block of a homogenous material,
     placed in a world.
     	
     Three parameters define the geometry :
 	- the material of the box,
	- the thickness of the box (sizeX),
	- the  tranverse dimension of the box (sizeYZ).
	
     The default is 20 cm of water.
     	 	
     In addition a transverse uniform magnetic field can be applied.
 	
     The default geometry is constructed in DetectorConstruction class,
     but all of the above parameters can be changed interactively via
     the commands defined in the DetectorMessenger class.
     
     The size, matter, positions of several test-volumes (tallies) can be
     defined via UI commands : /testem/det/tally...    
 	
 2- PHYSICS LIST
 
 Physics lists can be local (eg. in this example) or from G4 kernel
 physics_lists subdirectory.
     
 Local physics lists:	 
 - "local"	standard EM physics with current 'best' options setting.
                these options are explicited in PhysListEmStandard		
 - "standardSS" standard EM physics with single Coulomb scattering 
                instead of multiple scattering; 
 - "standardNR" standard EM physics with single Coulomb scattering 
                process G4ScreenedNuclearRecoil instead of the 
                multiple scattering for ions with energy less than 
                100 MeV/nucleon; the new process was developed 
                by M.H. Mendenhall and R.A. Weller from Vanderbuilt 
                University and published in NIM B 277 (2005) 420.
                In later Geant4 releases the process will be a part
                of Geant4 source, currently it is released together
                with its mathematical tool c2_functions in current 

    
 From geant4/source/physics_lists/builders:	 
 - "emstandard_opt0" recommended standard EM physics for LHC
 - "emstandard_opt1" best CPU performance standard physics for LHC
 - "emstandard_opt2"     
 - "emstandard_opt3" best current advanced EM options. 
                     analog to "local" above  
 - "emlivermore"  low-energy EM physics using Livermore data
 - "empenelope"   low-energy EM physics implementing Penelope models
    
 Optional components can be added:
 - "elastic"       elastic scattering of hadrons
 - "HElastic"
 - "QElastic"    
 - "binary"        QBBC configuration of hadron inelastic models
 - "binary_ion"    Binary ion inelastic models
     		        
 Physics lists and options can be (re)set with UI commands
    
 Please, notice that options set through G4EmProcessOPtions are global, eg
 for all particle types. In G4 builders, it is shown how to set options per
 particle type.		
 	 
 3- AN EVENT : THE PRIMARY GENERATOR
 
     The primary kinematic consists of a single particle which hits the
     block perpendicular to the input face. The type of the particle
     and its energy are set in the PrimaryGeneratorAction class, and can
     changed via the G4 build-in commands of ParticleGun class (see
     the macros provided with this example).
     The default is proton 160 MeV
     	
     In addition one can define randomly the impact point of the incident
     particle. The corresponding interactive command is built in
     PrimaryGeneratorMessenger class.
	 	
     A RUN is a set of events.
 	

 4- DOSE IN 'TEST-VOLUMES'
  
     The energy deposited in the test-volumes (tallies) defined in
     DetectorConstruction are printed at EndOfRun, both in MeV and gray.
 				
 5- VISUALIZATION
 
     The Visualization Manager is set in the main().
     The initialisation of the drawing is done via the command
     > /control/execute vis.mac
 	
     The detector has a default view which is a longitudinal view of the box.
 	
     The tracks are drawn at the end of event, and erased at the end of run.
     Optionaly one can choose to draw all particles, only the charged one,
     or none. This command is defined in EventActionMessenger class.
     
		  	
 6- HOW TO START ?
 
     - compile and link to generate an executable
	% cd geant4/examples/extended/electromagnetic/TestEm7 
 	% gmake
 		
     - execute Test  in 'batch' mode from macro files
 	% TestEm7    proton.mac
 		
     - execute Test  in 'interactive mode' with visualization
 	% TestEm7 
 		....
 	Idle> type your commands
 		....
 	Idle> exit


 7- HISTOGRAM OF THE BRAGG PEAK
 
     Testem7 computes the total energy deposited along the trajectory of 
     the incident particle : the so-called Bragg peak.
     
     In order to control the accuracy of the deposition, the user can limit
     the maximum allowed for the step size of charged particles.
     (command /testem/stepMax )
 
     The result is a 1D histogram, which is the total energy deposited 
     along the trajectory of the incident particle.
     
     The bin size is egal to stepMax. The number of bins is determined by 
     the thickness of the absorber (with a minimum of 100 bins).
     The total energy deposited is plotted in MeV/mm per incident particle.  

     The next histogram alowing to have a zoom around the Bragg peak. Its binning 
     should be defined via UI command: 
     /testem/histo/setHisto 1 nbins xmin xmax

     The last histogram shows the projectile range. Its binning should be defined
     similary by the UI command:
     /testem/histo/setHisto 2 nbins xmin xmax
      
  8- USING HISTOGRAMS

     By default the histograms are not activated. To activate histograms
     the environment variable G4ANALYSIS_USE should be defined. For instance
     uncomment the flag G4ANALYSIS_USE in GNUmakefile.
  
     To use histograms, at least one of the AIDA implementations should be 
     available. See InstallAida.txt

     Before compilation of the example it is optimal to clean up old files:
  	gmake histclean
  	gmake 

     It is possible to choose the format of the histogram file (hbook, root, XML):
     /testem/histo/setHistoType root

     The default name "testem7" can be changed:
     /testem/histo/setHistoName myname
