67 crossSectionCalculator(nullptr),
69 gParticleChange(nullptr),
104 if (polzz!=0 || poltt!=0) {
107 xs*=(1.+polzz*lasym+poltt*tasym);
138 if ( (valueA < -1) || (1 < valueA)) {
139 G4cout<<
" ERROR PolarizedAnnihilationPS::ComputeAsymmetries \n";
140 G4cout<<
" something wrong in total cross section calculation (valueA)\n";
141 G4cout<<
"*********** LONG "<<valueX<<
"\t"<<valueA<<
"\t"<<valueT<<
" energy = "<<gam<<
G4endl;
143 if ( (valueT < -1) || (1 < valueT)) {
144 G4cout<<
" ERROR PolarizedAnnihilationPS::ComputeAsymmetries \n";
145 G4cout<<
" something wrong in total cross section calculation (valueT)\n";
146 G4cout<<
"****** TRAN "<<valueX<<
"\t"<<valueA<<
"\t"<<valueT<<
" energy = "<<gam<<
G4endl;
171 G4double sinTeta = std::sqrt((1.0 - cosTeta)*(1.0 + cosTeta));
173 G4ThreeVector dir(sinTeta*std::cos(phi), sinTeta*std::sin(phi), cosTeta);
192 G4cout <<
"G4PolarizedComptonModel::SampleSecondaries in "
197 if (targetIsPolarized)
205 G4double gamam1 = PositKinEnergy/electron_mass_c2;
206 G4double gama = gamam1+1. , gamap1 = gamam1+2.;
207 G4double sqgrate = std::sqrt(gamam1/gamap1)/2. , sqg2m1 = std::sqrt(gamam1*gamap1);
210 G4double epsilmin = 0.5 - sqgrate , epsilmax = 0.5 + sqgrate;
211 G4double epsilqot = epsilmax/epsilmin;
219 G4double gmax=1. + std::fabs(polarization);
225 G4cout<<
"ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
232 G4cout<<
"ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
251 if (treject>gmax || treject<0.)
252 G4cout<<
"ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
253 <<
" eps ("<<epsil<<
") rejection does not work properly: "<<treject<<
G4endl;
255 if (treject>trejectmax) trejectmax=treject;
257 G4cout<<
"WARNING in PolarizedAnnihilationPS::PostStepDoIt\n"
258 <<
"eps dicing very inefficient ="<<trejectmax/gmax
259 <<
", "<<treject/gmax<<
". For secondary energy = "<<epsil<<
" "<<ncount<<
G4endl;
270 G4double cost = (epsil*gamap1-1.)/(epsil*sqg2m1);
271 G4double sint = std::sqrt((1.+cost)*(1.-cost));
304 treject = gdist/gdiced;
306 if (treject>1.+1.e-10 || treject<0){
307 G4cout<<
"!!!ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
308 <<
" phi rejection does not work properly: "<<treject<<
G4endl;
315 G4cout<<
"!!!ERROR in PolarizedAnnihilationPS::PostStepDoIt\n"
316 <<
" phi rejection does not work properly: "<<treject<<
"\n";
317 G4cout<<
" gdiced="<<gdiced<<
" gdist="<<gdist<<
"\n";
325 G4double dirx = sint*std::cos(phi) , diry = sint*std::sin(phi) , dirz = cost;
330 G4double TotalAvailableEnergy = PositKinEnergy + 2*electron_mass_c2;
331 G4double Phot1Energy = epsil*TotalAvailableEnergy;
332 G4double Phot2Energy =(1.-epsil)*TotalAvailableEnergy;
351 Phot1Direction.rotateUz(PositDirection);
354 Phot1Direction, Phot1Energy);
358 G4cout<<
"ERROR: PolarizedAnnihilation Polarization Vector at epsil = "
359 <<epsil<<
" is too large!!! \n"
371 fvect->push_back(aParticle1);
376 G4double Eratio= Phot1Energy/Phot2Energy;
377 G4double PositP= std::sqrt(PositKinEnergy*(PositKinEnergy+2.*electron_mass_c2));
379 (PositP-dirz*Phot1Energy)/Phot2Energy);
380 Phot2Direction.rotateUz(PositDirection);
383 Phot2Direction, Phot2Energy);
389 G4cout<<
"ERROR: PolarizedAnnihilation Polarization Vector at epsil = "<<epsil<<
" is too large!!! \n";
400 fvect->push_back(aParticle2);
const G4ThreeVector & GetPolarization() const
G4StokesVector GetPol2() override
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
virtual ~G4PolarizedAnnihilationModel()
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) override
static G4PolarizationManager * GetInstance()
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kinEnergy, G4double cut, G4double emax) override
static constexpr double twopi
static const G4StokesVector P3
G4StokesVector finalGamma2Polarization
G4GLOB_DLL std::ostream G4cout
static const G4StokesVector P2
virtual G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition *, G4double kinEnergy, G4double cutEnergy=0., G4double maxEnergy=DBL_MAX)
G4ParticleChangeForGamma * gParticleChange
const G4ThreeVector & GetMomentumDirection() const
G4PolarizedAnnihilationCrossSection * crossSectionCalculator
static const G4StokesVector P1
static G4ThreeVector GetFrame(const G4ThreeVector &, const G4ThreeVector &)
G4StokesVector theBeamPolarization
void SetPolarization(G4double polX, G4double polY, G4double polZ)
void ComputeAsymmetriesPerElectron(G4double gammaEnergy, G4double &valueX, G4double &valueA, G4double &valueT)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) override
static const G4double emax
void InvRotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
G4LogicalVolume * GetLogicalVolume() const
G4StokesVector GetPol3() override
virtual G4double TotalXSection(G4double xmin, G4double xmax, G4double y, const G4StokesVector &pol0, const G4StokesVector &pol1) override
G4PolarizedAnnihilationModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="Polarized-Annihilation")
G4StokesVector theTargetPolarization
bool IsPolarized(G4LogicalVolume *lVol) const
G4VPhysicalVolume * GetVolume() const
const G4Track * GetCurrentTrack() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4StokesVector finalGamma1Polarization
const G4String & GetName() const
void ProposeTrackStatus(G4TrackStatus status)
virtual void Initialize(G4double eps, G4double gamma, G4double phi, const G4StokesVector &p0, const G4StokesVector &p1, G4int flag=0) override
G4ThreeVector G4ParticleMomentum
static const G4StokesVector ZERO
const G4ThreeVector & GetVolumePolarization(G4LogicalVolume *lVol) const
void RotateAz(G4ThreeVector nInteractionFrame, G4ThreeVector particleDirection)
G4ParticleChangeForGamma * GetParticleChangeForGamma()