12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Detector Definition and Response3. Whenever the objects to be persistified are available, call the WriteObject method of TFile with thepointer to the appropriate object as argument (usually it is some sort of container, like std::vector containingthe collection of objects to be persistified)The two examples (P01 and P02) provided in examples/extended/persistency demonstrate how toper<strong>for</strong>m object persistency using the Reflex mechanism in ROOT I/O <strong>for</strong> storing hits and geometry description.4.7. Parallel Geometries4.7.1. A parallel worldOccasionally, it is not straight<strong>for</strong>ward to define geometries <strong>for</strong> sensitive detectors, importance geometries or envelopes<strong>for</strong> shower parameterization to be coherently assigned to volumes in the tracking (mass) geometry. Theparallel navigation functionality introduced since release 8.2 of <strong>Geant4</strong>, allows the user to define more than oneworlds simultaneously. The G4Transportation process will see all worlds simultaneously; steps will be limitedby both boundaries of the mass and parallel geometries.In a parallel world, the user can define volumes in arbitrary manner with sensitivity, regions, shower parameterizationsetups, and/or importance weight <strong>for</strong> biasing. Volumes in different worlds can overlap.Here are restrictions to be considered <strong>for</strong> the parallel geometry:• Materials, production thresholds and EM field are used only from the mass geometry. Even if such physicalquantities are defined in a parallel world, they do not affect to the simulation.• Although all worlds will be comprehensively taken care by the G4Transportation process <strong>for</strong> the navigation,each parallel world must have its own process assigned to achieve its purpose. For example: in case theuser defines a sensitive detector to a parallel world, a process dedicated to the parallel world is responsible toinvoke this detector. The G4SteppingManager treats only the detectors in the mass geometry. For this caseof detector sensitivity defined in a parallel world, a G4ParallelWorldScoringProcess process mustbe defined in the physics list (see Section 4.7.3).4.7.2. Defining a parallel worldA parallel world should be defined in the Construct() virtual method of the user's class derived from theabstract base class G4VUserParallelWorld.Example 4.17. An example header file of a concrete user parallel world class.#ifndef MyParallelWorld_h#define MyParallelWorld_h 1#include "globals.hh"#include "G4VUserParallelWorld.hh"class MyParallelWorld : public G4VUserParallelWorld{public:MyParallelWorld(G4String worldName);virtual ~MyParallelWorld();public:virtual void Construct();};#endifA parallel world must have its unique name, which should be set to the G4VUserParallelWorld base classas an argument of the base class constructor.The world physical volume of the parallel world is provided by the G4RunManager as a clone of the massgeometry. In the Construct() virtual method of the user's class, the pointer to this cloned world physicalvolume is available through the GetWorld() method defined in the base class. The user should fill the volumes138

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!