Geant4 建立几何篇(0基础版)

Geant4 建立几何 (0基础版):

https://geant4.web.cern.ch/

三步构建几何:

  1. Solid-包括 shape,size
  2. logical-包括母女关系、material等
  3. physical-包括position、rotation等

详见流程图:
在这里插入图片描述

G4VSolid构建

https://geant4.web.cern.ch/docs/

主要包括G4Box 、G4Tubs 、G4Cons、G4Para、G4Sphere等几何体

# G4Box的构建
G4Box(const G4String &pname, // name
			G4double half_x, // X half size
			G4double half_y, // Y half size
			G4double half_z); // Z half size
# G4Tubs的构建
G4Tubs(const G4String &pname, // name
				G4double pRmin, // inner radius
				G4double pRmax, // outer radius
				G4double pDz,   // Z half length
				G4double pSphi, // starting Phi
				G4double pDphi); // segment angle 跨度角

在这里插入图片描述

G4Vlogical构建

定义材料等

https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/GettingStarted/geometryDef.html?highlight=logical

To create a logical volume, you must start with a solid and a material.

G4LogicalVolume* worldLog = new G4LogicalVolume(worldBox,     //its solid
   			            						 Ar,           //its material
   				         						"World"      //its name);

G4PhysicalVolume构建

You create a physical volume starting with your logical volume.

G4double pos_x = -1.0*meter;
G4double pos_y =  0.0*meter;
G4double pos_z =  0.0*meter;

G4VPhysicalVolume* trackerPhys = new G4PVPlacement(0,                       // no rotation
                     							 G4ThreeVector(pos_x, pos_y, pos_z), // 是在空间中该子体相对于其逻辑母体几何中心的移动坐标
                     							 trackerLog,              // its logical volume
                      							"Tracker",               // its name
                      							worldLog,                // its mother (logical) volume
                      							false,                   // no boolean operations
                     							 0);                      // its copy number

解释 G4PVPlacement()
当把一个体积被放入其母体积时,其位置与旋转都是相对于其母体积的局域
坐标来说的。母体积局域坐标系的原点在几何中心

赋予材料

G4自带材料数据库:
https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/Appendix/materialNames.html

参考来源:
【1】https://www.slac.stanford.edu/xorg/geant4/SLACTutorial14/Geometry1.pdf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值