Presentation is loading. Please wait.

Presentation is loading. Please wait.

G4beamline Introduction and New Features A “Swiss Army Knife” for Geant4. Tom Roberts Muons, Inc. Januaary 23, 2014 TJRG4beamline1.

Similar presentations


Presentation on theme: "G4beamline Introduction and New Features A “Swiss Army Knife” for Geant4. Tom Roberts Muons, Inc. Januaary 23, 2014 TJRG4beamline1."— Presentation transcript:

1 G4beamline Introduction and New Features A “Swiss Army Knife” for Geant4. http://g4beamline.muonsinc.com Tom Roberts Muons, Inc. Januaary 23, 2014 TJRG4beamline1

2 Introduction G4beamline is a general, flexible, and extensible program for Geant4 simulations, optimized for beamlines. The emphasis is on being able to perform a realistic simulation, with a flexible and user-friendly interface. In practice, it is much more general than just beamlines (e.g. there is a cosmic-ray “beam”). It is based on Geant4, a modern HEP toolkit that implements much of what is known about particle interactions. Requires no programming by users. Includes collective effects such as space charge (infinite boundary conditions). Includes support for scripting, parallel jobs on a cluster, and MPI jobs on a workstation or supercomputer. G4beamline is open source, and freely available. Januaary 23, 2014 TJRG4beamline2

3 Using the Program The basic idea is to define each beamline element, and then place each one into the beamline at the appropriate place(s) All aspects of the simulation are specified in a single ASCII input file: –Element definitions –Geometry (placements of elements; includes E&M fields) –Input Beam –Physics processes –Program control parameters –Generation of output NTuples ‘include’ commands can be used to split the input file into sections The input file is a sequence of commands with named arguments Each command has its own list of arguments Command and argument names are spelled out, so the input file becomes a record of the simulation that is readable by others Help is easily available for each command Januaary 23, 2014 TJRG4beamline3

4 Using the Program Complex manual procedures have been automated: –The granularity of field maps can be automatically determined by specifying the required accuracy –RF Cavities can be tuned, for timing and gradient; both can be fixed or automatically tuned –Bending magnet fields can be tuned Geometry layout has been greatly simplified –Beam elements are simply lined up along the Z axis, using centerline coordinates –Centerline coordinates behave naturally for bending magnets –Elements may overlap (e.g. nested pipes), but not intersect –Many elements can be the parent of other elements – hierarchical geometry –Offsets and rotations are specified naturally –Automatic geometry testing detects invalid intersections All of the Geant4 9.6 physics lists are available by name Initial beam tracks can be generated internally, or read from a file Most Geant4 visualization drivers are supported by name –Open Inventor is included, and is by far the most user friendly Januaary 23, 2014 TJRG4beamline4

5 Using the Program The result is a program that reduces the complexity of the user input to that of the system being simulated –A major drawback of any simulation program, especially those using Geant4, is that C++ simulation code is considerably more complex than the problem. While C++ programming is not required to use the program, knowledge of the problem domain is absolutely required, as is enough experience to distinguish sensible results from nonsense. Visualization is highly recommended, to verify that the geometry is correct and makes sense. In some ways, a G4beamline simulation is more like a real experiment than any beam-optics code: –Materials must be specified –Magnets and RF cavities must be tuned –Shielding must be used to avoid unwanted backgrounds –You will see lots of delta-rays (etc.) Januaary 23, 2014 TJRG4beamline5

6 Beamline Elements absorber boolean box coil cylinder extrusion fieldexpr fieldmap genericbend genericquad helicaldipole helicalharmonic idealsectorbend Januaary 23, 2014 TJRG4beamline6 lilens multipole particlefilter pillbox polycone rfdevice solenoid sphere tessellatedsolid torus trap tube tubs Boolean and tessellatedsolid permit quite complex geometries.

7 Control Commands define do exit for g4ui geometry group if / elseif / else include list output param randomseed showmaterial trackermode tune Januaary 23, 2014 TJRG4beamline7 corner cornerarc start beam cosmicraybeam particlesource reference material particlecolor place physics emfactor setdecay spacecharge spacechargelw fieldlines

8 Output Commands (most generate NTuples) beamlossntuple NTuple containing particle tracks when lost. detector Construct a Detector that generates an NTuple. fieldntuple Generates an NTuple from B and E newparticlentuple NTuple containing particle tracks when created. ntuple Define an NTuple containing multiple detectors. printf Prints track variables and expressions (at list of z-s) printfield Prints E or B fields, or writes FieldMap file. probefield Prints B and E fields at specified points. profile Write beam profile information to a file (at list of z-s) timentuple Construct an NTuple of tracks at a specified time. totalenergy Print total energy deposited in selected volumes. trace Specifies tracing of tracks. tracker Defines a tracker. virtualdetector Construct a VirtualDetector zntuple Generate an NTuple for each of a list of Z positions. printf permits you to write track information in whatever format you want. Januaary 23, 2014 TJRG4beamline8

9 Example – The MICE Beamline Januaary 23, 2014 TJRG4beamline9

10 Example – Mu2E Januaary 23, 2014 TJRG4beamline10

11 Example – Cosmic-Ray Tomography Januaary 23, 2014 TJRG4beamline11 A 30-second exposure of a freight container with four 20 cm spheres: H 2 O, Al, Fe, U. (H 2 O is not visible.) Each dot is the vertex of an incoming and outgoing muon track.

12 Example – B-field Lines Januaary 23, 2014 TJRG4beamline12 Rectangular Bend Quadrupole Octopole A single chaotic field line (red) from crossed current loops (black) Field lines are in 3-D, so they don’t look like 2-D textbook pictures.

13 New Features in G4beamline 2.16 (January 2014) Januaary 23, 2014 TJRG4beamline13

14 New Features: Physics Geant4 9.6.p02 on Linux and Mac; still Geant4.9.5.p01 on Windows Geant4Data versions updated Added RadioactiveDecay process to all ions, in all physics lists The beam command now supports ions as beam particles for ASCII input files (output NTuples already supported them) Polarized muons from pion decay can be tracked; they decay properly. The beam command now supports polarization in ASCII and Root input files. The default physics list is now FTFP_BERT Januaary 23, 2014 TJRG4beamline14

15 New Features: Geometry New command: boolean - does union, intersection, and subtraction between two simple volumes: boolean, box, extrusion, polycone, sphere, tessellatedsolid, torus, trap, tubs. New command: tessellatedsolid - generates a solid defined by its surface consisting of triangles and planar quadrilaterals. New command: detector - similar to virtualdetector, except defaults to local coordinates, and outputs the energy deposited into the NTuple. New command: label - puts visible labels into the world (text labels or points). New command: survey - generates a survey file containing element positions. Januaary 23, 2014 TJRG4beamline15

16 Example – boolean Januaary 23, 2014 TJRG4beamline16 An extrusion (8-pointed star) subtracted from a cylinder. The view here is looking through the hole it made.

17 Example – tessellatedsolid Januaary 23, 2014 TJRG4beamline17 Icosahedron, with each vertex labeled by its index in the vertex array.


Download ppt "G4beamline Introduction and New Features A “Swiss Army Knife” for Geant4. Tom Roberts Muons, Inc. Januaary 23, 2014 TJRG4beamline1."

Similar presentations


Ads by Google