diff --git a/G4.code-workspace b/G4.code-workspace
index e447f0e..3c470bf 100644
--- a/G4.code-workspace
+++ b/G4.code-workspace
@@ -8,7 +8,9 @@
"files.associations": {
"*.icc": "cpp",
"line": "cpp",
- "plane": "cpp"
+ "plane": "cpp",
+ "qrot": "cpp",
+ "cmath": "cpp"
}
}
}
\ No newline at end of file
diff --git a/README.md b/README.md
index e289b0a..9041dd6 100644
--- a/README.md
+++ b/README.md
@@ -185,26 +185,7 @@ $$
-### 电子
-由于该模型较为简单,使用`Geant4`的`General Particle Source`(`GPS`)可以较为方便地生成源,
-```macro
-/gps/source/clear
-/gps/source/add 1
-/gps/particle e-
-/gps/pos/type Surface
-/gps/pos/shape Sphere
-/gps/pos/radius 15 m
-/gps/ene/type Exp
-/gps/ene/min 100 keV
-/gps/ene/max 10 MeV
-/gps/ene/ezero 0.0824
-/gps/ang/type iso
-/gps/ang/maxtheta 90 deg
-/run/beamOn 923242
-```
-
-### 质子与俘获辐射
-由于模型较为复杂,且需要发射的粒子种类繁多,因此该部分的粒子使用`G4ParticleGun`生成,关键是生成各向同性(在球面上均匀分布)的位置、方向和符合能谱的能量分布。
+由于模型较为复杂,且需要发射的粒子种类繁多,因此使用`G4ParticleGun`生成各类粒子,关键是生成各向同性(在球面上均匀分布)的位置、方向和符合能谱的能量分布。
1. `Inverse Transform Method`(`ITM`)
对于一个在$[a, b]$的分布,设其概率密度函数(PDF)为$F(x)$,对其积分可获得累积分布函数(CDF),记为$y=C(x)=\int_a^x F(u)\mathrm{d}u$,其反函数为$C^{-1}(y)$。设$y$为$[0, 1)$上均匀分布的随机数,则$x=C^{-1}(y)$满足$F(x)$的分布。
@@ -236,6 +217,15 @@ $$
为了保证发射方向是朝向球面内,因此需要限制$\theta$的最大角度为$90^{\circ}$。
3. 能量
+* 俘获电子的函数较为简单,采用`ITM`;(下表中$j_0$已经归一化)
+
+
+ | $F(E)$ | $\int F(E)\mathrm{d}E$ | $C(x)=\int_a^xF(u)\mathrm{d}u$ | $C^{-1}(y)$ |
+ |:--------------------------:|:------------------------------------------:|:----------------------------------------------------------------------------:|:---------------------------------------------------------------------------------------------------:|
+ | $j=j_0e^{-E/E_0}$ | $-j_0E_0e^{-E/E_0}$ | $j_0E_0e^{-a/E_0}-j_0E_0e^{-x/E_0}$ | $-E_0\ln(\frac{C-y}{j_0E_0}),\ C=j_0E_0e^{-a/E_0}$ |
+
+
+
* 俘获质子的函数较为简单,采用`ITM`;(下表中$j_0$已经归一化)
diff --git a/assets/model.txt b/assets/model.txt
index a507c08..d27adb9 100644
--- a/assets/model.txt
+++ b/assets/model.txt
@@ -1,3 +1,4 @@
+TE, 1, -1, 1333680.43009, 0.0824, 32652.96179377461
TP, 1, 1, 559.76377, -1.53424, 2.40873, 1.5156509
GCR_H, 1, 1, 125.89223, 44.00673, -0.000460574, 112356, 361.781666
GCR_He, 2, 4, 0.01815, 0.000297726, 0.00184, 0.49271, 48.4143048
diff --git a/docs/simu-te.png b/docs/simu-te.png
new file mode 100644
index 0000000..48eb078
Binary files /dev/null and b/docs/simu-te.png differ
diff --git a/include/G4CustomFemaleBuilder.h b/include/G4CustomFemaleBuilder.h
deleted file mode 100644
index 562c8bf..0000000
--- a/include/G4CustomFemaleBuilder.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef G4CustomFemaleBuilder_h
-#define G4CustomFemaleBuilder_h 1
-
-#include "G4PhantomBuilder.h"
-
-class G4CustomFemaleBuilder : public G4PhantomBuilder {
-public:
- G4CustomFemaleBuilder();
- ~G4CustomFemaleBuilder();
-
- void BuildVoxelLeftBreast(const G4String&, G4bool, G4bool);
- void BuildVoxelRightBreast(const G4String&, G4bool, G4bool);
- void BuildLeftOvary(const G4String&, G4bool, G4bool);
- void BuildRightOvary(const G4String&, G4bool, G4bool);
- void BuildUterus(const G4String&, G4bool, G4bool);
-};
-#endif
diff --git a/include/G4HumanPhantomMaterial.h b/include/G4HumanPhantomMaterial.h
index 221fe9c..2676361 100644
--- a/include/G4HumanPhantomMaterial.h
+++ b/include/G4HumanPhantomMaterial.h
@@ -14,12 +14,6 @@ public:
G4Material* GetMaterial(G4String); // returns the material
private:
- // G4Material* matW;
- // G4Material* matplexiglass;
- // G4Material* matPb;
- // G4Material* matir192;
- // G4Material* Titanium;
- // G4Material* matAir;
G4Material* matH2O;
G4Material* soft;
G4Material* skeleton;
@@ -27,8 +21,6 @@ private:
G4Material* adipose;
G4Material* glandular;
G4Material* adipose_glandular;
- // G4Material*Vacuum;
-
- // G4Material* muscle;
+ G4Material* muscle;
};
#endif
diff --git a/include/G4HumanPhantomMessenger.h b/include/G4HumanPhantomMessenger.h
index de6cd3b..fc24452 100644
--- a/include/G4HumanPhantomMessenger.h
+++ b/include/G4HumanPhantomMessenger.h
@@ -20,21 +20,14 @@ public:
void SetNewValue(G4UIcommand* command, G4String newValue);
- void AddBodyPart(G4String); // Set Body Parts Sensitivity
-
private:
DetectorConstruction* myUserPhantom;
G4UIdirectory* phantomDir;
- G4UIdirectory* bpDir;
G4UIcmdWithAString* modelCmd;
G4UIcmdWithAString* sexCmd;
- G4UIcmdWithAString* bodypartCmd;
G4UIcmdWithoutParameter* endCmd;
-
- G4String bodypart;
- G4bool bps;
};
#endif
diff --git a/include/G4VoxelBreastFactory.h b/include/G4VoxelBreastFactory.h
deleted file mode 100644
index fbabc33..0000000
--- a/include/G4VoxelBreastFactory.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef G4VoxelBreastFactory_h
-#define G4VoxelBreastFactory_h 1
-
-#include "G4VBodyFactory.h"
-#include "G4VOrgan.h"
-
-#include