52 , fCrossSectionCalculator(nullptr)
90 pd, kinEnergy, cut,
emax);
97 if(std::fabs(cut /
emax - 1.) < 1.e-10)
110 factor = crossPol / crossUnpol;
137 if(targetIsPolarized)
145 polL = std::fabs(polL);
148 polT = std::fabs(polT);
154 G4double xmin = tmin / kineticEnergy;
155 G4double xmax = tmax / kineticEnergy;
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));
183 (gmo2 * (
gam + 1.0));
188 x = xmin * xmax / (xmin * (1.0 - q) + xmax * q);
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.);
238 x = xmin * xmax / (xmin * (1.0 - q) + xmax * q);
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",
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;
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);
static const G4double emax
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static constexpr double twopi
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)
const G4Track * GetCurrentTrack() const
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
G4StokesVector fTargetPolarization
G4PolarizedIonisationModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="PolarizedMollerBhabha")
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
G4StokesVector fBeamPolarization
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kinEnergy, G4double cut, G4double emax) override
G4StokesVector fElectronPolarization
G4StokesVector fPositronPolarization
G4VPolarizedXS * fCrossSectionCalculator
static const G4StokesVector ZERO
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
G4VPhysicalVolume * GetVolume() const
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
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()
G4double energy(const ThreeVector &p, const G4double m)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
int classic_electr_radius