Basic Examples¶
Basic Examples Summary¶
Descriptions of the 5 basic examples are provided here along with links to source code documentation automatically generated with Doxygen.
Example B1 (see also Doxygen page)
Simple geometry with a few solids
Geometry with simple placements (
G4PVPlacement)Scoring total dose in a selected volume in user action classes
Using
G4AccValuefor automatic merging of scored values in multi-threading modeGeant4 physics list (QBBC)
Example B2 (see also Doxygen page)
Simplified tracker geometry with uniform magnetic field
Geometry with simple placements (
G4PVPlacement) and parameterisation (G4PVParameterisation)Scoring within tracker via G4 sensitive detector and hits
Geant4 physics list (FTFP_BERT) with step limiter
Started from novice N02 example
Example B3 (see also Doxygen page)
Schematic Positron Emission Tomography system
Geometry with simple placements with rotation (
G4PVPlacement)Radioactive source
Scoring within Crystals via G4 scorers plus via user actions (a), via user own Run object (b)
Using
G4AccValuefor automatic merging of scored values in multi-threading mode (a) andG4StatAnalysisfor accumulating statistics (b)Modular physics list built via builders provided in Geant4
Example B4 (see also Doxygen page)
Simplified calorimeter with layers of two materials
Geometry with replica (
G4PVReplica)Scoring within layers in four ways: via user actions (a), via user own Run object (b), via G4 sensitive detector and hits (c) and via scorers (d)
Geant4 physics list (FTFP_BERT)
Saving histograms and ntuple in a file using Geant4 analysis tools
UI commands defined using
G4GenericMessengerStarted from novice/N03 example
Example B5 (see also Doxygen page)
A double-arm spectrometer with wire chambers, hodoscopes and calorimeters with a local constant magnetic field
Geometry with placements with rotation, replicas and parameterisation
Scoring within wire chambers, hodoscopes and calorimeters via G4 sensitive detector and hits
Geant4 physics list (FTFP_BERT) with step limiter
UI commands defined using
G4GenericMessengerSaving histograms and ntuple in two files using Geant4 analysis tools
Plotting of histograms with visualization drivers
Started from extended/analysis/A01
The next three tables display the “item charts” for the examples currently prepared in the basic level. (Table 25, Table 26, and Table 27.)
Example B1 |
Example B2 |
|
Description |
Simple application for accounting dose in a selected volume |
Fixed target tracker geometry |
Geometry |
|
|
Physics |
Geant4 physics list: QBBC |
Geant4 physics list: FTFP_BERT |
Primary generator |
Particle gun |
Particle gun |
Scoring |
User action classes |
Sensitive detector & hits |
Vis/GUI |
Detector & trajectory drawing |
|
Stacking |
||
Analysis |
Example B3 |
Example B4 |
|
Description |
Schematic Positron Emitted Tomography system |
Simplified calorimeter with layers of two materials |
Geometry |
|
|
Physics |
Modular physics list with Geant4 builders |
Geant4 physics list: FTFP_BERT |
Primary generator |
Radioactive source (particle gun with Fluor ions) |
Particle gun |
Scoring |
Multi functional (sensitive) detector & scorers and
|
|
Vis/GUI |
Detector, trajectory & hits drawing |
|
Stacking |
Killing all neutrina |
|
Analysis |
Histograms 1D, ntuple |
Example B5 |
|
Description |
Double-arm spectrometer with several detectors and a local constant magnetic field |
Geometry |
|
Physics |
Geant4 physics list: FTFP_BERT |
Primary generator |
Particle gun |
Scoring |
Sensitive detectors & hits |
Vis/GUI |
|
Stacking |
|
Analysis |
|
Basic Examples Macros¶
All basic examples can be run either interactively or in a batch mode (see section How to Define the main() Program and How to Execute a Program) and they are provided with the following set of macros:
init_vis.macvis.mac[gui.mac][plotter.mac]run1.mac,run2.macexampleBN.in
The selection is done automatically according to the application build configuration.
The init_vis.mac macro is always executed just after the Geant4
kernel and user application classes instantiation. It sets first some
defaults, then performs Geant4 kernel initialization and finally calls
the vis.mac macro with visualization setting.
The vis.mac macros in each of the examples all have the same
structure - except for example B1, see below. There are only a few lines
in each example with a setting different from the other examples and so
they can be easily spotted when looking in the macro. Various commands
are proposed in commented blocks of lines with explanations so that a
user can just uncomment lines and observe the effect. Additionally, in
example B4, there are some visualization tutorial macros in
macros/visTutor/. See more on visualization in section
How to Visualize the Detector and Events and chapter Visualization.
From Release 9.6 the vis.mac macro in example B1 has additional
commands that demonstrate additional functionality of the vis system,
such as displaying text, axes, scales, date, logo and shows how to
change viewpoint and style. Consider copying these to your favourite
example or application. To see even more commands use help or ls
or browse the available UI commands in section
Built-in Commands.
The gui.mac macros are provided in examples B2, B4 and B5. This macro is
automatically executed if Geant4 is built with any GUI session. See more
on graphical user interfaces in section How to Set Up an Interactive Session.
When running interactively, the example program stops after processing
the init_vis.mac macro and the Geant4 kernel initialization, invoked
from the macro, with the prompt Idle>. At this stage users can type
in the commands from run1.mac line by line (recommended when running
the example for the first time) or execute all commands at once using
the "/control/execute run1.mac" command.
The run2.mac macros define conditions for execution a run with a
larger number of events and so they are recommended to be executed in a
batch. The exampleBN.in macros are also supposed to be run in a
batch mode and their outputs from the Geant4 system testing are
available in the files exampleBN.out.
The plotter.mac macro is provided in example B5. This macro shows
how to use the plotting coming with some of the visualization drivers
(for example the ToolsSG ones) to see histograms. This macro can be run
interactively, after example start at the prompt Idle>,
using the "/control/execute plotter.mac" command, the content of the
histograms is then displayed at the end of each run.
Multi-threading¶
Multi-threading mode¶
All basic examples have been migrated to multi-threading (MT). No special steps are needed to build the examples in multi-threading mode. They will automatically run in MT when they are built against the Geant4 libraries built with MT mode activated, otherwise they will run in sequential mode.
The choice of multi-threading mode is handled automatically by the use
of G4RunManagerFactory in the example main():
#include "G4RunManagerFactory.hh"
// ...
auto* runManager = G4RunManagerFactory::Create();
The concrete type of runManager will be G4MTRunManager when
the Geant4 install used supports multithreading, or G4RunManager` otherwise.
Action Initialization class [B1, B2, B3, B4, B5]¶
The Bn::ActionInitialization class derived from
G4VUserActionInitialization, present in all basic examples,
instantiates and registers all user action classes with the Geant4
kernel.
While in sequential mode the action classes are instantiated just once,
via invocation of the method BnActionInitialization::Build(). In
multi-threading mode the same method is invoked for each worker thread,
so all user action classes are defined thread-locally.
A run action class is instantiated both thread-locally and globally;
that is why its instance is created also in the method
Bn::ActionInitialization::BuildForMaster(), which is invoked only in
multi-threading mode.
Example B1¶
See also Doxygen page
Basic concept:
This example demonstrates a simple (medical) application within which users will familiarize themselves with simple placement, use the NIST material database, and can utilize electromagnetic and/or hadronic physics processes. Two items of information are collected in this example: the energy deposited and the total dose for a selected volume.
This example uses the Geant4 physics list QBBC, which is instantiated in the main() function. It requires data files for electromagnetic and hadronic processes. See more on installation of the datasets in Geant4 Installation Guide - Geant4 Build Options. The following datasets: G4LEDATA, G4LEVELGAMMADATA, G4NEUTRONXSDATA, G4SAIDXSDATA and G4ENSDFSTATEDATA are mandatory for this example.
Namespace:
Since Geant4 version 11 all example classes are defined in namespace B1.
Classes:
B1::DetectorConstructionThe geometry is constructed in the
B1::DetectorConstructionclass. The setup consists of a box shaped envelope containing two volumes: a circular cone and a trapezoid.Some common materials from medical applications are used. The envelope is made of water and the two inner volumes are made from tissue and bone materials. These materials are created using the
G4NistManagerclass, which allows one to build a material from the NIST database using their names. Available materials and their compositions can be found in the Appendix Material Database.The physical volumes are made from Constructive Solid Geometry (CSG) solids and placed without rotation using the
G4PVPlacementclass.B1::PrimaryGeneratorActionThe default kinematics is a 6 MeV gamma, randomly distributed in front of the envelope across 80% of the transverse (X,Y) plane. This default setting can be changed via the commands of the
G4ParticleGunclass.B1::SteppingActionIt is in the
UserSteppingAction()function that the energy deposition is collected for a selected volume.B1::EventActionThe statistical event by event accumulation of energy deposition. At the end of event, the accumulated values are passed in
B1::RunActionand summed over the whole run.B1::RunActionSums the event energy depositions. In multi-threading mode the energy deposition accumulated in
G4AccValueobjects per worker is merged to the master. Information about the primary particle is printed in this class along with the computation of the dose. An example of creating and computing new units (e.g., dose) is also shown in the class constructor.G4AccValue<G4double>type instead ofG4doubleis used for theB1::RunActiondata members in order to facilitate merging of the values accumulated on workers to the master. At present the accumulables have to be registered toG4AccumulableManagerandG4ParametersManager::Merge()has to be called from the users code.
Example B2¶
See also Doxygen page
This example simulates a simplified fixed target experiment. To demonstrate alternative ways of constructing the geometry two variants are provided: B2a (explicit construction) and B2b (parametrized volumes).
The set of available particles and their physics processes are defined in the FTFP_BERT physics list. This Geant4 physics list is instantiated in the main() function. It requires data files for electromagnetic and hadronic processes. See more on installation of the datasets in |Geant4| Installation Guide. The following datasets: G4LEDATA, G4LEVELGAMMADATA, G4NEUTRONXSDATA, G4SAIDXSDATA and G4ENSDFSTATEDATA are mandatory for this example.
This example also illustrates how to introduce tracking constraints like
maximum step length via G4StepLimiter, and minimum kinetic energy,
etc., via the G4UserSpecialCuts processes. This is accomplished by
adding G4StepLimiterPhysics to the physics list.
Namespaces:
Since Geant4 version 11 the example classes are defined in namespaces B2, B2a and B2b
Classes:
B2[a, b]::DetectorConstructionThe setup consists of a target followed by six chambers of increasing transverse size at defined distances from the target. These chambers are located in a region called the Tracker region. Their shape are cylinders constructed as simple cylinders (in
B2a::DetectorConstruction) and as parametrised volumes (inB2b::DetectorConstruction) - see also B2b::ChamberParameterisation class.In addition, a global uniform transverse magnetic field can be applied using
G4GlobalMagFieldMessenger, instantiated inConstructSDandField()with a non zero field value, or via an interactive command. An instance of theB2::TrackerSDclass is created and associated with each logical chamber volume (in B2a) and with the oneG4LogicalVolumeassociated withG4PVParameterised(in B2b).One can change the materials of the target and the chambers interactively via the commands defined in
B2a::DetectorMessenger(orB2b::DetectorMessenger).This example also illustrates how to introduce tracking constraints like maximum step length, minimum kinetic energy etc. via the
G4UserLimitsclass and associatedG4StepLimiterandG4UserSpecialCutsprocesses. The maximum step limit in the tracker region can be set by the interactive command defined inB2a::DetectorMessenger(orB2b::DetectorMessenger).B2::PrimaryGeneratorActionThe primary generator action class employs the
G4ParticleGun. The primary kinematics consists of a single particle which hits the target perpendicular to the entrance face. The type of the particle and its energy can be changed via the G4 built-in commands of theG4ParticleGunclass.B2::EventActionThe event number is written to the log file every requested number of events in
BeginOfEventAction()andEndOfEventAction(). Moreover, for the first 100 events and every 100 events thereafter information about the number of stored trajectories in the event is printed as well as the number of hits stored in theG4VHitsCollection.B2::RunActionThe run number is printed at
BeginOfRunAction(), where theG4RunManageris also informed how toSetRandomNumberStorefor storing initial random number seeds per run or per event.B2::TrackerHitThe tracker hit class is derived from
G4VHit. In this example, a tracker hit is a step by step record of the track identifier, the chamber number, the total energy deposit in this step, and the position of the energy deposit.B2::TrackerSDThe tracker sensitive detector class is derived from
G4VSensitiveDetector. InProcessHits()- called from the Geant4 kernel at each step - it creates one hit in the selected volume so long as energy is deposited in the medium during that step. This hit is inserted in a HitsCollection. The HitsCollection is printed at the end of each event (via the methodB2::TrackerSD::EndOfEvent()), under the control of the “/hits/verbose 2” command.
Example B3¶
See also Doxygen page
This example simulates a Schematic Positron Emission Tomography system.
To demonstrate alternative ways of accumulation event statistics in a
run two variants are provided: B3a (using the G4AccValue class)
and B3b (using the G4Run class).
Namespaces:
Since Geant4 version 11 the example classes are defined in namespaces B3, B3a and B3b
Classes:
B3::DetectorConstructionCrystals are circularly arranged to form a ring. A number rings make up the full detector (gamma camera). This is done by positioning Crystals in Ring with an appropriate rotation matrix. Several copies of Ring are then placed in the full detector.
The Crystal material, Lu2SiO5, is not included in the G4Nist database. Therefore, it is explicitly built in
DefineMaterials().Crystals are defined as scorers in
DetectorConstruction::CreateScorers(). There are two G4MultiFunctionalDetector objects: one for the Crystal (EnergyDeposit), and one for the Patient (DoseDeposit).B3::PhysicsListThe physics list contains standard electromagnetic processes and the radioactiveDecay module for GenericIon. It is defined in the
B3::PhysicsListclass as a Geant4 modular physics list with registered Geant4 physics builders:G4DecayPhysicsG4RadioactiveDecayPhysicsG4EmStandardPhysics
B3::PrimaryGeneratorActionThe default particle beam is an ion (F18), at rest, randomly distributed within a zone inside a patient and is defined in
GeneratePrimaries().B3a::EventAction,B3a::RunActionEnergy deposited in crystals is summed by
G4Scorer.The scorers hits are saved in form of ntuples in a Root file using Geant4 analysis tools. This feature is activated in the main () function with instantiating G4TScoreNtupleWriter.
At the end of event, the values accumulated in
B3aEventActionare passed inB3a::RunActionand summed over the whole run. In multi-threading mode the data accumulated inG4AccValueobjects per workers is merged to the master inB3a::RunAction::EndOfRunAction()and the final result is printed on the screen.G4AccValue<>type instead ofG4doubleandG4inttypes is used for theB3a::RunActiondata members in order to facilitate merging of the values accumulated on workers to the master. At present the accumulables have to be registered toG4AccumulableManagerandG4AccumulableManager::Merge()has to be called from the users code. This is planned to be further simplified with a closer integration ofG4AccValueclasses in the Geant4 kernel next year.B3b::Run,B3b::RunActionEnergy deposited in crystals is summed by
G4Scorer.B3b::Run::RecordEvent()collects information event by event from the hits collections, and accumulates statistics forB3b::RunAction::EndOfRunAction(). In multi-threading mode the statistics accumulated per worker is merged to the master inRun::Merge().In addition, results for dose are accumulated in a standard floating-point summation and using a lightweight statistical class called
G4StatAnalysis. TheG4StatAnalysisclass records four values: (1) the sum, (2) sum^2, (3) number of entries, and (4) the number of entries less than mean * machine-epsilon (the machine epsilon is the difference between 1.0 and the next value representable by the floating-point type). From these 4 values,G4StatAnalysisprovides the mean, FOM, relative error, standard deviation, variance, coefficient of variation, efficiency, r2int, and r2eff.B3::StackingActionBeta decay of Fluorine generates a neutrino. One wishes not to track this neutrino; therefore one kills it immediately, before created particles are put in a stack.
Example B4¶
See also Doxygen page
This example simulates a simple Sampling Calorimeter setup. To demonstrate several possible ways of data scoring, the example is provided in four variants: B4a, B4b, B4c, B4d. (See also examples/extended/electromagnetic/TestEm3).
The set of available particles and their physics processes are defined in the FTFP_BERT physics list. This Geant4 physics list is instantiated in the main() function. It requires data files for electromagnetic and hadronic processes. See more on installation of the datasets in |Geant4| Installation Guide. The following datasets: G4LEDATA, G4LEVELGAMMADATA, G4NEUTRONXSDATA, G4SAIDXSDATA and G4ENSDFSTATEDATA are mandatory for this example.
Namespaces:
Since Geant4 version 11 the example classes are defined in namespaces B4, B4a, B4b, B4c and B4d
Classes:
B4[c, d]::DetectorConstructionThe calorimeter is a box made of a given number of layers. A layer consists of an absorber plate and of a detection gap. The layer is replicated. In addition a transverse uniform magnetic field can be applied using
G4GlobalMagFieldMessenger, instantiated inConstructSDandField()with a non zero field value, or via interactive commands.B4::PrimaryGeneratorActionThe primary generator action class uses
G4ParticleGun. It defines a single particle which hits the calorimeter perpendicular to the input face. The type of the particle can be changed via the G4 built-in commands of theG4ParticleGunclass.B4::RunActionIt accumulates statistics and computes dispersion of the energy deposit and track lengths of charged particles with the aid of analysis tools. H1D histograms are created in
BeginOfRunAction()for the energy deposit and track length in both Absorber and Gap volumes. The same values are also saved in an ntuple. The histograms and ntuple are saved in the output file in a format according to a selected file extension. InEndOfRunAction(), the accumulated statistics and computed dispersion are printed. When running in multi-threading mode, the histograms accumulated on threads are automatically merged in a single output file, while the ntuple is written in files per thread.
Classes in B4a (scoring via user actions):
B4a::SteppingActionIn
UserSteppingAction()the energy deposit and track lengths of charged particles in each step in the Absorber and Gap layers are collected and subsequently recorded inB4a::EventAction.B4a::EventActionIt defines data members to hold the energy deposit and track lengths of charged particles in the Absorber and Gap layers. In
EndOfEventAction(), these quantities are printed and filled in H1D histograms and ntuple to accumulate statistic and compute dispersion.
Classes in B4b (via user own object):
B4b::RunDataA data class, derived from
G4Run, which defines data members to hold the energy deposit and track lengths of charged particles in the Absorber and Gap layers. It is instantiated inB4b::RunAction::GenerateRun. The data are collected step by step inB4b::SteppingAction, and the accumulated values are entered in histograms and an ntuple event by event inB4b::EventAction.B4b::SteppingActionIn
UserSteppingAction()the energy deposit and track lengths of charged particles in Absorber and Gap layers are collected and subsequently recorded inB4b::RunData.B4b::EventActionIn
EndOfEventAction(), the accumulated quantities of the energy deposit and track lengths of charged particles in Absorber and Gap layers are printed and then stored inB4b::RunData.
Classes in B4c (via |Geant4| sensitive detector and hits):
B4c::DetectorConstructionIn addition to materials, volumes and uniform magnetic field definitions as in
B4DetectorConstruction, inConstructSDandField()two instances of theB4c::CalorimeterSDclass are created and associated with Absorber and Gap volumes.B4c::CalorHitThe calorimeter hit class is derived from
G4VHit. It defines data members to store the energy deposit and track lengths of charged particles in a selected volume.B4c::CalorimeterSDThe calorimeter sensitive detector class is derived from
G4VSensitiveDetector. Two instances of this class are created inB4c::DetectorConstructionand associated with Absorber and Gap volumes. InInitialize(), it creates one hit for each calorimeter layer and one more hit for accounting the total quantities in all layers. The values are accounted in hits in theProcessHits()function, which is called by the Geant4 kernel at each step.B4c::EventActionIn
EndOfEventAction(), the accumulated quantities of the energy deposit and track lengths of charged particles in Absorber and Gap layers are printed and then stored in the hits collections.
Classes in B4d (via |Geant4| scorers):
B4d::DetectorConstructionIn addition to materials, volumes and uniform magnetic field definitions as in
B4DetectorConstruction, inConstructSDandField()sensitive detectors ofG4MultiFunctionalDetectortype with primitive scorers are created and associated with Absorber and Gap volumes.B4d::EventActionEnergy deposited in crystals is summed by
G4Scorer.The scorers hits are saved in form of ntuples in a Root file using Geant4 analysis tools. This feature is activated in the main () function with instantiating G4TScoreNtupleWriter.
In
EndOfEventAction(), the accumulated quantities of the energy deposit and track lengths of charged particles in Absorber and Gap layers are printed and then stored in the hits collections.
Example B5¶
See also Doxygen page
This example simulates a double-arm spectrometer with wire chambers, hodoscopes and calorimeters with a uniform local magnetic field.
The set of available particles and their physics processes are defined in the FTFP_BERT physics list. This Geant4 physics list is instantiated in the main() function. It requires data files for electromagnetic and hadronic processes. See more on installation of the datasets in |Geant4| Installation Guide. The following datasets: G4LEDATA, G4LEVELGAMMADATA, G4NEUTRONXSDATA, G4SAIDXSDATA and G4ENSDFSTATEDATA are mandatory for this example.
This example also illustrates how to introduce tracking constraints like
maximum step length via G4StepLimiter, and minimum kinetic energy,
etc., via the G4UserSpecialCuts processes. This is accomplished by
adding G4StepLimiterPhysics to the physics list.
Namespace:
Since Geant4 version 11 all example classes are defined in namespace B5.
Classes:
B5::DetectorConstructionThe spectrometer consists of two detector arms. One arm provides position and timing information of the incident particle while the other collects position, timing and energy information of the particle after it has been deflected by a magnetic field centered at the spectrometer pivot point.
First arm: box filled with air, also containing:
1 hodoscope (15 vertical strips of plastic scintillator)
1 drift chamber (horizontal argon gas layers with a “virtual wire” at the center of each layer)
Second arm: box filled with air, also containing:
1 hodoscope (25 vertical strips of plastic scintillator)
1 drift chamber (5 horizontal argon gas layers with a “virtual wire” at the center of each layer)
1 electromagnetic calorimeter: a box sub-divided along x,y and z axes into cells of CsI (see also B5::CellParameterisation class)
1 hadronic calorimeter: a box sub-divided along x,y, and z axes into cells of lead, with a layer of plastic scintillator placed at the center of each cell
The magnetic field region is represented by an air-filled cylinder which contains the field (see B5::MagneticField.). The maximum step limit in the magnetic field region is also set via the G4UserLimits class in a similar way as in Example B2.
The rotation angle of the second arm and the magnetic field value can be set via the interactive command defined using the
G4GenericMessengerclass.B5::PrimaryGeneratorActionThe primary generator action class employs the G4ParticleGun. The primary kinematics consists of a single particle which is is sent in the direction of the first spectrometer arm.
The type of the particle and its several properties can be changed via the Geant4 built-in commands of the
G4ParticleGunclass or this example command defined using theG4GenericMessengerclass.B5::EventActionAn event consists of the generation of a single particle which is transported through the first spectrometer arm. Here, a scintillator hodoscope records the reference time of the particle before it passes through a drift chamber where the particle position is measured. Momentum analysis is performed as the particle passes through a magnetic field at the spectrometer pivot and then into the second spectrometer arm. In the second arm, the particle passes through another hodoscope and drift chamber before interacting in the electromagnetic calorimeter. Here it is likely that particles will induce electromagnetic showers. The shower energy is recorded in a three-dimensional array of CsI crystals. Secondary particles from the shower, as well as primary particles which do not interact in the CsI crystals, pass into the hadronic calorimeter. Here, the remaining energy is collected in a three-dimensional array of scintillator-lead sandwiches.
In first execution of
BeginOfEventAction()the hits collections identifiers are saved in data members of the class and then used inEndOfEventAction()for accessing the hists collections and filling the accounted information in defined histograms and ntuples and printing its summary in a log file. The frequency of printing can be tuned with the built-in command"/run/printProgress frequency".B5::RunActionThe run action class handles the histograms and ntuples with the aid of Geant4 analysis tools in a similar way as in Example B4. From Release 10.2 the vectors of energy deposits in Electromagnetic and Hadronic calorimeter cells are also stored in the ntuple. In difference from example B4,
G4GenericAnalysisManageris used to demonstrate saving histograms and ntuple in two separate files.- Hit and Sensitive Detector Classes
All the information required to simulate and analyze an event is recorded in hits. This information is recorded in the following sensitive detectors:
Hodoscope (
B5::HodoscopeSD,B5::HodoscopeHit)particle time
strip ID, position and rotation
Drift chamber: (
B5::DriftChamberSD,B5::DriftChamberHit)particle time
particle position
layer ID
Electromagnetic calorimeter: (
B5::EmCalorimeterSD,B5::EmCalorimeterHit)energy deposited in cell
cell ID, position and rotation
Hadronic calorimeter: (
B5::HadCalorimeterSD,B5::HadCalorimeterHit)energy deposited in cell
cell column ID and row ID, position and rotation
The hit classes include methods
GetAttDefsandCreateAttValuesto define and then fill extra “HepRep-style” Attributes that the visualization system can use to present extra information about the hits. For example, if you pick aB5::HadCalorimeterHitin OpenGL or a HepRep viewer, you will be shown the hit’s “Hit Type”, “Column ID”, “Row ID”, “Energy Deposited” and “Position”.These attributes are essentially arbitrary extra pieces of information (integers, doubles or strings) that are carried through the visualization. Each attribute is defined once in
G4AttDefobject and then is filled for each hit in aG4AttValueobject. These attributes can also be used by commands to filter which hits are drawn:"/vis/filtering/hits/drawByAttribute".Detector Geometry and trajectories also carry HepRep-style attributes, but these are filled automatically in the base classes. HepRep is further described at: http://www.slac.stanford.edu/~perl/heprep/