Import Geant4 9.0.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizationHelper.cc,v 1.3 2006/11/17 14:14:19 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizationManager.cc,v 1.1 2006/09/21 21:35:11 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizationMessenger.cc,v 1.1 2006/09/21 21:35:11 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
// GEANT4 Class file
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// $Id: G4PolarizedAnnihilationCrossSection.cc,v 1.5 2006/11/20 12:21:25 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedAnnihilationModel.cc,v 1.4 2006/11/17 14:14:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4PolarizedAnnihilationModel.cc,v 1.5 2007/05/23 08:52:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "G4StokesVector.hh"
|
||||
#include "G4PolarizedAnnihilationCrossSection.hh"
|
||||
#include "G4ParticleChangeForGamma.hh"
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4Gamma.hh"
|
||||
|
||||
G4PolarizedAnnihilationModel::G4PolarizedAnnihilationModel(const G4ParticleDefinition* p,
|
||||
@@ -128,20 +129,21 @@ void G4PolarizedAnnihilationModel::ComputeAsymmetriesPerElectron(G4double ene,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4PolarizedAnnihilationModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple* /*couple*/,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double /*tmin*/,
|
||||
G4double /*maxEnergy*/)
|
||||
void G4PolarizedAnnihilationModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
const G4MaterialCutsCouple* /*couple*/,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double /*tmin*/,
|
||||
G4double /*maxEnergy*/)
|
||||
{
|
||||
G4ParticleChangeForGamma* fParticleChange
|
||||
= dynamic_cast<G4ParticleChangeForGamma*>(pParticleChange);
|
||||
const G4Track * aTrack = fParticleChange->GetCurrentTrack();
|
||||
|
||||
// kill primary
|
||||
fParticleChange->SetProposedKineticEnergy(0.);
|
||||
fParticleChange->ProposeTrackStatus(fStopAndKill);
|
||||
|
||||
// V.Ivanchenko add protection against zero kin energy
|
||||
std::vector<G4DynamicParticle*>* fvect = new std::vector<G4DynamicParticle*>;
|
||||
G4double PositKinEnergy = dp->GetKineticEnergy();
|
||||
|
||||
if(PositKinEnergy < DBL_MIN) {
|
||||
@@ -152,7 +154,7 @@ std::vector<G4DynamicParticle*>* G4PolarizedAnnihilationModel::SampleSecondaries
|
||||
G4ThreeVector dir(sinTeta*std::cos(phi), sinTeta*std::sin(phi), cosTeta);
|
||||
fvect->push_back( new G4DynamicParticle(G4Gamma::Gamma(), dir, electron_mass_c2));
|
||||
fvect->push_back( new G4DynamicParticle(G4Gamma::Gamma(),-dir, electron_mass_c2));
|
||||
return fvect;
|
||||
return;
|
||||
}
|
||||
|
||||
// *** obtain and save target and beam polarization ***
|
||||
@@ -370,6 +372,4 @@ std::vector<G4DynamicParticle*>* G4PolarizedAnnihilationModel::SampleSecondaries
|
||||
finalGamma2Polarization.p3());
|
||||
|
||||
fvect->push_back(aParticle2);
|
||||
|
||||
return fvect;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedBhabhaCrossSection.cc,v 1.4 2006/11/17 14:14:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedBremsstrahlungCrossSection.cc,v 1.3 2006/11/17 12:12:02 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PolarizedCompton.cc,v 1.3 2006/11/17 14:14:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4PolarizedCompton.cc,v 1.6 2007/06/11 13:37:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
//
|
||||
// File name: G4PolarizedCompton
|
||||
@@ -50,6 +50,7 @@
|
||||
// 17-10-05, correct reference frame dependence in GetMeanFreePath (A.Schalicke)
|
||||
// 26-07-06, cross section recalculated (P.Starovoitov)
|
||||
// 09-08-06, make it work under current geant4 release (A.Schalicke)
|
||||
// 11-06-07, add PostStepGetPhysicalInteractionLength (A.Schalicke)
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -172,21 +173,85 @@ G4double G4PolarizedCompton::GetMeanFreePath(
|
||||
G4cout << " Material " << aMaterial << G4endl;
|
||||
}
|
||||
|
||||
G4bool isOutRange;
|
||||
G4int midx= CurrentMaterialCutsCoupleIndex();
|
||||
G4PhysicsVector * aVector=(*theAsymmetryTable)(midx);
|
||||
|
||||
G4double asymmetry=0;
|
||||
if (aVector) {
|
||||
G4bool isOutRange;
|
||||
asymmetry = aVector->GetValue(GammaEnergy, isOutRange);
|
||||
} else {
|
||||
G4cout << " MaterialIndex " << midx << " is out of range \n";
|
||||
asymmetry=0;
|
||||
}
|
||||
|
||||
// we have to determine angle between particle motion
|
||||
// and target polarisation here
|
||||
// circ pol * Vec(ElectronPol)*Vec(PhotonMomentum)
|
||||
// both vectors in global reference frame
|
||||
|
||||
G4double pol=ElectronPolarization*GammaDirection0;
|
||||
|
||||
G4double polProduct = GammaPolarization.p3() * pol;
|
||||
mfp *= 1. / ( 1. + polProduct * asymmetry );
|
||||
|
||||
if (verboseLevel>=2) {
|
||||
G4cout << " MeanFreePath: " << mfp / mm << " mm " << G4endl;
|
||||
G4cout << " Asymmetry: " << asymmetry << G4endl;
|
||||
G4cout << " PolProduct: " << polProduct << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
return mfp;
|
||||
}
|
||||
|
||||
G4double G4PolarizedCompton::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
// *** get unploarised mean free path from lambda table ***
|
||||
G4double mfp = G4VEmProcess::PostStepGetPhysicalInteractionLength(aTrack, previousStepSize, condition);
|
||||
|
||||
|
||||
if (theAsymmetryTable && useAsymmetryTable) {
|
||||
// *** get asymmetry, if target is polarized ***
|
||||
const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle();
|
||||
const G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
|
||||
const G4StokesVector GammaPolarization = aTrack.GetPolarization();
|
||||
const G4ParticleMomentum GammaDirection0 = aDynamicGamma->GetMomentumDirection();
|
||||
|
||||
G4Material* aMaterial = aTrack.GetMaterial();
|
||||
G4VPhysicalVolume* aPVolume = aTrack.GetVolume();
|
||||
G4LogicalVolume* aLVolume = aPVolume->GetLogicalVolume();
|
||||
|
||||
// G4Material* bMaterial = aLVolume->GetMaterial();
|
||||
G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance();
|
||||
|
||||
const G4bool VolumeIsPolarized = polarizationManger->IsPolarized(aLVolume);
|
||||
G4StokesVector ElectronPolarization = polarizationManger->GetVolumePolarization(aLVolume);
|
||||
|
||||
if (!VolumeIsPolarized || mfp == DBL_MAX) return mfp;
|
||||
|
||||
if (verboseLevel>=2) {
|
||||
|
||||
G4cout << " Mom " << GammaDirection0 << G4endl;
|
||||
G4cout << " Polarization " << GammaPolarization << G4endl;
|
||||
G4cout << " MaterialPol. " << ElectronPolarization << G4endl;
|
||||
G4cout << " Phys. Volume " << aPVolume->GetName() << G4endl;
|
||||
G4cout << " Log. Volume " << aLVolume->GetName() << G4endl;
|
||||
G4cout << " Material " << aMaterial << G4endl;
|
||||
}
|
||||
|
||||
G4int midx= CurrentMaterialCutsCoupleIndex();
|
||||
G4PhysicsVector * aVector=(*theAsymmetryTable)(midx);
|
||||
|
||||
G4double asymmetry=0;
|
||||
if (aVector)
|
||||
if (aVector) {
|
||||
G4bool isOutRange;
|
||||
asymmetry = aVector->GetValue(GammaEnergy, isOutRange);
|
||||
else {
|
||||
} else {
|
||||
G4cout << " MaterialIndex " << midx << " is out of range \n";
|
||||
}
|
||||
if (isOutRange) {
|
||||
G4cout << " MaterialIndex " << midx
|
||||
<< " GammaEnergy=" << GammaEnergy << " is out of range \n";
|
||||
asymmetry=0;
|
||||
}
|
||||
|
||||
@@ -297,15 +362,4 @@ G4double G4PolarizedCompton::ComputeAsymmetry(G4double energy,
|
||||
return lAsymmetry;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4PolarizedCompton::SecondariesPostStep(
|
||||
G4VEmModel* model,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp)
|
||||
{
|
||||
std::vector<G4DynamicParticle*>* secondaries = model->SampleSecondaries(couple, dp);
|
||||
return secondaries;
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedComptonCrossSection.cc,v 1.3 2006/11/09 18:00:49 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4PolarizedComptonModel.cc,v 1.3 2006/11/09 18:00:49 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4PolarizedComptonModel.cc,v 1.4 2007/05/23 08:52:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -123,11 +123,11 @@ G4double G4PolarizedComptonModel::ComputeCrossSectionPerAtom(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4PolarizedComptonModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle* aDynamicGamma,
|
||||
G4double,
|
||||
G4double)
|
||||
void G4PolarizedComptonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle* aDynamicGamma,
|
||||
G4double,
|
||||
G4double)
|
||||
{
|
||||
const G4Track * aTrack = fParticleChange->GetCurrentTrack();
|
||||
G4VPhysicalVolume* aPVolume = aTrack->GetVolume();
|
||||
@@ -260,9 +260,6 @@ std::vector<G4DynamicParticle*>* G4PolarizedComptonModel::SampleSecondaries(
|
||||
gamEnergy1 += fParticleChange->GetLocalEnergyDeposit();
|
||||
fParticleChange->ProposeLocalEnergyDeposit(gamEnergy1);
|
||||
}
|
||||
|
||||
|
||||
std::vector<G4DynamicParticle*>* fvect = new std::vector<G4DynamicParticle*>;
|
||||
|
||||
//
|
||||
// kinematic of the scattered electron
|
||||
@@ -368,8 +365,6 @@ std::vector<G4DynamicParticle*>* G4PolarizedComptonModel::SampleSecondaries(
|
||||
finalElectronPolarization.p3());
|
||||
fvect->push_back(aElectron);
|
||||
}
|
||||
|
||||
return fvect;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedGammaConversion.cc,v 1.2 2006/09/26 09:08:47 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4PolarizedGammaConversion.cc,v 1.3 2007/05/23 08:52:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -91,14 +91,4 @@ void G4PolarizedGammaConversion::PrintInfo()
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4PolarizedGammaConversion::SecondariesPostStep(
|
||||
G4VEmModel* model,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp)
|
||||
{
|
||||
return model->SampleSecondaries(couple, dp);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
+8
-10
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedGammaConversionModel.cc,v 1.4 2007/03/19 12:38:15 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
// $Id: G4PolarizedGammaConversionModel.cc,v 1.5 2007/05/23 08:52:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -91,14 +91,13 @@ void G4PolarizedGammaConversionModel::Initialise(const G4ParticleDefinition* pd,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4PolarizedGammaConversionModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
void G4PolarizedGammaConversionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
std::vector<G4DynamicParticle*>* vdp =
|
||||
G4BetheHeitlerModel::SampleSecondaries(couple, dp, tmin, maxEnergy);
|
||||
G4BetheHeitlerModel::SampleSecondaries(vdp, couple, dp, tmin, maxEnergy);
|
||||
|
||||
if(vdp && vdp->size()>0) {
|
||||
G4double gamEnergy0 = dp->GetKineticEnergy();
|
||||
@@ -139,7 +138,6 @@ std::vector<G4DynamicParticle*>* G4PolarizedGammaConversionModel::SampleSecondar
|
||||
|
||||
}
|
||||
}
|
||||
return vdp;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedMollerBhabhaModel.cc,v 1.3 2006/11/09 18:00:49 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4PolarizedMollerBhabhaModel.cc,v 1.4 2007/05/23 08:52:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
@@ -137,11 +137,11 @@ G4double G4PolarizedMollerBhabhaModel::ComputeCrossSectionPerElectron(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4PolarizedMollerBhabhaModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple* ,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
void G4PolarizedMollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
const G4MaterialCutsCouple* ,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
// *** obtain and save target and beam polarization ***
|
||||
G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance();
|
||||
@@ -165,7 +165,7 @@ std::vector<G4DynamicParticle*>* G4PolarizedMollerBhabhaModel::SampleSecondarie
|
||||
|
||||
|
||||
G4double tmax = std::min(maxEnergy, MaxSecondaryKinEnergy(dp));
|
||||
if(tmin >= tmax) return 0;
|
||||
if(tmin >= tmax) return;
|
||||
// if(tmin > tmax) tmin = tmax;
|
||||
|
||||
G4double polL = theBeamPolarization.z()*theTargetPolarization.z();
|
||||
@@ -314,7 +314,6 @@ std::vector<G4DynamicParticle*>* G4PolarizedMollerBhabhaModel::SampleSecondarie
|
||||
}
|
||||
|
||||
// create G4DynamicParticle object for delta ray
|
||||
std::vector<G4DynamicParticle*>* vdp = new std::vector<G4DynamicParticle*>;
|
||||
G4DynamicParticle* delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
vdp->push_back(delta);
|
||||
|
||||
@@ -347,8 +346,6 @@ std::vector<G4DynamicParticle*>* G4PolarizedMollerBhabhaModel::SampleSecondarie
|
||||
fPositronPolarization=G4ThreeVector();
|
||||
fElectronPolarization=G4ThreeVector();
|
||||
}
|
||||
|
||||
return vdp;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedMollerCrossSection.cc,v 1.4 2006/11/17 14:14:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedPairProductionCrossSection.cc,v 1.4 2006/11/17 14:14:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4StokesVector.cc,v 1.3 2006/11/17 11:59:03 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VPolarizedCrossSection.cc,v 1.2 2006/11/17 14:14:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// File name: G4VPolarizedCrossSection
|
||||
//
|
||||
// Author: Andreas Schaelicke
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ePolarizedBremsstrahlung.cc,v 1.2 2006/09/26 09:08:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4ePolarizedBremsstrahlung.cc,v 1.3 2007/05/23 08:52:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -57,16 +57,14 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4ePolarizedBremsstrahlung::G4ePolarizedBremsstrahlung(const G4String& name, G4double thresh):
|
||||
G4eBremsstrahlung(name,thresh)
|
||||
{
|
||||
}
|
||||
G4ePolarizedBremsstrahlung::G4ePolarizedBremsstrahlung(const G4String& name):
|
||||
G4eBremsstrahlung(name)
|
||||
{}
|
||||
|
||||
|
||||
void G4ePolarizedBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDefinition* p,
|
||||
const G4ParticleDefinition*)
|
||||
{
|
||||
gammaThreshold = G4LossTableManager::Instance()->BremsstrahlungTh();
|
||||
if(!isInitialised) {
|
||||
isInitialised = true;
|
||||
particle = p;
|
||||
@@ -82,14 +80,3 @@ void G4ePolarizedBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDef
|
||||
AddEmModel(1, em, fm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4ePolarizedBremsstrahlung::SecondariesPostStep(
|
||||
G4VEmModel* model,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double& tcut)
|
||||
{
|
||||
std::vector<G4DynamicParticle*>* newp = model->SampleSecondaries(couple, dp, tcut);
|
||||
return newp;
|
||||
}
|
||||
|
||||
+11
-13
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ePolarizedBremsstrahlungModel.cc,v 1.2 2006/09/26 09:08:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4ePolarizedBremsstrahlungModel.cc,v 1.3 2007/05/23 08:52:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -82,17 +82,16 @@ void G4ePolarizedBremsstrahlungModel::Initialise(const G4ParticleDefinition* p,
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4ePolarizedBremsstrahlungModel::SampleSecondaries(
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
void G4ePolarizedBremsstrahlungModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double tmin,
|
||||
G4double maxEnergy)
|
||||
{
|
||||
std::vector<G4DynamicParticle*>* vdp =
|
||||
G4eBremsstrahlungModel::SampleSecondaries(couple,dp,tmin,maxEnergy);
|
||||
G4eBremsstrahlungModel::SampleSecondaries(vdp,couple,dp,tmin,maxEnergy);
|
||||
G4int num = vdp->size();
|
||||
|
||||
|
||||
if(vdp) {
|
||||
if(num > 0) {
|
||||
G4double lepEnergy0 = dp->GetKineticEnergy();
|
||||
G4double gamEnergy1 = (*vdp)[0]->GetKineticEnergy();
|
||||
G4double sintheta = dp->GetMomentumDirection().cross((*vdp)[0]->GetMomentumDirection()).mag();
|
||||
@@ -119,7 +118,6 @@ std::vector<G4DynamicParticle*>* G4ePolarizedBremsstrahlungModel::SampleSecondar
|
||||
fParticleChange->GetProposedMomentumDirection());
|
||||
fParticleChange->ProposePolarization(newBeamPol);
|
||||
|
||||
G4int num = vdp->size();
|
||||
if (num!=1) G4cout<<" WARNING "<<num<<" secondaries in polarized bremsstrahlung not supported!\n";
|
||||
for (G4int i=0; i<num; i++) {
|
||||
G4StokesVector photonPol = crossSectionCalculator->GetPol3();
|
||||
@@ -130,6 +128,6 @@ std::vector<G4DynamicParticle*>* G4ePolarizedBremsstrahlungModel::SampleSecondar
|
||||
photonPol.p3());
|
||||
}
|
||||
}
|
||||
return vdp;
|
||||
return;
|
||||
}
|
||||
// The emitted gamma energy is sampled using a parametrized formula
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ePolarizedIonisation.cc,v 1.2 2006/09/26 09:08:48 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4ePolarizedIonisation.cc,v 1.4 2007/06/11 13:37:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
@@ -43,7 +43,8 @@
|
||||
// , create asymmetry table and determine interactionlength
|
||||
// , update polarized differential cross section
|
||||
//
|
||||
// 20-08-05, modified interface (A.Schaelicke)
|
||||
// 20-08-06, modified interface (A.Schaelicke)
|
||||
// 11-06-07, add PostStepGetPhysicalInteractionLength (A.Schalicke)
|
||||
//
|
||||
// Class Description:
|
||||
//
|
||||
@@ -187,6 +188,60 @@ G4double G4ePolarizedIonisation::GetMeanFreePath(const G4Track& track,
|
||||
return mfp;
|
||||
}
|
||||
|
||||
G4double G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double s,
|
||||
G4ForceCondition* cond)
|
||||
{
|
||||
// *** get unploarised mean free path from lambda table ***
|
||||
G4double mfp = G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength(track, s, cond);
|
||||
|
||||
|
||||
// *** get asymmetry, if target is polarized ***
|
||||
G4VPhysicalVolume* aPVolume = track.GetVolume();
|
||||
G4LogicalVolume* aLVolume = aPVolume->GetLogicalVolume();
|
||||
|
||||
G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance();
|
||||
const G4bool volumeIsPolarized = polarizationManger->IsPolarized(aLVolume);
|
||||
const G4StokesVector ePolarization = track.GetPolarization();
|
||||
|
||||
if (mfp != DBL_MAX && volumeIsPolarized && !ePolarization.IsZero()) {
|
||||
const G4DynamicParticle* aDynamicElectron = track.GetDynamicParticle();
|
||||
const G4double eEnergy = aDynamicElectron->GetKineticEnergy();
|
||||
const G4ParticleMomentum eDirection0 = aDynamicElectron->GetMomentumDirection();
|
||||
|
||||
G4StokesVector volumePolarization = polarizationManger->GetVolumePolarization(aLVolume);
|
||||
|
||||
G4bool isOutRange;
|
||||
size_t idx = CurrentMaterialCutsCoupleIndex();
|
||||
G4double lAsymmetry = (*theAsymmetryTable)(idx)->
|
||||
GetValue(eEnergy, isOutRange);
|
||||
G4double tAsymmetry = (*theTransverseAsymmetryTable)(idx)->
|
||||
GetValue(eEnergy, isOutRange);
|
||||
|
||||
// calculate longitudinal spin component
|
||||
G4double polZZ = ePolarization.z()*
|
||||
volumePolarization*eDirection0;
|
||||
// calculate transvers spin components
|
||||
G4double polXX = ePolarization.x()*
|
||||
volumePolarization*G4PolarizationHelper::GetParticleFrameX(eDirection0);
|
||||
G4double polYY = ePolarization.y()*
|
||||
volumePolarization*G4PolarizationHelper::GetParticleFrameY(eDirection0);
|
||||
|
||||
|
||||
G4double impact = 1. + polZZ*lAsymmetry + (polXX + polYY)*tAsymmetry;
|
||||
// determine polarization dependent mean free path
|
||||
mfp /= impact;
|
||||
if (mfp <=0.) {
|
||||
G4cout <<"PV impact ( "<<polXX<<" , "<<polYY<<" , "<<polZZ<<" )"<<G4endl;
|
||||
G4cout << " impact on MFP is "<< impact <<G4endl;
|
||||
G4cout<<" lAsymmetry= "<<lAsymmetry<<" ("<<std::fabs(lAsymmetry)-1.<<")\n";
|
||||
G4cout<<" tAsymmetry= "<<tAsymmetry<<" ("<<std::fabs(tAsymmetry)-1.<<")\n";
|
||||
}
|
||||
}
|
||||
|
||||
return mfp;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
void G4ePolarizedIonisation::BuildPhysicsTable(const G4ParticleDefinition& part)
|
||||
{
|
||||
@@ -281,18 +336,4 @@ G4double G4ePolarizedIonisation::ComputeAsymmetry(G4double energy,
|
||||
return lAsymmetry;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
std::vector<G4DynamicParticle*>* G4ePolarizedIonisation::SecondariesPostStep(
|
||||
G4VEmModel* model,
|
||||
const G4MaterialCutsCouple* couple,
|
||||
const G4DynamicParticle* dp,
|
||||
G4double& tcut)
|
||||
{
|
||||
// determine the delta electron
|
||||
std::vector<G4DynamicParticle*>* particles = model->SampleSecondaries(couple, dp, tcut);
|
||||
// Note: G4VEnergyLossProcess relies on fParticleChange and not on polParticleChange,
|
||||
// but the former does not allow for polarization!
|
||||
return particles;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4eplusPolarizedAnnihilation.cc,v 1.3 2006/11/17 14:14:22 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4eplusPolarizedAnnihilation.cc,v 1.4 2007/06/11 13:37:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-00 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -40,6 +40,7 @@
|
||||
// Modifications:
|
||||
// 26-07-06 modified cross section (P. Starovoitov)
|
||||
// 21-08-06 interface updated (A. Schaelicke)
|
||||
// 11-06-07, add PostStepGetPhysicalInteractionLength (A.Schalicke)
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
@@ -179,6 +180,73 @@ G4double G4eplusPolarizedAnnihilation::GetMeanFreePath(const G4Track& track,
|
||||
|
||||
return mfp;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4eplusPolarizedAnnihilation::PostStepGetPhysicalInteractionLength(
|
||||
const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
G4double mfp = G4VEmProcess::PostStepGetPhysicalInteractionLength(track, previousStepSize, condition);
|
||||
|
||||
if (theAsymmetryTable) {
|
||||
|
||||
G4Material* aMaterial = track.GetMaterial();
|
||||
G4VPhysicalVolume* aPVolume = track.GetVolume();
|
||||
G4LogicalVolume* aLVolume = aPVolume->GetLogicalVolume();
|
||||
|
||||
// G4Material* bMaterial = aLVolume->GetMaterial();
|
||||
G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance();
|
||||
|
||||
const G4bool volumeIsPolarized = polarizationManger->IsPolarized(aLVolume);
|
||||
G4StokesVector electronPolarization = polarizationManger->GetVolumePolarization(aLVolume);
|
||||
|
||||
if (!volumeIsPolarized || mfp == DBL_MAX) return mfp;
|
||||
|
||||
// *** get asymmetry, if target is polarized ***
|
||||
const G4DynamicParticle* aDynamicPositron = track.GetDynamicParticle();
|
||||
const G4double positronEnergy = aDynamicPositron->GetKineticEnergy();
|
||||
const G4StokesVector positronPolarization = track.GetPolarization();
|
||||
const G4ParticleMomentum positronDirection0 = aDynamicPositron->GetMomentumDirection();
|
||||
|
||||
if (verboseLevel>=2) {
|
||||
|
||||
G4cout << " Mom " << positronDirection0 << G4endl;
|
||||
G4cout << " Polarization " << positronPolarization << G4endl;
|
||||
G4cout << " MaterialPol. " << electronPolarization << G4endl;
|
||||
G4cout << " Phys. Volume " << aPVolume->GetName() << G4endl;
|
||||
G4cout << " Log. Volume " << aLVolume->GetName() << G4endl;
|
||||
G4cout << " Material " << aMaterial << G4endl;
|
||||
}
|
||||
|
||||
G4bool isOutRange;
|
||||
G4int idx= CurrentMaterialCutsCoupleIndex();
|
||||
G4double lAsymmetry = (*theAsymmetryTable)(idx)->
|
||||
GetValue(positronEnergy, isOutRange);
|
||||
G4double tAsymmetry = (*theTransverseAsymmetryTable)(idx)->
|
||||
GetValue(positronEnergy, isOutRange);
|
||||
|
||||
G4double polZZ = positronPolarization.z()*
|
||||
electronPolarization*positronDirection0;
|
||||
G4double polXX = positronPolarization.x()*
|
||||
electronPolarization*G4PolarizationHelper::GetParticleFrameX(positronDirection0);
|
||||
G4double polYY = positronPolarization.y()*
|
||||
electronPolarization*G4PolarizationHelper::GetParticleFrameY(positronDirection0);
|
||||
|
||||
G4double impact = 1. + polZZ*lAsymmetry + (polXX + polYY)*tAsymmetry;
|
||||
|
||||
mfp *= 1. / impact;
|
||||
|
||||
if (verboseLevel>=2) {
|
||||
G4cout << " MeanFreePath: " << mfp / mm << " mm " << G4endl;
|
||||
G4cout << " Asymmetry: " << lAsymmetry << ", " << tAsymmetry << G4endl;
|
||||
G4cout << " PolProduct: " << polXX << ", " << polYY << ", " << polZZ << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
return mfp;
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4eplusPolarizedAnnihilation::BuildPhysicsTable(const G4ParticleDefinition& pd)
|
||||
|
||||
Reference in New Issue
Block a user