# Geant4

Geant4是一款自由软件工具包，用C++以面向对象技术编写，使用蒙特卡罗方法模拟粒子在物质中的输运过程。它涵盖几何与材料、初始事件产生、径迹追踪、物理过程、探测器响应、可视化与分析，强制依赖项仅有CLHEP类库和C++ STL。<sup>[1](https://geant4.web.cern.ch/documentation/dev/intro_html/IntroductionToGeant4/IntroductionToG4.html)</sup> 一次运行逐事件产生击中集合与径迹集合：每个粒子逐步传播，每一步在用户定义的灵敏体积中记录能量沉积。<sup>[2](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/kernel.pdf)</sup> 该工具包应用于高能物理、天体物理与空间科学、医学物理和辐射防护；[欧洲空间局](https://www.edgepedia.org/zh/european-space-agency)（ESA）和美国国家航空航天局（NASA）将其用于航天器设计与航天员剂量估算，它还应用于粒子束治疗、微剂量学和辐射防护。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0168900216306957)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 用于粒子在物质中输运的自由C++蒙特卡罗工具包；强制依赖包仅有CLHEP和STL<sup>[1](https://geant4.web.cern.ch/documentation/dev/intro_html/IntroductionToGeant4/IntroductionToG4.html)</sup> |
| 首个生产版本 | 1998年12月15日，此前于1994年11月获批为欧洲核子研究中心（CERN）研发项目RD44<sup>[4](https://cds.cern.ch/record/5714)</sup> |
| 主要参考论文 | 阿戈斯蒂内利（Agostinelli）及同事，"Geant4, a simulation toolkit"，NIM A 506, 250-303 (2003)；截至2023年9月Web of Science引用超过16,000次<sup>[5](https://iopscience.iop.org/article/10.1088/1748-0221/19/01/C01037/pdf)</sup> |
| 默认物理列表 | FTFP_BERT，结合弗里乔夫（Fritiof）弦模型与贝尔蒂尼（Bertini）核内级联，自10.0版起为默认<sup>[6](https://geant4.web.cern.ch/documentation/pipelines/master/plg_html/PhysicsListGuide/reference_PL/FTFP_BERT.html)</sup> |
| 多线程性能 | CPU加速比3至6倍，内存用量降至原来的七分之一，分布统计等价<sup>[3](https://www.sciencedirect.com/science/article/pii/S0168900216306957)</sup> |
| 医学验证 | G4-Med基准测试套件包含23项测试；电磁物理构造器option4在所有测试中均与参考数据一致<sup>[7](https://aapm.onlinelibrary.wiley.com/doi/10.1002/mp.14226)</sup> |
| 近期版本 | 11.4版（2025年）新增CaloDiT机器学习快速模拟模型及支持GPU导航的VecGeom 2.0.0<sup>[8](https://geant4.org/download/release-notes/notes-v11.4.0.html)</sup> |

## 工作原理

Geant4的输运是逐步进行的。模拟组织为嵌套循环：一次运行由物理与探测器构建以及随后的事件循环组成；一个事件产生初级粒子并追踪它们及所有次级粒子；一条径迹是步的循环，持续到粒子消亡或离开世界体积。<sup>[2](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/kernel.pdf)</sup> 在每一步，每个活跃过程根据其截面提出一个步长，取最小提议；几何导航器还计算到下一个体积边界的“安全”距离，取物理步长与几何距离中较短者。<sup>[9](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/tracking.html)</sup> 这种在PostStepGetPhysicalInteractionLength方法间的选择竞争称为GPIL（Get Physical Interaction Length）选择；胜出过程的DoIt方法随后执行相互作用。<sup>[10](https://geant4.web.cern.ch/documentation/dev/bftd_html/ForToolkitDeveloper/OOAnalysisDesign/Tracking/tracking.html)</sup>

过程从不直接修改粒子径迹。每个过程派生自基类\( G4VProcess \)，提供AtRest、AlongStep和PostStep DoIt方法，并通过\( G4VParticleChange \)对象返回其最终状态（包括次级径迹）；只有在收集这些提议之后径迹才被更新。<sup>[11](https://geant4.web.cern.ch/documentation/dev/bfad_html/ForApplicationDevelopers/TrackingAndPhysics/physicsProcess.html)</sup> 粒子由三个类层次表示：\( G4Track \)，当前量的快照；\( G4DynamicParticle \)，持有动量、能量和自旋；以及\( G4ParticleDefinition \)，持有电荷、质量、寿命和衰变道。\( G4Track \)和\( G4Step \)是瞬态的，在事件结束时不可用，因此供后续分析的径迹必须显式存储。<sup>[2](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/kernel.pdf)</sup> 由于整体性能关键取决于将粒子移动一步的CPU时间，几何采用优化结构；一项显著的计算创新是几何的“智能体素”组织，提升了追踪性能。<sup>[10](https://geant4.web.cern.ch/documentation/dev/bftd_html/ForToolkitDeveloper/OOAnalysisDesign/Tracking/tracking.html)</sup>

## 实现方式

Geant4不提供main()程序。用户编写一个程序，构建\( G4RunManager \)并注册三个强制初始化类：\( G4VUserDetectorConstruction \)用于几何与灵敏探测器，\( G4VUserPhysicsList \)用于物理，\( G4VUserActionInitialization \)用于用户动作；\( G4UImanager \)处理UI命令。<sup>[2](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/kernel.pdf)</sup> 可选的用户动作类有\( G4UserRunAction \)、\( G4UserEventAction \)、\( G4UserTrackingAction \)、\( G4UserSteppingAction \)和\( G4UserStackingAction \)；\( G4UserSteppingAction \)在每步结束时调用，是用户唯一能修改模拟行为（如杀死径迹）的类。<sup>[12](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/user_actions.pdf)</sup> 动作对象通过实现Build()的具体\( G4VUserActionInitialization \)声明，多线程还需实现BuildForMaster()；多线程处理必须使用该类。<sup>[12](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/user_actions.pdf)</sup>

运行开始时，几何针对导航进行优化，并为装置中的材料计算截面表；当径迹栈为空时事件结束，\( G4Event \)以初级顶点为输入、以击中与径迹集合为输出。<sup>[2](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/kernel.pdf)</sup> 该工具包是约200万行的模块化代码，文档包括《应用开发者指南》和《工具包开发者指南》两本书、物理参考手册和物理列表指南，含21个扩展示例类别和35个高级示例；Python和Julia绑定可从社区项目获得。<sup>[13](https://indico.jlab.org/event/963/contributions/16842/attachments/13259/21368/usersdocs_examples_jlab_august2025.pdf)</sup> 事件偏置选项包括带权重轮盘的几何重要性抽样、基于物理的偏置、伴随（反向）蒙特卡罗和通用偏置框架。<sup>[14](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/)</sup>

## 起源

该项目于1994年底获批为研发项目RD44，由来自欧洲、俄罗斯、日本、加拿大和美国40多个机构的约100名科学家组成。<sup>[4](https://cds.cern.ch/record/5714)</sup> 首个原型于1995年底交付，首个alpha版于1997年4月，首个beta版于1998年7月，首个生产版本于1998年12月15日。<sup>[4](https://cds.cern.ch/record/5714)</sup> Geant4继承自GEANT3.21——LEP、DESY、FNAL和SLAC探测器模拟的事实标准——是首次尝试为面向对象环境重新设计欧洲核子研究中心（CERN）的大型软件包。<sup>[4](https://cds.cern.ch/record/5714)</sup> 重写部分源于GEANT3在强子相互作用上依赖外部包（GEISHA、FLUKA和CALOR），以及其在约10 keV以下和约100 GeV以上电磁建模的薄弱。<sup>[15](https://arxiv.org/html/2405.12159v1)</sup> 研发阶段之后，合作组织依据欧洲核子研究中心（CERN）、主要高能物理实验室和欧洲空间局（ESA）签署的谅解备忘录重新成立。<sup>[4](https://cds.cern.ch/record/5714)</sup> 主要参考论文由阿戈斯蒂内利（Agostinelli）及同事发表于《核仪器与方法A》506卷250-303页，2003年；其物理过程涵盖电磁、强子和光学过程，范围在某些情况下从250 eV开始，在另一些情况下延伸至TeV量级。<sup>[16](https://doi.org/10.1016/s0168-9002%2803%2901368-8)</sup>

## 变体

物理列表为每个粒子和能量范围选择所用模型。FTFP_BERT是当前默认：贝尔蒂尼（Bertini）核内级联处理0至6 GeV的p、n、π介子、K介子和超子，弗里乔夫（Fritiof，简称FTF）弦模型处理3 GeV至100 TeV的相同粒子。<sup>[6](https://geant4.web.cern.ch/documentation/pipelines/master/plg_html/PhysicsListGuide/reference_PL/FTFP_BERT.html)</sup> 推荐用于对撞机物理和宇宙线应用，通常在簇射形状、能量响应和分辨率方面与测试束量能器数据符合最佳，但不适用于10 TeV量级或更高的碰撞。<sup>[6](https://geant4.web.cern.ch/documentation/pipelines/master/plg_html/PhysicsListGuide/reference_PL/FTFP_BERT.html)</sup> 10.0版之前默认为QGSP_BERT，之后由FTFP_BERT接替。<sup>[17](https://geant4.web.cern.ch/documentation/dev/plg_pdf/PhysicsListGuide.pdf)</sup> 变体包括FTFP_BERT_HP（20 MeV以下高精度中子模型）、FTFP_BERT_ATL（应ATLAS要求将FTF-Bertini过渡移至9-12 GeV范围）、FTFP_INCLXX（替换为INCL++级联）和FTF_BIC。<sup>[6](https://geant4.web.cern.ch/documentation/pipelines/master/plg_html/PhysicsListGuide/reference_PL/FTFP_BERT.html)</sup> 四个最大的LHC实验在Run 2（2015-2018）模拟中采用了FTFP_BERT及其轻微变体。<sup>[18](https://inspirehep.net/files/577f15c710a8c3480f04ef9292c3fb36)</sup>

对于低能工作，在需要精确输运1 GeV以下质子和中子时，以及医学和空间应用中，推荐QBBC；QGSP_BIC_HP对[强子治疗](https://www.edgepedia.org/zh/hadron-therapy)物理（包括质子和碳离子治疗）给出了总体充分的描述。<sup>[17](https://geant4.web.cern.ch/documentation/dev/plg_pdf/PhysicsListGuide.pdf)</sup> 电磁物理通过构造器选择：option3使用UseDistanceToBoundary多重散射与\( G4UrbanMscModel \)及10 eV低能表限，而option4结合\( G4WentzelVIModel \)与\( G4eCoulombScatteringModel \)、100 MeV以下e±的\( G4GoudsmitSaundersonMscModel \)、20 MeV以下的\( G4LowEPComptonModel \)，以及用于伽马转换的\( G4BetheHeitler5DModel \)；Livermore和Penelope构造器也可用。<sup>[11](https://geant4.web.cern.ch/documentation/dev/bfad_html/ForApplicationDevelopers/TrackingAndPhysics/physicsProcess.html)</sup> Geant4-DNA扩展模拟液态水中的物理相互作用低至几eV，用于微剂量学和纳米剂量学；在11.4版中DNA模型的能量上限为电子1 MeV、质子和离子300 MeV/u，以上使用标准物理。<sup>[8](https://geant4.org/download/release-notes/notes-v11.4.0.html)</sup>

## 应用

该工具包应用于高能物理、天体物理与空间科学、医学物理和辐射防护，包括航天器设计、航天员剂量估算、粒子束治疗、微剂量学和辐射防护。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0168900216306957)</sup> 验证通过两个主要系统进行。geant-val Web应用托管约四十项验证测试的结果，并应用\( \chi^{2} \)和Kolmogorov-Smirnov统计比较对照参考数据和先前版本。<sup>[18](https://inspirehep.net/files/577f15c710a8c3480f04ef9292c3fb36)</sup> G4-Med是面向生物医学物理的Geant4基准测试系统，从18项测试增至23项，新增Geant4-DNA回归测试、125I近距离治疗、X射线和电子FLASH放射治疗剂量学、质子治疗微剂量学以及碳和氧束的在体PET。<sup>[7](https://aapm.onlinelibrary.wiley.com/doi/10.1002/mp.14226)</sup> Geant4 10.5的基准测试表明\( G4EmStandardPhysics \_option4 \)在所有G4-Med测试中与参考数据符合良好。<sup>[7](https://aapm.onlinelibrary.wiley.com/doi/10.1002/mp.14226)</sup> 性能方面，多线程在主线程中一次性初始化能量损失、阻止本领和截面表并在线程间共享，给出CPU加速比3至6倍、内存用量降至原来的七分之一、初始化时间缩短至原来的一半，分布与顺序版本统计等价。<sup>[3](https://www.sciencedirect.com/science/article/pii/S0168900216306957)</sup> 11.3版新增首个子事件并行完整实现，在工作线程中处理子事件并在主线程合并结果。<sup>[19](https://geant4.org/download/release-notes/notes-v11.3.0.html)</sup>

## 局限与替代方案

已知精度限制有文档记录。能量损失、射程和截面的内部表从100 eV到100 TeV构建，1 keV以下默认电磁模型精度显著下降。<sup>[17](https://geant4.web.cern.ch/documentation/dev/plg_pdf/PhysicsListGuide.pdf)</sup> 早期放射治疗比较发现光子束剂量分布与EGSnrc在三种电磁模型下均在2%以内一致（剂量建成区除外），但入射电子束偏差更大，受用户施加的步长限制影响，表明凝聚历史算法可能存在潜在问题。<sup>[20](https://aapm.onlinelibrary.wiley.com/doi/10.1118/1.1895796)</sup> 在量能器束流测试中，Geant4强子模型低估簇射长度而FLUKA.CERN模型高估，尤其在120 GeV以上，两者均将π/e比高估最多约2.6%。<sup>[21](https://cds.cern.ch/record/2927893/files/document.pdf)</sup> 对于质子治疗中的杂散中子，蒙特卡罗代码与物理模型之间总次级中子注量差异达90%，在束流前向最为明显，远端位置中子剂量当量差异最多达3倍；贝尔蒂尼（Bertini）级联与其他代码和模型的符合度比BIC或INCL更差。<sup>[22](https://researchportal.sckcen.be/en/publications/the-influence-of-monte-carlo-radiation-transport-codes-and-hadron/)</sup> 一项模型系统学评估发现，模型开发者和经验丰富的用户所得结果与实验值之比通常在二分之一至2倍或三分之一至3倍的范围内，Geant4和MCNPX/MCNP6让用户完全访问微观尺度模型参数，而FLUKA、MARS15和PHITS则加以限制。<sup>[23](https://www.osti.gov/servlets/purl/1637599)</sup> 相比之下，在聚变中子学基准测试中，Geant4 10.3与MCNP5-1.6在微分基准的全能谱平均相对偏差低于1%。<sup>[24](https://www.sciencedirect.com/science/article/abs/pii/S092037961930314X)</sup>

近期版本既有进展也有回退。11.3版改进了贝尔蒂尼（Bertini）级联的角发射，在参考列表中给出高几个百分点的能量响应和更窄的横向簇射形状，但一些薄靶数据（特别是HARP数据中的π介子产生）退化；自11.3.2起，一个选项（SetBertiniAs11_2(true)）将BERT回滚至11.2行为。<sup>[19](https://geant4.org/download/release-notes/notes-v11.3.0.html)</sup> [回归测试](https://www.edgepedia.org/zh/regression-testing)还表明11.1中option3的多重散射参数对临床X射线和电子剂量学不充分，因此在11.2.1中恢复为10.5的值。<sup>[25](https://iris.uniroma1.it/retrieve/b00468ea-4be9-47dc-a619-8d4664714967/Arce_Results_2025.pdf)</sup> 自11.2版起，FLUKA.CERN强子非弹性物理接口提供对PEANUT模型的访问，涵盖从阈值（中子为20 MeV）到20 TeV的强子-核相互作用。<sup>[21](https://cds.cern.ch/record/2927893/files/document.pdf)</sup> 11.4版在Par04示例中引入CaloDiT预训练机器学习模型用于快速模拟，并附带VecGeom 2.0.0，提供使用BVH的仅头文件无状态GPU导航API。<sup>[8](https://geant4.org/download/release-notes/notes-v11.4.0.html)</sup>

## References

1. [Introduction to Geant4, Scope of Application (official documentation)](https://geant4.web.cern.ch/documentation/dev/intro_html/IntroductionToGeant4/IntroductionToG4.html)
2. [Kernel (Geant4-ED lecture slides, IN2P3)](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/kernel.pdf)
3. [Recent developments in Geant4 (Allison et al., 2016, NIM A)](https://www.sciencedirect.com/science/article/pii/S0168900216306957)
4. [GEANT 4: an Object-Oriented toolkit for simulation in HEP - CERN Document Server (RD44 record)](https://cds.cern.ch/record/5714)
5. [Geant4 silver anniversary: 25 years enabling scientific research across multiple disciplines (2024, JINST)](https://iopscience.iop.org/article/10.1088/1748-0221/19/01/C01037/pdf)
6. [FTFP_BERT, PhysicsListGuide 11.2 documentation](https://geant4.web.cern.ch/documentation/pipelines/master/plg_html/PhysicsListGuide/reference_PL/FTFP_BERT.html)
7. [Report on G4-Med, a Geant4 benchmarking system for medical physics applications (Medical Physics, 2021)](https://aapm.onlinelibrary.wiley.com/doi/10.1002/mp.14226)
8. [Geant4 11.4 Release Notes](https://geant4.org/download/release-notes/notes-v11.4.0.html)
9. [Tracking, Book For Application Developers 11.4](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/TrackingAndPhysics/tracking.html)
10. [Tracking, Book For Toolkit Developers 11.4](https://geant4.web.cern.ch/documentation/dev/bftd_html/ForToolkitDeveloper/OOAnalysisDesign/Tracking/tracking.html)
11. [Physics Processes, Book For Application Developers 11.4](https://geant4.web.cern.ch/documentation/dev/bfad_html/ForApplicationDevelopers/TrackingAndPhysics/physicsProcess.html)
12. [III. Primary Particles, User Actions (Geant4-ED lecture slides, IN2P3)](https://geant4-ed-project.pages.in2p3.fr/geant4-ed-web/docs/user_actions.pdf)
13. [Geant4 User Documentation and Examples (tutorial slides, JLab, August 2025)](https://indico.jlab.org/event/963/contributions/16842/attachments/13259/21368/usersdocs_examples_jlab_august2025.pdf)
14. [Book For Application Developers, 11.4 documentation](https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/)
15. [Geant4: a Game Changer in High Energy Physics and Related Applicative Fields (2024)](https://arxiv.org/html/2405.12159v1)
16. [Geant4—a simulation toolkit (Nuclear Instruments and Methods in Physics Research Section A Accelerators Spectrometers Detectors and Associated Equipment, 2003)](https://doi.org/10.1016/s0168-9002%2803%2901368-8)
17. [Guide For Physics Lists (PDF)](https://geant4.web.cern.ch/documentation/dev/plg_pdf/PhysicsListGuide.pdf)
18. [Including Calorimeter Test Beams in Geant-val, The Physics Validation Testing Suite of Geant4](https://inspirehep.net/files/577f15c710a8c3480f04ef9292c3fb36)
19. [Geant4 11.3 Release Notes](https://geant4.org/download/release-notes/notes-v11.3.0.html)
20. [Accuracy of the photon and electron physics in GEANT4 for radiotherapy applications (Medical Physics, 2005)](https://aapm.onlinelibrary.wiley.com/doi/10.1118/1.1895796)
21. [Validating Geant4 and its FLUKA.CERN interface against calorimeters beam tests](https://cds.cern.ch/record/2927893/files/document.pdf)
22. [The influence of Monte Carlo radiation transport codes and hadron physics models on stray neutron dose estimations in proton therapy (Radiation Measurements, 2024)](https://researchportal.sckcen.be/en/publications/the-influence-of-monte-carlo-radiation-transport-codes-and-hadron/)
23. [Assessment of model systematic errors in Monte Carlo codes for accelerator-based nuclear applications](https://www.osti.gov/servlets/purl/1637599)
24. [V&V analyses of the GEANT4 Monte Carlo code toolkit with computational and experimental fusion neutronics benchmarks](https://www.sciencedirect.com/science/article/abs/pii/S092037961930314X)
25. [Results of a Geant4 benchmarking study for bio-medical applications, performed with the G4-Med system](https://iris.uniroma1.it/retrieve/b00468ea-4be9-47dc-a619-8d4664714967/Arce_Results_2025.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Named software products and platforms

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/geant4

English original: https://www.edgepedia.org/geant4
