PrimaryGeneratorAction.cc
#include "G4LogicalVolumeStore.hh"
……
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) {
G4LogicalVolume* worldLV = G4LogicalVolumeStore::GetInstance()->GetVolume("World"); G4Box* worldBox = nullptr; if ( worldLV ) worldBox = dynamic_cast<G4Box*>(worldLV->GetSolid()); if ( worldBox ) worldZHalfLength = worldBox->GetZHalfLength(); …… }
标签:PrimaryGenerator,G4LogicalVolumeStore,获取,worldBox,worldLV,Geant4,PrimaryGenerato From: https://www.cnblogs.com/endcase/p/17629759.html