79 G4double worldZHalfLength = 0;
81 = G4LogicalVolumeStore::GetInstance()->GetVolume(
"World");
82 G4Box* worldBox =
nullptr;
83 if ( worldLV ) worldBox =
dynamic_cast<G4Box*
>(worldLV->GetSolid());
84 if ( worldBox ) worldZHalfLength = worldBox->GetZHalfLength();
86 G4cerr <<
"World volume of box not found." << G4endl;
87 G4cerr <<
"Perhaps you have changed geometry." << G4endl;
88 G4cerr <<
"The gun will be place in the center." << G4endl;
93 fParticleGun->SetParticlePosition(G4ThreeVector(0., 0., -worldZHalfLength));