]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - AliGeant4/doc/README
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / AliGeant4 / doc / README
index 654fddda43dddbb5579709d3abb044b36ce63b25..0194d8daaf1bae163a511a56404207cfc22d9879 100644 (file)
 $Id$
 -----------------------------------------------------------------
 
-Geant4 related files in AliRoot:
-================================
-   AliRoot/TGeant4   - source of TGeant4 category
-   AliRoot/AliGeant4 - source of AliGeant4 category
-   
-   AliRoot/AliGeant4/config:
-             configuration scripts: 
-                setup.sh, setup.csh
-            script for generating HTML documentation:
-               doc_XXc++2html.pl, doc_XXddl2html.pl, doc_XXsorthtml.pl, 
-               doc_XXcategory.pl                     where XX = al, g4
-            scripts and template files for automatic generation of G4 test 
-            macros:
-               test_create.sh, test_create_in.sh, test_create_struct.sh,
-               test_run.sh, test_run_in.sh, test_run_struct.sh,
-               test_default_det_novis.in, test_default_det_vis.in              
-               test_default_genN.in;       N = 0,1,2,3
-                test_default_visN.in;      N = 1 
-             script for generation source directories with files
-            sorted in subdirectories corresponding to subcategories:
-               make_source.pl
-
-   AliRoot/AliGeant4/doc:
-             README
-            README.CodingConvention;
-            CodePrototype.html, G4CodePrototype.html - main code html pages
-                 (they are not produced automatically)
-             HTML directory is created here by doc_alc++2html.sh script;
-            HTML documentation of Geant4 can be created by doc_g4c++2html.pl
-
-   AliRoot/AliGeant4/macro:
-             Detector specific root and G4 macros (in detector subdirectories);
-            Examples of G4 macros:
-              alirunN.in         
-            Root macros:
-               g4libs.C    - Root macro for loading G4 and AliRoot libraries                
-              g4menu.C    - primitive GUI for instantiating TGeant4 and
-                            switching to G4 UI
-              g4Config.C  - alternative of Config.C for G4
-             
-   
-Alice Geant4 related environment variables:
-==========================================
-  (used when code is compiled; see config/setup.sh)
+Introduction:
+=============
+  In order to run AliRoot with Geant4,
+  it is sufficient to install Geant4 VMC and then use macros
+  g4Config.C and eventually g4menu.C.  
 
-  AG4_INSTALL
-    the path to AliRoot/AliGeant4;
+  AliGeant4 modude, in addition to that, enables to run AliRoot 
+  fully from Geant4 UI; it also defines interactive commands 
+  for selecting detector setup from G4 and interactive particle gun
+  for simple tests     
+  A set of test macros/examples is provided with AliGeant4 package.
 
-  AG4_VERSION
-    the Geant4 version;
-    if set: the provided Geant4 version and not the default one is set
-    Default: unset
-
-  AG4_VISUALIZE
-    if set: the program is compiled with visualisation (default)
-    Categories affected: 
-       geometry, main, visualization     
-    Default: set 
-    
-  AG4_OPACS    
-    if set: the program is compiled with OPACS visualisation
-    Categories affected: 
-       geometry, main, visualization     
-    Default: unset 
 
-  TG4_DEBUG
-    if set: checks for existence fStep, fTrack are performed in TG4StepManager,
-            checks for type (by dybamic_cast) elsewhere 
-    Categories affected: physics, event
-    Default: unset   
-    
+How to set environment:
+=======================
+  See Geant4 VMC README how to set G4 environment
+  for both Geant4 and Geant4 VMC.
+  AliGeant4 requires to have the path to AliGeant4
+  package set in the AG4_INSTALL variable:
+  
+  export AG4_INSTALL=$ALICE_ROOT/AliGeant4
+  setenv AG4_INSTALL ${ALICE_ROOT}/AliGeant4
 
-  Default setting:
-  ---------------- 
-  Can be set running the setup.sh script:
+  Default Geant4 setting for AliRoot can be set 
+  running the old setup.(c)sh script:
 
