53 , fAsymmetryTable(nullptr)
54 , fTransverseAsymmetryTable(nullptr)
64void G4PolarizedAnnihilation::CleanTables()
69 delete fAsymmetryTable;
70 fAsymmetryTable =
nullptr;
72 if(fTransverseAsymmetryTable)
75 delete fTransverseAsymmetryTable;
76 fTransverseAsymmetryTable =
nullptr;
88 if(
nullptr != fAsymmetryTable &&
nullptr != fTransverseAsymmetryTable && mfp <
DBL_MAX)
90 mfp *= ComputeSaturationFactor(track);
94 G4cout <<
"G4PolarizedAnnihilation::MeanFreePath: " << mfp / mm <<
" mm "
116 if(
nullptr != fAsymmetryTable &&
nullptr != fTransverseAsymmetryTable && x <
DBL_MAX)
118 satFact = ComputeSaturationFactor(track);
120 G4double prvLength = iLength * satFact;
124 std::max(nLength - previousStepSize / prvLength, 0.0);
130 G4cout <<
"G4PolarizedAnnihilation::PostStepGPIL: " << std::setprecision(8)
131 << x / mm <<
" mm;" <<
G4endl
132 <<
" unpolarized value: "
133 << std::setprecision(8) << x0 / mm <<
" mm." <<
G4endl;
139G4double G4PolarizedAnnihilation::ComputeSaturationFactor(
const G4Track& track)
154 if(volumeIsPolarized)
166 G4cout <<
"G4PolarizedAnnihilation::ComputeSaturationFactor: " <<
G4endl;
168 G4cout <<
" Polarization " << positronPolarization <<
G4endl;
169 G4cout <<
" MaterialPol. " << electronPolarization <<
G4endl;
178 if(midx < fAsymmetryTable->size())
180 aVector = (*fAsymmetryTable)(midx);
182 if(midx < fTransverseAsymmetryTable->size())
184 bVector = (*fTransverseAsymmetryTable)(midx);
186 if(aVector && bVector)
191 positronPolarization.
z() * (electronPolarization * positronDirection0);
193 positronPolarization.
x() *
194 (electronPolarization *
197 positronPolarization.
y() *
198 (electronPolarization *
201 factor /= (1. + polZZ * lAsymmetry + (polXX + polYY) * tAsymmetry);
205 G4cout <<
" Asymmetry: " << lAsymmetry <<
", " << tAsymmetry
207 G4cout <<
" PolProduct: " << polXX <<
", " << polYY <<
", " << polZZ
215 ed <<
"Problem with asymmetry tables: material index " << midx
216 <<
" is out of range or tables are not filled";
217 G4Exception(
"G4PolarizedAnnihilation::ComputeSaturationFactor",
"em0048",
231 BuildAsymmetryTables(part);
236void G4PolarizedAnnihilation::BuildAsymmetryTables(
242 fTransverseAsymmetryTable =
244 if(
nullptr == fAsymmetryTable)
return;
250 for(
G4int i = 0; i < numOfCouples; ++i)
252 if(fAsymmetryTable->
GetFlag(i))
262 for(
G4int j = 0; j < nn; ++j)
266 G4double asym = ComputeAsymmetry(energy, couple, part, 0., tasm);
282G4double G4PolarizedAnnihilation::ComputeAsymmetry(
294 fEmModel->
CrossSection(couple, &aParticle, energy, cut, energy);
301 fEmModel->
CrossSection(couple, &aParticle, energy, cut, energy);
308 fEmModel->
CrossSection(couple, &aParticle, energy, cut, energy);
313 lAsymmetry = sigma2 / sigma0 - 1.;
314 tAsymmetry = sigma3 / sigma0 - 1.;
322 out <<
"Polarized model for positron annihilation into 2 photons.\n";
G4double condition(const G4ErrorSymMatrix &m)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4String & GetName() const
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
static void SetPhysicsVector(G4PhysicsTable *physTable, std::size_t idx, G4PhysicsVector *vec)
G4bool GetFlag(std::size_t i) const
void PutValue(const std::size_t index, const G4double value)
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
std::size_t GetVectorLength() const
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
static G4ThreeVector GetParticleFrameY(const G4ThreeVector &)
static G4ThreeVector GetParticleFrameX(const G4ThreeVector &)
bool IsPolarized(G4LogicalVolume *lVol) const
const G4StokesVector GetVolumePolarization(G4LogicalVolume *lVol) const
static G4PolarizationManager * GetInstance()
void SetTargetPolarization(const G4ThreeVector &pTarget)
void SetBeamPolarization(const G4ThreeVector &pBeam)
virtual ~G4PolarizedAnnihilation() override
virtual void ProcessDescription(std::ostream &) const override
G4PolarizedAnnihilation(const G4String &name="pol-annihil")
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
std::size_t GetTableSize() const
static G4ProductionCutsTable * GetProductionCutsTable()
G4VPhysicalVolume * GetVolume() const
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetPolarization() const
G4double CrossSection(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *)
void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetEmModel(G4VEmModel *, G4int index=0)
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
size_t CurrentMaterialCutsCoupleIndex() const
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
G4double currentInteractionLength
G4double theNumberOfInteractionLengthLeft