Skip to content

Commit

Permalink
Completed the set of notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
peremato committed Apr 17, 2024
1 parent c3fef11 commit 5671ce7
Show file tree
Hide file tree
Showing 14 changed files with 2,087 additions and 86 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
FHist = "68837c9b-b678-4cd5-9925-8a54edc8f695"
Geant4 = "559df036-b7a0-42fd-85df-7d5dd9d70f44"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Expand Down
4 changes: 2 additions & 2 deletions tutorial/docs/02-wrapped-classes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The type hierarchy is a follows:\n",
"The type hierarchy is as follows:\n",
"```\n",
" +-------+\n",
" | Any |\n",
Expand Down Expand Up @@ -422,7 +422,7 @@
"box1 = box2 = zeros(1000)\n",
"GC.gc()\n",
"@show GetCubicVolume(union) # G4BooleanSolid cashes the volume\n",
"@show DistanceToIn(union, G4ThreeVector(10,10,10)); # this will probabluy crash the program"
"@show DistanceToIn(union, G4ThreeVector(10,10,10)); # now this will not crash the program"
]
}
],
Expand Down
36 changes: 4 additions & 32 deletions tutorial/docs/04-physics-list.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,9 @@
"metadata": {},
"outputs": [],
"source": [
"#---The next will be hidden in new versions-------------------------\n",
"# create a empty world filled with vacumm\n",
"struct World <: G4JLDetector end\n",
"using Geant4.PhysicalConstants: universe_mean_density\n",
"using Geant4.SystemOfUnits: g, mole, kelvin, pascal\n",
"function bigbang(::World)\n",
" vacuum = G4Material(\"Vacuum\", z=1., a=1.01g/mole, density=universe_mean_density, state=kStateGas, \n",
" temperature=2.73*kelvin, pressure=3.e-18*pascal)\n",
" G4PVPlacement(nothing, G4ThreeVector(),\n",
" G4LogicalVolume(G4Box(\"world\", 1000,1000,1000), move!(vacuum), \"World\"),\n",
" \"World\", nothing, false, 0, false)\n",
"end \n",
"Geant4.getConstructor(::World) = bigbang\n",
"#---end-------------------------------------------------------------"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n",
"app = G4JLApplication(\n",
" detector = World(), # should be the default\n",
" generator = G4JLGunGenerator(), # should be the default\n",
" physics_type = FTFP_BERT\n",
");"
")"
]
},
{
Expand Down Expand Up @@ -120,10 +95,8 @@
"metadata": {},
"outputs": [],
"source": [
"ui`/run/verbose 1`\n",
"app = nothing\n",
"GC.gc()\n",
"G4RunManager!GetRunManager()"
"ui`/control/verbose 1`\n",
"ui`/run/verbose 1`"
]
},
{
Expand All @@ -149,9 +122,8 @@
"outputs": [],
"source": [
"app = G4JLApplication(\n",
" detector = World(), # should be the default\n",
" generator = G4JLGunGenerator(), # should be the default\n",
" physics_type = MyPhysicsList,\n",
" verbose=1,\n",
")\n",
"configure(app)\n",
"initialize(app)"
Expand Down
Loading

0 comments on commit 5671ce7

Please sign in to comment.