52 , fCrossSectionCalculator(nullptr)
78 if(fCrossSectionCalculator)
80 delete fCrossSectionCalculator;
90 pd, kinEnergy, cut, emax);
95 tmax = std::min(emax, tmax);
97 if(std::fabs(cut / emax - 1.) < 1.e-10)
104 G4double gam = kinEnergy / electron_mass_c2 + 1.0;
106 xmin, xmax, gam, fBeamPolarization, fTargetPolarization);
110 factor = crossPol / crossUnpol;
137 if(targetIsPolarized)
144 G4double polL = fBeamPolarization.
z() * fTargetPolarization.
z();
145 polL = std::fabs(polL);
146 G4double polT = fBeamPolarization.
x() * fTargetPolarization.
x() +
147 fBeamPolarization.
y() * fTargetPolarization.
y();
148 polT = std::fabs(polT);
151 G4double energy = kineticEnergy + electron_mass_c2;
153 std::sqrt(kineticEnergy * (energy + electron_mass_c2));
154 G4double xmin = tmin / kineticEnergy;
155 G4double xmax = tmax / kineticEnergy;
156 G4double gam = energy / electron_mass_c2;
173 G4double G = ((2.0 * gam - 1.0) / gamma2) * (1. - polT - polL * gam);
175 (1. + polT + polL * ((gam + 3.) / (gam - 1.)));
178 grej = 1.0 - G * xmax + xmax * xmax * (H + (1.0 - G * y) / (y * y));
179 grej2 = 1.0 - G * xmin + xmin * xmin * (H + (1.0 - G * y) / (y * y));
182 G4double prefM = gamma2 * classic_electr_radius * classic_electr_radius /
183 (gmo2 * (gam + 1.0));
188 x = xmin * xmax / (xmin * (1.0 - q) + xmax * q);
189 if(fCrossSectionCalculator)
191 fCrossSectionCalculator->
Initialize(x, gam, phi, fBeamPolarization,
192 fTargetPolarization, 1);
195 z = xs *
sqr(x) * 4.;
199 ed <<
"WARNING : error in Moller rejection routine! \n"
200 <<
" z = " << z <<
" grej=" << grej <<
"\n";
201 G4Exception(
"G4PolarizedIonisationModel::SampleSecondaries",
"pol019",
207 G4cout <<
"No calculator in Moller scattering" <<
G4endl;
218 grej += y * y * gmo3 * (1. + (polL + polT) * (gam + 3.) / gmo);
219 grej += -2. * xmin * xmin * xmin * gam * gmo2 *
220 (1. - (polL + polT) * (gam + 3.) / gmo);
221 grej += y * y * gmo * (3. * gamma2 + 6. * gam + 4.) *
222 (1. + (polL * (3. * gam + 1.) * (gamma2 + gam + 1.) +
223 polT * ((gam + 2.) * gamma2 + 1.)) /
224 (gmo * (3. * gam * (gam + 2.) + 4.)));
226 grej += -xmin * (2. * gamma2 + 4. * gam + 1.) *
227 (1. - gam * (polL * (2. * gam + 1.) + polT) /
228 (2. * gam * (gam + 2.) + 1.)) /
230 grej += gamma2 / (gamma2 - 1.);
232 classic_electr_radius * classic_electr_radius / (gam - 1.0);
238 x = xmin * xmax / (xmin * (1.0 - q) + xmax * q);
239 if(fCrossSectionCalculator)
241 fCrossSectionCalculator->
Initialize(x, gam, phi, fBeamPolarization,
242 fTargetPolarization, 1);
245 z = xs *
sqr(x) * 4.;
249 G4cout <<
"No calculator in Bhabha scattering" <<
G4endl;
255 ed <<
"G4PolarizedIonisationModel::SampleSecondaries Warning!\n "
256 <<
"Majorant " << grej <<
" < " << z <<
" for x= " << x <<
G4endl
257 <<
" e+e- (Bhabha) scattering"
258 <<
" at KinEnergy " << kineticEnergy <<
G4endl;
259 G4Exception(
"G4PolarizedIonisationModel::SampleSecondaries",
"pol020",
267 if(fCrossSectionCalculator)
273 fCrossSectionCalculator->
Initialize(x, gam, phi, fBeamPolarization,
274 fTargetPolarization, 1);
282 ed <<
"Majorant " << grej <<
" < " << xs <<
" for phi= " << phi
284 <<
" e-e- (Moller) scattering\n"
286 G4Exception(
"G4PolarizedIonisationModel::SampleSecondaries",
"pol021",
292 ed <<
"Majorant " << grej <<
" < " << xs <<
" for phi= " << phi
294 <<
" e+e- (Bhabha) scattering\n"
296 G4Exception(
"G4PolarizedIonisationModel::SampleSecondaries",
"pol022",
305 G4double deltaKinEnergy = x * kineticEnergy;
307 std::sqrt(deltaKinEnergy * (deltaKinEnergy + 2.0 * electron_mass_c2));
308 G4double cost = deltaKinEnergy * (energy + electron_mass_c2) /
309 (deltaMomentum * totalMomentum);
312 sint = std::sqrt(sint);
314 G4ThreeVector deltaDirection(-sint * std::cos(phi), -sint * std::sin(phi),
319 kineticEnergy -= deltaKinEnergy;
325 totalMomentum * direction - deltaMomentum * deltaDirection;
326 direction = dir.
unit();
333 vdp->push_back(delta);
339 if(fCrossSectionCalculator)
342 fBeamPolarization.
InvRotateAz(nInteractionFrame, direction);
343 fTargetPolarization.
InvRotateAz(nInteractionFrame, direction);
344 fCrossSectionCalculator->
Initialize(x, gam, phi, fBeamPolarization,
345 fTargetPolarization, 2);
348 fPositronPolarization = fCrossSectionCalculator->
GetPol2();
349 fPositronPolarization.
RotateAz(nInteractionFrame, direction);
354 fElectronPolarization = fCrossSectionCalculator->
GetPol3();
355 fElectronPolarization.
RotateAz(nInteractionFrame, deltaDirection);
357 fElectronPolarization.
z());
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
Hep3Vector & rotateUz(const Hep3Vector &)
void SetPolarization(const G4ThreeVector &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4ThreeVector & GetPolarization() const
G4ParticleChangeForLoss * fParticleChange
G4ParticleDefinition * theElectron
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy)
G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) final
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposePolarization(const G4ThreeVector &dir)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
static G4ThreeVector GetFrame(const G4ThreeVector &, const G4ThreeVector &)
bool IsPolarized(G4LogicalVolume *lVol) const
const G4StokesVector GetVolumePolarization(G4LogicalVolume *lVol) const
static G4PolarizationManager * GetInstance()
virtual ~G4PolarizedIonisationModel() override
G4PolarizedIonisationModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="PolarizedMollerBhabha")
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kinEnergy, G4double cut, G4double emax) override
static const G4StokesVector ZERO
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
G4VPhysicalVolume * GetVolume() const
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
const G4Track * GetCurrentTrack() const
G4LogicalVolume * GetLogicalVolume() const
virtual void Initialize(G4double, G4double, G4double, const G4StokesVector &p0, const G4StokesVector &p1, G4int flag=0)=0
virtual G4double XSection(const G4StokesVector &pol2, const G4StokesVector &pol3)=0
virtual G4double TotalXSection(G4double xmin, G4double xmax, G4double y, const G4StokesVector &pol0, const G4StokesVector &pol1)
virtual G4StokesVector GetPol2()
virtual G4StokesVector GetPol3()