Geant4 Note
一般的Program目录结构
+- Program/
| CMakeLists.txt //CMake编译时需要的文件
| Program.cc // main()函数
| +- include
| | ...include.hh... //放置头文件,声明需要的类
| +- src
| | ...source.cc... //放置源文件,定义相应的类和方法
一个活的程序需要什么
+- Program/
| CMakeLists.txt // CMake编译时需要的文件
| Program.cc // main()函数
| +- include // 用来存放头文件
| | ProgramDetectorConstruction.hh // 声明探测器结构的类
| | ProgramPrimaryGeneratorAction.hh // 声明初始事件类
| +- src // C++中,定义函数原型
| | ProgramDetectorConstruction.cc //设置探测器结构
| | ProgramPrimaryGeneratorAction.cc //设置初始粒子的位置,速度等信息(搭建粒子枪)
main()函数的一般内容:
项目
- runManager
- DetectorConstruction
- PhysicsList
- ActionInitialization
- PrimaryGeneratorAction
- UI mode
- ‘Purely hard-coded’ batch mode 硬编码批处理模式,即完全交由main()函数完成,不存在交互
硬编码是将数据直接嵌入到程序或其他可执行对象的源代码中的软件开发实践,与从外部获取数据或在运行时生成数据不同。 硬编码数据通常只能通过编辑源代码和重新编译可执行文件来修改…… ——百度百科·硬编码
- batch mode, but reading a macro of commands 批处理模式,但读取一个宏。这时用户可以在编译后通过输入不同的宏文本来调整一部分信息,而不需要重新编译源代码
- interactive mode, driven by command lines 命令行交互模式
- interactive mode via a Graphical User Interface GUI用户图形界面交互模式
- ‘Purely hard-coded’ batch mode 硬编码批处理模式,即完全交由main()函数完成,不存在交互