-  . $ALICE_ROOT/AliGeant4/config/setup.sh          for zsh  users   
-  source $ALICE_ROOT/AliGeant4/config/setup.csh    for tcsh users
+  . $ALICE_ROOT/AliGeant4/config/oldsetup.sh          for zsh  users   
+  source $ALICE_ROOT/AliGeant4/config/oldsetup.csh    for tcsh users
 
-  The setup script can be added into a user login script:
+  The setup script can be added into a user login script.
   
-  for zsh  users:
-  # can be added to .zshenv 
-  # Alice and Geant4 default settings 
-  . $ALICE_ROOT/AliGeant4/config/setup.sh    
-
-  for tcsh users (not available yet)
-  # can be added to .login
-  # Alice and Geant4 default settings 
-  source $ALICE_ROOT/AliGeant4/config/setup.csh     
-
-  Supported systems: HP-aCC, Linux-g++.
+  !!! Always be careful to have the same environment set when building
+  all dependent libraries:
+  CLHEP, Geant4, Geant4 VirtualMC, AliGeant4
   
 
-Compilation:
-============
+How to compile:
+===============
    cd $ALICE_ROOT
-   gmake geant4        
+   gmake -f Makefile.old geant4        
    
    Optionally, using Makefile.flugg instead of standard Makefiles,
    two libraries in each package can be created:
    libXXX_1 - low level library (subcategories global, geometry, visualization);
    libXXX_2 - high level library (subcategories digits+hits, event, run)    
+   NEED TO BE REVISED WITH MOVE TO VIRTUAL MC
    
 
-Executables:
-============
-   (in $ALICE_ROOT/bin/tgt_SYSTEM/)
-   aliroot   - standard aliroot main;
-               not linked with G4 libs, starts in Root UI;
-              !! cannot be used with all G4 GUIs
-   aligeant4 - main linked with G4 libs, starts in G4 UI
-
+How to run:
+===========
+   - Add $ALICE_ROOT/AliGeant4/macro path to your Root macro path
+     or go to this directory
 
-   1. Interactive mode
-      -----------------
+   To run AliRoot with Geant4 VMC:
 
-   1.A. with aliroot:
-   
-        aliroot [Xm]
-       .x g4menu.C
+   - Run aliroot with g4Config.C
+      - gAlice->Init("g4Config.C");
+        gAlice->Run(); 
        
-   1.B. with aligeant4:             
-
-     B.1.  aligeant4 [Xm]        
-                  terminal is used for typing commands;
-                   if Xm is specified Motif Window is open for typing 
-                  commands 
-                   !! when simple terminal used with Xo driver it may 
-                  freeze the whole X server 
-                  -> use A. instead of this possibility 
-      
-     B.2.a. java gag
-                  java GAG GUI is activated; 
-                  select: GEANT4 -> Execute GEANT4 
-                  and select aligeant4 executable in file browser
-     B.2.b  tmomo
-                  Tcl/Tk Momo and GAG GUI is activated;
-                  select GAG -> Function -> Run GEANT4 
-                  and select aligean4 executable in file browser          
-     B.3. aligeant4 Wo    
-                  OPACS GUI is activated
-                  
-   2. Batch mode:       
-      -----------
-      Use aliroot for running in batch mode with Root macros
-      (*.C) and aligeant4 with G4 macros (*.in):
-      
-      aliroot    macro.C         
-      aligeant4  macro.in   
-      
-      G4 macro "macro.in" can be called from Root macro:
+   - You can also start from a mini GUI - g4menu.C
+      - aliroot
+      - .x g4menu.C
+            --> Select "Init" and then "Run" button
+           
+      From the menu you can start Geant4 interactive session,
+      by button "Geant4UI" and use Geant4 interactive commands;
+      in case TGeant4 has not yet been created you have first
+      select button "Geant4".          
       
