75 theAsymmetryTable(nullptr),
76 theTransverseAsymmetryTable(nullptr)
91void G4eplusPolarizedAnnihilation::CleanTables()
93 if(theAsymmetryTable) {
95 delete theAsymmetryTable;
96 theAsymmetryTable =
nullptr;
98 if(theTransverseAsymmetryTable) {
100 delete theTransverseAsymmetryTable;
101 theTransverseAsymmetryTable =
nullptr;
113 if(theAsymmetryTable && theTransverseAsymmetryTable && mfp <
DBL_MAX) {
114 mfp *= ComputeSaturationFactor(track);
117 G4cout <<
"G4eplusPolarizedAnnihilation::MeanFreePath: "
118 << mfp / mm <<
" mm " <<
G4endl;
143 if(theAsymmetryTable && theTransverseAsymmetryTable && x <
DBL_MAX) {
144 satFact = ComputeSaturationFactor(track);
146 G4double prvLength = iLength*satFact;
149 std::max(nLength - previousStepSize/prvLength, 0.0);
154 G4cout <<
"G4eplusPolarizedAnnihilation::PostStepGPIL: "
155 << std::setprecision(8) << x/mm <<
" mm;" <<
G4endl
156 <<
" unpolarized value: "
157 << std::setprecision(8) << x0/mm <<
" mm." <<
G4endl;
165G4eplusPolarizedAnnihilation::ComputeSaturationFactor(
const G4Track& track)
178 if (volumeIsPolarized) {
187 G4cout <<
"G4eplusPolarizedAnnihilation::ComputeSaturationFactor: " <<
G4endl;
189 G4cout <<
" Polarization " << positronPolarization <<
G4endl;
190 G4cout <<
" MaterialPol. " << electronPolarization <<
G4endl;
199 if(midx < theAsymmetryTable->size()) {
200 aVector = (*theAsymmetryTable)(midx);
202 if(midx < theTransverseAsymmetryTable->size()) {
203 bVector = (*theTransverseAsymmetryTable)(midx);
205 if(aVector && bVector) {
208 G4double polZZ = positronPolarization.
z()*
209 (electronPolarization*positronDirection0);
210 G4double polXX = positronPolarization.
x()*
212 G4double polYY = positronPolarization.
y()*
215 factor /= (1. + polZZ*lAsymmetry + (polXX + polYY)*tAsymmetry);
218 G4cout <<
" Asymmetry: " << lAsymmetry <<
", " << tAsymmetry <<
G4endl;
219 G4cout <<
" PolProduct: " << polXX <<
", " << polYY <<
", " << polZZ <<
G4endl;
224 ed <<
"Problem with asymmetry tables: material index " << midx
225 <<
" is out of range or tables are not filled";
226 G4Exception(
"G4eplusPolarizedAnnihilation::ComputeSaturationFactor",
"em0048",
242 if(masterProcess && masterProcess !=
this) { isMaster =
false; }
243 if(isMaster) { BuildAsymmetryTables(part); }
248void G4eplusPolarizedAnnihilation::BuildAsymmetryTables(
255 theTransverseAsymmetryTable =
263 for(
size_t i=0; i<numOfCouples; ++i) {
265 if (!theAsymmetryTable)
break;
267 if (theAsymmetryTable->
GetFlag(i)) {
280 G4double asym = ComputeAsymmetry(lowEdgeEnergy, couple, part, 0., tasm);
321 lAsymmetry=sigma2/sigma0-1.;
322 tAsymmetry=sigma3/sigma0-1.;
331 G4cout <<
" Polarized model for annihilation into 2 photons"
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
G4double Value(G4double theEnergy, std::size_t &lastidx) const
G4double GetLowEdgeEnergy(std::size_t binNumber) const
void PutValue(std::size_t index, G4double theValue)
static G4ThreeVector GetParticleFrameY(const G4ThreeVector &)
static G4ThreeVector GetParticleFrameX(const G4ThreeVector &)
bool IsPolarized(G4LogicalVolume *lVol) const
static G4PolarizationManager * GetInstance()
const G4ThreeVector & GetVolumePolarization(G4LogicalVolume *lVol) const
void SetTargetPolarization(const G4ThreeVector &pTarget)
void SetBeamPolarization(const G4ThreeVector &pBeam)
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 *)
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetEmModel(G4VEmModel *, G4int index=0)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4int LambdaBinning() const
size_t CurrentMaterialCutsCoupleIndex() const
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4LogicalVolume * GetLogicalVolume() const
const G4String & GetName() const
G4double currentInteractionLength
const G4VProcess * GetMasterProcess() const
G4double theNumberOfInteractionLengthLeft
G4eplusPolarizedAnnihilation(const G4String &name="pol-annihil")
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
virtual ~G4eplusPolarizedAnnihilation()
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
virtual void PrintInfo() override