80 G4double envSizeXY = 0;
81 G4double envSizeZ = 0;
86 = G4LogicalVolumeStore::GetInstance()->GetVolume(
"Envelope");
95 G4ExceptionDescription msg;
96 msg <<
"Envelope volume of box shape not found.\n";
97 msg <<
"Perhaps you have changed geometry.\n";
98 msg <<
"The gun will be place at the center.";
99 G4Exception(
"B1PrimaryGeneratorAction::GeneratePrimaries()",
100 "MyCode0002",JustWarning,msg);
104 G4double x0 = size * envSizeXY * (G4UniformRand()-0.5);
105 G4double y0 = size * envSizeXY * (G4UniformRand()-0.5);
106 G4double z0 = -0.5 * envSizeZ;
108 fParticleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));