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.

Tracking and PhysicsExample 5.10. Setting production cuts to a regionvoid MyPhysicsList::SetCuts(){// default production thresholds <strong>for</strong> the world volumeSetCutsWithDefault();// Production thresholds <strong>for</strong> detector regionsG4Region* region;G4String regName;G4ProductionCuts* cuts;regName = "tracker";region = G4RegionStore::GetInstance()->GetRegion(regName);cuts = new G4ProductionCuts;cuts->SetProductionCut(0.01*mm); // same cuts <strong>for</strong> gamma, e- and e+region->SetProductionCuts(cuts);regName = "calorimeter";region = G4RegionStore::GetInstance()->GetRegion(regName);cuts = new G4ProductionCuts;cuts->SetProductionCut(0.01*mm,G4ProductionCuts::GetIndex("gamma"));cuts->SetProductionCut(0.1*mm,G4ProductionCuts::GetIndex("e-"));cuts->SetProductionCut(0.1*mm,G4ProductionCuts::GetIndex("e+"));region->SetProductionCuts(cuts);}5.6. Physics Table5.6.1. General ConceptsIn <strong>Geant4</strong>, physics processes use many tables of cross sections, energy losses and other physics values. Be<strong>for</strong>e theexecution of an event loop, the BuildPhysicsTable() method of G4VProcess is invoked <strong>for</strong> all processesand as a part of initialisation procedure cross section tables are prepared. Energy loss processes calculate crosssection and/or energy loss values <strong>for</strong> each material and <strong>for</strong> each production cut value assigned to each material.A change in production cut values there<strong>for</strong>e require these cross sections to be re-calculated. Cross sections <strong>for</strong>hadronic processes and gamma processes do not depend on the production cut.The G4PhysicsTable class is used to handle cross section tables. G4PhysicsTable is a collection of instances ofG4PhysicsVector (and derived classes), each of which has cross section values <strong>for</strong> a particle within a given energyrange traveling in a material. By default the linear interpolation is used, alternatively spline may be used if the flagof spline is activated by SetSpline method of the G4PhysicsVector5.6.2. Material-Cuts CoupleUsers can assign different production cuts to different regions (see Section 5.5). This means that if the samematerial is used in regions with different cut values, the processes need to prepare several different cross sections<strong>for</strong> that material.The G4ProductionCutsTable has G4MaterialCutsCouple objects, each of which consists of a material pairedwith a cut value. These G4MaterialCutsCouples are numbered with an index which is the same as the indexof a G4PhysicsVector <strong>for</strong> the corresponding G4MaterialCutsCouplein the G4PhysicsTable. The list of Material-CutsCouples used in the current geometry setup is updated be<strong>for</strong>e starting the event loop in each run.5.6.3. File I/O <strong>for</strong> the Physics TableCalculated physics tables <strong>for</strong> electromagnetic processes can be stored in files. The user may thus eliminate thetime required <strong>for</strong> the calculation of physics tables by retrieving them from the files.Using the built-in user command "storePhysicsTable" (see Section 7.1), stores physics tables in files. In<strong>for</strong>mationon materials and cuts defined in the current geometry setup are stored together with physics tables becausecalculated values in the physics tables depend on MaterialCutsCouple. Note that physics tables are calculated187

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

Saved successfully!

Ooh no, something went wrong!