54 , fBuildAsymmetryTable(true)
55 , fUseAsymmetryTable(true)
56 , fIsInitialised(false)
73 out <<
"Polarized model for Compton scattering.\n";
79void G4PolarizedCompton::CleanTable()
84 delete theAsymmetryTable;
85 theAsymmetryTable =
nullptr;
100 fIsInitialised =
true;
123 if(ss ==
"Klein-Nishina")
127 if(ss ==
"Polarized-Compton")
142 if(theAsymmetryTable && fUseAsymmetryTable && mfp <
DBL_MAX)
144 mfp *= ComputeSaturationFactor(aTrack);
148 G4cout <<
"G4PolarizedCompton::MeanFreePath: " << mfp / mm <<
" mm "
170 if(theAsymmetryTable && fUseAsymmetryTable && x <
DBL_MAX)
172 satFact = ComputeSaturationFactor(aTrack);
174 G4double prvLength = iLength * satFact;
178 std::max(nLength - previousStepSize / prvLength, 0.0);
184 G4cout <<
"G4PolarizedCompton::PostStepGPIL: " << std::setprecision(8)
185 << x / mm <<
" mm;" <<
G4endl
186 <<
" unpolarized value: " << std::setprecision(8)
187 << x0 / mm <<
" mm." <<
G4endl;
193G4double G4PolarizedCompton::ComputeSaturationFactor(
const G4Track& aTrack)
216 if(VolumeIsPolarized)
220 G4cout <<
"G4PolarizedCompton::ComputeSaturationFactor: " <<
G4endl;
222 G4cout <<
" Polarization " << GammaPolarization <<
G4endl;
223 G4cout <<
" MaterialPol. " << ElectronPolarization <<
G4endl;
231 if(midx < theAsymmetryTable->size())
233 aVector = (*theAsymmetryTable)(midx);
244 G4double pol = ElectronPolarization * GammaDirection0;
245 G4double polProduct = GammaPolarization.
p3() * pol;
246 factor /= (1. + polProduct * asymmetry);
257 ed <<
"Problem with asymmetry table: material index " << midx
258 <<
" is out of range or the table is not filled";
259 G4Exception(
"G4PolarizedComptonModel::ComputeSaturationFactor",
"em0048",
271 if(fBuildAsymmetryTable && fEmModel)
276 if(masterProcess && masterProcess !=
this)
282 BuildAsymmetryTable(part);
299 if(!theAsymmetryTable)
309 for(
G4int i = 0; i < numOfCouples; ++i)
311 if(theAsymmetryTable->
GetFlag(i))
327 for(
G4int j = 0; j <= nbins; ++j)
331 G4double asym = ComputeAsymmetry(energy, couple, part, 0., tasm);
341G4double G4PolarizedCompton::ComputeAsymmetry(
353 fEmModel->
CrossSection(couple, &aParticle, energy, cut, energy);
360 fEmModel->
CrossSection(couple, &aParticle, energy, cut, energy);
365 lAsymmetry = sigma2 / sigma0 - 1.;
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
static G4Electron * Electron()
static G4EmParameters * Instance()
G4double MinKinEnergy() const
G4double MaxKinEnergy() 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
void FillSecondDerivatives(const G4SplineType=G4SplineType::Base, const G4double dir1=0.0, const G4double dir2=0.0)
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 void BuildPhysicsTable(const G4ParticleDefinition &) override
void SetModel(const G4String &name)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
virtual void ProcessDescription(std::ostream &) const override
virtual G4double GetMeanFreePath(const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition) override
virtual ~G4PolarizedCompton() override
virtual G4bool IsApplicable(const G4ParticleDefinition &) override
G4PolarizedCompton(const G4String &processName="pol-compt", G4ProcessType type=fElectromagnetic)
virtual void InitialiseProcess(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
void SetHighEnergyLimit(G4double)
void SetLowEnergyLimit(G4double)
G4double CrossSection(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4VEmModel * EmModel(size_t index=0) const
void SetBuildTableFlag(G4bool val)
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
void SetEmModel(G4VEmModel *, G4int index=0)
void SetSecondaryParticle(const G4ParticleDefinition *p)
void SetSplineFlag(G4bool val)
void ProcessDescription(std::ostream &outFile) const override
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4double MaxKinEnergy() const
G4double MinKinEnergy() const
void SetStartFromNullFlag(G4bool val)
G4int LambdaBinning() const
void SetMinKinEnergyPrim(G4double e)
size_t CurrentMaterialCutsCoupleIndex() const
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
void SetProcessSubType(G4int)
G4double energy(const ThreeVector &p, const G4double m)