G4-ExampleB1/include/DetectorConstruction.hh

30 lines
779 B
C++

#ifndef B1DetectorConstruction_h
#define B1DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh" // 基类
#include "globals.hh"
class G4VPhysicalVolume;
class G4LogicalVolume;
/// Detector construction class to define materials and geometry.
namespace B1 {
class DetectorConstruction : public G4VUserDetectorConstruction {
public:
DetectorConstruction(); // 构造
~DetectorConstruction() override; // 构析
G4VPhysicalVolume* Construct() override; // 函数,描述探测器,返回物理体
G4LogicalVolume* GetScoringVolume() const { return fScoringVolume; } // 自定义计数函数 返回指针fScoringVolume
protected:
G4LogicalVolume* fScoringVolume = nullptr; // 用于计数
};
} // namespace B1
#endif