Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/basic/B2/README is written in an unsupported language. File is not indexed.

0001 -------------------------------------------------------------------
0002 
0003      =========================================================
0004      Geant4 - an Object-Oriented Toolkit for Simulation in HEP
0005      =========================================================
0006 
0007                             Example B2
0008                             ----------
0009 
0010  This example simulates a simplified fixed target experiment.
0011 
0012  1- GEOMETRY DEFINITION
0013 
0014      The setup consists of a target followed by six chambers of increasing
0015      transverse size at defined instances from the target. These chambers are
0016      located in a region called the Tracker region.
0017      Their shape are cylinders, constructed as simple cylinders
0018      (in B2a::DetectorConstruction) and as parametrised volumes
0019      (in B2b::DetectorConstruction), see also B2b::ChamberParameterisation class.
0020 
0021      In addition, a global, uniform, and transverse magnetic field can be
0022      applied using G4GlobalMagFieldMessenger, instantiated in
0023      B2[a,b]::DetectorConstruction::ConstructSDandField with a non zero field value,
0024      or via interactive commands.
0025      For example:
0026 
0027      /globalField/setValue 0.2 0 0 tesla
0028 
0029      An instance of the B2::TrackerSD class is created and associated with each
0030      logical chamber volume (in B2a) and with the one G4LogicalVolume associated
0031      with G4PVParameterised (in B2b).
0032 
0033      One can change the materials of the target and the chambers
0034      interactively via the commands defined in B2a::DetectorMessenger
0035      (or B2b::DetectorMessenger). For example:
0036 
0037      /B2/det/setTargetMaterial G4_WATER
0038      /B2/det/setChamberMaterial G4_Ar
0039 
0040  2- PHYSICS LIST
0041 
0042      The particle's type and the physic processes which will be available
0043      in this example are set in the FTFP_BERT physics list. This physics list
0044      requires data files for electromagnetic and hadronic processes.
0045      See more on installation of the datasets in Geant4 Installation Guide,
0046      Chapter 3.3: Note On Geant4 Datasets:
0047      http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch03s03.html
0048      The following datasets: G4LEDATA, G4LEVELGAMMADATA, G4SAIDXSDATA and
0049      G4ENSDFSTATEDATA are mandatory for this example.
0050 
0051      In addition, the build-in interactive command:
0052                  /process/(in)activate processName
0053      allows the user to activate/inactivate the processes one by one.
0054 
0055  3- ACTION INITALIZATION
0056 
0057    A newly introduced class, B2::ActionInitialization,
0058    instantiates and registers to Geant4 kernel all user action classes.
0059 
0060    While in sequential mode the action classes are instatiated just once,
0061    via invoking the method:
0062       B2::ActionInitialization::Build()
0063    in multi-threading mode the same method is invoked for each thread worker
0064    and so all user action classes are defined thread-local.
0065 
0066    A run action class is instantiated both thread-local
0067    and global that's why its instance has is created also in the method
0068       B2::ActionInitialization::BuildForMaster()
0069    which is invoked only in multi-threading mode.
0070 
0071  4- PRIMARY GENERATOR
0072 
0073      The primary generator action class employs the G4ParticleGun.
0074      The primary kinematics consists of a single particle which starts close
0075      to the world boundary and hits the target perpendicular to the entrance
0076      face. The type of the particle and its energy can be changed via the
0077      Geant4 built-in commands of the G4ParticleGun class.
0078 
0079  5- RUNS and EVENTS
0080 
0081      A run is a set of events.
0082 
0083      The user has control:
0084         - at Begin and End of each run (class B2::RunAction)
0085         - at Begin and End of each event (class B2::EventAction)
0086         - at Begin and End of each track (class TrackingAction, not used here)
0087         - at End of each step (class SteppingAction, not used here)
0088 
0089      The event number is written to the log file every requested number
0090      of events in B2::EventAction::BeginOfEventAction() and
0091      B2::EventAction::EndOfEventAction().
0092      Moreover, for the first 100 events and every 100 events thereafter
0093      information about the number of stored trajectories in the event
0094      is printed as well as the number of hits stored in the G4VHitsCollection.
0095 
0096      The run number is printed at B2::RunAction::BeginOfRunAction(), where the
0097      G4RunManager is also informed how to SetRandomNumberStore for storing
0098      initial random number seeds per run or per event.
0099 
0100  6- USER LIMITS
0101 
0102     This example also illustrates how to introduce tracking constraints
0103     like maximum step length, minimum kinetic energy etc. via the G4UserLimits
0104     class and associated G4StepLimiter and G4UserSpecialCuts processes.
0105     See B2a::DetectorConstruction (or B2b::DetectorConstruction).
0106 
0107     The maximum step limit in the tracker region can be set by the interactive
0108     command (see B2a::DetectorMessenger, B2b::DetectorMessenger classes).
0109     For example:
0110 
0111     /B2/det/stepMax 1.0 mm
0112 
0113  7- DETECTOR RESPONSE
0114 
0115      A HIT is a step per step record of all the information needed to
0116      simulate and analyse the detector response.
0117 
0118      In this example the Tracker chambers are considered to be the detector.
0119      Therefore, the chambers are declared 'sensitive detectors' (SD) in
0120      the B2a::DetectorConstruction (or B2b::DetectorConstruction) class.
0121      They are associated with an instance of the B2::TrackerSD class.
0122 
0123      Then, a Hit is defined as a set of 4 informations per step, inside
0124      the chambers, namely:
0125         - the track identifier (an integer),
0126         - the chamber number,
0127         - the total energy deposit in this step, and
0128         - the position of the energy deposit.
0129 
0130      A given hit is an instance of the class B2::TrackerHit which is created
0131      during the tracking of a particle, step by step, in the method
0132      B2::TrackerSD::ProcessHits(). This hit is inserted in a HitsCollection.
0133 
0134      The HitsCollection is printed at the end of each event (via the method
0135      B2::TrackerSD::EndOfEvent()), under the control of the command:
0136      /hits/verbose 2
0137 
0138  The following paragraphs are common to all basic examples
0139 
0140  A- VISUALISATION
0141 
0142    The visualization manager is set via the G4VisExecutive class
0143    in the main() function in exampleB2a.cc (or exampleB2b.cc).
0144    The initialisation of the drawing is done via a set of /vis/ commands
0145    in the macro vis.mac. This macro is automatically read from
0146    the main function when the example is used in interactive running mode.
0147 
0148    By default, vis.mac opens an OpenGL viewer (/vis/open OGL).
0149    The user can change the initial viewer by commenting out this line
0150    and instead uncommenting one of the other /vis/open statements, such as
0151    HepRepFile or DAWNFILE (which produce files that can be viewed with the
0152    HepRApp and DAWN viewers, respectively).  Note that one can always
0153    open new viewers at any time from the command line.  For example, if
0154    you already have a view in, say, an OpenGL window with a name
0155    "viewer-0", then
0156       /vis/open DAWNFILE
0157    then to get the same view
0158       /vis/viewer/copyView viewer-0
0159    or to get the same view *plus* scene-modifications
0160       /vis/viewer/set/all viewer-0
0161    then to see the result
0162       /vis/viewer/flush
0163 
0164    The DAWNFILE, HepRepFile drivers are always available
0165    (since they require no external libraries), but the OGL driver requires
0166    that the Geant4 libraries have been built with the OpenGL option.
0167 
0168    For more information on visualization, including information on how to
0169    install and run DAWN, OpenGL and HepRApp, see the visualization tutorials,
0170    for example,
0171    http://geant4.slac.stanford.edu/Presentations/vis/G4[VIS]Tutorial/G4[VIS]Tutorial.html
0172    (where [VIS] can be replaced by DAWN, OpenGL and HepRApp)
0173 
0174    The tracks are automatically drawn at the end of each event, accumulated
0175    for all events and erased at the beginning of the next run.
0176 
0177  B- USER INTERFACES
0178 
0179    The user command interface is set via the G4UIExecutive class
0180    in the main() function in exampleB2a.cc
0181    The selection of the user command interface is then done automatically
0182    according to the Geant4 configuration or it can be done explicitly via
0183    the third argument of the G4UIExecutive constructor (see exampleB4a.cc).
0184 
0185  C- HOW TO RUN
0186 
0187     - Execute exampleB2a in the 'interactive mode' with visualization
0188         % exampleB2a
0189       and type in the commands from run1.mac line by line:
0190         Idle> /tracking/verbose 1
0191         Idle> /run/beamOn 1
0192         Idle> ...
0193         Idle> exit
0194       or
0195         Idle> /control/execute run1.mac  or run2.mac
0196         ....
0197         Idle> exit
0198 
0199     - Execute exampleB2a in the 'batch' mode from macro files
0200       (without visualization)
0201         % exampleB2a run2.mac
0202         % exampleB2a exampleB2.in > exampleB2.out
0203