├── INSTALL ├── Geant4 │ ├── .gitignore │ ├── Docker │ │ ├── .dockerignore │ │ └── entrypoint.sh │ ├── winEnv.png │ ├── winSys.png │ ├── wing4path.png │ ├── macG4libPermission.png │ └── data │ │ ├── .gitignore │ │ └── README.md ├── Docker │ ├── .dockerignore │ ├── config │ │ └── micro │ │ │ └── settings.json │ ├── v2x │ └── tmux.conf ├── ROOT │ ├── notebook │ │ ├── .dockerignore │ │ ├── Dockerfile │ │ ├── singularity.def │ │ └── README.md │ ├── .dockerignore │ ├── winrootpath.png │ ├── .rootrc │ ├── rootlogon.C │ └── Dockerfile ├── CMake │ ├── cmake2VS.png │ ├── cmakeconf.png │ ├── cmakebuilddir.png │ ├── cmakeInstallOpt.png │ ├── cmakegenerator.png │ └── compileGearsInVS.png ├── VisualStudio │ ├── vsconfig.png │ ├── vsrepos.png │ ├── vsstart.png │ ├── vsrungears.png │ ├── winCmdPath.png │ ├── vscmakermdebug.png │ ├── vscmakesetting.png │ ├── vsdebuggears.png │ ├── vsselectgears.png │ └── vssavecmakejson.png └── Apptainer │ └── gears.def ├── tutorials ├── detector │ ├── GDML │ │ ├── .gitignore │ │ ├── export.mac │ │ ├── visualize.C │ │ └── README.md │ ├── optical │ │ ├── .gitignore │ │ ├── Cherenkov │ │ │ ├── PMTwindow.tg │ │ │ ├── ogl.mac │ │ │ ├── run.mac │ │ │ └── drawEdistr.C │ │ ├── scintillation │ │ │ ├── detector.tg │ │ │ ├── run.mac │ │ │ ├── ogl.mac │ │ │ ├── fitNdistr.C │ │ │ └── fitTslow.C │ │ ├── absorption │ │ │ ├── detector.tg │ │ │ ├── run.mac │ │ │ ├── ogl.mac │ │ │ └── fitZdistr.C │ │ ├── scattering │ │ │ ├── detector.tg │ │ │ ├── run.mac │ │ │ ├── ogl.mac │ │ │ └── fitStepLenghs.C │ │ ├── surface │ │ │ ├── ideal │ │ │ │ ├── run.mac │ │ │ │ ├── CsI2PMT.tg │ │ │ │ └── ogl.mac │ │ │ ├── CsI2Teflon.tg │ │ │ ├── groundFrontPainted.mac │ │ │ ├── ground │ │ │ │ ├── r0t0.tg │ │ │ │ ├── r0t1.tg │ │ │ │ ├── r05t05.tg │ │ │ │ ├── r1t0sa0.tg │ │ │ │ ├── r1t0sa5.tg │ │ │ │ ├── r1t0sa30.tg │ │ │ │ ├── r1t0sa5back1.tg │ │ │ │ ├── r1t0sa0back1.tg │ │ │ │ ├── r1t0sa0sl1.tg │ │ │ │ ├── r1t0sa0spec1.tg │ │ │ │ ├── r1t0sa0spec01sl01back01.tg │ │ │ │ ├── r0t0.mac │ │ │ │ ├── r0t1.mac │ │ │ │ ├── r1t0sa0.mac │ │ │ │ ├── r1t0sa30.mac │ │ │ │ ├── r1t0sa5.mac │ │ │ │ ├── r05t05.mac │ │ │ │ ├── r1t0sa0sl1.mac │ │ │ │ ├── r1t0sa0spec1.mac │ │ │ │ ├── r1t0sa5back1.mac │ │ │ │ ├── r1t0sa0back1.mac │ │ │ │ └── r1t0sa0spec01sl01back01.mac │ │ │ ├── polished │ │ │ │ ├── r0t0.tg │ │ │ │ ├── r0t1.tg │ │ │ │ ├── r1t0.tg │ │ │ │ ├── r01t09.tg │ │ │ │ ├── r05t05.tg │ │ │ │ ├── r09t01.tg │ │ │ │ ├── totalInternalReflection.mac │ │ │ │ ├── totalInternalReflection.tg │ │ │ │ ├── r0t0.mac │ │ │ │ ├── r0t1.mac │ │ │ │ ├── r1t0.mac │ │ │ │ ├── r01t09.mac │ │ │ │ ├── r05t05.mac │ │ │ │ └── r09t01.mac │ │ │ ├── groundfrontpainted │ │ │ │ ├── r0t0.tg │ │ │ │ ├── r1t0.tg │ │ │ │ ├── r1t1.tg │ │ │ │ ├── r0t1.tg │ │ │ │ ├── r05t05.tg │ │ │ │ ├── r0t0.mac │ │ │ │ ├── r0t1.mac │ │ │ │ ├── r1t0.mac │ │ │ │ └── r1t1.mac │ │ │ ├── polishedfrontpainted │ │ │ │ ├── r0t0.tg │ │ │ │ ├── r0t1.tg │ │ │ │ ├── r1t0.tg │ │ │ │ ├── r05t05.tg │ │ │ │ ├── r0t1.mac │ │ │ │ ├── r1t0.mac │ │ │ │ └── r0t0.mac │ │ │ ├── groundbackpainted │ │ │ │ ├── r0sa0.tg │ │ │ │ ├── r1sa5rin09.tg │ │ │ │ ├── r1sa0rin09.tg │ │ │ │ ├── r0sa5rin09.tg │ │ │ │ ├── r0sa0back1.tg │ │ │ │ ├── r0sa0spec1.tg │ │ │ │ ├── r1sa0spec1rin09.tg │ │ │ │ ├── r1sa0spec1rin2.tg │ │ │ │ ├── r0sa0.mac │ │ │ │ ├── r0sa0back1.mac │ │ │ │ ├── r0sa0spec1.mac │ │ │ │ ├── r0sa5rin09.mac │ │ │ │ ├── r1sa0rin09.mac │ │ │ │ ├── r1sa5rin09.mac │ │ │ │ ├── r1sa0spec1rin09.mac │ │ │ │ └── r1sa0spec1rin2.mac │ │ │ └── polishedbackpainted │ │ │ │ ├── r1sa5rin09.tg │ │ │ │ ├── r1sa30.tg │ │ │ │ ├── r1sa0rin2.tg │ │ │ │ ├── r0sa5rin09.tg │ │ │ │ ├── r1sa0rin09.tg │ │ │ │ ├── r0sa0back1.tg │ │ │ │ ├── r0sa0spec1.tg │ │ │ │ ├── r1sa0spec1rin09.tg │ │ │ │ ├── r1sa0spec1rin2.tg │ │ │ │ ├── r0sa0back1.mac │ │ │ │ ├── r0sa0spec1.mac │ │ │ │ ├── r1sa30.mac │ │ │ │ ├── r0sa5rin09.mac │ │ │ │ ├── r1sa0rin09.mac │ │ │ │ ├── r1sa0rin2.mac │ │ │ │ ├── r1sa5rin09.mac │ │ │ │ ├── r1sa0spec1rin2.mac │ │ │ │ └── r1sa0spec1rin09.mac │ │ ├── epoxy.tg │ │ ├── CsI3inWLS.mac │ │ └── CsI3inWLS.tg │ ├── scripts │ │ ├── .gitignore │ │ ├── onion.png │ │ ├── tracker.png │ │ ├── LINEAR_X.tg │ │ ├── onion.sh │ │ └── tracker.sh │ ├── boolean │ │ ├── frame2.png │ │ ├── tophat.png │ │ ├── 0.tg │ │ ├── 1.tg │ │ ├── 2.tg │ │ ├── 3.tg │ │ ├── cut.mac │ │ ├── frame1.mac │ │ ├── tophat.tg │ │ ├── frame1.tg │ │ ├── frame2.tg │ │ ├── tophat.mac │ │ └── frame2.mac │ ├── visualization │ │ ├── gears.png │ │ ├── VrmlMerge-0.5beta.jar │ │ ├── .dockerignore │ │ ├── RayTracer.mac │ │ ├── Qt.mac │ │ ├── VTK.mac │ │ ├── VRML.mac │ │ ├── HepRApp.properties │ │ ├── HepRepFile.mac │ │ ├── ASCIITree.mac │ │ ├── TSG.mac │ │ ├── HepRApp.def │ │ ├── DAWN.mac │ │ ├── OpenGL.mac │ │ ├── hv │ │ └── gearsX3D.html │ ├── CSG │ │ ├── trd.mac │ │ ├── cons.mac │ │ ├── torus.mac │ │ ├── trap.mac │ │ ├── tubs.mac │ │ ├── vis.mac │ │ ├── ellipticalTube.tg │ │ ├── polycone.mac │ │ ├── sphere.mac │ │ ├── ellipsoid.mac │ │ ├── hyperbolic.mac │ │ ├── polyhedra.mac │ │ ├── twistedBox.mac │ │ ├── twistedTRD.mac │ │ ├── twistedTRAP.mac │ │ ├── twistedTubs.mac │ │ ├── tetrahedron.mac │ │ ├── tubs.tg │ │ ├── ellipticalCone.mac │ │ ├── ellipticalTube.mac │ │ ├── paralellepiped.mac │ │ ├── torus.tg │ │ ├── twistedBox.tg │ │ ├── ellipsoid.tg │ │ ├── trd.tg │ │ ├── ellipticalCone.tg │ │ ├── hyperbolic.tg │ │ ├── paralellepiped.tg │ │ ├── sphere.tg │ │ ├── tetrahedron.tg │ │ ├── twistedTubs.tg │ │ ├── README.md │ │ ├── cons.tg │ │ ├── twistedTRD.tg │ │ ├── trap.tg │ │ ├── twistedTRAP.tg │ │ ├── polycone.tg │ │ └── polyhedra.tg │ ├── syntax │ │ └── tg.yaml │ └── gears.tg ├── sources │ ├── .gitignore │ ├── AmBe │ │ ├── AmBe.sh │ │ ├── CsIandNaIwithAmBe.mac │ │ ├── AmBe.gnu │ │ └── CsIandNaI4438keV.mac │ ├── Ar39.sh │ ├── NA.tg │ ├── HPGe.tg │ ├── Ar39.gnu │ ├── Co57HPGe.mac │ ├── Am241.tg │ ├── Co57.mac │ ├── Fe55.mac │ └── muons.mac ├── physics │ ├── beta │ │ ├── air.tg │ │ ├── betaInAir.png │ │ └── interactions.png │ ├── gamma │ │ ├── air.tg │ │ ├── gammaInAir.png │ │ ├── lead.mac │ │ ├── rootlogon.C │ │ └── lead.tg │ ├── alpha │ │ ├── dedl.png │ │ ├── alphaInAir.png │ │ ├── endpoints.png │ │ ├── air.tg │ │ ├── CsI.tg │ │ └── air.mac │ ├── muon │ │ ├── panels.png │ │ ├── panels.tg │ │ ├── panels.mac │ │ ├── gui.mac │ │ └── panels.html │ ├── neutron │ │ ├── Gd │ │ │ ├── Gd.tg │ │ │ └── thermal.mac │ │ ├── scattering │ │ │ ├── TUNL.mac │ │ │ └── TUNL.tg │ │ └── concrete.tg │ ├── X-ray │ │ ├── foil.tg │ │ ├── fluorescence.mac │ │ └── README.md │ └── decay │ │ ├── HPGe.tg │ │ └── Pb210.mac ├── UI │ ├── winGUI.png │ └── winLaunchGears.png ├── output │ ├── tracks.png │ ├── combinedHits.png │ ├── stepLength │ │ ├── drawLimitless.mac │ │ ├── p250MeV.mac │ │ ├── draw1mmInbody.mac │ │ ├── draw1mmInbone.mac │ │ ├── checkOverlap.mac │ │ ├── vis.mac │ │ └── detector.tg │ ├── scoring │ │ ├── README.md │ │ ├── detector.tg │ │ ├── drawE.C │ │ └── energy.mac │ ├── detector.tg │ └── drawHits.C ├── Rutherford │ ├── README.md │ ├── foil.tg │ ├── scatter.mac │ └── scatter.sh ├── radiotherapy │ └── radioembolization │ │ ├── liver.tg │ │ └── README.md └── README.md ├── .gitattributes ├── gears.sh ├── .codedocs ├── _config.yml ├── gears.bat ├── .gitignore └── LICENSE /INSTALL/Geant4/.gitignore: -------------------------------------------------------------------------------- 1 | 11.* -------------------------------------------------------------------------------- /tutorials/detector/GDML/.gitignore: -------------------------------------------------------------------------------- 1 | hall.gdml 2 | -------------------------------------------------------------------------------- /tutorials/detector/optical/.gitignore: -------------------------------------------------------------------------------- 1 | *.png 2 | -------------------------------------------------------------------------------- /tutorials/sources/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.eps 3 | -------------------------------------------------------------------------------- /INSTALL/Docker/.dockerignore: -------------------------------------------------------------------------------- 1 | *.png 2 | Dockerfile 3 | *.md 4 | -------------------------------------------------------------------------------- /INSTALL/Geant4/Docker/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | *.md 3 | -------------------------------------------------------------------------------- /INSTALL/ROOT/notebook/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | *.md 3 | -------------------------------------------------------------------------------- /tutorials/detector/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | onion.tg 2 | tracker.tg 3 | -------------------------------------------------------------------------------- /tutorials/physics/beta/air.tg: -------------------------------------------------------------------------------- 1 | :volu air BOX 5.5*m 5*m 5*m G4_AIR 2 | -------------------------------------------------------------------------------- /tutorials/physics/gamma/air.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 11*m 9*m 9*m G4_AIR 2 | -------------------------------------------------------------------------------- /INSTALL/Docker/config/micro/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "colorscheme": "solarized" 3 | } 4 | -------------------------------------------------------------------------------- /INSTALL/ROOT/.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | notebook 3 | README.md 4 | winrootpath.png 5 | -------------------------------------------------------------------------------- /tutorials/UI/winGUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/UI/winGUI.png -------------------------------------------------------------------------------- /INSTALL/CMake/cmake2VS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/CMake/cmake2VS.png -------------------------------------------------------------------------------- /INSTALL/Geant4/winEnv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/Geant4/winEnv.png -------------------------------------------------------------------------------- /INSTALL/Geant4/winSys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/Geant4/winSys.png -------------------------------------------------------------------------------- /INSTALL/CMake/cmakeconf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/CMake/cmakeconf.png -------------------------------------------------------------------------------- /INSTALL/Geant4/wing4path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/Geant4/wing4path.png -------------------------------------------------------------------------------- /INSTALL/ROOT/winrootpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/ROOT/winrootpath.png -------------------------------------------------------------------------------- /tutorials/output/tracks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/output/tracks.png -------------------------------------------------------------------------------- /INSTALL/CMake/cmakebuilddir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/CMake/cmakebuilddir.png -------------------------------------------------------------------------------- /tutorials/UI/winLaunchGears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/UI/winLaunchGears.png -------------------------------------------------------------------------------- /INSTALL/CMake/cmakeInstallOpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/CMake/cmakeInstallOpt.png -------------------------------------------------------------------------------- /INSTALL/CMake/cmakegenerator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/CMake/cmakegenerator.png -------------------------------------------------------------------------------- /INSTALL/CMake/compileGearsInVS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/CMake/compileGearsInVS.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vsconfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vsconfig.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vsrepos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vsrepos.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vsstart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vsstart.png -------------------------------------------------------------------------------- /tutorials/output/combinedHits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/output/combinedHits.png -------------------------------------------------------------------------------- /tutorials/physics/alpha/dedl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/physics/alpha/dedl.png -------------------------------------------------------------------------------- /tutorials/physics/muon/panels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/physics/muon/panels.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vsrungears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vsrungears.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/winCmdPath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/winCmdPath.png -------------------------------------------------------------------------------- /tutorials/detector/GDML/export.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ../gears.tg 2 | /run/initialize 3 | /geometry/export gears.gdml 4 | -------------------------------------------------------------------------------- /tutorials/detector/scripts/onion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/detector/scripts/onion.png -------------------------------------------------------------------------------- /tutorials/physics/beta/betaInAir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/physics/beta/betaInAir.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # https://github.com/github/linguist#overrides 2 | *.C linguist-language=C++ 3 | *.py linguish-language=Python -------------------------------------------------------------------------------- /INSTALL/Geant4/macG4libPermission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/Geant4/macG4libPermission.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vscmakermdebug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vscmakermdebug.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vscmakesetting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vscmakesetting.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vsdebuggears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vsdebuggears.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vsselectgears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vsselectgears.png -------------------------------------------------------------------------------- /tutorials/detector/boolean/frame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/detector/boolean/frame2.png -------------------------------------------------------------------------------- /tutorials/detector/boolean/tophat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/detector/boolean/tophat.png -------------------------------------------------------------------------------- /tutorials/detector/scripts/tracker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/detector/scripts/tracker.png -------------------------------------------------------------------------------- /tutorials/physics/alpha/alphaInAir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/physics/alpha/alphaInAir.png -------------------------------------------------------------------------------- /tutorials/physics/alpha/endpoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/physics/alpha/endpoints.png -------------------------------------------------------------------------------- /tutorials/physics/beta/interactions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/physics/beta/interactions.png -------------------------------------------------------------------------------- /tutorials/physics/gamma/gammaInAir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/physics/gamma/gammaInAir.png -------------------------------------------------------------------------------- /INSTALL/VisualStudio/vssavecmakejson.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/INSTALL/VisualStudio/vssavecmakejson.png -------------------------------------------------------------------------------- /tutorials/detector/visualization/gears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/detector/visualization/gears.png -------------------------------------------------------------------------------- /tutorials/sources/AmBe/AmBe.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat AmBe.mac |grep hist|awk '{print $2,$3}' > AmBe.dat 3 | gnuplot AmBe.gnu 4 | rm -f AmBe.dat 5 | -------------------------------------------------------------------------------- /tutorials/output/stepLength/drawLimitless.mac: -------------------------------------------------------------------------------- 1 | /control/execute checkOverlap.mac 2 | /control/execute p250MeV.mac 3 | /control/execute vis.mac 4 | -------------------------------------------------------------------------------- /tutorials/output/stepLength/p250MeV.mac: -------------------------------------------------------------------------------- 1 | /gps/particle proton 2 | /gps/energy 250 MeV 3 | /gps/position -35 0 0 mm 4 | /gps/direction 1 0 0 5 | 6 | -------------------------------------------------------------------------------- /tutorials/sources/Ar39.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cat Ar39.mac |grep "hist/point" |awk '{print $2,$3}' > Ar39.dat 3 | gnuplot Ar39.gnu 4 | rm -f Ar39.dat 5 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/VrmlMerge-0.5beta.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jintonic/gears/HEAD/tutorials/detector/visualization/VrmlMerge-0.5beta.jar -------------------------------------------------------------------------------- /gears.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # add gears directory to PATH 3 | GEARS="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" >/dev/null 2>&1 && pwd)" 4 | export PATH=$GEARS:$PATH 5 | -------------------------------------------------------------------------------- /tutorials/Rutherford/README.md: -------------------------------------------------------------------------------- 1 | ```sh 2 | $ ./scatter.sh 3 | ``` 4 | 5 | [DAWN](https://geant4.kek.jp/~tanaka/DAWN/About_DAWN.html) is needed to generate eps files. 6 | 7 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/.dockerignore: -------------------------------------------------------------------------------- 1 | # ignore everything 2 | * 3 | # except for 4 | !Dockerfile 5 | !*.jar 6 | !gears* 7 | !HepRApp* 8 | !hv 9 | !v2x 10 | -------------------------------------------------------------------------------- /INSTALL/ROOT/.rootrc: -------------------------------------------------------------------------------- 1 | # enable status bar at the bottom of a canvas 2 | Canvas.ShowEventStatus: true 3 | # avoid missing menu in ROOT GUI running in Docker 4 | X11.UseXft: no 5 | -------------------------------------------------------------------------------- /tutorials/output/stepLength/draw1mmInbody.mac: -------------------------------------------------------------------------------- 1 | /control/execute checkOverlap.mac 2 | /control/execute p250MeV.mac 3 | /tracking/setStepLimit body 1 4 | /control/execute vis.mac 5 | -------------------------------------------------------------------------------- /tutorials/output/stepLength/draw1mmInbone.mac: -------------------------------------------------------------------------------- 1 | /control/execute checkOverlap.mac 2 | /control/execute p250MeV.mac 3 | /tracking/setStepLimit bone 1 4 | /control/execute vis.mac 5 | -------------------------------------------------------------------------------- /tutorials/physics/neutron/Gd/Gd.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 1*m 1*m 1*m G4_Galactic 2 | :volu Gd(S) SPHERE 0 0.5*m 0 360 0 360 G4_Gd 3 | 4 | :rotm r0 0 0 0 5 | 6 | :place Gd(S) 1 hall r0 0.0 0.0 0.0 7 | -------------------------------------------------------------------------------- /tutorials/sources/NA.tg: -------------------------------------------------------------------------------- 1 | :volu NA BOX 10*m 10*m 10*m G4_AIR 2 | :vis NA OFF 3 | 4 | :volu concrete BOX 10*m 10*m 2.2*m G4_CONCRETE 5 | :rotm r000 0 0 0 6 | :place concrete -1 NA r000 0 0 5*m 7 | -------------------------------------------------------------------------------- /tutorials/detector/GDML/visualize.C: -------------------------------------------------------------------------------- 1 | // ROOT script to visualize gears.gdml 2 | { 3 | TGeoManager::Import("gears.gdml"); 4 | gGeoManager->GetTopVolume()->Draw(); 5 | } 6 | // -*- c++ -*- 7 | // vim: set ft=cpp: 8 | -------------------------------------------------------------------------------- /tutorials/Rutherford/foil.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 1*cm 0.5*cm 0.5*cm G4_Galactic 2 | :volu foil BOX 2*micrometer 0.4*cm 0.4*cm G4_Au 3 | :rotm r000 0 0 0 4 | :place foil 1 hall r000 0 0 0 5 | 6 | :color foil 1 1 0 7 | :vis hall OFF 8 | -------------------------------------------------------------------------------- /tutorials/output/stepLength/checkOverlap.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 2 | 3 | /geometry/source detector.tg 4 | 5 | /process/em/verbose 0 6 | /process/had/verbose 0 7 | 8 | /run/initialize 9 | 10 | /geometry/test/run 11 | 12 | -------------------------------------------------------------------------------- /INSTALL/Geant4/data/.gitignore: -------------------------------------------------------------------------------- 1 | G4ABLA* 2 | G4EMLOW* 3 | G4EMLOW* 4 | G4ENSDFSTATE* 5 | G4INCL* 6 | G4NDL* 7 | G4PARTICLEXS* 8 | G4PII* 9 | G4SAIDDATA* 10 | PhotonEvaporation* 11 | RadioactiveDecay* 12 | RealSurface* 13 | G4ABLA* 14 | G4TENDL* 15 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/trd.mac: -------------------------------------------------------------------------------- 1 | /geometry/source trd.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep trd.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl trd.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/cons.mac: -------------------------------------------------------------------------------- 1 | /geometry/source cons.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep cons.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl cons.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/torus.mac: -------------------------------------------------------------------------------- 1 | /geometry/source torus.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep torus.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl torus.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/trap.mac: -------------------------------------------------------------------------------- 1 | /geometry/source trap.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep trap.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl trap.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/tubs.mac: -------------------------------------------------------------------------------- 1 | /geometry/source tubs.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep tubs.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl tubs.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/vis.mac: -------------------------------------------------------------------------------- 1 | /run/initialize 2 | 3 | /geometry/test/run 4 | 5 | /vis/open 6 | /vis/drawVolume 7 | 8 | /vis/scene/add/axes 9 | /vis/viewer/set/background black 10 | /vis/viewer/set/viewpointThetaPhi 60 120 11 | /vis/viewer/flush 12 | 13 | -------------------------------------------------------------------------------- /tutorials/physics/alpha/air.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu world BOX 31 11 11 G4_Galactic 3 | :vis world OFF 4 | 5 | :volu air(S) BOX 30 10 10 G4_AIR 6 | :color air(S) 0.5 0.5 0.5 7 | 8 | :rotm r000 0 0 0 9 | :place air(S) 1 world r000 0 0 0 10 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/ellipticalTube.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // half x, y, z 7 | :volu etube ELLIPTICALTUBE 10 15 20 G4_AIR 8 | :color etube 0.4 0.3 0.8 9 | :place etube 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/polycone.mac: -------------------------------------------------------------------------------- 1 | /geometry/source polycone.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep polycone.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl polycone.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/sphere.mac: -------------------------------------------------------------------------------- 1 | /geometry/source sphere.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep sphere.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl sphere.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/output/scoring/README.md: -------------------------------------------------------------------------------- 1 | This example demonstrates how to get energy deposition in different depth of a typical calorometer material, CsI, using [scoring](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Detector/commandScore.html). 2 | 3 | -------------------------------------------------------------------------------- /tutorials/physics/X-ray/foil.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu world BOX 1.1 5 5 G4_Galactic 3 | :vis world OFF 4 | 5 | :volu foil(S) BOX 0.001 4 4 G4_Al 6 | :color foil(S) 0.9 0.9 0.1 7 | 8 | :rotm r000 0 0 0 9 | :place foil(S) 1 world r000 0 0 0 10 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/ellipsoid.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ellipsoid.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep ellipsoid.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl ellipsoid.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/hyperbolic.mac: -------------------------------------------------------------------------------- 1 | /geometry/source hyperbolic.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep hyperbolic.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl hyperbolic.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/polyhedra.mac: -------------------------------------------------------------------------------- 1 | /geometry/source polyhedra.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep polyhedra.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl polyhedra.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedBox.mac: -------------------------------------------------------------------------------- 1 | /geometry/source twistedBox.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep twistedBox.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl twistedBox.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedTRD.mac: -------------------------------------------------------------------------------- 1 | /geometry/source twistedTRD.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep twistedTRD.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl twistedTRD.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/physics/decay/HPGe.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu world BOX 500 500 500 G4_Galactic 3 | :vis world OFF 4 | 5 | :volu HPGe(S) BOX 450 450 450 G4_Ge 6 | :color HPGe(S) 0.9 0.9 0.1 7 | 8 | :rotm r000 0 0 0 9 | :place HPGe(S) 1 world r000 0 0 0 10 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedTRAP.mac: -------------------------------------------------------------------------------- 1 | /geometry/source twistedTRAP.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep twistedTRAP.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl twistedTRAP.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedTubs.mac: -------------------------------------------------------------------------------- 1 | /geometry/source twistedTubs.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep twistedTubs.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl twistedTubs.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/physics/alpha/CsI.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu world BOX 500 500 500 G4_Galactic 3 | :vis world OFF 4 | 5 | :volu air(S) BOX 450 450 450 G4_CESIUM_IODIDE 6 | :color air(S) 0.9 0.9 0.1 7 | 8 | :rotm r000 0 0 0 9 | :place air(S) 1 world r000 0 0 0 10 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/tetrahedron.mac: -------------------------------------------------------------------------------- 1 | /geometry/source tetrahedron.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep tetrahedron.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl tetrahedron.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/tubs.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // Rin, Rout, half z in mm, start phi, dphi in degree 7 | :volu tubs TUBS 5 10 20 0 120 G4_AIR 8 | :color tubs 0.4 0.3 0.8 9 | :place tubs 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/ellipticalCone.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ellipticalCone.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep ellipticalCone.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl ellipticalCone.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/ellipticalTube.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ellipticalTube.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep ellipticalTube.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl ellipticalTube.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/paralellepiped.mac: -------------------------------------------------------------------------------- 1 | /geometry/source paralellepiped.tg 2 | 3 | /control/execute vis.mac 4 | 5 | /control/shell if [ -f G4Data0.heprep ]; then mv G4Data0.heprep paralellepiped.heprep; fi 6 | /control/shell if [ -f g4_00.wrl ]; then mv g4_00.wrl paralellepiped.wrl; fi 7 | 8 | -------------------------------------------------------------------------------- /tutorials/detector/scripts/LINEAR_X.tg: -------------------------------------------------------------------------------- 1 | :volu world BOX 10*cm 10*cm 10*cm G4_Galactic 2 | :vis world OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | :volu tracker BOX 1*micrometer 9*cm 9*cm G4_Galactic 7 | :place_param tracker 20 world LINEAR_X r000 81 2*mm -8*cm 8 | 9 | :color tracker 0.3 0.4 0.3 10 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/torus.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // inner radius , outer radius , swept radius, starting phi, delta phi 7 | :volu torus TORUS 5 10 25 0 300 G4_AIR 8 | :color torus 0.4 0.3 0.8 9 | :place torus 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedBox.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 80 80 80 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // twist angle in rad, half x, y, z in mm 7 | :volu twistedBox TWISTEDBOX 3.1415926/6 30 40 60 G4_AIR 8 | :color twistedBox 0.4 0.3 0.8 9 | :place twistedBox 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/ellipsoid.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // semi axis in x, y, z, z of bottom, z of top surface in mm 7 | :volu ellipsoid ELLIPSOID 10 20 50 -10 40 G4_AIR 8 | :color ellipsoid 0.4 0.3 0.8 9 | :place ellipsoid 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/trd.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 80 80 80 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // half x of bottom surface, half x of top, half y bottom, half y top, half z 7 | :volu trapezoid TRD 30 10 40 15 60 G4_AIR 8 | :color trapezoid 0.4 0.3 0.8 9 | :place trapezoid 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/ellipticalCone.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // scaling along x, y in mm, z of the apex, z of the top plane in mm 7 | :volu econe ELLIPTICALCONE 30/75 60/75 50 25 G4_AIR 8 | :color econe 0.4 0.3 0.8 9 | :place econe 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/hyperbolic.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // Inner radius , Outer radius , Inner stereo angle , outer stereo angle , Half length in Z 7 | :volu hype HYPE 10 12 25 35 9 G4_AIR 8 | :color hype 0.4 0.3 0.8 9 | :place hype 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/paralellepiped.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 100 100 100 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // half x, y, z in mm, alpha, theta, phi in degrees 7 | :volu parallelepiped PARA 30 40 60 10 30 20 G4_AIR 8 | :color parallelepiped 0.4 0.3 0.8 9 | :place parallelepiped 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/sphere.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // inner, outer radius, starting, delta phi, starting, delta theta of the segment 7 | :volu sphere SPHERE 20 40 30 60 45 60 G4_AIR 8 | :color sphere 0.9 0 0 9 | :place sphere 1 hall r000 0 0 0 10 | 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/tetrahedron.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // anchor point, point 2, 3, 4 7 | :volu tetrahedron TET 8 | 0 0 0 9 | 0 10 15 10 | -12 -5 15 11 | 12 -5 15 12 | G4_AIR 13 | :color tetrahedron 0.4 0.3 0.8 14 | :place tetrahedron 1 hall r000 0 0 0 15 | 16 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/0.tg: -------------------------------------------------------------------------------- 1 | :rotm r000 0 0 0 2 | 3 | :solid tube TUBE 0 20*mm 12*mm 4 | :solid saw TUBE 0 50.8*mm 1*mm 5 | :volu crystal SUBTRACTION tube saw r000 49*mm 0 11.1*mm G4_Ge 6 | 7 | :volu hall BOX 60*mm 60*mm 60*mm G4_AIR 8 | 9 | :place crystal 1 hall r000 0 0 0 10 | 11 | :color crystal 0.4 0.4 0.4 12 | :vis hall OFF 13 | -------------------------------------------------------------------------------- /.codedocs: -------------------------------------------------------------------------------- 1 | # https://codedocs.xyz/static/codedocs_example.txt 2 | 3 | PROJECT_NAME = "GEARS" 4 | PROJECT_BRIEF = "Geant4 Example Application with Rich features and Small footprints" 5 | 6 | INPUT = gears.cc 7 | 8 | EXTRACT_ALL = YES 9 | SOURCE_BROWSER = YES 10 | INLINE_SOURCES = YES 11 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedTubs.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 80 80 80 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // twist angle in rad, Rin, Rout, half z in mm, dphi in rad 7 | // phi0 = -dphi/2 8 | :volu twistedTubs TWISTEDTUBS 3.14159265/3 10 15 20 3.14159265/2 G4_AIR 9 | :color twistedTubs 0.4 0.3 0.8 10 | :place twistedTubs 1 hall r000 0 0 0 11 | 12 | -------------------------------------------------------------------------------- /INSTALL/ROOT/notebook/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM physino/root 2 | 3 | # jupyter notebook to run ROOT and python scripts 4 | # https://root-forum.cern.ch/t/failed-to-import-root-in-jupyter-notebook-in-docker-fedora-36/51517/2 5 | RUN dnf install -y python3-jupyroot root-graf-gpadv7 \ 6 | && dnf clean all && rm -fr /var/cache/* \ 7 | && pip install uproot awkward jupytext --no-cache-dir 8 | 9 | -------------------------------------------------------------------------------- /INSTALL/ROOT/notebook/singularity.def: -------------------------------------------------------------------------------- 1 | BootStrap: docker 2 | From: physino/root:notebook 3 | 4 | %runscript 5 | root -l "$@" 6 | 7 | %environment 8 | # default locale in the host might be en_US.UTF-8, 9 | # which is not available in the container 10 | export LANG=C.UTF-8 11 | export LC_ALL=C.UTF-8 12 | # load settings in ~/.bashrc 13 | export SINGULARITY_SHELL=/usr/bin/bash 14 | -------------------------------------------------------------------------------- /tutorials/output/scoring/detector.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu world BOX 500 1200 1200 G4_Galactic 3 | :vis world OFF 4 | 5 | // a germanium detector in a vacuum chamber 6 | :volu CsI BOX 372 1000 1000 G4_CESIUM_IODIDE 7 | :color CsI 0 0.9 0.8 8 | 9 | // define a rotation matrix that does no rotation 10 | :rotm r000 0 0 0 11 | :place CsI 1 world r000 0 0 0 12 | 13 | -------------------------------------------------------------------------------- /tutorials/detector/optical/Cherenkov/PMTwindow.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vacuum TUBE 0 40 1.1 G4_Galactic 3 | :vis vacuum OFF 4 | 5 | // 3" PMT window, 2 mm thick 6 | :volu window TUBE 0. 38.1 1 G4_SILICON_DIOXIDE 7 | :color window 0 0.7 0.93 8 | 9 | :rotm r000 0 0 0 10 | :place window 1 vacuum r000 0 0 0 11 | 12 | // optical properties of SiO2 13 | #include ../SiO2.tg 14 | 15 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scintillation/detector.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vacuum TUBE 0 40 30 G4_Galactic 3 | :vis vacuum OFF 4 | 5 | // CsI crystal, 3" in diameter, 5 cm long: 6 | :volu CsI TUBE 0 38.1 25 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | :rotm r000 0 0 0 10 | :place CsI 1 vacuum r000 0 0 0 11 | 12 | // optical properties of CsI 13 | #include ../CsI.tg 14 | -------------------------------------------------------------------------------- /INSTALL/Geant4/Docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # use geant4.sh to avoid hard coding datasets' locaitons 4 | . /usr/bin/geant4.sh 5 | 6 | # ENV PS1="\u@Geant4:\w \$ " doesn't work together with ENTRYPOINT 7 | # https://superuser.com/a/367280 8 | export PS1="\[\e[0;32m\]\u@Geant4:\[\e[0;34m\]\w \[\e[0;31m\]\$\[\e[m\] " 9 | 10 | exec "$@" # run cmd specified in Dockerfile or docker-compose.yml 11 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/1.tg: -------------------------------------------------------------------------------- 1 | :rotm r000 0 0 0 2 | 3 | :solid tube TUBE 0 20*mm 12*mm 4 | :solid saw TUBE 0 50.8*mm 1*mm 5 | :solid tube_cut SUBTRACTION tube saw r000 49*mm 0 11.1*mm 6 | :volu crystal SUBTRACTION tube_cut saw r000 -49*mm 0 11.1*mm G4_Ge 7 | 8 | :volu hall BOX 60*mm 60*mm 60*mm G4_AIR 9 | 10 | :place crystal 1 hall r000 0 0 0 11 | 12 | :color crystal 0.4 0.4 0.4 13 | :vis hall OFF 14 | -------------------------------------------------------------------------------- /tutorials/detector/optical/Cherenkov/ogl.mac: -------------------------------------------------------------------------------- 1 | /vis/open OGL 2 | /vis/drawVolume 3 | 4 | /vis/scene/add/trajectories 5 | 6 | /vis/viewer/zoomTo 50 7 | /vis/viewer/set/upVector 0 0 1 8 | /vis/viewer/set/viewpointVector 1 0 0 9 | /vis/viewer/set/background white 10 | /vis/viewer/set/globalLineWidthScale 3 11 | 12 | /gui/addMenu export Export 13 | /gui/addButton export png "/vis/ogl/export Cherenkov.png" 14 | 15 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/RayTracer.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 2 | 3 | /geometry/source ../gears.tg 4 | 5 | /run/initialize 6 | 7 | /geometry/test/run 8 | /vis/geometry/list 9 | 10 | /vis/open RayTracer 11 | /vis/viewer/set/background ! ! ! 0 12 | /vis/viewer/set/upThetaPhi 10 0 13 | /vis/viewer/set/viewpointThetaPhi 60 0 14 | /vis/viewer/set/style surface 15 | /vis/drawVolume 16 | /vis/viewer/refresh 17 | -------------------------------------------------------------------------------- /tutorials/physics/muon/panels.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu air BOX 301 51 51 G4_AIR 3 | :color air 0.5 0.5 0.5 4 | 5 | :volu concrete BOX 100 50 50 G4_CONCRETE 6 | :color concrete 0.8 0.8 0.8 7 | 8 | :volu panel(S) BOX 8 50 50 G4_PLASTIC_SC_VINYLTOLUENE 9 | :color panel(S) 0 0.8 1 10 | 11 | :rotm r000 0 0 0 12 | :place concrete -1 air r000 0 0 0 13 | :place panel(S) 1 air r000 150 0 0 14 | -------------------------------------------------------------------------------- /tutorials/output/stepLength/vis.mac: -------------------------------------------------------------------------------- 1 | /vis/open 2 | /vis/drawVolume 3 | 4 | /vis/scene/add/axes 5 | /vis/scene/add/trajectories 6 | /vis/scene/endOfEventAction accumulate 7 | 8 | /vis/modeling/trajectories/create/drawByParticleID 9 | /vis/modeling/trajectories/drawByParticleID-0/default/setDrawStepPts true 10 | /vis/modeling/trajectories/drawByParticleID-0/default/setStepPtsColour yellow 11 | 12 | /run/beamOn 10 13 | 14 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/Qt.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ../gears.tg 2 | 3 | /run/initialize 4 | 5 | /geometry/test/run 6 | 7 | /vis/geometry/list 8 | 9 | /vis/open Qt3D 10 | /vis/drawVolume 11 | /vis/viewer/set/style surface 12 | /vis/viewer/set/background white ! ! 0 13 | /vis/viewer/set/lineSegmentsPerCircle 50 14 | /vis/viewer/set/viewpointThetaPhi 35 55 15 | /vis/viewer/set/lightsMove cam 16 | /vis/viewer/flush 17 | 18 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/VTK.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ../gears.tg 2 | 3 | /run/initialize 4 | 5 | /geometry/test/run 6 | 7 | /vis/geometry/list 8 | 9 | /vis/open Vtk 10 | /vis/drawVolume 11 | /vis/viewer/set/style surface 12 | /vis/viewer/set/background white ! ! 0 13 | /vis/viewer/set/lineSegmentsPerCircle 50 14 | /vis/viewer/set/viewpointThetaPhi 35 55 15 | /vis/viewer/set/lightsMove cam 16 | /vis/viewer/flush 17 | 18 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/README.md: -------------------------------------------------------------------------------- 1 | This folder contains demos of all CSG solids that can be handled by Geant4 text geometry description. A shape, sphere for example, is defined in [sphere.tg](sphere.tg). To visualize it, please run 2 | 3 | ```sh 4 | G4VIS_DEFAULT_DRIVER=HepRepFile gears sphere.mac 5 | ``` 6 | 7 | The environment variable `G4VIS_DEFAULT_DRIVER` can be used to select a visualization driver other than the default one. 8 | 9 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/cons.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 50 50 50 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // conical section 7 | :volu cons CONS 8 | 8 20 // Rin @ -z/2, Rout @ -z/2 in mm 9 | 5 10 // Rin @ z/2, Rout @ z/2 in mm 10 | 20 // z/2 in mm 11 | 0 270 // start phi, dphi in degree 12 | G4_AIR // material 13 | :color cons 0.86 0.19 0.18 // solarized red 14 | :place cons 1 hall r000 0 0 0 15 | 16 | -------------------------------------------------------------------------------- /tutorials/detector/GDML/README.md: -------------------------------------------------------------------------------- 1 | [![YouTube](https://img.shields.io/badge/You-Tube-blue?style=flat)](https://youtu.be/rU4Ps3pHdIc) 2 | 3 | ```sh 4 | $ rm -f *.gdml # remove existing old gdml file 5 | $ gears export.mac # export gears.tg to gears.gdml 6 | $ root -l visualize.C # visualize gears.gdml in ROOT 7 | ``` 8 | 9 | You can view the geometry using X3D or openGL by clicking "View" in the menu bar and then the "View With" menu. 10 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/VRML.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 1 2 | 3 | /geometry/source ../gears.tg 4 | 5 | /run/initialize 6 | 7 | /geometry/test/run 8 | /vis/geometry/list 9 | 10 | /gps/particle gamma 11 | /gps/energy 2 MeV 12 | /gps/ang/type iso 13 | 14 | /vis/open VRML2FILE 15 | /vis/drawVolume 16 | /vis/viewer/flush 17 | 18 | /vis/scene/add/trajectories 19 | /vis/scene/endOfEventAction accumulate 10 20 | 21 | /run/beamOn 10 22 | -------------------------------------------------------------------------------- /tutorials/detector/optical/absorption/detector.tg: -------------------------------------------------------------------------------- 1 | :prop G4_CESIUM_IODIDE 2 | photon_energies 2 2.5*eV 5*eV 3 | Rindex 1.808 2.216 4 | absLength 300 300 5 | 6 | // default unit of length is mm 7 | :volu vacuum TUBE 0 101 4000 G4_Galactic 8 | :vis vacuum OFF 9 | 10 | // a long CsI crystal tube 11 | :volu CsI(S) TUBE 0 100 2000 G4_CESIUM_IODIDE 12 | :color CsI(S) 0.2 0.4 0.8 13 | 14 | :rotm r000 0 0 0 15 | :place CsI(S) 1 vacuum r000 0 0 -1500 16 | 17 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scattering/detector.tg: -------------------------------------------------------------------------------- 1 | :prop G4_CESIUM_IODIDE 2 | photon_energies 2 2.5*eV 5*eV 3 | Rindex 1.808 2.216 4 | Rayleigh 339 339 5 | 6 | // default unit of length is mm 7 | :volu vacuum TUBE 0 101 4000 G4_Galactic 8 | :vis vacuum OFF 9 | 10 | // a long CsI crystal tube 11 | :volu CsI(S) TUBE 0 100 2000 G4_CESIUM_IODIDE 12 | :color CsI(S) 0.2 0.4 0.8 13 | 14 | :rotm r000 0 0 0 15 | :place CsI(S) 1 vacuum r000 0 0 -1500 16 | 17 | -------------------------------------------------------------------------------- /tutorials/output/stepLength/detector.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 40 40 40 G4_Galactic 2 | :volu body BOX 30 30 30 G4_WATER 3 | :volu bone BOX 10 30 30 G4_BONE_COMPACT_ICRU 4 | :volu fat BOX 10 30 30 G4_ADIPOSE_TISSUE_ICRP 5 | 6 | :vis hall OFF 7 | :color body 0.1 0.2 0.8 8 | :color bone 0.3 0.3 0.3 9 | :color fat 0.7 0.3 0.1 10 | 11 | :rotm r000 0 0 0 12 | :place body 1 hall r000 0 0 0 13 | :place bone 2 body r000 15 0 0 14 | :place fat 3 body r000 -15 0 0 15 | 16 | -------------------------------------------------------------------------------- /tutorials/physics/neutron/Gd/thermal.mac: -------------------------------------------------------------------------------- 1 | /geometry/source Gd.tg 2 | 3 | // HP (high precision) neutron model is needed 4 | /physics_lists/select QGSP_BERT_HP 5 | 6 | /run/initialize 7 | 8 | /process/list 9 | 10 | /gps/particle neutron 11 | /gps/energy 0.005 eV 12 | 13 | /tracking/verbose 1 14 | /run/beamOn 1 15 | 16 | /analysis/setFileName output.root 17 | 18 | /tracking/verbose 0 19 | /run/verbose 2 20 | /run/printProgress 100 21 | /run/beamOn 1000 22 | -------------------------------------------------------------------------------- /tutorials/output/scoring/drawE.C: -------------------------------------------------------------------------------- 1 | { 2 | TGraph *ge = new TGraph("electron.csv", "%lg,%*lg,%*lg,%lg"); 3 | ge->Draw("ac"); 4 | ge->SetLineColor(kRed); 5 | ge->SetTitle(";X_{0}; Energy [keV]"); 6 | 7 | TGraph *gg = new TGraph("gamma.csv", "%lg,%*lg,%*lg,%lg"); 8 | gg->Draw("c"); 9 | gg->SetLineColor(kBlue); 10 | 11 | TLegend *l = new TLegend(0.5, 0.6, 0.8, 0.8); 12 | l->AddEntry(ge,"e^{-}","l"); 13 | l->AddEntry(gg,"#gamma","l"); 14 | l->Draw(); 15 | } 16 | -------------------------------------------------------------------------------- /tutorials/detector/syntax/tg.yaml: -------------------------------------------------------------------------------- 1 | filetype: tg 2 | 3 | detect: 4 | filename: "\\.tg$" 5 | 6 | rules: 7 | - identifier: "\\b(G4_Ge|G4_AIR|G4_Galactic)\\b" 8 | - type: "\\b(BOX|TUBE|TUBS|HYPE|TWISTEDTRD)\\b" 9 | - special: "^:(vis|volu|place|rotm|color)" 10 | - symbol: "\\b(mm|cm|m|degree)\\b" 11 | - comment: 12 | start: "//" 13 | end: "$" 14 | - constant.bool: \b(ON|OFF) 15 | - constant.number: ([^G][0-9]+) 16 | - constant.specialChar: "\\*" -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedTRD.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 100 100 100 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | :volu twistedtrd TWISTEDTRD 7 | 30 // Half x-length at the surface at -dz 8 | 10 // Half x-length at the surface at +dz 9 | 40 // Half y-length at the surface at -dz 10 | 15 // Half y-length at the surface at +dz 11 | 60 // Half z length 12 | 30*degree // twisted angle 13 | G4_AIR 14 | :color twistedtrd 0.7 0.2 0.1 15 | 16 | :place twistedtrd 1 hall r000 0 0 0 17 | 18 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/HepRApp.properties: -------------------------------------------------------------------------------- 1 | # http://www.slac.stanford.edu/~perl/HepRApp/#options 2 | # http://www.slac.stanford.edu/~perl/HepRApp/default.properties 3 | lockPropertiesFile=true 4 | 5 | mainToolbarStyle=Text 6 | 7 | width=1024 8 | height=730 9 | xPosition=0 10 | yPosition=25 11 | 12 | divider=0.7 13 | backgroundColor=255,255,255 14 | initialOrientation=Top 15 | mouseMode=Rotation 16 | fastMode=true 17 | 18 | showSpecifyGroup=false 19 | group=Standard 20 | quiet=true 21 | -------------------------------------------------------------------------------- /tutorials/physics/neutron/scattering/TUNL.mac: -------------------------------------------------------------------------------- 1 | /geometry/source TUNL.tg 2 | 3 | /physics_lists/select LBE_LIV_HP 4 | 5 | /run/initialize 6 | 7 | /geometry/test/run 8 | 9 | /vis/ASCIITree/verbose 13 10 | /vis/drawTree 11 | 12 | /vis/open HepRepFile 13 | /vis/drawVolume 14 | 15 | /vis/scene/add/trajectories 16 | /vis/scene/endOfEventAction accumulate 50 17 | 18 | /gps/particle neutron 19 | /gps/energy 3.2 MeV 20 | /gps/position 0 -20 0 cm 21 | /gps/direction 0 1 0 22 | 23 | /run/beamOn 50 24 | -------------------------------------------------------------------------------- /tutorials/Rutherford/scatter.mac: -------------------------------------------------------------------------------- 1 | /geometry/source foil.tg 2 | /run/initialize 3 | 4 | /vis/ASCIITree/verbose 13 5 | /vis/drawTree 6 | /geometry/test/run 7 | 8 | /vis/open DAWNFILE 9 | /vis/viewer/zoom 8 10 | /vis/viewer/set/style surface 11 | /vis/drawVolume 12 | /vis/scene/add/trajectories 13 | /vis/scene/endOfEventAction accumulate 10 14 | 15 | /gps/particle alpha 16 | /gps/energy 5.5 MeV 17 | /gps/pos/centre -0.1 0 0 cm 18 | /gps/direction 1 0 0 19 | 20 | /run/verbose 2 21 | /run/beamOn 1000000 22 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/2.tg: -------------------------------------------------------------------------------- 1 | :rotm r000 0 0 0 2 | 3 | :solid tube TUBE 0 20*mm 12*mm 4 | :solid saw TUBE 0 50.8*mm 1*mm 5 | :solid tube_cut SUBTRACTION tube saw r000 49*mm 0 11.1*mm 6 | :solid handle SUBTRACTION tube_cut saw r000 -49*mm 0 11.1*mm 7 | :solid hole_saw TUBE 0 17*mm 1*mm 8 | :volu crystal SUBTRACTION handle hole_saw r000 0 0 11.1*mm G4_Ge 9 | 10 | :volu hall BOX 60*mm 60*mm 60*mm G4_AIR 11 | 12 | :place crystal 1 hall r000 0 0 0 13 | 14 | :color crystal 0.4 0.4 0.4 15 | :vis hall OFF 16 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/3.tg: -------------------------------------------------------------------------------- 1 | :rotm r000 0 0 0 2 | 3 | :solid tube TUBE 17*mm 20*mm 1*mm 4 | :solid saw TUBE 0 50.8*mm 2*mm 5 | :solid tube_cut SUBTRACTION tube saw r000 49*mm 0 0 6 | :solid handle SUBTRACTION tube_cut saw r000 -49*mm 0 0 7 | :solid hemisphere SPHERE 0 20*mm 0 360 90 180 8 | :volu crystal UNION handle hemisphere r000 0 0 -1*mm G4_Ge 9 | 10 | :volu hall BOX 60*mm 60*mm 60*mm G4_AIR 11 | 12 | :place crystal 1 hall r000 0 0 0 13 | 14 | :color crystal 0.4 0.4 0.4 15 | :vis hall OFF 16 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/HepRepFile.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ../gears.tg 2 | 3 | /run/initialize 4 | 5 | /geometry/test/run 6 | 7 | /vis/geometry/list 8 | 9 | /control/verbose 2 10 | 11 | /vis/open HepRepFile 12 | /vis/drawVolume 13 | 14 | /vis/scene/add/axes 15 | /vis/scene/add/date 16 | /vis/scene/add/scale 17 | /vis/scene/add/trajectories 18 | /vis/scene/endOfEventAction accumulate 50 19 | 20 | /gps/particle gamma 21 | /gps/energy 1.2 MeV 22 | /gps/ang/type iso 23 | 24 | /run/beamOn 10 25 | -------------------------------------------------------------------------------- /tutorials/physics/muon/panels.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 2 | /geometry/source panels.tg 3 | 4 | /control/ifInteractive gui.mac 5 | /run/initialize 6 | 7 | /geometry/test/run 8 | 9 | /gps/particle mu+ 10 | /gps/energy 6 GeV 11 | /gps/pos/centre -30 0 0 cm 12 | /gps/direction 1 0 0 13 | 14 | /vis/open 15 | /vis/drawVolume 16 | /vis/scene/add/trajectories 17 | /vis/scene/endOfEventAction accumulate 100 18 | 19 | /analysis/setFileName panels.root 20 | 21 | /random/setSeeds 12 43 22 | /run/beamOn 1000 23 | 24 | -------------------------------------------------------------------------------- /tutorials/sources/HPGe.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu world BOX 50 50 50 G4_AIR 3 | :vis world OFF 4 | 5 | :volu vacuum TUBE 0 45 45 G4_Galactic 6 | :color vacuum 0.2 0.3 0.5 7 | 8 | :volu HPGe(S) TUBE 0 35 35 G4_Ge 9 | :color HPGe(S) 0.9 0.9 0.1 10 | 11 | :rotm r000 0 0 0 12 | // The source is placed in vacuum. 13 | // Give vacuum a copy number >0 !=1 to 14 | // record information of the primary particle 15 | :place vacuum 2 world r000 0 0 0 16 | :place HPGe(S) 1 vacuum r000 0 0 0 17 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/cut.mac: -------------------------------------------------------------------------------- 1 | /geometry/source 0.tg 2 | 3 | /run/initialize 4 | 5 | /vis/ASCIITree/verbose 13 6 | /vis/drawTree 7 | /geometry/test/run 8 | 9 | /vis/open DAWNFILE 10 | /vis/viewer/set/background white 11 | /vis/viewer/set/style surface 12 | /vis/viewer/set/viewpointThetaPhi 45 0 13 | /vis/viewer/set/projection perspective 14 | # too slow if too large, causing white segment in dawn if too small 15 | /vis/viewer/set/lineSegmentsPerCircle 300 16 | /vis/drawVolume 17 | /vis/viewer/flush 18 | -------------------------------------------------------------------------------- /tutorials/detector/scripts/onion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | output="onion.tg" 3 | echo -n "Creating $output... " 4 | 5 | cat << END > $output 6 | // default unit for length is mm 7 | :volu skin50 ORB 50 G4_AIR 8 | :color skin50 0.5 0 0.5 9 | 10 | :rotm r000 0 0 0 11 | 12 | END 13 | 14 | r=45 15 | while [ $r -ge 5 ]; do 16 | echo ":volu skin$r ORB $r G4_AIR" >> $output 17 | echo ":place skin$r 1 skin$((r+5)) r000 0 0 0" >> $output 18 | echo ":color skin$r 0.3 0 0.$r" >> $output 19 | r=$((r-5)) 20 | done 21 | echo Done. 22 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/ASCIITree.mac: -------------------------------------------------------------------------------- 1 | # tell gears where is the detector definition file 2 | /geometry/source ../gears.tg 3 | 4 | # the following cmd must be called before any visualization 5 | # since it triggers the construction of the detector 6 | /run/initialize 7 | 8 | # the only two cmds needed to print detector components (volumes) on screen 9 | /vis/ASCIITree/verbose 13 10 | /vis/drawTree 11 | 12 | # check if there is any overlapping between detector components (volumes) 13 | /geometry/test/run 14 | 15 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/frame1.mac: -------------------------------------------------------------------------------- 1 | /geometry/source frame1.tg 2 | 3 | /run/initialize 4 | 5 | # the only visualization method that works 6 | /vis/open RayTracer 7 | /vis/drawVolume 8 | /vis/viewer/set/background white 9 | /vis/viewer/set/viewpointThetaPhi 20 30 10 | /vis/viewer/flush 11 | 12 | # all the rest fail 13 | /vis/open VRML2FILE 14 | /vis/drawVolume 15 | /vis/viewer/flush 16 | 17 | /vis/open DAWNFILE 18 | /vis/drawVolume 19 | /vis/viewer/flush 20 | 21 | /vis/open HepRepFile 22 | /vis/drawVolume 23 | /vis/viewer/flush 24 | -------------------------------------------------------------------------------- /tutorials/detector/scripts/tracker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | output="tracker.tg" 3 | echo -n "Creating $output... " 4 | 5 | cat << EOC > $output 6 | :volu world BOX 10*cm 10*cm 10*cm G4_Galactic 7 | :vis world OFF 8 | 9 | :rotm r000 0 0 0 10 | 11 | :volu tracker BOX 1*micrometer 9*cm 9*cm G4_Galactic 12 | EOC 13 | 14 | id=1 15 | while [ $id -le 81 ]; do 16 | x=$((id*2-82))*mm 17 | echo ":place tracker $id world r000 $x 0 0" >> $output 18 | echo ":color tracker 0.3 0.4 0.3" >> $output 19 | id=$((id+1)) 20 | done 21 | 22 | echo Done. 23 | -------------------------------------------------------------------------------- /tutorials/sources/Ar39.gnu: -------------------------------------------------------------------------------- 1 | #!/usr/bin/gnuplot -persist 2 | set lmargin -1 3 | set bmargin -1 4 | set rmargin -1 5 | set tmargin -1 6 | 7 | set title "Ar39 beta source energy spectrum" 8 | set ylabel "Normalized intensity" 9 | set xlabel "beta energy [KeV]" 10 | set key reverse 11 | 12 | set terminal png giant 13 | set output 'Ar39.png' 14 | plot "Ar39.dat" 15 | 16 | set terminal postscript eps "Times" 32 17 | set output 'Ar39.eps' 18 | set notitle 19 | set size 1.8, 0.8 20 | replot 21 | 22 | set output # important! close output file 23 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/TSG.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ../gears.tg 2 | 3 | /run/initialize 4 | 5 | /geometry/test/run 6 | 7 | /vis/geometry/list 8 | 9 | # https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Visualization/visdrivers.html#toolssg 10 | /vis/open TSG_OFFSCREEN 11 | /vis/drawVolume 12 | /vis/viewer/set/style surface 13 | /vis/viewer/set/background white ! ! 0 14 | /vis/viewer/set/lineSegmentsPerCircle 50 15 | /vis/viewer/set/viewpointThetaPhi 35 55 16 | /vis/viewer/set/lightsMove cam 17 | /vis/viewer/flush 18 | 19 | -------------------------------------------------------------------------------- /INSTALL/Geant4/data/README.md: -------------------------------------------------------------------------------- 1 | ## Datasets installer 2 | 3 | [![YouTube](https://img.shields.io/badge/You-Tube-red.svg)](https://youtu.be/OIhNBPfaTm8) 4 | 5 | [set.bat](set.bat) is a Windows [batch][] file used to download Geant4 data files and set corresponding environment variables automatically. Place it in a folder where you'd like to save Geant4 data files and double click it to run it. It works for the newest Geant4. If you need it to work with older versions of Geant4, please use `set4.xx.x.bat` instead. 6 | 7 | [batch]: https://en.wikipedia.org/wiki/Batch_file 8 | -------------------------------------------------------------------------------- /tutorials/detector/optical/absorption/run.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 | /process/em/verbose 0 3 | /process/had/verbose 0 4 | 5 | /geometry/source detector.tg 6 | /physics_lists/factory/addOptical 7 | 8 | /gps/particle opticalphoton 9 | /gps/energy 3.5 eV 10 | /gps/polarization 1 0 0 11 | 12 | /run/initialize 13 | 14 | /geometry/test/run 15 | 16 | /tracking/verbose 2 17 | /run/beamOn 2 18 | /tracking/verbose 0 19 | 20 | /control/ifInteractive ogl.mac 21 | 22 | /control/doifBatch /analysis/setFileName absorption.root 23 | /control/doifBatch /run/beamOn 100000 24 | 25 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scattering/run.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 | /process/em/verbose 0 3 | /process/had/verbose 0 4 | 5 | /geometry/source detector.tg 6 | /physics_lists/factory/addOptical 7 | 8 | /gps/particle opticalphoton 9 | /gps/energy 3.65 eV 10 | /gps/polarization 1 0 0 11 | 12 | /run/initialize 13 | 14 | /geometry/test/run 15 | 16 | /tracking/verbose 2 17 | /run/beamOn 2 18 | /tracking/verbose 0 19 | 20 | /control/ifInteractive ogl.mac 21 | 22 | /control/doifBatch /analysis/setFileName scattering.root 23 | /control/doifBatch /run/beamOn 100000 24 | 25 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/tophat.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 20 20 20 G4_Galactic 2 | :vis hall OFF 3 | 4 | :solid base TUBE 0 15 5 5 | :solid inner TUBE 0 9 5 6 | :solid outer TUBE 10 16 5 7 | :solid top SUBTRACTION base inner r000 0 0 1 8 | :solid hat SUBTRACTION top outer r000 0 0 -1 9 | :volu hat hat G4_AIR 10 | :volu inner inner G4_Galactic 11 | :volu outer outer G4_Galactic 12 | :color hat 0.2 0.2 0 13 | :color inner 0.2 0.4 0.7 14 | :color outer 0.7 0.4 0.2 15 | 16 | :rotm r000 0 0 0 17 | :place hat 1 hall r000 0 0 0 18 | :place inner 1 hall r000 0 0 1 19 | :place outer 1 hall r000 0 0 -1 20 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scintillation/run.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 | /process/em/verbose 0 3 | /process/had/verbose 0 4 | 5 | /geometry/source detector.tg 6 | 7 | /physics_lists/factory/addOptical 8 | 9 | /run/initialize 10 | 11 | /gps/particle gamma 12 | /gps/energy 1 keV 13 | /gps/ang/type iso 14 | 15 | 16 | /control/ifInteractive ogl.mac 17 | 18 | /tracking/verbose 2 19 | /run/beamOn 20 | /tracking/verbose 0 21 | 22 | /control/doifBatch /vis/disable 23 | /control/doifBatch /analysis/setFileName scintillation.root 24 | /run/verbose 2 25 | /control/doifBatch /run/beamOn 5000 26 | 27 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/HepRApp.def: -------------------------------------------------------------------------------- 1 | BootStrap: docker 2 | From: physino/heprapp 3 | 4 | %help 5 | Container of HepRApp 6 | 7 | %post 8 | # customize container PS1 (https://stackoverflow.com/a/61251143) 9 | echo "#!/bin/sh" > /.singularity.d/env/99-vis.sh 10 | echo 'PS1="\u@HepRApp:\w \$ "' >> /.singularity.d/env/99-vis.sh 11 | 12 | %environment 13 | export LANG=C.UTF-8 14 | export LC_ALL=C.UTF-8 15 | # https://github.com/apptainer/singularity/issues/643 16 | # settings in ~/.bashrc will be loaded last 17 | export SINGULARITY_SHELL=/usr/bin/bash 18 | 19 | %runscript 20 | hv "$@" 21 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ideal/run.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 | /process/em/verbose 0 3 | /process/had/verbose 0 4 | 5 | /geometry/source CsI2PMT.tg 6 | 7 | /physics_lists/factory/addOptical 8 | 9 | /run/initialize 10 | 11 | /geometry/test/run 12 | 13 | /gps/particle opticalphoton 14 | /gps/energy 3.5 eV 15 | /gps/polarization 0 1 0 16 | /gps/position 0 0 -2 cm 17 | 18 | /tracking/verbose 2 19 | /run/beamOn 2 20 | /tracking/verbose 0 21 | 22 | /control/ifInteractive ogl.mac 23 | 24 | /control/doifBatch /analysis/setFileName ideal.root 25 | /control/doifBatch /run/beamOn 5000 26 | 27 | -------------------------------------------------------------------------------- /tutorials/detector/optical/epoxy.tg: -------------------------------------------------------------------------------- 1 | // C_21 H_25 Cl O_5, density=1.1 ~ 1.4 g/cm^3, molar mass=393 g/mole 2 | 3 | //:MIXT_BY_NATOMS <# of components> 4 | // <# of atoms> (1 line per component) 5 | :MIXT_BY_NATOMS epoxy 1.25 4 6 | C 21 7 | H 25 8 | Cl 1 9 | O 5 10 | 11 | :prop epoxy 12 | photon_energies 2 2*eV 5*eV 13 | rindex 1.54 1.54 14 | 15 | // default unit for length is mm 16 | :volu hall BOX 500 500 500 G4_Galactic 17 | :volu window TUBE 0 200 0.5 epoxy 18 | :rotm r000 0 0 0 19 | :place window 1 hall r000 0 0 0 20 | 21 | :color window 0.2 0.4 0.8 22 | -------------------------------------------------------------------------------- /tutorials/physics/gamma/lead.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 2 | /geometry/source lead.tg 3 | 4 | /run/initialize 5 | 6 | /vis/ASCIITree/verbose 13 7 | /vis/drawTree 8 | 9 | /geometry/test/run 10 | 11 | /vis/open HepRepFile 12 | /vis/drawVolume 13 | 14 | /vis/scene/add/trajectories 15 | /vis/scene/endOfEventAction accumulate 200 16 | 17 | /gps/particle gamma 18 | /gps/energy 2614 keV 19 | /gps/position 0 0 -240 mm 20 | /gps/direction 0 0 1 21 | 22 | /run/beamOn 100 23 | 24 | /vis/disable 25 | /analysis/setFileName g2614inLead.root 26 | /run/verbose 2 27 | /run/printProgress 1000 28 | /run/beamOn 10000 29 | 30 | -------------------------------------------------------------------------------- /tutorials/sources/AmBe/CsIandNaIwithAmBe.mac: -------------------------------------------------------------------------------- 1 | /geometry/source CsIandNaI.tg 2 | 3 | /physics_lists/enable HadronElastic 4 | /physics_lists/enable HadronInelastic 5 | 6 | /run/initialize 7 | 8 | /vis/ASCIITree/verbose 13 9 | /vis/drawTree 10 | /geometry/test/run 11 | 12 | /process/list 13 | #/grdm/deselectVolume chamber 14 | #/grdm/nucleusLimits 1 293 40 50 15 | 16 | # AmBe neutron spectrum 17 | /control/execute AmBe.mac 18 | /gps/pos/centre 0 0 -22.5 cm 19 | 20 | /random/setSeeds 2412 79628 21 | 22 | /tracking/verbose 0 23 | 24 | /run/output AmBe.root 25 | /run/statusReport 10000 26 | /run/beamOn 1000000 27 | -------------------------------------------------------------------------------- /tutorials/detector/optical/Cherenkov/run.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 | /process/em/verbose 0 3 | /process/had/verbose 0 4 | 5 | /geometry/source PMTwindow.tg 6 | 7 | /physics_lists/factory/addOptical 8 | #/process/optical/processActivation Cerenkov false 9 | 10 | /run/initialize 11 | 12 | /geometry/test/run 13 | 14 | /gps/particle e- 15 | /gps/energy 511 keV 16 | /gps/position 0 0 1.01 mm 17 | 18 | /control/ifInteractive ogl.mac 19 | 20 | /tracking/verbose 2 21 | /run/beamOn 2 22 | /tracking/verbose 0 23 | 24 | /control/doifBatch /analysis/setFileName Cherenkov.root 25 | /control/doifBatch /run/beamOn 5000 26 | 27 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/DAWN.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ../gears.tg 2 | 3 | /run/initialize 4 | 5 | /geometry/test/run 6 | /vis/geometry/list 7 | 8 | /control/shell dawn -c 9 | /control/shell rm -f *.prim g4_????.eps gears.png 10 | 11 | /vis/open DAWNFILE 12 | /vis/viewer/set/background white ! ! 0 13 | /vis/viewer/set/style surface 14 | /vis/viewer/set/viewpointThetaPhi 15 20 15 | /vis/viewer/set/projection perspective 16 | /vis/viewer/set/lineSegmentsPerCircle 60 17 | /vis/geometry/set/lineWidth ! ! 0 18 | /vis/drawVolume 19 | /vis/viewer/flush 20 | 21 | /control/shell convert g4_????.eps -trim +repage gears.png 22 | -------------------------------------------------------------------------------- /tutorials/radiotherapy/radioembolization/liver.tg: -------------------------------------------------------------------------------- 1 | :volu room BOX 1*m 1*m 1*m G4_AIR 2 | :volu air BOX 500 500 500 G4_AIR 3 | 4 | // https://www.ncbi.nlm.nih.gov/books/NBK421/ 5 | :volu chest ELLIPTICALTUBE 150 100 150 G4_WATER 6 | :volu liver BOX 60 10 50 G4_WATER 7 | :volu tumor ORB 5 G4_WATER 8 | 9 | :rotm r000 0 0 0 10 | :place tumor 1 liver r000 -30 0 -10 11 | :place liver 2 chest r000 -50 0 -50 12 | :place chest 3 air r000 0 0 0 13 | :place air 4 room r000 0 0 0 14 | 15 | :color tumor 0.18 0.03 0.33 16 | :color liver 0.4 0 0 17 | :color chest 0.89 0.87 0.71 18 | :vis air OFF 19 | :vis room OFF 20 | 21 | -------------------------------------------------------------------------------- /tutorials/sources/AmBe/AmBe.gnu: -------------------------------------------------------------------------------- 1 | #!/usr/bin/gnuplot -persist 2 | set lmargin -1 3 | set bmargin -1 4 | set rmargin -1 5 | set tmargin -1 6 | 7 | set title "AmBe neutron source energy spectrum" 8 | set ylabel "Normalized intensity" 9 | set xlabel "Neutron energy [MeV]" 10 | set key reverse 11 | 12 | set terminal png giant 13 | set output 'AmBe.png' 14 | plot "AmBe.dat" using 1:2 title "Digitized data from Fig.5 in NIMA 366 (1995) 340" with line 15 | 16 | set terminal postscript eps "Times" 32 17 | set output 'AmBe.eps' 18 | set notitle 19 | set size 1.8, 0.8 20 | replot 21 | 22 | set output # important! close output file 23 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/OpenGL.mac: -------------------------------------------------------------------------------- 1 | /geometry/source ../gears.tg 2 | 3 | /run/initialize 4 | 5 | /geometry/test/run 6 | 7 | /vis/geometry/list 8 | 9 | /vis/open OGL 600x600+25+25 10 | /vis/drawVolume 11 | /vis/viewer/set/style surface 12 | /vis/viewer/set/background white ! ! 0 13 | /vis/viewer/set/lineSegmentsPerCircle 50 14 | /vis/viewer/set/viewpointThetaPhi 35 55 15 | /vis/viewer/set/lightsMove cam 16 | /vis/viewer/flush 17 | 18 | # create png file 19 | /control/shell rm -f gears_*.pdf gearsOGL.png 20 | /vis/ogl/set/exportFormat pdf 21 | /vis/ogl/export gears 22 | /control/shell convert gears_*.pdf -trim +repage gearsOGL.png 23 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate 2 | title: GEARS | 齿轮组 3 | tagline: Geant4 Example Application with Rich features yet Small footprint 4 | show_downloads: true 5 | github: 6 | zip_url: https://github.com/jintonic/gears/zipball/master 7 | tar_url: https://github.com/jintonic/gears/tarball/master 8 | 9 | plugins: 10 | - jekyll-mentions 11 | - jekyll-seo-tag 12 | - jekyll-theme-slate 13 | 14 | # the slate theme already contains the script to use this id 15 | google_analytics: UA-61659360-3 16 | 17 | exclude: 18 | - INSTALL/Geant4/data/G4* 19 | - INSTALL/Geant4/data/P* 20 | - INSTALL/Geant4/data/R* 21 | - build/* 22 | 23 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/trap.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 200 200 200 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2y 7 | :volu genericTrapezoid11pars TRAP 60 3.14159265/9 3.14159265/36 8 | 40 30 40 3.14159265/18 16 10 14 3.14159265/18 G4_AIR 9 | :color genericTrapezoid11pars 0.4 0.3 0.8 10 | :place genericTrapezoid11pars 1 hall r000 0 0 0 11 | 12 | // pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2y 13 | :volu simplerTrapezoid TRAP 120 80 80 60 G4_AIR 14 | :color simplerTrapezoid 0.9 0.3 0.2 15 | :place simplerTrapezoid 2 hall r000 100 0 0 16 | 17 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/twistedTRAP.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 100 100 100 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | :volu twistedTrap TWISTEDTRAP 7 | 3.14159265/6 // twisted angle in rad 8 | 60 // dz/2 9 | 3.14159265/9 // theta 10 | 3.14159265/36 // phi 11 | 40 // dy1/2: half y @ -dz/2 12 | 30 // half x @ -dz/2 and -dy1/2 13 | 40 // half x @ -dz/2 and +dy1/2 14 | 16 // dy1/2: half y @ dz/2 15 | 10 // half x @ dz/2 and -dy1/2 16 | 14 // half x @ dz/2 and +dy1/2 17 | 3.14159265/18 // angle with respect to y from the centre of the side 18 | G4_AIR 19 | :color twistedTrap 0.7 0.2 0.1 20 | 21 | :place twistedTrap 1 hall r000 0 0 0 22 | 23 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ideal/CsI2PMT.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac TUBE 0 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI crystal 6 | :volu CsI TUBE 0 38.1 25 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // PMT window 10 | :volu PMT TUBE 0 38.1 2 G4_SILICON_DIOXIDE 11 | :color PMT 0.3 0.3 0.3 12 | 13 | // place PMTs on the two end surfaces of CsI 14 | :rotm r000 0 0 0 15 | :place CsI 1 vac r000 0 0 0 16 | :place PMT 2 vac r000 0 0 -27 17 | :place PMT 3 vac r000 0 0 27 18 | 19 | // optical properties of CsI 20 | #include ../../CsI.tg 21 | // optical properties of PMT 22 | #include ../../SiO2.tg 23 | 24 | -------------------------------------------------------------------------------- /tutorials/detector/optical/Cherenkov/drawEdistr.C: -------------------------------------------------------------------------------- 1 | { 2 | gStyle->SetOptStat(0); 3 | gStyle->SetPadTopMargin(0.01); 4 | gStyle->SetPadLeftMargin(0.09); 5 | gStyle->SetPadRightMargin(0.005); 6 | gStyle->SetPadBottomMargin(0.19); 7 | gStyle->SetTitleOffset(0.53,"Y"); 8 | gStyle->SetTitleSize(0.09,"XY"); 9 | gStyle->SetLabelSize(0.09,"XY"); 10 | 11 | TCanvas* c = new TCanvas("c", "c", 800, 300); 12 | 13 | TChain t("t"); 14 | t.Add("Cherenkov.root"); 15 | 16 | TH1F* h = new TH1F("h", ";Cherenkov photon energy [eV]; Entries", 100, 0, 6.5); 17 | h->SetLineWidth(2); 18 | t.Draw("k*1000>>h", "stp==0 && pdg==-22"); 19 | 20 | c->Print("crkvE.png"); 21 | } 22 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scintillation/ogl.mac: -------------------------------------------------------------------------------- 1 | /vis/open OGL 2 | /vis/drawVolume 3 | 4 | /vis/viewer/zoomTo 1.5 5 | /vis/viewer/set/lineSegmentsPerCircle 60 6 | /vis/viewer/set/viewpointVector 0 0 1 7 | /vis/viewer/set/background white 8 | 9 | /vis/modeling/trajectories/create/drawByParticleID 10 | /vis/modeling/trajectories/drawByParticleID-0/default/setLineWidth 5 11 | /vis/modeling/trajectories/drawByParticleID-0/setDefaultRGBA 0 0.78 0.55 1 12 | 13 | /vis/set/textSize 36 14 | /vis/scene/add/axes 15 | /vis/scene/add/trajectories 16 | 17 | /run/beamOn 2 18 | 19 | /gui/addMenu export Export 20 | /gui/addButton export png "/vis/ogl/export scintillation.png" 21 | 22 | -------------------------------------------------------------------------------- /tutorials/sources/AmBe/CsIandNaI4438keV.mac: -------------------------------------------------------------------------------- 1 | /geometry/source CsIandNaI.tg 2 | 3 | /run/initialize 4 | 5 | /vis/ASCIITree/verbose 13 6 | /vis/drawTree 7 | /geometry/test/run 8 | 9 | /process/list 10 | 11 | /gps/particle gamma 12 | 13 | /gps/pos/type Plane 14 | /gps/pos/shape Circle 15 | /gps/pos/radius 1. cm 16 | /gps/pos/centre 0 0 -22.5 cm 17 | 18 | # shoot downward only 19 | /gps/ang/type iso 20 | /gps/ang/mintheta 90 degree 21 | 22 | /gps/ene/type Gauss 23 | /gps/ene/mono 4.43803 MeV 24 | /gps/ene/sigma 0.0467 MeV 25 | 26 | /random/setSeeds 2412 79628 27 | 28 | /tracking/verbose 0 29 | 30 | /analysis/setFileName 4438MeV 31 | /run/statusReport 10000 32 | /run/beamOn 1000 33 | -------------------------------------------------------------------------------- /INSTALL/Apptainer/gears.def: -------------------------------------------------------------------------------- 1 | BootStrap: docker 2 | From: physino/geant4:gears 3 | 4 | %help 5 | Container of the latest Geant4 on the latest Fedora 6 | 7 | %post 8 | echo "#!/bin/sh" > /.singularity.d/env/99-g4.sh 9 | grep DATA /usr/bin/geant4.sh >> /.singularity.d/env/99-g4.sh 10 | 11 | # customize container PS1 (https://stackoverflow.com/a/61251143) 12 | echo 'PS1="\u@geant4.11.0.3:\w \$ "' >> /.singularity.d/env/99-g4.sh 13 | 14 | %environment 15 | export LANG=C.UTF-8 16 | export LC_ALL=C.UTF-8 17 | # https://github.com/apptainer/singularity/issues/643 18 | # settings in ~/.bashrc will be loaded last 19 | export SINGULARITY_SHELL=/usr/bin/bash 20 | 21 | %runscript 22 | gears "$@" 23 | -------------------------------------------------------------------------------- /tutorials/README.md: -------------------------------------------------------------------------------- 1 | ## Tutorials 2 | 3 | - [User interface and session mode](UI) 4 | - [Detector construction](detector) and [visualization](detector/visualization) 5 | - [Particle sources](sources), *e.g.*, [Am-241](sources#am241), [AmBe](sources#@ambe), [Ar39](sources#ar39), [Fe55](sources#fe55), [Co57](sources#co57), etc. 6 | - [Output](output) in various formats (including [ROOT](output#root)) 7 | - [Physics](physics) [processes](physics#physics-processes) for [alphas](physics/alpha), [betas](physics/beta), [gammas](physics/gamma), [neutrons](physics/neutron), [muons](physics/muon), etc. Optionally, [optical simulation](physics#optical-processes) and [radioactive decay](physics#radioactive-decay). 8 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/frame1.tg: -------------------------------------------------------------------------------- 1 | // default unit is mm for length and degree for angle 2 | :volu world BOX 20 20 20 G4_Galactic 3 | :vis world OFF 4 | 5 | :solid cube BOX 16 16 16 6 | // cuboid is longer than cube to avoid sharing surface 7 | :solid cuboid BOX 17 12 12 8 | 9 | //rotational matrix 10 | :rotm ry90 0 90 0 11 | :rotm rz90 0 0 90 12 | :rotm r000 0 0 0 13 | 14 | // boolean operations 15 | :solid base0 SUBTRACTION cube cuboid r000 0 0 0 16 | :solid base1 SUBTRACTION base0 cuboid ry90 0 0 0 17 | :solid frame SUBTRACTION base1 cuboid rz90 0 0 0 18 | 19 | :volu frame frame G4_AIR 20 | :color frame 0 0.5 0.5 21 | :place frame 1 world r000 0 0 0 22 | -------------------------------------------------------------------------------- /tutorials/physics/X-ray/fluorescence.mac: -------------------------------------------------------------------------------- 1 | /geometry/source foil.tg 2 | 3 | # https://geant4.web.cern.ch/node/1620 4 | /physics_lists/select LBE_LIV 5 | # PIXE must be used to enable the creation of characteristic X-rays 6 | /process/em/pixe true 7 | /run/initialize 8 | 9 | /process/em/printParameters 10 | 11 | /gps/particle alpha 12 | /gps/energy 5.5 MeV 13 | /gps/pos/centre -1 0 0 mm 14 | /gps/direction 1 0 0 15 | 16 | /vis/open HepRepFile 17 | /vis/drawVolume 18 | /vis/scene/add/trajectories 19 | /vis/scene/endOfEventAction accumulate 20 | 21 | /tracking/verbose 2 22 | /run/beamOn 10 23 | 24 | /vis/disable 25 | /tracking/verbose 0 26 | /analysis/setFileName fluorescence 27 | /run/beamOn 10000 28 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/polycone.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 80 80 80 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // start phi, dphi in degrees, # of rz points, 7 | // r1, z1, 8 | // r2, z2, 9 | // ... 10 | :volu method1 POLYCONE 0 360 6 11 | 3 -2 12 | 3.5 -2 13 | 3.5 0.75 14 | 3.75 1 15 | 3.75 2 16 | 3 2 17 | G4_AIR 18 | :color method1 0.4 0.3 0.8 19 | :place method1 1 hall r000 0 0 0 20 | 21 | // start phi, dphi in degrees, # of z planes, 22 | // z1, r1in, r1out, 23 | // z2, r2in, r2out, 24 | // ... 25 | :volu method2 POLYCONE 0 360 4 26 | -2 3 3.5 27 | 0.75 3 3.5 28 | 1. 3. 3.75 29 | 2. 3. 3.75 30 | G4_AIR 31 | :color method2 0.9 0.2 0.1 32 | :place method2 2 hall r000 10 0 0 33 | 34 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/frame2.tg: -------------------------------------------------------------------------------- 1 | // default unit is mm for length and degree for angle 2 | :volu world BOX 20 20 20 G4_Galactic 3 | :vis world OFF 4 | 5 | :solid cube BOX 16 16 16 6 | // cuboid is longer than cube to avoid sharing surface 7 | :solid cuboid1 BOX 17 12 12 8 | :solid cuboid2 BOX 12 17 12 9 | // won't work if 11.999 becomes 12 10 | :solid cuboid3 BOX 11.999 11.999 17 11 | 12 | :rotm r000 0 0 0 13 | 14 | // boolean operations 15 | :solid base0 SUBTRACTION cube cuboid1 r000 0 0 0 16 | :solid base1 SUBTRACTION base0 cuboid2 r000 0 0 0 17 | :solid frame SUBTRACTION base1 cuboid3 r000 0 0 0 18 | 19 | :volu frame frame G4_AIR 20 | :color frame 0 0.5 0.5 21 | :place frame 1 world r000 0 0 0 22 | -------------------------------------------------------------------------------- /tutorials/detector/CSG/polyhedra.tg: -------------------------------------------------------------------------------- 1 | :volu hall BOX 80 80 80 G4_Galactic 2 | :vis hall OFF 3 | 4 | :rotm r000 0 0 0 5 | 6 | // start phi, dphi in degree, # of sides, # of z planes, 7 | // z0, R0in, R0out, 8 | // z1, R1out, R1in, 9 | // ... 10 | :volu method1 POLYHEDRA 0 270 5 3 11 | -20 2 10 12 | 0 3 8 13 | 20 5 10 14 | G4_AIR 15 | :color method1 0.4 0.3 0.8 16 | :place method1 1 hall r000 0 0 0 17 | 18 | // start phi, dphi in degree, # of sides, # of rz points, 19 | // r0, z0, 20 | // r1, z1, 21 | // ... 22 | :volu method2 POLYHEDRA 0 270 5 6 23 | 2 -20 24 | 10 -20 25 | 8 0 26 | 10 20 27 | 5 20 28 | 3 0 29 | G4_AIR 30 | :color method2 0.9 0.3 0.2 31 | :place method2 2 hall r000 25 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scintillation/fitNdistr.C: -------------------------------------------------------------------------------- 1 | { 2 | gStyle->SetOptFit(1); 3 | gStyle->SetStatW(0.25); 4 | gStyle->SetOptStat(1110); 5 | gStyle->SetPadTopMargin(0.01); 6 | gStyle->SetPadLeftMargin(0.09); 7 | gStyle->SetPadRightMargin(0.01); 8 | gStyle->SetTitleOffset(0.9,"Y"); 9 | TCanvas* c = new TCanvas; 10 | 11 | TChain t("t"); 12 | t.Add("scintillation.root"); 13 | 14 | TH1F* h = new TH1F("h", ";Number of scintillation photons; Entries", 100, 0, 310); 15 | t.Draw("(n-5)/2>>h"); 16 | 17 | TF1* f0 = new TF1("f0", "gausn", 0, 310); 18 | f0->SetLineColor(kRed); 19 | f0->SetLineWidth(1); 20 | f0->SetParNames("norm", "mean", "sigma"); 21 | h->Fit(f0); 22 | 23 | c->Print("Nphotons.png"); 24 | } 25 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/tophat.mac: -------------------------------------------------------------------------------- 1 | /geometry/source tophat.tg 2 | 3 | /run/initialize 4 | 5 | /geometry/test/run 6 | 7 | /vis/ASCIITree/verbose 13 8 | /vis/drawTree 9 | 10 | /vis/open HepRepFile 11 | /vis/drawVolume 12 | /vis/viewer/flush 13 | 14 | /control/shell dawn -c 15 | /control/shell rm -f *.prim g4_????.eps tophat.png 16 | 17 | /vis/open DAWNFILE 18 | /vis/drawVolume 19 | /vis/viewer/set/style surface 20 | /vis/viewer/set/background white ! ! 0 21 | /vis/viewer/set/viewpointThetaPhi 60 60 22 | /vis/viewer/set/lineSegmentsPerCircle 121 23 | # hide low density volumes 24 | /vis/viewer/set/culling density true 1e-10 kg/m3 25 | /vis/viewer/flush 26 | 27 | /control/shell convert g4_????.eps -trim +repage tophat.png 28 | -------------------------------------------------------------------------------- /tutorials/detector/boolean/frame2.mac: -------------------------------------------------------------------------------- 1 | /geometry/source frame2.tg 2 | 3 | /run/initialize 4 | 5 | # all of them work for frame2 6 | /vis/open RayTracer 7 | /vis/drawVolume 8 | /vis/viewer/set/background white 9 | /vis/viewer/set/viewpointThetaPhi 20 30 10 | /vis/viewer/flush 11 | 12 | /vis/open VRML2FILE 13 | /vis/drawVolume 14 | /vis/viewer/flush 15 | 16 | /vis/open HepRepFile 17 | /vis/drawVolume 18 | /vis/viewer/flush 19 | 20 | /control/shell dawn -c 21 | /control/shell rm -f *.prim g4_????.eps frame2.png 22 | 23 | /vis/open DAWNFILE 24 | /vis/drawVolume 25 | /vis/viewer/set/viewpointThetaPhi 30 120 26 | /vis/viewer/set/style surface 27 | /vis/viewer/flush 28 | 29 | /control/shell convert g4_????.eps -trim +repage frame2.png 30 | -------------------------------------------------------------------------------- /tutorials/radiotherapy/radioembolization/README.md: -------------------------------------------------------------------------------- 1 | ## Y-90 Radioembolization 2 | 3 | - 4 | 5 | ### Yttrium-90 6 | 7 | - 8 | - 9 | 10 | ### Simulation 11 | 12 | ```sh 13 | # simulate 10000 Y-90 decays in a liver tumor 14 | gears y90.mac 15 | # open the record for analysis 16 | root record.root 17 | ``` 18 | 19 | Example analysis code in ROOT: 20 | 21 | ```cpp 22 | // draw beta spectrum 23 | t->Draw("k","trk==4 && stp==0") 24 | // draw energy spectrum of X-rays created by e- bremstrahlung 25 | t->Draw("k","trk==5 && pdg==22 && stp==0") 26 | ``` 27 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/hv: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # check java 4 | j=`command -v java` 5 | if [ X"$j" = X ]; then echo "No java can be found. Quit"; exit; fi 6 | 7 | VERSION=`java -version 2>&1 | head -n 1 | awk '{print $3}' | awk -F "." '{print $1}'` 8 | VERSION=${VERSION:1} 9 | if [ $VERSION -gt 8 ]; then 10 | echo java $VERSION is too new to run HepRApp. Quit. 11 | exit 12 | fi 13 | 14 | # download and run HepRApp.jar 15 | JAR="HepRApp.jar" 16 | DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" 17 | if [ ! -f $DIR/$JAR ]; then 18 | curl -L https://www.dropbox.com/s/xfatlu1rp7ffavv/HepRApp.jar?dl=1 -o $DIR/$JAR 19 | fi 20 | # https://github.com/XQuartz/XQuartz/issues/31#issuecomment-1356328281 21 | java -Dsun.java2d.xrender=false -jar $DIR/$JAR -opt ~/.heprapprc -file $1 22 | -------------------------------------------------------------------------------- /tutorials/physics/neutron/concrete.tg: -------------------------------------------------------------------------------- 1 | :P percent 0.01 2 | 3 | // concrete (cement) mixed by weight 4 | :MIXT_BY_WEIGHT concrete 3.9*g/cm3 11 5 | G4_O 55.714*$percent 6 | G4_Fe 28.026*$percent 7 | G4_H 10.293*$percent 8 | G4_Ca 3.090*$percent 9 | G4_Si 1.929*$percent 10 | G4_Al 0.550*$percent 11 | G4_Mg 0.236*$percent 12 | G4_S 0.092*$percent 13 | G4_Mn 0.044*$percent 14 | G4_K 0.014*$percent 15 | G4_Na 0.012*$percent 16 | 17 | :volu world BOX 1*m 1*m 1*m G4_AIR 18 | :volu concrete BOX 5*cm 50*cm 50*cm concrete 19 | :volu detector BOX 1*mm 50*cm 50*cm G4_AIR 20 | 21 | //rotation matrix 22 | :rotm r000 0 0 0 23 | 24 | :place concrete 1 world r000 0 0 0 25 | :place detector 2 world r000 10*cm 0 0 26 | 27 | :vis world OFF 28 | :color concrete 0.66 0.70 0.76 //Crayola 29 | :color detector 0.36 0.68 0.93 //blue jeans 30 | 31 | -------------------------------------------------------------------------------- /INSTALL/ROOT/rootlogon.C: -------------------------------------------------------------------------------- 1 | { // https://root.cern.ch/doc/master/classTStyle.html 2 | // margins 3 | gStyle->SetPadRightMargin(0.02); 4 | gStyle->SetPadLeftMargin(0.08); 5 | gStyle->SetPadTopMargin(0.02); 6 | gStyle->SetPadBottomMargin(0.11); 7 | 8 | // axes 9 | gStyle->SetLabelFont(22,"xyz"); 10 | gStyle->SetTitleFont(22,"xyz"); 11 | gStyle->SetLabelSize(0.05,"xyz"); 12 | gStyle->SetTitleSize(0.05,"xyz"); 13 | 14 | // title 15 | gStyle->SetTitleY(0.95); 16 | gStyle->SetTitleFont(22,"h"); 17 | gStyle->SetTitleSize(0.05,"h"); 18 | 19 | // statistic box 20 | gStyle->SetOptStat(111110); 21 | gStyle->SetStatX(0.98); 22 | gStyle->SetStatY(0.98); 23 | gStyle->SetStatW(0.25); 24 | gStyle->SetStatFont(22); 25 | gStyle->SetStatFontSize(0.05); 26 | 27 | // legend 28 | gStyle->SetLegendBorderSize(1); 29 | gStyle->SetLegendFont(22); 30 | } 31 | -------------------------------------------------------------------------------- /INSTALL/ROOT/Dockerfile: -------------------------------------------------------------------------------- 1 | # fedora has ROOT in its package repo, ubuntu doesn't 2 | FROM fedora 3 | 4 | # overwrite the maintainer of fedora image 5 | LABEL maintainer="Jing Liu" 6 | 7 | # https://hub.docker.com/r/fedora/container-best-practices/dockerfile 8 | RUN dnf update -y && dnf clean all 9 | 10 | RUN dnf install -y root root-gui-webdisplay root-gui-fitpanel \ 11 | && dnf clean all && rm -fr /var/cache/* root/*.log root/*.cfg 12 | 13 | # fine tune ROOT configurations 14 | COPY .rootrc /root/ 15 | # set default drawing style 16 | COPY rootlogon.C /usr/share/root/macros/ 17 | 18 | # overwrite the default working directory: / 19 | WORKDIR /root/ 20 | 21 | # enable colorful shell prompt 22 | # https://superuser.com/a/367280 23 | ENV PS1="\[\e[0;32m\]\u@fedora:\[\e[0;34m\]\w \[\e[0;31m\]\$\[\e[m\] " 24 | ENV TERM="xterm-256color" 25 | 26 | -------------------------------------------------------------------------------- /tutorials/detector/optical/absorption/ogl.mac: -------------------------------------------------------------------------------- 1 | /vis/open OGL 2 | /vis/drawVolume 3 | 4 | /vis/viewer/zoomTo 2 5 | /vis/viewer/set/auxiliaryEdge 6 | /vis/viewer/set/viewpointVector 0.56 0.53 0.64 7 | # this doesn't really create a transparent background 8 | /vis/viewer/set/background 1 1 1 0 9 | # use the following instead 10 | # magick absorption_0000.png -transparent white absorption.png 11 | 12 | /vis/modeling/trajectories/create/drawByParticleID 13 | /vis/modeling/trajectories/drawByParticleID-0/default/setLineWidth 5 14 | /vis/modeling/trajectories/drawByParticleID-0/setDefaultRGBA 0 0.78 0.55 1 15 | 16 | /vis/set/textSize 36 17 | /vis/scene/add/axes 18 | /vis/scene/add/trajectories 19 | /vis/scene/endOfEventAction accumulate 20 | 21 | /run/beamOn 10 22 | 23 | /gui/addMenu export Export 24 | /gui/addButton export png "/vis/ogl/export absorption.png" 25 | 26 | -------------------------------------------------------------------------------- /tutorials/physics/X-ray/README.md: -------------------------------------------------------------------------------- 1 | ## X-ray creation 2 | 3 | The characteristic X-ray creation by ionizing particles in a material is demonstrated in [fluorescence.mac](fluorescence.mac), where 5.5 MeV alpha rays are shot to a thin Al foil defined in [foil.tg](foil.tg).Minimal macro commands needed to create characteristic X-ray are: 4 | 5 | ```sh 6 | # working EM options: _LIV, _PEN, _EMY, _EMZ 7 | /physics_lists/select LBE_LIV 8 | # /process/em/ only exists with radioactive decay being enabled 9 | /physics_lists/factory/addRadioactiveDecay 10 | # PIXE must be used to enable the creation of characteristic X-rays 11 | /process/em/pixe true 12 | # /run/initialize must be called after the physics setups above 13 | /run/initialize 14 | ``` 15 | 16 | For detailed tuning, please refer to Geant4 [node 1620][]. 17 | 18 | [node 1620]: https://geant4.web.cern.ch/node/1620 19 | -------------------------------------------------------------------------------- /tutorials/physics/alpha/air.mac: -------------------------------------------------------------------------------- 1 | /geometry/source air.tg 2 | 3 | /run/initialize 4 | 5 | /vis/ASCIITree/verbose 13 6 | /vis/drawTree 7 | /geometry/test/run 8 | 9 | /vis/open HepRepFile 10 | /vis/viewer/zoom 450 11 | /vis/drawVolume 12 | /vis/scene/add/trajectories 13 | /vis/scene/add/text -3 -0.4 0 cm 20 0 0 0 14 | /vis/scene/add/text -2 -0.4 0 cm 20 0 0 1 15 | /vis/scene/add/text -1 -0.4 0 cm 20 0 0 2 16 | /vis/scene/add/text 0 -0.4 0 cm 20 0 0 3 17 | /vis/scene/add/text 1 -0.4 0 cm 20 0 0 4 18 | /vis/scene/add/text 2 -0.4 0 cm 20 0 0 5 cm 19 | /vis/scene/add/text -3 0.4 0 cm 20 0 0 6.11 MeV alpha particles fly in air 20 | /vis/scene/endOfEventAction accumulate 100 21 | 22 | /gps/particle alpha 23 | /gps/energy 6.11 MeV 24 | /gps/pos/centre -3 0 0 25 | /gps/direction 1 0 0 26 | 27 | /random/setSeeds 12 43 28 | /run/beamOn 100 29 | 30 | /vis/open OGL 31 | 32 | -------------------------------------------------------------------------------- /tutorials/physics/gamma/rootlogon.C: -------------------------------------------------------------------------------- 1 | { // https://root.cern.ch/doc/master/classTStyle.html 2 | // margins 3 | gStyle->SetPadRightMargin(0.02); 4 | gStyle->SetPadLeftMargin(0.08); 5 | gStyle->SetPadTopMargin(0.02); 6 | gStyle->SetPadBottomMargin(0.11); 7 | 8 | // axes 9 | gStyle->SetLabelFont(22,"xyz"); 10 | gStyle->SetTitleFont(22,"xyz"); 11 | gStyle->SetLabelSize(0.05,"xyz"); 12 | gStyle->SetTitleSize(0.05,"xyz"); 13 | 14 | // title 15 | gStyle->SetTitleY(0.95); 16 | gStyle->SetTitleFont(22,"h"); 17 | gStyle->SetTitleSize(0.05,"h"); 18 | 19 | // statistic box 20 | gStyle->SetOptStat(111110); 21 | gStyle->SetStatX(0.98); 22 | gStyle->SetStatY(0.98); 23 | gStyle->SetStatW(0.25); 24 | gStyle->SetStatFont(22); 25 | gStyle->SetStatFontSize(0.05); 26 | 27 | // legend 28 | gStyle->SetLegendBorderSize(1); 29 | gStyle->SetLegendFont(22); 30 | } 31 | -------------------------------------------------------------------------------- /tutorials/sources/Co57HPGe.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 1 2 | 3 | /geometry/source HPGe.tg 4 | 5 | /run/initialize 6 | 7 | # load pre-defined source 8 | /control/execute Co57.mac 9 | 10 | # modify it 11 | /control/alias pos "0 0 40 mm" 12 | /gps/source/set 0 13 | /gps/position {pos} 14 | /gps/direction 0 0 -1 15 | /gps/source/set 1 16 | /gps/position {pos} 17 | /gps/direction 0 0 -1 18 | /gps/source/set 2 19 | /gps/position {pos} 20 | /gps/direction 0 0 -1 21 | /gps/source/set 3 22 | /gps/position {pos} 23 | /gps/direction 0 0 -1 24 | 25 | # check if modification works 26 | /gps/source/list 27 | 28 | # visualize geometry and events for debugging 29 | /vis/open HepRepFile 30 | /vis/drawVolume 31 | /vis/scene/add/trajectories 32 | /run/beamOn 10 33 | /vis/disable 34 | 35 | /analysis/setFileName Co57HPGe 36 | 37 | /run/verbose 2 38 | /run/printProgress 1000 39 | /run/beamOn 10000 40 | -------------------------------------------------------------------------------- /INSTALL/Docker/v2x: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # a bash scrip to convert g4_??.wrl to g4_??.x3d 3 | 4 | echo Search g4_??.wrl files ... 5 | files=`find . | grep wrl` 6 | if [ -z "$files" ]; then 7 | echo "There is no g4_??.wrl file found"; exit 8 | else 9 | for each in $files; do echo $each; done; echo 10 | fi 11 | 12 | echo "Convert g4_??.wrl to g4_??.x3d ..." 13 | for each in $files; do 14 | file=${each#./} # remove ./ from the beginning of string 15 | fx3d=${file/wrl/x3d} # .wrl -> .x3d 16 | page=${file/wrl/html} # .wrl -> .html 17 | # convert g4_??.wrl to g4_??.x3d 18 | java -jar /usr/bin/VrmlMerge-0.5beta.jar -convert $file $fx3d 19 | # tune transparency in g4_??.x3d 20 | sed -i.bak 's/"0.7"/"0.1"/g' $fx3d; rm $fx3d.bak 21 | # embed g4_??.x3d in g4_??.html 22 | base=`basename $fx3d` 23 | sed "s|gears.x3d|$base|" /usr/share/gearsX3D.html > $page 24 | done 25 | 26 | -------------------------------------------------------------------------------- /tutorials/detector/optical/CsI3inWLS.mac: -------------------------------------------------------------------------------- 1 | /geometry/source CsI3inWLS.tg 2 | 3 | /physics_lists/factory/addOptical 4 | /process/optical/processActivation Scintillation 5 | /process/optical/processActivation OpBoundary 6 | /process/optical/processActivation OpAbsorption false 7 | /process/optical/processActivation OpRayleigh false 8 | /process/optical/processActivation OpMieHG false 9 | /process/optical/processActivation Cerenkov false 10 | /process/optical/processActivation OpWLS false 11 | 12 | /run/initialize 13 | 14 | /vis/ASCIITree/verbose 13 15 | /vis/drawTree 16 | /geometry/test/run 17 | 18 | /process/list 19 | /process/setVerbose 10 OpBoundary 20 | 21 | /vis/open OGLIQt 22 | /vis/scene/add/axes 0 0 0 10 cm 23 | /vis/scene/add/trajectories 24 | 25 | /gps/particle gamma 26 | /gps/energy 1 keV 27 | /gps/position 0 0 0 cm 28 | 29 | /tracking/verbose 2 30 | /run/beamOn 1 31 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scattering/ogl.mac: -------------------------------------------------------------------------------- 1 | /vis/open OGL 2 | /vis/drawVolume 3 | 4 | /vis/viewer/zoomTo 2 5 | /vis/viewer/set/auxiliaryEdge 6 | #/vis/viewer/set/lineSegmentsPerCircle 6 7 | /vis/viewer/set/viewpointVector 1 1 -1 8 | # this doesn't really create a transparent background 9 | /vis/viewer/set/background 1 1 1 0 10 | # use the following instead 11 | # magick Rayleigh_0000.png -transparent white Rayleigh.png 12 | 13 | /vis/modeling/trajectories/create/drawByParticleID 14 | /vis/modeling/trajectories/drawByParticleID-0/default/setLineWidth 5 15 | /vis/modeling/trajectories/drawByParticleID-0/setDefaultRGBA 0 0.78 0.55 1 16 | 17 | /vis/set/textSize 36 18 | /vis/scene/add/axes 19 | /vis/scene/add/trajectories 20 | /vis/scene/endOfEventAction accumulate 21 | 22 | /run/beamOn 10 23 | 24 | /gui/addMenu export Export 25 | /gui/addButton export png "/vis/ogl/export Rayleigh.png" 26 | 27 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/CsI2Teflon.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 10 20 20 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 10 20 20 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 20 0 0 16 | 17 | // optical properties of CsI 18 | #include ../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundFrontPainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.99 0.99 31 | 32 | -------------------------------------------------------------------------------- /tutorials/physics/gamma/lead.tg: -------------------------------------------------------------------------------- 1 | // define logic volumes (default unit for length: mm) 2 | :volu hall BOX 250 250 250 G4_AIR 3 | :volu lead BOX 200 200 200 G4_Pb 4 | :volu slab BOX 200 200 0.1 G4_Pb 5 | 6 | // define a rotation matrix (needed in :place commands) 7 | :rotm r000 0 0 0 8 | 9 | // place a logic volume in another 10 | :place lead -1 hall r000 0 0 0 11 | :place slab 1 lead r000 0 0 -180 12 | :place slab 2 lead r000 0 0 -160 13 | :place slab 3 lead r000 0 0 -140 14 | :place slab 4 lead r000 0 0 -120 15 | :place slab 5 lead r000 0 0 -100 16 | :place slab 6 lead r000 0 0 -80 17 | :place slab 7 lead r000 0 0 -60 18 | :place slab 8 lead r000 0 0 -40 19 | :place slab 9 lead r000 0 0 -20 20 | :place slab 10 lead r000 0 0 0 21 | :place slab 11 lead r000 0 0 20 22 | 23 | // color is defined as percentage of RGB 24 | :color lead 0.5 0.5 0.5 25 | :color slab 0.5 0.5 0.5 26 | 27 | -------------------------------------------------------------------------------- /tutorials/output/detector.tg: -------------------------------------------------------------------------------- 1 | // default unit for length is mm 2 | :volu world BOX 100 100 100 G4_AIR 3 | :vis world OFF 4 | 5 | // a germanium detector in a vacuum chamber 6 | :volu chamber TUBE 0 52 62 G4_Al 7 | :volu vacuum TUBE 0 50 60 G4_Galactic 8 | :volu IRshield TUBE 0 48 58 G4_Al 9 | :volu inside TUBE 0 47 50 G4_Galactic 10 | :volu HPGe(S) TUBE 0 35 35 G4_Ge 11 | :color chamber 0.33 0.1 0.55 12 | :color vacuum 0.33 0.1 0.55 13 | :color IRshield 0 0 0.1 14 | :color inside 0 0 0.1 15 | :color HPGe(S) 0 0 0.8 16 | 17 | // define a rotation matrix that does no rotation 18 | :rotm r000 0 0 0 19 | // place them off center to demonstrate the 20 | // difference between xx, yy, zz and x, y, z 21 | :place chamber 3 world r000 40 40 20 22 | :place vacuum 0 chamber r000 0 0 0 23 | :place IRshield 2 vacuum r000 0 0 0 24 | :place inside 0 IRshield r000 0 0 7 25 | :place HPGe(S) 1 inside r000 0 0 -15 26 | -------------------------------------------------------------------------------- /tutorials/physics/muon/gui.mac: -------------------------------------------------------------------------------- 1 | /gui/addMenu particle Particle 2 | /gui/addButton particle alpha "/gps/particle alpha" 3 | /gui/addButton particle "beta (e-)" "/gps/particle e-" 4 | /gui/addButton particle "gamma (photon)" "/gps/particle gamma" 5 | /gui/addButton particle muon "/gps/particle mu+" 6 | /gui/addButton particle neutron "/gps/particle neutron" 7 | /gui/addButton particle proton "/gps/particle proton" 8 | 9 | /gui/addMenu energy Energy 10 | /gui/addButton energy "1 keV" "/gps/energy 1 keV" 11 | /gui/addButton energy "1 MeV" "/gps/energy 1 MeV" 12 | /gui/addButton energy "1 GeV" "/gps/energy 1 GeV" 13 | /gui/addButton energy "1 TeV" "/gps/energy 1 TeV" 14 | 15 | /gui/addMenu run Run 16 | /gui/addButton run "beamOn 1" "/run/beamOn 1" 17 | /gui/addButton run "beamOn 10" "/run/beamOn 10" 18 | /gui/addButton run "beamOn 100" "/run/beamOn 100" 19 | /gui/addButton run "beamOn 1000" "/run/beamOn 1000" 20 | 21 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundFrontPainted.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source CsI2Teflon.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | # must be run after the cmds above 12 | /run/initialize 13 | 14 | # check physics processes 15 | /process/list Electromagnetic 16 | /process/list Optical 17 | 18 | # generate primary particle with tiny energy 19 | /gps/particle opticalphoton 20 | /gps/energy 3.5 eV 21 | /gps/direction 1 0 0 22 | 23 | # visualize geometry and events for debugging 24 | /vis/open HepRepFile 25 | /vis/drawVolume 26 | /vis/scene/add/trajectories 27 | /vis/scene/endOfEventAction accumulate 28 | 29 | # dump a few events on screen for debugging 30 | /tracking/verbose 2 31 | /run/beamOn 50 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r0t0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r0t1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 1 1 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r0t0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polished 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r0t1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polished 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 1 1 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r1t0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polished 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 1 1 31 | TRANSMITTANCE 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/physics/decay/Pb210.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 1 2 | 3 | /geometry/source HPGe.tg 4 | 5 | /physics_lists/select QGSP_BERT 6 | # cmd below becomes available only when the cmd above is used 7 | /physics_lists/factory/addRadioactiveDecay 8 | # cmd below must be run after the cmds above 9 | /run/initialize 10 | 11 | # double check if radiactive decay is enabled 12 | /process/list Decay 13 | 14 | # split decay chain to multiple events based on time intervals between decays 15 | /grdm/setTimeWindow 1 s 16 | 17 | # Define Pb210 18 | /gps/particle ion 19 | /gps/ion 82 210 20 | # default kinetic energy set by gps is 1 MeV, 21 | # must be set to zero if your ion decays at rest 22 | /gps/energy 0 23 | 24 | /tracking/verbose 2 25 | # show how a track is passed between the stacking and tracking managers 26 | /event/verbose 2 27 | /analysis/setFileName output.root 28 | # one event is enough to demonstrate the process 29 | /run/beamOn 1 30 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r05t05.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.5 0.5 31 | TRANSMITTANCE 0.5 0.5 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r01t09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polished 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.1 0.1 31 | TRANSMITTANCE 0.9 0.9 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r05t05.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polished 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.5 0.5 31 | TRANSMITTANCE 0.5 0.5 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r09t01.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polished 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.9 0.9 31 | TRANSMITTANCE 0.1 0.1 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa5.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 5 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r0t0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r1t0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 1 1 31 | TRANSMITTANCE 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r1t1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 10 20 20 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 10 20 20 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 20 0 0 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 1 1 31 | TRANSMITTANCE 1 1 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa30.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 30 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r0t1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 1 1 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedfrontpainted/r0t0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedfrontpainted/r0t1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0 0 31 | TRANSMITTANCE 1 1 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedfrontpainted/r1t0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 1 1 31 | TRANSMITTANCE 0 0 32 | 33 | -------------------------------------------------------------------------------- /tutorials/output/drawHits.C: -------------------------------------------------------------------------------- 1 | // Draw combined hits in a simulated event 2 | void drawHits(int evt=16, const char *intput="hits.root") 3 | { 4 | TChain *h = new TChain("h"); 5 | h->Add(intput); 6 | 7 | gStyle->SetPadTopMargin(0.02); 8 | gStyle->SetPadRightMargin(0.025); 9 | TCanvas *c = new TCanvas("c","c",500,500); 10 | 11 | // draw all hits to show the detector cross section 12 | h->SetMarkerColor(30); 13 | h->SetMarkerStyle(kDot); 14 | h->Draw("y:x"); 15 | ((TH2F*) gPad->GetPrimitive("htemp"))->SetTitle(";x [mm];y [mm]"); 16 | 17 | // draw combined hits in an event 18 | h->SetMarkerColor(kRed); 19 | h->SetMarkerStyle(kFullDotLarge); 20 | h->Draw("y:x","","samelp",1,evt); 21 | 22 | TText *txt1 = new TText(-20,-16,"Combined hits"); 23 | txt1->SetTextColor(kRed); 24 | txt1->Draw(); 25 | TText *txt2 = new TText(-20,36,"Detector cross section"); 26 | txt2->SetTextColor(30); 27 | txt2->Draw(); 28 | 29 | c->Print("combinedHits.png"); 30 | } 31 | -------------------------------------------------------------------------------- /tutorials/sources/Am241.tg: -------------------------------------------------------------------------------- 1 | //AmO2 geometry 2 | //https://en.wikipedia.org/wiki/Americium-241#Manufacturing_process 3 | //https://en.wikipedia.org/wiki/Americium_dioxide 4 | 5 | :MIXT_BY_NATOMS AmO2 11.68 2 6 | Am 1 7 | O 2 8 | 9 | // holder geometry 10 | :rotm r0 0 0 0 11 | :solid base TUBE 0 3.16 1.26 12 | :solid inner TUBE 0 1.61 0.5 13 | :solid outer TUBE 1.61 3.17 1.23 14 | :solid top SUBTRACTION base inner r00 0 0 1.26 15 | :solid holder SUBTRACTION top outer r00 0 0 -1.26 16 | :volu holder holder G4_Al 17 | 18 | //source geometry 19 | :volu AmO2 TUBE 0 1.61 0.1 AmO2 20 | :volu gold TUBE 0 1.61 0.001 G4_Au 21 | :volu silver TUBE 0 1.61 0.001 G4_Ag 22 | 23 | :rotm r00 0 0 0 24 | :place gold 2 holder r00 0 0 0.759 25 | :place AmO2 3 holder r00 0 0 0.658 26 | :place silver 4 holder r00 0 0 0.557 27 | 28 | :color AmO2 0.04 0.8 0.16 29 | :color gold 0.3 0.3 0.4 30 | :color silver 0.6 0.2 0.2 31 | :color holder 0.2 0.2 0.2 32 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r05t05.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.5 0.5 31 | TRANSMITTANCE 0.5 0.5 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedfrontpainted/r05t05.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedfrontpainted 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.5 0.5 31 | TRANSMITTANCE 0.5 0.5 32 | 33 | -------------------------------------------------------------------------------- /tutorials/detector/gears.tg: -------------------------------------------------------------------------------- 1 | :volu world BOX 1*m 1*m 1*m G4_AIR 2 | 3 | :rotm r000 0 0 0 4 | 5 | :solid base TUBS 5*cm 14*cm 5*cm 0 360 6 | :solid gap1 TUBS 10*cm 15*cm 6*cm 0 36 7 | :solid gap2 TUBS 10*cm 15*cm 6*cm 72 36 8 | :solid gap3 TUBS 10*cm 15*cm 6*cm 144 36 9 | :solid gap4 TUBS 10*cm 15*cm 6*cm 216 36 10 | :solid gap5 TUBS 10*cm 15*cm 6*cm 288 36 11 | :solid bas1 subtraction base gap1 r000 0 0 0 12 | :solid bas2 subtraction bas1 gap2 r000 0 0 0 13 | :solid bas3 subtraction bas2 gap3 r000 0 0 0 14 | :solid bas4 subtraction bas3 gap4 r000 0 0 0 15 | :solid bas5 subtraction bas4 gap5 r000 0 0 0 16 | 17 | :volu gear1 bas5 G4_STAINLESS-STEEL 18 | :volu gear2 bas5 G4_BRASS 19 | :volu gear3 bas5 G4_PARAFFIN 20 | 21 | :place gear1 1 world r000 -2*cm -8*cm 0 22 | :place gear2 2 world r000 -8*cm 8*cm 12*cm 23 | :place gear3 3 world r000 8*cm 8*cm -12*cm 24 | 25 | :color gear1 0.9 0.9 0 26 | :color gear2 0 0.5 0.5 27 | :color gear3 0 0.5 0 28 | :vis world OFF 29 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa0.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa5rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 5 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 0.9 0.9 33 | 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa5rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 5 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 0.9 0.9 33 | 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/totalInternalReflection.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source intRef.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 1 1 0 24 | 25 | # visualize geometry and events for debugging 26 | /vis/open HepRepFile 27 | /vis/drawVolume 28 | /vis/scene/add/trajectories 29 | /vis/scene/endOfEventAction accumulate 30 | 31 | # dump a few events on screen for debugging 32 | /tracking/verbose 2 33 | /run/beamOn 50 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa30.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 30 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa5back1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 5 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | BACKSCATTERCONSTANT 1 1 34 | -------------------------------------------------------------------------------- /gears.bat: -------------------------------------------------------------------------------- 1 | :: Add gears folder to user PATH 2 | 3 | :: Disable printing commands on screen 4 | @echo OFF 5 | 6 | if not exist gears.exe ( 7 | if not exist ..\gears.exe ( 8 | echo cannot find gears.exe, please compile gears.cc first 9 | pause & exit /b 10 | ) 11 | ) 12 | 13 | :: Get curernt user PATH from the registry 14 | :: https://stackoverflow.com/questions/46712814 15 | :: https://stackoverflow.com/questions/14509652 16 | for /f "skip=2 tokens=1-2*" %%G in ('Reg Query HKCU\Environment /V PATH 2^>nul') do set user_path=%%I 17 | 18 | :: check if current folder is already in PATH 19 | echo %user_path% | findstr /i /c:%~dp0 > nul 20 | if %errorlevel% neq 0 ( 21 | echo add "%~dp0" to user PATH 22 | setx path "%user_path%%~dp0;" 23 | ) else ( 24 | echo %~dp0 & echo is already in your user PATH: 25 | echo %user_path:;=&echo.% 26 | ) 27 | 28 | echo gears.exe can be executed anywhere now 29 | :: keep terminal open to show result if the script is run manually 30 | pause & exit /b 31 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0back1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 20 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | BACKSCATTERCONSTANT 1 1 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0sl1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | SPECULARLOBECONSTANT 1 1 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0spec1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | SPECULARSPIKECONSTANT 1 1 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa0rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 0.9 0.9 33 | 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0rin2.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 2 2 33 | 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scintillation/fitTslow.C: -------------------------------------------------------------------------------- 1 | { 2 | gStyle->SetOptFit(0); 3 | gStyle->SetStatW(0.25); 4 | gStyle->SetOptStat(1110); 5 | gStyle->SetPadTopMargin(0.01); 6 | gStyle->SetPadLeftMargin(0.09); 7 | gStyle->SetPadRightMargin(0.01); 8 | gStyle->SetTitleOffset(0.9,"Y"); 9 | TCanvas* c = new TCanvas; 10 | 11 | TChain t("t"); 12 | t.Add("scintillation.root"); 13 | 14 | TH1F* h = new TH1F("h", ";Scintillation photon generation time [ns]; Entries", 100, 0, 1.5e4); 15 | t.Draw("t>>h", "stp==0 && pdg==-22"); 16 | 17 | h->Fit("expo", "", "", 100, 1.3e4); 18 | TF1* f = h->GetFunction("expo"); 19 | f->SetLineColor(kRed); 20 | f->SetLineWidth(1); 21 | 22 | TLatex l1, l2; 23 | l1.SetTextFont(22); l1.SetTextSize(0.06); l1.SetTextColor(kRed); 24 | l2.SetTextFont(22); l2.SetTextSize(0.06); 25 | l1.DrawLatex(2000, 10, "f(t)=A e^{-t/#tau}"); 26 | l2.DrawLatex(2000, 2, Form("#tau = (%.0f #pm 1) ns", -1/f->GetParameter(1))); 27 | 28 | c->SetLogy(); 29 | c->Print("Tslow.png"); 30 | } 31 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa5rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 5 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r0sa5rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 5 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 0.9 0.9 33 | 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa0back1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | BACKSCATTERCONSTANT 1 1 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa0spec1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | SPECULARSPIKECONSTANT 1 1 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r0sa0back1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | BACKSCATTERCONSTANT 1 1 34 | -------------------------------------------------------------------------------- /tutorials/sources/Co57.mac: -------------------------------------------------------------------------------- 1 | # http://www.spectrumtechniques.com/products/sources/cobalt-57/ 2 | 3 | /control/alias srcpos "0 0 0" 4 | 5 | # gamma 1 6 | /gps/source/intensity 0.0916 # 9.16% 7 | /gps/particle gamma 8 | /gps/pos/type Point 9 | /gps/pos/centre {srcpos} 10 | /gps/ang/type iso 11 | /gps/ene/type Mono 12 | /gps/ene/mono 14.4 keV 13 | 14 | # gamma 2 15 | /gps/source/add 0.856 # 85.6% 16 | /gps/particle gamma 17 | /gps/pos/type Point 18 | /gps/pos/centre {srcpos} 19 | /gps/ang/type iso 20 | /gps/ene/type Mono 21 | /gps/ene/mono 122.06 keV 22 | 23 | # gamma 3 24 | /gps/source/add 0.1068 # 10.68% 25 | /gps/particle gamma 26 | /gps/pos/type Point 27 | /gps/pos/centre {srcpos} 28 | /gps/ang/type iso 29 | /gps/ene/type Mono 30 | /gps/ene/mono 136.5 keV 31 | 32 | # gamma 4 33 | /gps/source/add 0.00157 # 0.157% 34 | /gps/particle gamma 35 | /gps/pos/type Point 36 | /gps/pos/centre {srcpos} 37 | /gps/ang/type iso 38 | /gps/ene/type Mono 39 | /gps/ene/mono 692. keV 40 | 41 | # list all sources 42 | /gps/source/list 43 | -------------------------------------------------------------------------------- /tutorials/sources/Fe55.mac: -------------------------------------------------------------------------------- 1 | /control/alias srcpos "0 0 0" 2 | 3 | # http://nucleardata.nuclear.lu.se/toi/nuclide.asp?iZA=260055 4 | 5 | # X-ray 1 6 | /gps/source/intensity 0.0854 # 8.54% 7 | /gps/particle gamma 8 | /gps/pos/type Point 9 | /gps/pos/centre {srcpos} 10 | /gps/ang/type iso 11 | /gps/ene/type Mono 12 | /gps/ene/mono 5.888 keV 13 | 14 | # X-ray 2 15 | /gps/source/add 0.1698 # 16.98% 16 | /gps/particle gamma 17 | /gps/pos/type Point 18 | /gps/pos/centre {srcpos} 19 | /gps/ang/type iso 20 | /gps/ene/type Mono 21 | /gps/ene/mono 5.899 keV 22 | 23 | # X-ray 3 24 | /gps/source/add 0.0101 # 1.01% 25 | /gps/particle gamma 26 | /gps/pos/type Point 27 | /gps/pos/centre {srcpos} 28 | /gps/ang/type iso 29 | /gps/ene/type Mono 30 | /gps/ene/mono 6.490 keV 31 | 32 | # X-ray 4 33 | /gps/source/add 0.0198 # 1.98% 34 | /gps/particle gamma 35 | /gps/pos/type Point 36 | /gps/pos/centre {srcpos} 37 | /gps/ang/type iso 38 | /gps/ene/type Mono 39 | /gps/ene/mono 6.490 keV 40 | 41 | # list all sources 42 | /gps/source/list 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r0sa0spec1.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 0 0 32 | RINDEX 0.9 0.9 33 | SPECULARSPIKECONSTANT 1 1 34 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa0spec1rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 2 2 33 | SPECULARSPIKECONSTANT 1 1 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa0spec1rin2.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish groundbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 2 2 33 | SPECULARSPIKECONSTANT 1 1 34 | 35 | -------------------------------------------------------------------------------- /tutorials/output/scoring/energy.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | # geometry must be specified before /run/initialize 4 | /geometry/source detector.tg 5 | # specify a physics list 6 | /physics_lists/select LBE_LIV_EMV 7 | # initialize geometry and physics 8 | /run/initialize 9 | 10 | # change particle and its energy here 11 | /gps/particle e- 12 | /gps/energy 30 GeV 13 | /gps/position -40 0 0 cm 14 | /gps/direction 1 0 0 15 | 16 | # visualize geometry and events for debugging 17 | /vis/open 18 | /vis/drawVolume 19 | /vis/scene/add/trajectories 20 | /run/beamOn 1 21 | 22 | /score/create/boxMesh mesh 23 | /score/mesh/boxSize 37.2 100 100 cm 24 | /score/mesh/nBin 40 1 1 25 | 26 | /score/quantity/energyDeposit eDep 27 | /score/close 28 | 29 | ## turn off screen printing for fast simulation 30 | /vis/disable 31 | 32 | # turn on progress report 33 | /run/verbose 2 34 | /run/printProgress 100 35 | # start simulation 36 | /run/beamOn 500 37 | 38 | /score/dumpQuantityToFile mesh eDep electron.csv 39 | 40 | -------------------------------------------------------------------------------- /tutorials/physics/muon/panels.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | panels.x3d 4 | 5 | 6 | 7 | 8 | Rotate: 9 | 10 | Zoom: 11 | 12 | Zoom: 13 | 14 | Pan: 15 | 16 | More: 17 | X3DOM Documentation 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0spec1rin09.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 3 3 33 | SPECULARSPIKECONSTANT 1 1 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0spec1rin2.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish polishedbackpainted 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | RINDEX 1.8 1.8 33 | SPECULARSPIKECONSTANT 1 1 34 | 35 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/totalInternalReflection.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 10 20 20 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 10 20 20 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 20 0 0 16 | 17 | // optical properties of CsI 18 | #include ../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish Polished 29 | 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | RINDEX 0.9 0.9 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /tutorials/detector/optical/absorption/fitZdistr.C: -------------------------------------------------------------------------------- 1 | { 2 | gStyle->SetOptFit(0); 3 | gStyle->SetOptStat(0); 4 | gStyle->SetPadTopMargin(0.01); 5 | gStyle->SetPadLeftMargin(0.11); 6 | gStyle->SetPadRightMargin(0.01); 7 | TCanvas* c = new TCanvas; 8 | c->SetLogy(); 9 | 10 | TChain t("t"); 11 | t.Add("absorption.root"); 12 | 13 | TH1F* h = new TH1F("h", ";Penetration depth [m]; Entries", 100, -3.5, 0); 14 | t.Draw("z/1000>>h", "pdg==-22 && pro==3031"); 15 | 16 | h->Fit("expo"); 17 | TF1* f = h->GetFunction("expo"); 18 | f->SetLineColor(kRed); 19 | f->SetLineWidth(1); 20 | 21 | TLatex l1, l2; 22 | l1.SetTextFont(22); l1.SetTextSize(0.06); l1.SetTextColor(kRed); 23 | l2.SetTextFont(22); l2.SetTextSize(0.06); 24 | l1.DrawLatex(-1.5, 10, "f(z)=A e^{z/#tau}"); 25 | l2.DrawLatex(-1.5, 2, Form("#tau = (%.1f #pm 0.4) cm", 100/f->GetParameter(1))); 26 | 27 | TPad *l = new TPad("l","l",0.02,0.17,0.96,1); 28 | l->SetFillColorAlpha(kWhite, 0); 29 | l->Draw(); l->cd(); 30 | TImage *p = TImage::Open("absorption.png"); 31 | p->Draw(); 32 | 33 | c->Print("depth.png"); 34 | } 35 | -------------------------------------------------------------------------------- /tutorials/sources/muons.mac: -------------------------------------------------------------------------------- 1 | /control/verbose 2 | 3 | /geometry/source NA.tg 4 | 5 | /run/initialize 6 | 7 | # muons at sea level 8 | 9 | /gps/pos/type Plane 10 | /gps/pos/shape Circle 11 | /gps/pos/radius 1. m 12 | 13 | /gps/pos/centre 0. 0. 6. m 14 | 15 | /gps/ene/type User 16 | /gps/hist/type energy 17 | 18 | /gps/hist/point 100 1 19 | /gps/hist/point 1000 12 20 | /gps/hist/point 10000 10 21 | /gps/hist/point 100000 2 22 | 23 | /gps/ang/type user 24 | /gps/hist/type theta 25 | 26 | /gps/hist/point 0 1 27 | /gps/hist/point 0.17 0.98 28 | /gps/hist/point 0.35 0.88 29 | /gps/hist/point 0.52 0.75 30 | /gps/hist/point 0.70 0.61 31 | /gps/hist/point 0.87 0.42 32 | /gps/hist/point 1.05 0.27 33 | /gps/hist/point 1.22 0.14 34 | /gps/hist/point 1.40 0.03 35 | /gps/hist/point 1.57 0 36 | 37 | /gps/source/intensity 0.5652 # 56.52% 38 | /gps/particle mu+ 39 | 40 | /gps/source/add 0.4348 # 43.48% 41 | /gps/particle mu- 42 | 43 | /vis/open HepRepFile 44 | /vis/drawVolume 45 | 46 | /vis/scene/add/axes 47 | /vis/scene/add/trajectories 48 | 49 | /tracking/verbose 2 50 | 51 | /run/beamOn 1 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Geant4 and ROOT 2 | INSTALL/Geant4/11.* 3 | INSTALL/Geant4/examples 4 | INSTALL/ROOT/6.* 5 | # container 6 | *.sif 7 | 8 | # webpage related 9 | _site 10 | *jekyll* 11 | *.lock 12 | .sass-cache 13 | 14 | # visualization files 15 | .DAWN* 16 | *.heprep 17 | *.eps 18 | *.prim 19 | *.jpeg 20 | *.jpg 21 | *.png 22 | *.pdf 23 | user.properties 24 | *.gif 25 | *.zip 26 | *.wrl 27 | *.jar 28 | *.x3d 29 | *.html 30 | *.htm 31 | *.gdml 32 | 33 | # Executables 34 | gears 35 | gears.exe 36 | ghdf5 37 | gcsv 38 | gxml 39 | 40 | # backup files 41 | \#* 42 | .swp 43 | *~ 44 | 45 | # Data 46 | *.root 47 | *.json 48 | *.csv 49 | *.h5 50 | *.he5 51 | *.hdf 52 | *.hdf5 53 | *log 54 | *.xlsx 55 | 56 | # alternative output format 57 | ghdf5.cc 58 | gcsv.cc 59 | gxml.cc 60 | 61 | # file system 62 | .nfs* 63 | 64 | # windows 65 | .vs 66 | out 67 | build 68 | Release 69 | *.pdb 70 | 71 | # macOS 72 | .DS_Store 73 | .java-version 74 | .Trash-0 75 | 76 | # CMake 77 | CMakeCache.txt 78 | CMakeFiles 79 | cmake_install.cmake 80 | 81 | # jupyter notebook 82 | *ipynb_checkpoints 83 | 84 | #RStudio 85 | .R* 86 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0spec01sl01back01.tg: -------------------------------------------------------------------------------- 1 | // default unit of length is mm 2 | :volu vac BOX 50 50 50 G4_Galactic 3 | :vis vac OFF 4 | 5 | // CsI block 6 | :volu CsI BOX 20 20 10 G4_CESIUM_IODIDE 7 | :color CsI 0.2 0.4 0.8 8 | 9 | // Teflon block 10 | :volu Teflon BOX 20 20 10 G4_TEFLON 11 | :color Teflon 0.3 0.3 0.3 12 | 13 | :rotm r000 0 0 0 14 | :place CsI 1 vac r000 0 0 0 15 | :place Teflon 2 vac r000 0 0 20 16 | 17 | // optical properties of CsI 18 | #include ../../CsI.tg 19 | // optical properties of Teflon 20 | :prop G4_TEFLON 21 | photon_energies 2 2.5*eV 5.0*eV 22 | RINDEX 1.36 1.36 23 | 24 | // optical properties of the surface between CsI & Teflon 25 | :surf CsI2Teflon CsI:1 Teflon:2 26 | type dielectric_dielectric 27 | model unified 28 | finish ground 29 | sigma_alpha 0 30 | property photon_energies 2 2.5*eV 5.0*eV 31 | REFLECTIVITY 1 1 32 | TRANSMITTANCE 0 0 33 | SPECULARSPIKECONSTANT 0.1 0.1 34 | SPECULARLOBECONSTANT 0.1 0.1 35 | BACKSCATTERCONSTANT 0.1 0.1 36 | 37 | -------------------------------------------------------------------------------- /tutorials/Rutherford/scatter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 1 ]; then 4 | echo "usage: ./scatter.sh 1000" 5 | echo "since no number of simulations is specified, 100 is used by default" 6 | num=100; 7 | else 8 | num=$1; 9 | fi 10 | 11 | # tailor mac file for animation 12 | M=animate.mac 13 | sed 's|mOn [0-9]*|mOn '$num'|' scatter.mac > $M 14 | 15 | # run geant4 to create eps files 16 | DAWN_BATCH=1 G4DAWNFILE_MAX_FILE_NUM=$num ../../gears $M 17 | 18 | # convert eps to png 19 | # eps cannot have transparent background, png can 20 | # -transparent white: make white color transparent 21 | # -trim: remove margins 22 | for eps in `ls *.eps`; do 23 | CMD="convert -transparent white -trim $eps ${eps%.*}.png" 24 | echo $CMD 25 | $CMD 26 | done 27 | 28 | # create animation 29 | # -delay 10/2: 4 seconds 30 | # -delay 10: 10/100 seconds 31 | # IE has a minimum speed of 6 32 | # No browser honors a 0 delay 33 | # -dispose None: keep previous png on canvas 34 | CMD="convert -delay 8 -dispose None g4*.png merged.gif" 35 | echo $CMD 36 | $CMD 37 | 38 | if [ -f merged.gif ]; then rm -f $M g4*.* .DAWN*; fi 39 | -------------------------------------------------------------------------------- /INSTALL/Docker/tmux.conf: -------------------------------------------------------------------------------- 1 | # create [new] and [close] buttons for mouse clicks 2 | set -g mouse 3 | set -g status-position top 4 | set -g status-left-length 20 5 | set -g status-left "#S:#I.#P [new] " 6 | set -g status-right " [close] " 7 | set -g status-style bg=blue,fg=black 8 | 9 | setw -g window-status-current-style bg=black,fg=white 10 | setw -g mode-keys vi # https://blog.sanctum.geek.nz/vi-mode-in-tmux/ 11 | 12 | # toggle mouse on/off using v for external copy/paste functions 13 | bind v set -g mouse 14 | 15 | # use :list-keys to check current key bindings 16 | bind -n MouseUp1StatusDefault split-window -h # left click empty space in status bar 17 | bind -n MouseUp1Border next-layout # left click pane border to change layout 18 | bind -n MouseUp1StatusLeft new-window # left click [new] button 19 | bind -n MouseUp1StatusRight kill-window # left click [close] botton 20 | bind -n MouseUp2Status kill-window # middle click window tab 21 | 22 | # https://gist.github.com/jikkujose/7509315 23 | unbind C-b 24 | set-option -g prefix ` 25 | bind ` send-prefix 26 | 27 | bind r source-file ~/.tmux.conf 28 | 29 | -------------------------------------------------------------------------------- /tutorials/detector/optical/CsI3inWLS.tg: -------------------------------------------------------------------------------- 1 | // optical properties of CsI 2 | #include CsI.tg 3 | // optical properties of SiO2 4 | #include SiO2.tg 5 | // optical properties of TPB 6 | #include TPB.tg 7 | // optical properties of Teflon 8 | :prop G4_TEFLON 9 | photon_energies 2 2.5*eV 5.0*eV 10 | RINDEX 1.36 1.36 11 | 12 | // default unit of length is mm 13 | :volu vacuum TUBE 0 40 50 G4_Galactic 14 | :volu CsI(S) TUBE 0 38 25 G4_CESIUM_IODIDE 15 | :volu Teflon TUBE 38 38.1 25 G4_TEFLON 16 | :volu PMT TUBE 0. 38.1 1 G4_SILICON_DIOXIDE 17 | :rotm r000 0 0 0 18 | :place Teflon 1 vacuum r000 0 0 0 19 | :place CsI(S) 1 vacuum r000 0 0 0 20 | :place PMT 1 vacuum r000 0 0 26 21 | :place PMT 2 vacuum r000 0 0 -26 22 | 23 | // optical properties of the surface between CsI & Teflon 24 | :surf CsI2Teflon CsI(S):1 Teflon:1 25 | type dielectric_dielectric 26 | model unified 27 | finish ground 28 | sigma_alpha 0.1 29 | property photon_energies 2 2.5*eV 5.0*eV 30 | REFLECTIVITY 0.9 0.9 31 | 32 | // visual effects 33 | :color CsI(S) 0.2 0.4 0.8 34 | :color Teflon 0.3 0.3 0.3 35 | :color PMT 0.8 0.4 0.2 36 | :vis vacuum OFF 37 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ideal/ogl.mac: -------------------------------------------------------------------------------- 1 | /vis/open OGL 2 | /vis/drawVolume 3 | 4 | /vis/viewer/zoomTo 5 5 | /vis/viewer/set/style surface 6 | /vis/viewer/set/background white 7 | /vis/viewer/set/upVector 0 0 1 8 | /vis/viewer/set/viewpointVector 1 0 0 9 | /vis/viewer/set/targetPoint 0 0.5 -2.8 cm 10 | 11 | /vis/modeling/trajectories/create/drawByParticleID 12 | /vis/modeling/trajectories/drawByParticleID-0/default/setLineWidth 5 13 | /vis/modeling/trajectories/drawByParticleID-0/setDefaultRGBA 0 0.78 0.55 1 14 | 15 | /vis/set/textSize 36 16 | /vis/scene/add/axes 17 | /vis/scene/add/trajectories 18 | /vis/scene/endOfEventAction accumulate 19 | /vis/scene/endOfRunAction accumulate 20 | 21 | /vis/set/textColour white 22 | /vis/scene/add/text 0 -1 -2 cm 36 ! ! CsI 23 | /vis/scene/add/text 0 -1 -2.8 cm 36 ! ! SiO2 24 | /vis/set/textColour black 25 | /vis/scene/add/text 0 -1 -3.2 cm 36 ! ! Vacuum 26 | 27 | /gps/direction 0 1 -1 28 | /run/beamOn 100 29 | #/gps/direction 0 2 -1 30 | #/run/beamOn 1 31 | #/vis/viewer/refresh 32 | 33 | /gui/addMenu export Export 34 | /gui/addButton export png "/vis/ogl/export ideal.png" 35 | 36 | -------------------------------------------------------------------------------- /tutorials/physics/neutron/scattering/TUNL.tg: -------------------------------------------------------------------------------- 1 | :volu world BOX 1.5*m 1.5*m 1.5*m G4_AIR 2 | :color world 0.5 0.5 0.5 3 | :vis world OFF 4 | 5 | :volu target BOX 2*cm 2*cm 2*cm G4_CESIUM_IODIDE 6 | :volu vacuum TUBE 0 4.9*cm 5*cm G4_Galactic 7 | :volu chamber TUBE 0 5*cm 6*cm G4_STAINLESS-STEEL 8 | 9 | :color target 0.9 0.9 0 10 | :color vacuum 0.2 0.3 0.5 11 | :color chamber 0 0.5 0 12 | 13 | :rotm r000 0 0 0 14 | :place chamber 1 world r000 0 0 0 15 | :place vacuum 1 chamber r000 0 0 0 16 | :place target 1 vacuum r000 0 0 0 17 | 18 | :volu NaI TUBE 0 5*cm 6*cm G4_SODIUM_IODIDE 19 | :color NaI 0 0.5 0.9 20 | 21 | :rotm x90 90 0 0 22 | :place NaI 1 world x90 0 1*m 0 23 | :rotm x90yp45 90 45 0 24 | :place NaI 2 world x90yp45 -0.7*m 0.7*m 0 25 | :rotm x90ym45 90 -45 0 26 | :place NaI 3 world x90ym45 0.7*m 0.7*m 0 27 | :rotm x90yp30 90 30 0 28 | :place NaI 4 world x90yp30 -0.5*m 0.866*m 0 29 | :rotm x90ym30 90 -30 0 30 | :place NaI 5 world x90ym30 0.5*m 0.866*m 0 31 | :rotm x90yp15 90 15 0 32 | :place NaI 6 world x90yp15 -0.25881905*m 0.96592583*m 0 33 | :rotm x90ym15 90 -15 0 34 | :place NaI 7 world x90ym15 0.25881905*m 0.96592583*m 0 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Jing Liu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /INSTALL/ROOT/notebook/README.md: -------------------------------------------------------------------------------- 1 | [Dockerfile](Dockerfile) in this folder is used to create the docker image, [physino/root:notebook](https://hub.docker.com/r/physino/root/tags), in the following way: 2 | 3 | ```sh 4 | cd /path/to/gears/INSTALL/ROOT/notebook 5 | docker build -t physino/root:notebook . 6 | docker push physino/root:notebook 7 | ``` 8 | 9 | It can be used in the following way: 10 | 11 | ```sh 12 | cd /path/to/gears 13 | docker compose up 14 | [+] Running 8/8 15 | ... 16 | gears-analysis-1 | To access the notebook, open this file in a browser: 17 | gears-analysis-1 | file:///root/.local/share/jupyter/runtime/nbserver-11-open.html 18 | gears-analysis-1 | Or copy and paste one of these URLs: 19 | gears-analysis-1 | http://3aefd9eb4f5f:8888/?token=19ca614154325439e355baf69574a2683714c988c033d5c8 20 | gears-analysis-1 | or http://127.0.0.1:8888/?token=19ca614154325439e355baf69574a2683714c988c033d5c8 21 | ``` 22 | 23 | Open the last link in your browser in the host computer and you can use the [jupyter][] notebook to analyze data generated by your [Geant4][] simulation. 24 | 25 | [jupyter]: https://jupyter.org 26 | -------------------------------------------------------------------------------- /tutorials/detector/optical/scattering/fitStepLenghs.C: -------------------------------------------------------------------------------- 1 | { 2 | gStyle->SetOptFit(0); 3 | gStyle->SetOptStat(1110); 4 | gStyle->SetStatX(0.965); 5 | gStyle->SetStatW(0.2); 6 | gStyle->SetPadTopMargin(0.01); 7 | gStyle->SetPadLeftMargin(0.11); 8 | gStyle->SetPadRightMargin(0.035); 9 | gStyle->SetTitleOffset(1.2,"Y"); 10 | TCanvas* c = new TCanvas; 11 | 12 | TChain t("t"); 13 | t.Add("scattering.root"); 14 | 15 | TH1F* h = new TH1F("h", ";Step length [cm]; Entries", 100, 0, 3500); 16 | t.Draw("l>>h", "stp==1 && pro==3033"); 17 | 18 | h->Fit("expo"); 19 | TF1* f = h->GetFunction("expo"); 20 | f->SetLineColor(kRed); 21 | f->SetLineWidth(1); 22 | 23 | TLatex l1, l2; 24 | l1.SetTextFont(22); l1.SetTextSize(0.06); l1.SetTextColor(kRed); 25 | l2.SetTextFont(22); l2.SetTextSize(0.06); 26 | l1.DrawLatex(680, 1800, "f(z)=A e^{-z/#tau}"); 27 | l2.DrawLatex(800, 1000, Form("#tau = (%.0f #pm 1) cm", -1/f->GetParameter(1))); 28 | 29 | TPad *l = new TPad("l","l",0.08,0,1,1); 30 | l->SetFillColorAlpha(kWhite, 0); 31 | l->Draw(); l->cd(); 32 | TImage *p = TImage::Open("Rayleigh.png"); 33 | p->Draw(); 34 | 35 | c->Print("scattering.png"); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r0t0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r0t1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r0t0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r0t1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r1t0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 -1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa30.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa30.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa5.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa5.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0sa0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r0t0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r0t1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r1t0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundfrontpainted/r1t1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedfrontpainted/r0t1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedfrontpainted/r1t0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r05t05.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r05t05.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0sl1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa0sl1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedfrontpainted/r0t0.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0t0.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0spec1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa0spec1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa5back1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa5back1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa0back1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0sa0back1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa0spec1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0sa0spec1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r0sa0back1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0sa0back1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r0sa0spec1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0sa0spec1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0back1.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa0back1.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa30.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa30.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r0sa5rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0sa5rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa0rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa0rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa5rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa5rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r0sa5rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r0sa5rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa0rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0rin2.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa0rin2.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/ground/r1t0sa0spec01sl01back01.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1t0sa0spec01sl01back01.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | /vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa5rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa5rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 0 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa0spec1rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa0spec1rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/groundbackpainted/r1sa0spec1rin2.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa0spec1rin2.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0spec1rin2.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa0spec1rin2.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polishedbackpainted/r1sa0spec1rin09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r1sa0spec1rin09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 1 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | #/gps/pos/type Plane 25 | #/gps/pos/shape Rectangle 26 | #/gps/pos/halfx .1 mm 27 | #/gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open HepRepFile 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/set/viewpointVector -1 0 0 38 | 39 | # dump a few events on screen for debugging 40 | /tracking/verbose 2 41 | /run/beamOn 50 42 | #/vis/viewer/rebuild 43 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r01t09.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r01t09.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/zoomTo 1.5 38 | /vis/viewer/set/background black 39 | /vis/viewer/set/viewpointVector -1 0 0 40 | 41 | # dump a few events on screen for debugging 42 | /tracking/verbose 2 43 | /run/beamOn 50 44 | /vis/viewer/rebuild 45 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r05t05.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r05t05.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/zoomTo 1.5 38 | /vis/viewer/set/background black 39 | /vis/viewer/set/viewpointVector -1 0 0 40 | 41 | # dump a few events on screen for debugging 42 | /tracking/verbose 2 43 | /run/beamOn 50 44 | /vis/viewer/rebuild 45 | -------------------------------------------------------------------------------- /tutorials/detector/optical/surface/polished/r09t01.mac: -------------------------------------------------------------------------------- 1 | # print macro commands on screen 2 | /control/verbose 1 3 | 4 | # geometry must be specified before /run/initialize 5 | /geometry/source r09t01.tg 6 | 7 | # turn on optical physics 8 | /physics_lists/factory/addOptical 9 | # turn off unnecessary output 10 | /process/optical/verbose 0 11 | /process/em/verbose 0 12 | /process/had/verbose 0 13 | # must be run after the cmds above 14 | /run/initialize 15 | 16 | # check physics processes 17 | /process/list Electromagnetic 18 | /process/list Optical 19 | 20 | # generate primary particle with tiny energy 21 | /gps/particle opticalphoton 22 | /gps/energy 3.5 eV 23 | /gps/direction 0 1 1 24 | /gps/pos/type Plane 25 | /gps/pos/shape Rectangle 26 | /gps/pos/halfx .1 mm 27 | /gps/pos/halfy 18 mm 28 | 29 | # visualize geometry and events for debugging 30 | /vis/open 31 | /vis/drawVolume 32 | /vis/scene/add/gps 33 | /vis/scene/add/axes 34 | /vis/scene/add/trajectories 35 | /vis/scene/endOfEventAction accumulate 36 | 37 | /vis/viewer/zoomTo 1.5 38 | /vis/viewer/set/background black 39 | /vis/viewer/set/viewpointVector -1 0 0 40 | 41 | # dump a few events on screen for debugging 42 | /tracking/verbose 2 43 | /run/beamOn 50 44 | /vis/viewer/rebuild 45 | -------------------------------------------------------------------------------- /tutorials/detector/visualization/gearsX3D.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | gears.x3d 5 | 6 | 7 | 8 | 9 |
10 | Rotate: 11 | 12 | Zoom: 13 | 14 | Zoom: 15 | 16 | Pan: 17 | 18 | More: 19 | X3DOM Documentation 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | --------------------------------------------------------------------------------