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