51 , fCrossSectionCalculator(nullptr)
52 , fParticleChange(nullptr)
90 if(polzz != 0 || poltt != 0)
94 xs *= (1. + polzz * lasym + poltt * tasym);
117 valueA = xsA / xs0 - 1.;
118 valueT = xsT / xs0 - 1.;
120 if((valueA < -1) || (1 < valueA))
123 ed <<
" ERROR PolarizedAnnihilationPS::ComputeAsymmetries \n";
124 ed <<
" something wrong in total cross section calculation (valueA)\n";
125 ed <<
" LONG: " << valueX <<
"\t" << valueA <<
"\t" << valueT
127 G4Exception(
"G4PolarizedAnnihilationModel::ComputeAsymmetriesPerElectron",
130 if((valueT < -1) || (1 < valueT))
133 ed <<
" ERROR PolarizedAnnihilationPS::ComputeAsymmetries \n";
134 ed <<
" something wrong in total cross section calculation (valueT)\n";
135 ed <<
" TRAN: " << valueX <<
"\t" << valueA <<
"\t" << valueT
137 G4Exception(
"G4PolarizedAnnihilationModel::ComputeAsymmetriesPerElectron",
155 if(PositKinEnergy == 0.0)
158 G4double sinTeta = std::sqrt((1.0 - cosTeta) * (1.0 + cosTeta));
160 G4ThreeVector dir(sinTeta * std::cos(phi), sinTeta * std::sin(phi),
184 G4cout <<
"G4PolarizedComptonModel::SampleSecondaries in "
189 if(targetIsPolarized)
198 G4double gama = gamam1 + 1., gamap1 = gamam1 + 2.;
199 G4double sqgrate = std::sqrt(gamam1 / gamap1) / 2.,
200 sqg2m1 = std::sqrt(gamam1 * gamap1);
203 G4double epsilmin = 0.5 - sqgrate, epsilmax = 0.5 + sqgrate;
204 G4double epsilqot = epsilmax / epsilmin;
210 G4double gmax = 1. + std::fabs(polarization);
217 ed <<
"ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
218 <<
"epsilmin DiceRoutine not appropriate ! "
220 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol006",
229 ed <<
"ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
230 <<
"epsilmax DiceRoutine not appropriate ! "
232 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol007",
250 if(treject > gmax || treject < 0.)
253 ed <<
"ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
255 <<
") rejection does not work properly: " << treject <<
G4endl;
256 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol008",
260 if(treject > trejectmax)
261 trejectmax = treject;
265 ed <<
"WARNING in PolarizedAnnihilationPS::PostStepDoIt\n"
266 <<
"eps dicing very inefficient =" << trejectmax / gmax <<
", "
267 << treject / gmax <<
". For secondary energy = " << epsil <<
" "
269 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol009",
278 G4double cost = (epsil * gamap1 - 1.) / (epsil * sqg2m1);
279 G4double sint = std::sqrt((1. + cost) * (1. - cost));
298 beamTrans * targetTrans;
323 treject = gdist / gdiced;
324 if(treject > 1. + 1.e-10 || treject < 0)
327 ed <<
"!!!ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
328 <<
" phi rejection does not work properly: " << treject <<
G4endl;
332 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol009",
339 ed <<
"!!!ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
340 <<
" phi rejection does not work properly: " << treject <<
"\n";
341 G4cout <<
" gdiced=" << gdiced <<
" gdist=" << gdist <<
"\n";
343 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol010",
350 G4double dirx = sint * std::cos(phi);
351 G4double diry = sint * std::sin(phi);
356 G4double Phot1Energy = epsil * TotalAvailableEnergy;
357 G4double Phot2Energy = (1. - epsil) * TotalAvailableEnergy;
375 Phot1Direction.
rotateUz(PositDirection);
384 ed <<
"ERROR: PolarizedAnnihilation Polarization Vector at epsil = "
385 << epsil <<
" is too large!!! \n"
388 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol011",
399 fvect->push_back(aParticle1);
403 G4double Eratio = Phot1Energy / Phot2Energy;
407 (PositP - dirz * Phot1Energy) / Phot2Energy);
408 Phot2Direction.
rotateUz(PositDirection);
419 ed <<
"ERROR: PolarizedAnnihilation Polarization Vector at epsil = "
420 << epsil <<
" is too large!!! \n";
423 G4Exception(
"G4PolarizedAnnihilationModel::SampleSecondaries",
"pol012",
433 fvect->push_back(aParticle2);
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 G4String & GetName() const
const G4Track * GetCurrentTrack() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4ThreeVector GetFrame(const G4ThreeVector &, const G4ThreeVector &)
bool IsPolarized(G4LogicalVolume *lVol) const
const G4StokesVector GetVolumePolarization(G4LogicalVolume *lVol) const
static G4PolarizationManager * GetInstance()
G4ParticleChangeForGamma * fParticleChange
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
G4StokesVector fFinalGamma1Polarization
virtual G4double ComputeCrossSectionPerElectron(G4double kinEnergy) override
G4StokesVector fTargetPolarization
void ComputeAsymmetriesPerElectron(G4double gammaEnergy, G4double &valueX, G4double &valueA, G4double &valueT)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) final
G4StokesVector fBeamPolarization
G4PolarizedAnnihilationModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="Polarized-Annihilation")
G4StokesVector fFinalGamma2Polarization
G4PolarizedAnnihilationXS * fCrossSectionCalculator
virtual ~G4PolarizedAnnihilationModel() override
virtual G4double TotalXSection(G4double xmin, G4double xmax, G4double y, const G4StokesVector &pol0, const G4StokesVector &pol1) override
virtual void Initialize(G4double eps, G4double gamma, G4double phi, const G4StokesVector &p0, const G4StokesVector &p1, G4int flag=0) override
virtual G4StokesVector GetPol3() override
virtual G4StokesVector GetPol2() override
static const G4StokesVector P3
static const G4StokesVector ZERO
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
static const G4StokesVector P2
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
static const G4StokesVector P1
G4VPhysicalVolume * GetVolume() const
const G4ThreeVector & GetPolarization() const
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeTrackStatus(G4TrackStatus status)
G4LogicalVolume * GetLogicalVolume() const
virtual G4double ComputeCrossSectionPerElectron(G4double kinEnergy)
void Initialise(const G4ParticleDefinition *, const G4DataVector &) override