Geant4 最简单的模拟程序
G4 运行至少需要 3 个最基本的 class :
- DetectorConstruction : 继承自 G4VUserDetectorConstruction,必须实现的虚函数是 G4VPhysicalVolume* Construct(); 作用:定义空间中所有的物质(探测器,靶,磁场等)
- PrimaryGeneratorAction : 继承自 G4VUserPrimaryGeneratorAction,必须实现的虚函数是 void GeneratePrimaries(G4Event* anEvent); 作用:定义待发射的初级粒子(粒子种类,能量,动量方向,初始位置等)
- PhysicsList : 继承自 G4VModularPhysicsList;作用:为所有初级粒子和可能产生的次级粒子定义物理过程
在主函数中需要如下部分:
1 //Run管理器 2 G4RunManager* runManager = new G4RunManager(); 3 4 //Detector 5 DetectorConstruction* detector = new DetectorConstruction(); 6 runManager->SetUserInitialization(detector); 7 8 //PhysicsList 9 PhysicsList* physics= new PhysicsList(); 10 runManager->SetUserInitialization(physics); 11 12 //Action 13 PrimaryGeneratorAction* gen_action = new PrimaryGeneratorAction; 14 runManager->SetUserAction(gen_action); 15 16 //=============Initialize G4 kernel============// 17 runManager->Initialize(); 18 runManager->BeamOn(1); // 一次Run
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现