geant4 射线源定义_Geant4系列讲座二.ppt

提 纲 一、Geant4运行模式 “purely hard-coded” batch mode Batch mode,macro commands Interactive mode,command lines 二、材料定义 简单物质 分子定义 混合物 同位素 Geant4自定义 三、Geant4中使用物理量的单位 基本单位 输入 输出 四、几何结构定义 简单结构定义 复杂结构定义 颜色显示 五PrimaryGeneratorAction 一、Geant4运行模式 Geant4运行模式: “purely hard-coded” batch mode Batch mode,macro commands Interactive mode,command lines 每种模式的选择必须在Main文件中编制相应的代码 以实现其对应模式。通常采用混合模式。 ……. 头文件 Purely batch-coded mode ……. int main() { . . ….. G4runManager初始化… . . ….. class初始化… ………G4核初始化… runManager->Initialize(); //start run G4int numberOfEvent = 3; runManager->BeamOn(numberOfEvent); delete runManager; return 0; } ……. 头文件 Batch-coded with macro file mode ……. int main(int argc,char** argv) { . . ….. G4runManager初始化… . . ….. class初始化… ………G4核初始化… runManager->Initialize(); // Get the pointer to the UI manager G4UImanager* UI = G4UImanager::GetUIpointer(); G4String command = "/control/execute "; G4String fileName = argv[1]; UI->applyCommand(command+fileName); delete runManager; return 0; } ……. 头文件 Interactive by command line mode ……. #include "G4UIterminal.hh" #include "G4UIsession.hh" int main(int argc,char** argv) { . . ….. G4runManager初始化… . . ….. class初始化… ………G4核初始化… runManager->Initialize(); // Terminal initialization; G4UIsession* session = new G4UIterminal; session->SessionStart(); delete runManager; return 0; } Macro file: 命令行序列: #2008.6.9 #mac file for visulization /vis/scene/create /vis/open OGLIX /vis/scene/add/trajectories /vis/scene/add/hits /vis/scene/endOfEventAction accumulate /vis/viewer/set/viewpointThetaPhi 72 25 /vis/viewer/zoom 16 /run/beamOn 10000 /vis/viewer/set/style w /vis/viewer/set/style s 以文本格式保存 #include "G4UImanager.hh " Mixed mode #include "G4RunManager.hh" ……………. #include "G4VisManager.hh" #include "G4VisExecutive.hh" #include "G4UItcsh.hh" #include "G4UIterminal.hh" #include "G4UIsession.hh" int main(int argc,char** argv) { G4RunManager* MyRun = new G4RunManager; //this part is for the visualization G4VisManager

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值