电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

Geant4系列讲座二VIP免费

Geant4系列讲座二_第1页
1/29
Geant4系列讲座二_第2页
2/29
Geant4系列讲座二_第3页
3/29
提纲一、Geant4运行模式“purelyhard-coded”batchmodeBatchmode,macrocommandsInteractivemode,commandlines二、材料定义简单物质分子定义混合物同位素Geant4自定义三、Geant4中使用物理量的单位基本单位输入输出四、几何结构定义简单结构定义复杂结构定义颜色显示五PrimaryGeneratorAction第一页,共二十九页。一、Geant4运行模式Geant4运行模式:“purelyhard-coded”batchmodeBatchmode,macrocommandsInteractivemode,commandlines每种模式的选择必须在Main文件中编制相应的代码以实现其对应模式。通常采用混合模式。第二页,共二十九页。…….头文件Purelybatch-codedmode…….intmain(){..…..G4runManager初始化…..…..class初始化…………G4核初始化…runManager->Initialize();//startrunG4intnumberOfEvent=3;runManager->BeamOn(numberOfEvent);deleterunManager;return0;}…….头文件Batch-codedwithmacrofilemode…….intmain(intargc,char**argv){..…..G4runManager初始化…..…..class初始化…………G4核初始化…runManager->Initialize();//GetthepointertotheUImanagerG4UImanager*UI=G4UImanager::GetUIpointer();G4Stringcommand="/control/execute";G4StringfileName=argv[1];UI->applyCommand(command+fileName);deleterunManager;return0;}第三页,共二十九页。…….头文件Interactivebycommandlinemode…….#include"G4UIterminal.hh"#include"G4UIsession.hh"intmain(intargc,char**argv){..…..G4runManager初始化…..…..class初始化…………G4核初始化…runManager->Initialize();//Terminalinitialization;G4UIsession*session=newG4UIterminal;session->SessionStart();deleterunManager;return0;}Macrofile:命令行序列:#2008.6.9#macfileforvisulization/vis/scene/create/vis/openOGLIX/vis/scene/add/trajectories/vis/scene/add/hits/vis/scene/endOfEventActionaccumulate/vis/viewer/set/viewpointThetaPhi7225/vis/viewer/zoom16/run/beamOn10000/vis/viewer/set/stylew/vis/viewer/set/styles以文本格式保存第四页,共二十九页。#include"G4UImanager.hh"Mixedmode#include"G4RunManager.hh"…………….#include"G4VisManager.hh"#include"G4VisExecutive.hh"#include"G4UItcsh.hh"#include"G4UIterminal.hh"#include"G4UIsession.hh"intmain(intargc,char**argv){G4RunManager*MyRun=newG4RunManager;//thispartisforthevisualizationG4VisManager*VisManager=newG4VisExecutive;VisManager->Initialize();…………………………………………MyRun->Initialize();//G4UIsession*session=newG4UIterminal(newG4UItcsh);第五页,共二十九页。G4UImanager*UI=G4UImanager::GetUIpointer();Mixedmodeif(argc==1){UI->ApplyCommand("/run/verbose2");G4Stringcommand="/control/execute/g4work/pphotonelectron/vis.mac";UI->ApplyCommand(command);//session->SessionStart();}else{UI->ApplyCommand("/run/verbose2");G4Stringcommand="/control/execute/g4work/pphotonelectron/";G4StringfileName=argv[1];UI->ApplyCommand(command+fileName);//session->SessionStart();}//deletesession;deleteVisManager;deleteMyRun;return0;}第六页,共二十九页。二、材料定义一般的物质(化合物,混合物)是由元素构成,元素又由同位素组成。按照这种物质的划分层次,可以通过类似的概念定义宏观世界中的物质。Geant4中定义的物质类(class)有两种:G4ElementG4Material第七页,共二十九页。G4Elementclass描述微观层面的原子的性质如:原子序数核子数壳层能量诸如原子截面等G4Isotopeclass描述微观层面的原子的性质如:原子序数核子数莫尔质量等G4Materialclass描述微观层面的原子的性质如:原...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

Geant4系列讲座二

您可能关注的文档

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部