猪头Geant4讲座(6)
时间:2025-04-20
时间:2025-04-20
猪头Geant4讲座第五讲——材料定义
几何结构类(DetectorConstruction)属于强制初始化类,其主要功能是构建模拟问题的几何结构,包括各部分的材料、形状、尺寸、位置等信息。
因此,在这个类里面我们就必须完成上述几个信息的设置工作。
首先,材料定义。
材料可以分为单质和化合物(混合物)两种。而不管是单质还是化合物都是由元素组成的,因此在定义材料前,必须首先定义元素。而元素的定义将决定在模拟过程中需要使用的截面库的选择(大部分是自动选择的,这里不重点讲)。
那么下面我们来看如何定义元素。
我们知道,每一种元素都可能有多个同位素,但是所有这些同位素的原子序数(核内质子数)都是相同的,其摩尔质量也可以根据各个同位素所占份额计算出来。因此,只需要有原子序数Z和摩尔质量A就可以定义出一个元素。这就是元素的直接定义法,参考$G4INSTLL/source/materials/include/G4Element.hh,如下:
// Constructor to Build an element directly; no reference to isotopes
//
G4Element(const G4String& name, //its name
const G4String& symbol, //its symbol
G4double Zeff, //atomic number
G4double Aeff); //mass of mole
其中元素名称和符号只是个标记,并不会影响元素的物理性质。
$G4INSTALL/example/novice/N02中氮元素的定义就是采用的直接定义法。
G4Element* N = new G4Element("Nitrogen", "N", z=7., a= 14.01*g/mole);
此外,既然每种元素都是由不同的同位素组成的,那如果事先定义了同位素,加上每个同位素所占份额不也可以确定一种元素,而不必麻烦地去计算摩尔质量吗?
确实如此,在Geant4中同样提供了另一种定义元素的方法,我将之称为间接定义法。
同样参考$G4INSTLL/source/materials/include/G4Element.hh,如下:
// Constructor to Build an element from isotopes via AddIsotope
//
G4Element(const G4String& name, //its name
const G4String& symbol, //its symbol
G4int nbIsotopes); //nb of isotopes
void AddIsotope(G4Isotope* isotope, //isotope
G4double RelativeAbundance); //fraction of nb of
//atomes per volume
而同位素的定义则参考$G4INSTLL/source/materials/include/G4Isotope.hh
G4Isotope(const G4String& name, //its name
G4int z, //atomic number
G4int n, //number of nucleons
G4double a = 0.); //mass of mole
$G4INSTALL/example/novice/N03中铀元素的定义就是采用的间接定义法。
// define an Element from isotopes, by relative abundance
//
G4Isotope* U5 = new G4Isotope("U235", iz=92, n=235, a=235.01*g/mole);
上一篇:日常工作准则