-          (TGeant4*)gMC->ProcessGeantMacro("macro.in");
-          
-      Root macro "macro.C" can be called from G4 macro:
-      
-           /g4mc/rootMacro  macro
-             
-            
-      Several examples of Geant4 macros for running aligeant4 in a batch mode
-      are available in $ALICE_ROOT/macro:
+   To run AliRoot with Geant4 VMC + AliGeant4:
+
+      AliGeant4 enables to run aliroot fully from Geant4 UI;
+      it also defines interactive commands for selecting detector
+      setup from G4 and interactive particle gun for simple tests      
+
+   - Run aligeant4 interactively or with Geant4 macros alirunN.in:
+     - aligeant4 [alirunN.in] 
+               
+   - You can still stay fully in Root UI and run aliroot with ag4Config.C:
+      - gAlice->Init("ag4Config.C");
+        gAlice->Run();         
+   
+Tests:
+======
+   Several tests are defined with use of Geant4 macros;
+   the following macros are available:
       
-          alirun0.in - the simple macro how to run with default setup
-                      using g4 commands
-          alirun1.in - example of interactive particle gun usage and
-                       drawing trajectories;     
-         alirun2.in - example of special lego run with calling
-                       Root macro lego.C from g4 and switching to root UI
-         alirun4.in - example for geometry browser usage              
+     alirun0.in - standard AliRoot run with all detectors and 
+                  AliRoot event generator defined in g4Config.C
+     alirun1.in - example of interactive particle gun usage with
+                  visualization of geometry and trajectories;    
+     alirun2.in - example of special lego run with calling
+                  Root macro lego.C from g4 and switching to root UI
+     alirun3.in - Geant4 geometry test (all detectors with excluded thos
+                  using MANY)
+     alirun4.in - example for geometry browser usage 
+     
+     To run the tests from aliroot, do:
+     aliroot
+     .x ag4test.C("alirun0.in");       
                       
 
+How to go to Geant4 interactive session:
+========================================
+   When a user runs aligeant4, he starts immediately
+   in Geant4 interactive session. 
+
+   When a user runs aliroot, the AliRun global object (gAlice)
+   is created and then Root interactive session is invoked.
+   In order to go to interactive Geant4 a user has to first
+   Geant4 VirtualMC and then use its function to invoke interactive
+   Geant4.
+   
+   To do this, do:
+   aliroot  
+   .x g4menu.C       -> opens a GUI window
+   click on Geant4   -> creates Geant4 VirtualMC
+   click on Geant4UI -> switches to interactive Geant4
+   
+   To go back to Root UI, type exit.
+   
+   To switch to interactive Geant4 "without clicking", do:
+   aliroot  
+   .x g4libs.C 
+   .L g4menu.C
+   CreateGeant4(); 
+   StartGeant4UI();
+    
+   To go back to Root UI, type exit.
+
+   See also related paragraph in Geant4 VMC/README:
+   Root and Geant4 UI
+
+
+Alice Geant4 Commands:
+=======================
+  Both Geant4 VMC and AliGeant4 define several commands
+  that can be invoked in Geant4 interactive session.
+  The documentation for all available commands
+  can be generated from Geant4 using G4 command:
+      /control/createHTML [dir]    
+      
+  This will generate a set of HTML files in the current 
+  [or specified] directory. The top file has name .html.
+  
+  All Geant4 VMC commands start with prefix "mc",
+  all AliGeant4 commands start with prefix "ali".
+  
+
 Code documentation:
 ===================                
     doc_alc++2html.pl
@@ -186,189 +163,50 @@ Code documentation:
                 doc_alsorthtml.pl: generates html pages for class
                                   categories 
        - the main page AG4CodePrototype.html with links to category index 
-         pages and the alphabetical index page was created manually                             
-
-
-Alice Geant4 Commands:
-=======================
-
-/aliDet
-  
-  /aliDet/switchOn  modNameVer
-     modNameVer: 
-       NONE, ALL, DDD[n]      
-     where
-       NONE    no modules are selected (default)
-       ALL     all available modules (default versions) are selected
-       DDD[n]  AliRoot module DDD of n-th version is selected;
-               if n is not specified the default version is selected 
-       !! work only during preinit phase;
-     
-  /aliDet/switchOff  whichVolume
-     whichVolume: 
-       ALL, LV, DDD
-     default value: no
-     !! work only during preinit phase;
-
-  /aliDet/list
-     list of all modules currently switched on
+         pages and the alphabetical index page was created manually
+     NEED TO BE REVISED WITH MOVE TO VIRTUAL MC
 
