56 G4double mass_proton = particle->GetPDGMass();
58 G4double muN = 0.5*CLHEP::eplus*CLHEP::hbar_Planck/
59 (mass_proton/CLHEP::c_squared);
61 G4cout <<
" *** Neutron *** " << G4endl;
63 particle = particleTable->FindParticle(
"neutron");
64 G4double mass_neutron = particle->GetPDGMass();
66 G4double magneticMoment = particle->GetPDGMagneticMoment();
67 G4cout <<
" magneticMoment: " << magneticMoment/muN << G4endl;
71 G4double g_factor = 2 * magneticMoment/muN;
72 G4cout <<
" g_factor: " << g_factor << G4endl;
74 G4double charge = particle->GetPDGCharge();
75 G4cout <<
" charge: " << charge << G4endl;
77 G4double anomaly = (g_factor - 2.)/2.;
78 G4cout <<
" anomaly: " << anomaly << G4endl;
80 anomaly = (g_factor * (mass_neutron/mass_proton) - 2.)/2.;
81 G4cout <<
" corrected anomaly: " << anomaly << G4endl;
83 muN = 0.5*CLHEP::eplus*CLHEP::hbar_Planck/(mass_neutron/CLHEP::c_squared);
84 g_factor = 2 * magneticMoment/muN;
86 anomaly = (g_factor - 2.)/2.;
87 G4cout <<
" *** anomaly: " << anomaly << G4endl;
89 G4cout <<
" *** MuonPlus *** " << G4endl;
91 particle = particleTable->FindParticle(
"mu+");
92 G4double mass_muon = particle->GetPDGMass();
94 G4double muB = 0.5*CLHEP::eplus*CLHEP::hbar_Planck/
95 (mass_muon/CLHEP::c_squared);
97 magneticMoment = particle->GetPDGMagneticMoment();
98 G4cout <<
" magneticMoment: " << magneticMoment/muB << G4endl;
102 g_factor = magneticMoment/muB;
103 G4cout <<
" g_factor: " << g_factor << G4endl;
105 charge = particle->GetPDGCharge();
106 G4cout <<
" charge: " << charge << G4endl;
108 anomaly = (g_factor - 2.)/2.;
109 G4cout <<
" anomaly: " << anomaly << G4endl;
114 particle = particleTable->FindParticle(
"neutron");
132 fParticleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, 0.0));
133 fParticleGun->SetParticlePolarization(G4ThreeVector(0,1,0));
135 G4double particleEnergy = G4UniformRand()*1e-7*eV;
138 G4double theta = 2*pi*G4UniformRand();
139 G4double phi = std::acos(1-2*G4UniformRand());
140 if (phi > pi/2 && phi < pi) phi = pi-phi;
142 G4double z = std::sin(phi)*std::cos(theta);
143 G4double x = std::sin(phi)*std::sin(theta);
144 G4double y = std::cos(phi);
146 fParticleGun->SetParticleMomentumDirection(G4ThreeVector(x,y,z));