随笔- 5  文章- 0  评论- 0  阅读- 1769 

geant4官网:Geant4 (cern.ch)

打开B1实例的方法:

  • 进入用户文件夹/geant4_workspace/B1/build
  • 右键点击在终端中打开
  • 输入 cmake .. 进行编译以及生成配置文件(预编译)
  • 再输入make合并编译器生成的目标exampleB1可执行文件
  • 输入./exampleB1对可执行文件运行,生成可视化界面

配置参数文件(run1.mac)

以下为run1.mac文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Macro file for example B1
#
# Can be run in batch, without graphic
# or interactively: Idle> /control/execute run1.mac
#
# Change the default number of workers (in multi-threading mode)
#/run/numberOfThreads 4
#
# Initialize kernel
/run/initialize//初始化
#
/control/verbose 2
/run/verbose 2
/event/verbose 0
/tracking/verbose 1
#
# gamma 6 MeV to the direction (0.,0.,1.)
#
/gun/particle gamma
/gun/energy 6 MeV
#
/run/beamOn 5//发射5个能量为6兆电子伏的γ粒子,此处为第一个模拟
#
# proton 210 MeV to the direction (0.,0.,1.)
#
/gun/particle proton
/gun/energy 210 MeV
/tracking/verbose 2
#
/run/beamOn 1//发射1个能量为210兆电子伏的质子粒子

 src基础代码

➢假设我们自己来写一个程序进行一一个模拟实验,有哪些必要部分:

构建几何模型,假设想建立4*4*4 cm3的金属铝板   

  •  B1DetectorConstruction

 

设置粒子源,类型,能量,位置...     

  • B1PrimaryGeneratorAction  run1.mac



确定要统计的物理量,能量沉积,能谱

  • 统计结果的输出
  • B1EventAction
  • B1RunAction
  • B1SteppingAction


物理过程
初始化类

  • exampleB1.cc
  • B1 ActionInitialization

 

 

 posted on   笨笨刀  阅读(321)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 提示词工程——AI应用必不可少的技术
· 地球OL攻略 —— 某应届生求职总结
· 字符编码:从基础到乱码解决
· SpringCloud带你走进微服务的世界
点击右上角即可分享
微信分享提示