-  /aliDet/listAvailable
-     list of all available modules
 
-  /aliDet/fieldValue value
-     define magnetic field in Z direction
-     
-  /aliDet/writeGeometry true
-     generate g3calls.dat for all built AliRoot detectors  
-
-  /aliDet/readGeometry true
-     build AliRoot detectors from g3calls.dat instead of
-     processing AliModule->CreateGeometry()
-
-  /aliDet/printMaterials
-     prints all materials
-
-  /aliDet/generateXML
-     generate geometry XML file
+Geant4 related files in AliRoot:
+================================
+   AliRoot/AliGeant4 - source of AliGeant4 category
+   
+   AliRoot/AliGeant4/config:
+             configuration scripts: 
+                setup.sh, setup.csh
+            script for generating HTML documentation:
+               doc_XXc++2html.pl, doc_XXddl2html.pl, doc_XXsorthtml.pl, 
+               doc_XXcategory.pl                     where XX = al, g4
+            scripts and template files for automatic generation of G4 test 
+            macros:
+               test_create.sh, test_create_in.sh, test_create_struct.sh,
+               test_run.sh, test_run_in.sh, test_run_struct.sh,
+               test_default_det_novis.in, test_default_det_vis.in              
+               test_default_genN.in;       N = 0,1,2,3
+                test_default_visN.in;      N = 1 
+             script for generation source directories with files
+            sorted in subdirectories corresponding to subcategories:
+               make_source.pl
 
-  Sub-directories /aliDet/XXX/ commands : 
-    setFrame            * Set detector frame
-    list                * List all logical volumes of body detector
-    listLong            * List all logical volumes and number of its physical
-                          volumes (daughters) that are placed in this LV
-    listDaughters       * List daughters of the given logical volumes
-    listLongDaughters   * List daughters of the given logical volumes
-    setVolume           * Set the current logical volume.
-    setVisibility       * Make body detector visible/invisible.
-    setLVTreeVisibility * Make current volume tree visible/invisible.
-    setVolVisibility    * Make current volume visible/invisible.
-    setColour           * Set colour for all body detector volumes.
-    setLVTreeColour     * Set colour for the current volume tree.
-    setVolColour        * Set colour for the current volume.
-    
-/aliGenerator
-   set primary generator action 
-   /aliGenerator/set generatorName
-      generatorName: 
-        Gun              ->  particle gun (default)
-        Geantino         ->  geantino with random momentum (default);
-        GhargedGeantino  ->  charged geantino with random momentum;
-        AliGenerator     ->  generator from AliRoot defined either in
-                            Config.C or interactively in Root shell                                                 
-   /aliGenerator/nofParticles number
-      default value: 1
-      Comment: does not set nof particles for AliGenerator
-               ( it has to be set by Aligenerator set method)  
-   /aliGenerator/verbose verboseLevel
-     verboseLevel: 0, 1, 2
-          default value: 0                     
+   AliRoot/AliGeant4/doc:
+             README - this file
+            README.CodingConvention;
+            CodePrototype.html, G4CodePrototype.html - main code html pages
+                 (they are not produced automatically)
+             HTML directory is created here by doc_alc++2html.sh script;
+            HTML documentation of Geant4 can be created by doc_g4c++2html.pl
 
-/aliGun
-   build a gun of particles with given properties
+   AliRoot/AliGeant4/macro:
+            G4 macros examples/tests:
+              alirunN.in         
+            Root macros:
+               g4libs.C    - Root macro for loading G4 libraries                    
+              g4menu.C    - primitive GUI for instantiating TGeant4 and
+                            switching to G4 UI
+              g4test.C    - root macro for running the alirunN.in
+                            from aliroot                    
+              g4Config.C  - Configuration macro Config.C for G4
+             Detector specific root and G4 macros (in detector subdirectories);
+                     
    
