Files
geant4/examples/extended/electromagnetic/TestEm3
2016-06-09 12:11:21 +02:00
..
2016-06-09 12:11:21 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 11:11:55 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 12:11:21 +02:00
2016-06-09 10:49:58 +02:00

$Id: README,v 1.24 2005/05/18 15:28:37 maire Exp $
-------------------------------------------------------------------

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

                            TestEm3
                            -------

	This example simulates a simple Sampling Calorimeter setup.
	
 1- GEOMETRY DEFINITION
 
  The calorimeter is a box made of a given number of layers.
  A layer consists of a sequence of various absorbers (maximum MaxAbsor=9).
  The layer is replicated.
 	
  Parameters defining the calorimeter :
    - the number of layers,
    - the number of absorbers within a layer,		
    - the material of the absorbers,
    - the thickness of the absorbers,
    - the transverse size of the calorimeter (the input face is a square). 
 	
  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 modified interactively via the commands 
  defined in the DetectorMessenger class.
  
  NB. Numbering scheme (for histograms):
  layer     : from 1 to NbOfLayers (inclued)
  absorbers : from 1 to NbOfAbsor (inclued)
  planes    : from 1 to NbOfLayers*NbOfAbsor + 1 (inclued)      
 	
  NB. The number of absorbers and the number of layers can be set to 1.
  In this case we have a unique homogeneous block of matter, which looks like 
  a bubble chamber rather than a calorimeter ...
  (see the macro of commands: newgeom.mac)
	    
 2- PHYSICS LISTS

    Physics Lists are subdivided on 4 following modules:
    1. "particles" - particle definitions  
    2. "general" - decays and transportation  
    3. "standard" (alternative) - standard EM physics
    4. "g4v52"    (alternative) - standard EM physics version G4 5.2
    
    Notice that there is an example of definition of a static ion : IonC12
    (see PhysListParticle.cc) and an example of use : ionC12.mac
     	    
 3- AN EVENT : THE PRIMARY GENERATOR
 
  The primary kinematic consists of a single particle which hits the calorimeter
  perpendicular to the input face. The type of the particle and its energy are 
  set in the PrimaryGeneratorAction class, and can be changed via the 
  G4 build-in commands of ParticleGun class (see the macros provided with this 
  example).
 	
  In addition one can choose randomly the impact point of the incident particle.
  The corresponding interactive command is built in PrimaryGeneratorMessenger.
 	
  A RUN is a set of events.
 				
 4- VISUALIZATION
 
  The Visualization Manager is set in the main().
  The initialisation of the drawing is done via the commands :
  /vis/... in the macro vis.mac. In interactive session:
  PreInit or Idle > /control/execute vis.mac
 	
  The default view is a longitudinal view of the calorimeter.
 	
  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.
 	
 5- PHYSICS DEMO
 
  The particle's type and the physic processes which will be available
  in this example are set in PhysicsList class.
 	
  In addition a build-in interactive command (/process/inactivate processName)
  allows to activate/inactivate the processes one by one.
  Then one can well visualize the processes one by one, especially 
  in the bubble chamber setup with a transverse magnetic field.
 
  As a homework try to visualize a gamma conversion alone, 
  or the effect of the multiple scattering.
	
  Notice that one can control the maximum step size in each absorber, via the
  StepMax process and the command /testem/stepMax/absorber  
  (see StepMax and PhysicsList classes)
 	
 6- HOW TO START ?
 
  - compile and link to generate an executable
 	% cd TestEm3
 	% gmake
 		
  - execute TestEm3 in 'batch' mode from macro files
 	% TestEm3   run01.mac
 		
  - execute TestEm3 in 'interactive mode' with visualization
 	% TestEm3
 	....
 	Idle> type your commands. For instance:
 	Idle> /control/execute run01.mac
 	....
 	Idle> exit
 	
 7- HISTOGRAMS
 
 Testem3 can produce histograms : 
  histo 1 : energy deposit in absorber 1
  histo 2 : energy deposit in absorber 2
  ...etc...........
  
 One can control the binning of the histo with the command:
  /testem/histo/setHisto   idAbsor  nbin  Emin  Emax  unit 
  ...etc...........  
  where unit is the desired energy unit for that histo (see TestEm3.in).
  
  histo 11 : longitudinal profile of energy deposit in absorber 1 (MeV/event)
  histo 12 : longitudinal profile of energy deposit in absorber 2 (MeV/event)  
  ...etc...........  
  
  histo 21 :  forward energy flow (MeV/event)
  histo 22 : backward energy flow (MeV/event)  

 One can control the name of the histograms file with the command:
 /testem/histo/setFileName  name  (default testem3.hbook)
 
 Note that, by default, histograms are disabled. To activate them, uncomment
 the flag G4ANALYSIS_USE in GNUmakefile.

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

  To use histograms, at least one of the AIDA implementations should be 
  available (see http://aida.freehep.org).
  
 8a - PI 

  A package including AIDA and extended interfaces also using Python is PI, 
  available from: http://cern.ch/pi

  Once installed PI or PI-Lite in a specified local area $MYPY, it is required 
  to add the installation path to $PATH, i.e. for example, for release 1.2.1 of 
  PI:
  setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin

  CERN users can use the PATH to the LCG area on AFS.
  Before running the example the command should be issued:
  eval `aida-config --runtime csh`

 8b -  OpenScientist
 
  OpenScientist is available at http://www.lal.in2p3.fr/OpenScientist
  
  In OpenScientist, the AIDA implementation is the Lab package. 
  You have to "setup" this package before compiling (then with G4ANALYSIS_USE) 
  and running your Geant4 application.
   
  On UNIX you setup, with a csh flavoured shell : 
	csh> setenv CMTPATH <OpenScientist install path> 
	csh> source <OpenScientist install path>/Lab/<version>/cmt/setup.csh 
  On UNIX with a sh flavoured shell : 
	sh> CMTPATH=<OpenScientist install path>;export CMTPATH 
	sh> . <OpenScientist install path>/Lab/<version>/cmt/setup.sh 
  On Windows : 
	DOS> set CMTPATH=<OpenScientist install path> 
	DOS> call <OpenScientist install path>/Lab/<version>/cmt/setup.bat 

  You have to use the XML or root file formats ; producing hbook files is not 
  supported by OpenScientist/Lab. But the three formats (hbook, AIDA-XML, root) 
  are readable by the interactive applications ; the Lab onx interactive 
  program or the OpenPAW program. 

  With OpenPAW, someone can view the histograms with : 
	OS> opaw 
	opaw> h/file 1 run0.aida   (or opaw> h/file 1 run1.root) 
	opaw> zone 2 2 
	opaw> h/plot 1 
	opaw> h/plot 2 
	opaw> h/plot 3