Geant4 建立几何 (0基础版):
https://geant4.web.cern.ch/
三步构建几何:
- Solid-包括 shape,size
- logical-包括母女关系、material等
- 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