-  /aliGun/listAvailable
-     list of available particles
-  /aliGun/listCurrent
-     list of the properties of the current gun particle, that
-     can be add to the gun using addGun command
-  /aliGun/particle
-     set the current particle definition
-  /aliGun/momentum
-     set the current particle momentum 
-  /aliGun/position
-     set the current particle position  
-  /aliGun/time
-     set the current particle initial time
-  /aliGun/polarization
-     set the current particle polarization
-  /aliGun/direction 
-     set the current particle momentum direction
-  /aliGun/kinEnergy
-     set the current particle kinetic energy
-  /aliGun/list
-     list of all particles in the Alice gun
-  /aliGun/addParticle      
-     add the current particle to the gun
-  /aliGun/removeParticle i
-     remove the i-th particle from the gun
-  /aliGun/reset
-     remove all the particles from the gun   
-     
-/aliEvent        
-  /aliEvent/drawTracks  drawFlag
-     drawFlag:  ALL      tracks for all particles are drawn
-                CHARGED  tracks for charged particles only are drawn
-               NONE     no tracks are drawn
-     default value: CHARGED    
-  /aliEvent/verbose verboseLevel
-     verboseLevel: 0   no hits information  is printed
-                   1   number of hits for hits collections stored per event
-                      is printed
-                  2   full hits information for hits collections stored 
-                      per event is printed
-     default value: 0                  
-
-/aliTracking        
-  /aliTracking/verbose verboseLevel
-     verboseLevel: 0   no information from AlTrackingAction is printed
-                   1   each 100th primary track id is printed
-                   2   each primary track id is printed    
-     default value: 0          
-  /aliTracking/loopVerbose loopVerboseLevel
-     set tracking verbose level for detected looping tracks
-     loopVerboseLevel: see /tracking/verbose
-     default value: 0
-  /aliTracking/newVerbose      
-     set new tracking verbose level (/tracking/verbose)
-     when the track of ID set with newVerboseTrack comands starts
-     default value: -
-  /aliTracking/newVerboseTrack 
-     set the track ID for which the new tracking verbose level 
-     will be used
-     default value: -
-  /aliTracking/maxNofSteps
-     set maximum number of steps allowed
-     default value: -
   
-/aliStacking
-  /aliStacking/verbose verboseLevel         
-     verboseLevel: 0   no information from AliStackingAction is printed
-                   1   each stacking stage is printed
-
-/aliRunAction
-  /aliRunAction/verbose  verboseLevel
-     verboseLevel: 0 - 2    no influence on output yet
-
-/aliRun  
-  redefinition of /run commands for AliRoot:
-  !! /aliRun commands has to be used instead of /run commands 
-     in order to perform AliRun actions, too       
-  /aliRun/initialize  
-  /aliRun/beamOn   nofEvent
-  /aliRun/lego    
-     special lego run from AliRoot
-     (with default lego parameters) 
-  /aliRun/setConfig
-     set configuration macro name (default Config)
-
-/g4mc 
-Commands: 
-   setEM * Set electromagnetic physics.
-   setMuon * Set muon physics.
-   setHadron * Set hadron physics.
-   setOptical * Set Cerenkov and optical physics.
-   setSpecialCuts * Set special cuts process.
-   setSpecialControls * Set special controls process.
-   root * Switch to Root interactive shell.
-   rootMacro * Process Root macro with given name (from file name.C)
-   rootCmd * Process Root command
-   g3Defaults * Set G3 default parameters (cut values,, tracking media max 
-                step values, ...)
-   setProcessActivation * Activate/inactivate physics processes.
-                          (for development tests only)
-   printProcessMCMap * Prints mapping of G4 processes to G3 controls.
-   printProcessControlMap * Prints mapping of G4 processes to G3 controls.
-   printVolumeLimits * Prints the limits set to the specified volume.
-   printGeneralCuts * Prints the general G3 cuts.
-   printGeneralControls * Prints the general G3 process controls.