change some comments

This commit is contained in:
liuyihui 2022-04-30 21:39:54 +08:00
parent 4f6b88b162
commit 29dd4efc5e
5 changed files with 22 additions and 21 deletions

View File

@ -48,7 +48,6 @@ int main(int argc, char** argv) {
G4UImanager* UImanager = G4UImanager::GetUIpointer(); G4UImanager* UImanager = G4UImanager::GetUIpointer();
// 根据模式选择开始进行模拟或打开GUI // 根据模式选择开始进行模拟或打开GUI
//
if (!ui) { if (!ui) {
// batch mode // batch mode
G4String command = "/control/execute "; G4String command = "/control/execute ";

View File

@ -17,8 +17,7 @@ public:
SteppingAction(EventAction* eventAction); SteppingAction(EventAction* eventAction);
~SteppingAction() override; ~SteppingAction() override;
// method from the base class // 每个 step 调用一次
// 循环每个 step
void UserSteppingAction(const G4Step*) override; void UserSteppingAction(const G4Step*) override;
private: private:

View File

@ -68,9 +68,9 @@ G4VPhysicalVolume* DetectorConstruction::Construct() {
new G4PVPlacement(0, // no rotation new G4PVPlacement(0, // no rotation
G4ThreeVector(), // at (0,0,0) G4ThreeVector(), // at (0,0,0)
logicEnv, // its logical volume logicEnv, // logical volume
"Envelope", // its name "Envelope", // name
logicWorld, // 放置在 World 中 logicWorld, // Mother Logical Volumes即 World
false, // no boolean operation false, // no boolean operation
0, // copy number 0, // copy number
checkOverlaps); // overlaps checking checkOverlaps); // overlaps checking
@ -87,15 +87,15 @@ G4VPhysicalVolume* DetectorConstruction::Construct() {
G4Cons* solidShape1 = new G4Cons("Shape1", shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb, shape1_hz, G4Cons* solidShape1 = new G4Cons("Shape1", shape1_rmina, shape1_rmaxa, shape1_rminb, shape1_rmaxb, shape1_hz,
shape1_phimin, shape1_phimax); shape1_phimin, shape1_phimax);
G4LogicalVolume* logicShape1 = new G4LogicalVolume(solidShape1, // its solid G4LogicalVolume* logicShape1 = new G4LogicalVolume(solidShape1, // solid
shape1_mat, // its material shape1_mat, // material
"Shape1"); // its name "Shape1"); // name
new G4PVPlacement(0, // no rotation new G4PVPlacement(0, // no rotation
pos1, // at position pos1, // at position
logicShape1, // its logical volume logicShape1, // logical volume
"Shape1", // its name "Shape1", // name
logicEnv, // its mother volume logicEnv, // mother volume
false, // no boolean operation false, // no boolean operation
0, // copy number 0, // copy number
checkOverlaps); // overlaps checking checkOverlaps); // overlaps checking
@ -108,19 +108,19 @@ G4VPhysicalVolume* DetectorConstruction::Construct() {
G4double shape2_dxa = 12 * cm, shape2_dxb = 12 * cm; G4double shape2_dxa = 12 * cm, shape2_dxb = 12 * cm;
G4double shape2_dya = 10 * cm, shape2_dyb = 16 * cm; G4double shape2_dya = 10 * cm, shape2_dyb = 16 * cm;
G4double shape2_dz = 6 * cm; G4double shape2_dz = 6 * cm;
G4Trd* solidShape2 = new G4Trd("Shape2", // its name G4Trd* solidShape2 = new G4Trd("Shape2", // name
0.5 * shape2_dxa, 0.5 * shape2_dxb, 0.5 * shape2_dya, 0.5 * shape2_dyb, 0.5 * shape2_dxa, 0.5 * shape2_dxb, 0.5 * shape2_dya, 0.5 * shape2_dyb,
0.5 * shape2_dz); // its size 0.5 * shape2_dz); // size
G4LogicalVolume* logicShape2 = new G4LogicalVolume(solidShape2, // its solid G4LogicalVolume* logicShape2 = new G4LogicalVolume(solidShape2, // solid
shape2_mat, // its material shape2_mat, // material
"Shape2"); // its name "Shape2"); // name
new G4PVPlacement(0, // no rotation new G4PVPlacement(0, // no rotation
pos2, // at position pos2, // at position
logicShape2, // its logical volume logicShape2, // logical volume
"Shape2", // its name "Shape2", // name
logicEnv, // its mother volume logicEnv, // mother volume
false, // no boolean operation false, // no boolean operation
0, // copy number 0, // copy number
checkOverlaps); // overlaps checking checkOverlaps); // overlaps checking

View File

@ -6,6 +6,7 @@
namespace B1 { namespace B1 {
// 初始化 fEventAction即获取到当前 Event 所在的 Run
EventAction::EventAction(RunAction* runAction) : fRunAction(runAction) {} EventAction::EventAction(RunAction* runAction) : fRunAction(runAction) {}
EventAction::~EventAction() {} EventAction::~EventAction() {}

View File

@ -9,12 +9,14 @@
namespace B1 { namespace B1 {
SteppingAction::SteppingAction(EventAction* eventAction) : fEventAction(eventAction) {} // 初始化 eventAction 类 // 初始化 fEventAction即获取到当前 Step 所在的 Event
SteppingAction::SteppingAction(EventAction* eventAction) : fEventAction(eventAction) {}
SteppingAction::~SteppingAction() {} SteppingAction::~SteppingAction() {}
// 每个 step 调用一次 // 每个 step 调用一次
void SteppingAction::UserSteppingAction(const G4Step* step) { void SteppingAction::UserSteppingAction(const G4Step* step) {
// 这段代码的目的是获得 Shape2 所代表的 Logical Volume
if (!fScoringVolume) { if (!fScoringVolume) {
const DetectorConstruction* detConstruction = const DetectorConstruction* detConstruction =
static_cast<const DetectorConstruction*>(G4RunManager::GetRunManager()->GetUserDetectorConstruction()); static_cast<const DetectorConstruction*>(G4RunManager::GetRunManager()->GetUserDetectorConstruction());