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.

Getting Started with <strong>Geant4</strong>- Running a Simple ExampleAn exception exists to the rule that a physical volume must be placed inside a mother volume. That exception is<strong>for</strong> the World volume, which is the largest volume created, and which contains all other volumes. This volumeobviously cannot be contained in any other. Instead, it must be created as a G4PVPlacement with a null motherpointer. It also must be unrotated, and it must be placed at the origin of the global coordinate system.Generally, it is best to choose a simple solid as the World volume, and in Example N01, we use the experimentalhall:Example 2.6. The World volume from Example N01.G4VPhysicalVolume* experimentalHall_phys= new G4PVPlacement(0, // no rotationG4ThreeVector(0.,0.,0.), // translation positionexperimentalHall_log, // its logical volume"expHall",// its name0, // its mother volumefalse,// no boolean operations0); // its copy number2.2.7. Coordinate Systems and RotationsIn <strong>Geant4</strong>, the rotation matrix associated to a placed physical volume represents the rotation of the referencesystem of this volume with respect to its mother.A rotation matrix is normally constructed as in CLHEP, by instantiating the identity matrix and then applying arotation to it. This is also demonstrated in Example N04.2.3. How to Specify Materials in the Detector2.3.1. General ConsiderationsIn nature, general materials (chemical compounds, mixtures) are made of elements, and elements are made ofisotopes. There<strong>for</strong>e, these are the three main classes designed in <strong>Geant4</strong>. Each of these classes has a table as astatic data member, which is <strong>for</strong> keeping track of the instances created of the respective classes.The G4Element class describes the properties of the atoms:• atomic number,• number of nucleons,• atomic mass,• shell energy,• as well as quantities such as cross sections per atom, etc.The G4Material class describes the macroscopic properties of matter:• density,• state,• temperature,• pressure,• as well as macroscopic quantities like radiation length, mean free path, dE/dx, etc.The G4Material class is the one which is visible to the rest of the toolkit, and is used by the tracking, the geometry,and the physics. It contains all the in<strong>for</strong>mation relative to the eventual elements and isotopes of which it is made,at the same time hiding the implementation details.2.3.2. Define a Simple MaterialIn the example below, liquid argon is created, by specifying its name, density, mass per mole, and atomic number.8

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

Saved successfully!

Ooh no, something went wrong!