400 likes | 870 Views
Geant4. A simulation toolkit Ge ometry an d t racking 4 th incarnation. Synopsis. Overview Introduction Toolkit Main program Detector construction Physics list Generator Analysis Guiding Geant4 User actions Commands CPU performance Physics performance Some applications
E N D
Geant4 A simulation toolkit Geometry and tracking4th incarnation Geant4 Manchester Seminar
Synopsis • Overview • Introduction • Toolkit • Main program • Detector construction • Physics list • Generator • Analysis • Guiding Geant4 • User actions • Commands • CPU performance • Physics performance • Some applications • Publications • Future • Demonstrations Geant4 Manchester Seminar
Introduction — 1 • Started from two studies done independently at CERN and KEK in 1993 • Became RD44, sponsored by the CERN Detector Research and Development Committee, in 1994 • GEANT3’s Fortran-based technology was limiting development • Mandate: modern (object oriented) techniques • Early decision to use C++ • 100 scientists/engineers, global Geant4 Manchester Seminar
Introduction — 2 • After 4 years R &D, first version December 1998 • Geant4 Collaboration formed January 1999 • Continue development • Provide maintenance • New Collaboration Agreement 2006 • Open software licence • 10 institutes (including PPARC) • 85 members (25 FTEs) • Technical Forum for users (HEP, Space, Medicine, Nuclear Physics,…) Geant4 Manchester Seminar
Toolkit • Make your own application • Open • Extendable • Versatile • Toolkit++ • Huge range of physics • Many geometrical shapes • Many examples • Web-based documentation and code browsing Geant4 Manchester Seminar
Main program int main(int argc,char** argv) { G4RunManager * runManager = new G4RunManager; runManager->SetUserInitialization(new MyDetector); runManager->SetUserInitialization(new MyPhysics); runManager->SetUserAction(new MyGenerator); runManager->Initialize(); runManager->BeamOn(10); delete runManager; return 0; } MyDetector, MyPhysics and MyGenerator are “mandatory” classes, i.e., instances are required by the run manager. The above will track 10 events — but will keep things to itself!!! (See later for how to get information out!!) Geant4 Manchester Seminar
Detector Construction — 1 class MyDetector: public G4VUserDetectorConstruction { public: G4VPhysicalVolume* Construct(); }; G4VPhysicalVolume* MyDetector::Construct() { G4Material* Ar = new G4Material("ArgonGas",18,39.95*g/mole,1.782*mg/cm3); G4Material* Pb = new G4Material("Lead",82,207.19*g/mole,11.35*g/cm3); G4VSolid* world = new G4Box(“World”,10*m,10*m,10*m); G4LogicalVolume* world_log = new G4LogicalVolume(world,Ar,“World”,0,0,0); G4VPhysicalVolume* world_phys = new G4PVPlacement(G4Transform3D(),world_log,“World”,0,false,0); G4VSolid* detector = new G4Box(“Detector”,5*m,5*m,5*m); G4LogicalVolume* det_log = new G4LogicalVolume(detector,Pb,“Detector”,0,0,0); new G4PVPlacement(G4Transform3D(),det_log,“Detector”,world_log,false,0); … return world_phys; } Geant4 Manchester Seminar
Detector construction — 2 • Materials can be built from isotopes • Hierarchy of volumes • Each physical volume, except “world”, has a logical mother • Replicas — repetitive placements • Parametrisations • Size, placement and material have functional dependence on copy number • Boolean solids — union, intersection, subtraction • Sensitive detectors • Volumes that hold an instance of a class with a method that is messaged when a track enters • Magnetic field • Visualisation attributes — visibility, colour, etc. Geant4 Manchester Seminar
Detector construction — 3 • Optical properties • Track optical photons in scintillators, etc. • Parallel worlds • Shower parametrisation • “scoring” (energy deposition, dose, etc.) • “event biasing” (variance reduction, weighting, importance sampling, etc.) Geant4 Manchester Seminar
Physics list — 1 • class MyPhysics: public G4VUserPhysicsList {public: void ConstructParticle(); void ConstructProcess(); void SetCuts();}; • Each particle has a process manager • 100’s of particles pre-defined • Define ions as required • Thus, each particle has a set of many processes • At rest (capture, decay) • Along step (ionisation, bremsstrahlung,…) • Post step (interaction, decay, multiple scattering) • They must be carefully ordered Geant4 Manchester Seminar
Physics list — 2 • Cuts apply to em processes with infra-red divergences • Cut is in range (distance) (different to GEANT3) • Converted internally to energy for each material • Processes have sub-processes for different energy ranges • Many choices of process • Low energy or standard electromagnetic • Many alternative hadronic models • All particles have the transportation process • User responsibility, but “best guess” examples of physics lists are provided (some are 1000’s lines) Geant4 Manchester Seminar
Generator • class MyGenerator: public G4VUserPrimaryGeneratorAction { void GeneratePrimaries(G4Event*);}; • Examples provided • Particle gun • Event generator, e.g., phythia • Read from file • General particle source, command (script) driven • Can specify decay point and decay channel Geant4 Manchester Seminar
Analysis • Information available • At each step (UserSteppingAction) (not advised) • Your sensitive detector • Scorer • Create hits (and digis) • View, pick, write to file • Graph, histogram • AIDA interface to HBOOK, OpenScientist, JAS,… Geant4 Manchester Seminar
Guiding Geant4 • User actions (callbacks) • Commands (scripts) • Python interface Geant4 Manchester Seminar
User actions • User actions (callbacks) • G4UserRunAction: begin and end of run • G4UserEventAction: begin and end of event • G4UserStackingAction: track-stacking selection • G4UserTrackingAction: before or after each track • G4UserSteppingAction: actions for each step • Declare instances to the run manager, e.g: • runManager->SetUserAction(new MyTrackingAction);where MyTrackingAction is a sub-class of G4UserTrackingAction implementing methods Pre or PostUserTrackingAction, e.g., to abort the event if some condition prevails Geant4 Manchester Seminar
Stacking action • Distinctive and key feature of Geant4 • Used to control the order of tracking • Pick out tracks potentially important for a trigger, e.g., muons, for early tracking • Abort event early if will not trigger • avoid unnecessary em showering • huge time saving • Postpone tracks to next event (event pile-up) Geant4 Manchester Seminar
Commands • Instantiate a session (in main program) • session = new G4UIterminal();session->SessionStart();delete session; • Motif window and tcsh terminal also available • GAG (Geant4 Adaptive GUI) (Java based) • Typically, command line or script replaces C++ code • /run/initialize/run/beamOn 10 • Large number of commands available Geant4 Manchester Seminar
Visualisation • G4VisManager* visManager = new G4VisExecutive;visManager->initialise();…delete visManager; • Interface to multifarious graphics systems • OpenGL • OpenInventor • DAWN • HepRep • Ray Tracer (uses Geant4’s own tracking) • Command driven • Brilliant!!! Geant4 Manchester Seminar
CPU performance • About same as GEANT3 under comparable circumstances • Many more optimisation tools • Geometry “voxelisation” • Track stacking and event abort mechanisms • Parallel geometries for event biasing and hit scoring Geant4 Manchester Seminar
Physics performance • Under continual review • Good em physics • 1 keV - 100 TeV (standard) • 250 eV - 100 GeV (low energy) with large database of atomic levels • Hadronic physics: 21 models! • CHIPS, Bertini, parameter-driven,… • Large database of nuclear levels • Physics reference manual Geant4 Manchester Seminar
Some applications • Space • Medicine • Particle physics • … • See recent workshop, Lisbon 2006 • See timetable and presentations therein Geant4 Manchester Seminar
5º 5º Mars surface simulation GEANT4 and set-up Geant4 Manchester Seminar
Particle Therapy Geant4 Manchester Seminar
Proton therapy doses Geant4 Manchester Seminar
Pierre Auger Fluorescence Detector Geant4 Manchester Seminar
Publications • Geant4 — a simulation toolkit, Nuclear Instruments and Methods in Physics ResearchA 506 (2003) 250-303 • Geant4 Development and Applications, IEEE Transactions on Nuclear Science53 No. 1 (2006) 270-278. • Numerous specialist papers • See web page, geant4.cern.ch Geant4 Manchester Seminar
Summary • Open, extendable toolkit • Excellent physics processes • Still being developed and refined • Compare well with other codes • Wealth of geometrical shapes • Versatile user actions and commands • Many examples provided Geant4 Manchester Seminar
Future • Paper on the Visualisation System • Article in Nuclear Physics News • The 12th Geant4 Workshop, 13th-19th September 2007, organised by us, held at Hebden House Conference Centre, Hebden Bridge • Possibility of Special Interest Group meetings here (in Manchester) or Hebden Bridge. • Join us Geant4 Manchester Seminar
Demonstrations • N02: Target + chambers + field • N04: Pythia event, muon trigger • N03 with QGSP: Pb-LiqAr calorimeter • Making a movie • Sections and cutaways • Display by time Geant4 Manchester Seminar