G4PolarizedCompton Class Reference

#include <G4PolarizedCompton.hh>

Inheritance diagram for G4PolarizedCompton:

G4VEmProcess G4VDiscreteProcess G4VProcess

Public Member Functions

 G4PolarizedCompton (const G4String &processName="pol-compt", G4ProcessType type=fElectromagnetic)
virtual ~G4PolarizedCompton ()
G4bool IsApplicable (const G4ParticleDefinition &)
virtual void PrintInfo ()
void SetModel (const G4String &name)

Protected Member Functions

virtual void InitialiseProcess (const G4ParticleDefinition *)
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
void BuildAsymmetryTable (const G4ParticleDefinition &part)
G4double ComputeAsymmetry (G4double energy, const G4MaterialCutsCouple *couple, const G4ParticleDefinition &particle, G4double cut, G4double &tAsymmetry)
virtual G4double GetMeanFreePath (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)

Detailed Description

Definition at line 73 of file G4PolarizedCompton.hh.


Constructor & Destructor Documentation

G4PolarizedCompton::G4PolarizedCompton ( const G4String processName = "pol-compt",
G4ProcessType  type = fElectromagnetic 
)

Definition at line 70 of file G4PolarizedCompton.cc.

References fComptonScattering, G4VEmProcess::SetLambdaBinning(), G4VEmProcess::SetMaxKinEnergy(), G4VEmProcess::SetMinKinEnergy(), and G4VProcess::SetProcessSubType().

00071                      :
00072   G4VEmProcess (processName, type),
00073   buildAsymmetryTable(true),
00074   useAsymmetryTable(true),
00075   isInitialised(false),
00076   selectedModel(0),
00077   mType(10),
00078   theAsymmetryTable(NULL)
00079 {
00080   SetLambdaBinning(90);
00081   SetMinKinEnergy(0.1*keV);
00082   SetMaxKinEnergy(100.0*GeV);
00083   SetProcessSubType(fComptonScattering);
00084   emModel = 0;
00085 }

G4PolarizedCompton::~G4PolarizedCompton (  )  [virtual]

Definition at line 89 of file G4PolarizedCompton.cc.

References G4PhysicsTable::clearAndDestroy().

00090 {
00091   if (theAsymmetryTable) {
00092     theAsymmetryTable->clearAndDestroy();
00093     delete theAsymmetryTable;
00094   }
00095 }


Member Function Documentation

void G4PolarizedCompton::BuildAsymmetryTable ( const G4ParticleDefinition part  )  [protected]

Definition at line 303 of file G4PolarizedCompton.cc.

References ComputeAsymmetry(), G4PhysicsTable::GetFlag(), G4PhysicsVector::GetLowEdgeEnergy(), G4ProductionCutsTable::GetMaterialCutsCouple(), G4ProductionCutsTable::GetProductionCutsTable(), G4ProductionCutsTable::GetTableSize(), G4VEmProcess::LambdaBinning(), G4VEmProcess::LambdaPhysicsVector(), G4PhysicsVector::PutValue(), and G4PhysicsTableHelper::SetPhysicsVector().

Referenced by BuildPhysicsTable().

00304 {
00305   // Access to materials
00306   const G4ProductionCutsTable* theCoupleTable=
00307         G4ProductionCutsTable::GetProductionCutsTable();
00308   size_t numOfCouples = theCoupleTable->GetTableSize();
00309   for(size_t i=0; i<numOfCouples; ++i) {
00310     if (!theAsymmetryTable) break;
00311     if (theAsymmetryTable->GetFlag(i)) {
00312 
00313       // create physics vector and fill it
00314       const G4MaterialCutsCouple* couple = theCoupleTable->GetMaterialCutsCouple(i);
00315       // use same parameters as for lambda
00316       G4PhysicsVector* aVector = LambdaPhysicsVector(couple);
00317       //      modelManager->FillLambdaVector(aVector, couple, startFromNull);
00318 
00319       for (G4int j = 0 ; j < LambdaBinning() ; ++j ) {
00320         G4double lowEdgeEnergy = aVector->GetLowEdgeEnergy(j);
00321         G4double tasm=0.;
00322         G4double asym = ComputeAsymmetry(lowEdgeEnergy, couple, part, 0., tasm);
00323         aVector->PutValue(j,asym);
00324       }
00325 
00326       G4PhysicsTableHelper::SetPhysicsVector(theAsymmetryTable, i, aVector);
00327     }
00328   }
00329 
00330 }

void G4PolarizedCompton::BuildPhysicsTable ( const G4ParticleDefinition  )  [protected, virtual]

Reimplemented from G4VEmProcess.

Definition at line 292 of file G4PolarizedCompton.cc.

References BuildAsymmetryTable(), and G4VEmProcess::BuildPhysicsTable().

00293 {
00294   // *** build (unpolarized) cross section tables (Lambda)
00295   G4VEmProcess::BuildPhysicsTable(part);
00296   if(buildAsymmetryTable)
00297     BuildAsymmetryTable(part);
00298 }

G4double G4PolarizedCompton::ComputeAsymmetry ( G4double  energy,
const G4MaterialCutsCouple couple,
const G4ParticleDefinition particle,
G4double  cut,
G4double tAsymmetry 
) [protected]

Definition at line 335 of file G4PolarizedCompton.cc.

References G4VEmModel::CrossSection(), G4PolarizedComptonModel::SetBeamPolarization(), and G4PolarizedComptonModel::SetTargetPolarization().

Referenced by BuildAsymmetryTable().

00340 {
00341   G4double lAsymmetry = 0.0;
00342   tAsymmetry=0;
00343 
00344   //
00345   // calculate polarized cross section
00346   //
00347   G4ThreeVector thePolarization=G4ThreeVector(0.,0.,1.);
00348   emModel->SetTargetPolarization(thePolarization);
00349   emModel->SetBeamPolarization(thePolarization);
00350   G4double sigma2=emModel->CrossSection(couple,&aParticle,energy,cut,energy);
00351 
00352   //
00353   // calculate unpolarized cross section
00354   //
00355   thePolarization=G4ThreeVector();
00356   emModel->SetTargetPolarization(thePolarization);
00357   emModel->SetBeamPolarization(thePolarization);
00358   G4double sigma0=emModel->CrossSection(couple,&aParticle,energy,cut,energy);
00359 
00360   // determine assymmetries
00361   if (sigma0>0.) {
00362     lAsymmetry=sigma2/sigma0-1.;
00363   }
00364   return lAsymmetry;
00365 }

G4double G4PolarizedCompton::GetMeanFreePath ( const G4Track aTrack,
G4double  previousStepSize,
G4ForceCondition condition 
) [protected, virtual]

Reimplemented from G4VEmProcess.

Definition at line 140 of file G4PolarizedCompton.cc.

References G4VEmProcess::CurrentMaterialCutsCoupleIndex(), DBL_MAX, G4cout, G4endl, G4Track::GetDynamicParticle(), G4PolarizationManager::GetInstance(), G4DynamicParticle::GetKineticEnergy(), G4VPhysicalVolume::GetLogicalVolume(), G4Track::GetMaterial(), G4VEmProcess::GetMeanFreePath(), G4DynamicParticle::GetMomentumDirection(), G4LogicalVolume::GetName(), G4VPhysicalVolume::GetName(), G4Track::GetPolarization(), G4PhysicsVector::GetValue(), G4Track::GetVolume(), G4PolarizationManager::GetVolumePolarization(), G4PolarizationManager::IsPolarized(), G4StokesVector::p3(), and G4VProcess::verboseLevel.

00144 {
00145   // *** get unploarised mean free path from lambda table ***
00146   G4double mfp = G4VEmProcess::GetMeanFreePath(aTrack, previousStepSize, condition);
00147 
00148 
00149    if (theAsymmetryTable && useAsymmetryTable) {
00150      // *** get asymmetry, if target is polarized ***
00151      const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle();
00152      const G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
00153      const G4StokesVector GammaPolarization = aTrack.GetPolarization();
00154      const G4ParticleMomentum GammaDirection0 = aDynamicGamma->GetMomentumDirection();
00155 
00156      G4Material*         aMaterial = aTrack.GetMaterial();
00157      G4VPhysicalVolume*  aPVolume  = aTrack.GetVolume();
00158      G4LogicalVolume*    aLVolume  = aPVolume->GetLogicalVolume();
00159 
00160      //   G4Material* bMaterial = aLVolume->GetMaterial();
00161      G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance();
00162 
00163      const G4bool VolumeIsPolarized = polarizationManger->IsPolarized(aLVolume);
00164      G4StokesVector ElectronPolarization = polarizationManger->GetVolumePolarization(aLVolume);
00165 
00166      if (!VolumeIsPolarized || mfp == DBL_MAX) return mfp;
00167      
00168      if (verboseLevel>=2) {
00169 
00170        G4cout << " Mom " << GammaDirection0  << G4endl;
00171        G4cout << " Polarization " << GammaPolarization  << G4endl;
00172        G4cout << " MaterialPol. " << ElectronPolarization  << G4endl;
00173        G4cout << " Phys. Volume " << aPVolume->GetName() << G4endl;
00174        G4cout << " Log. Volume  " << aLVolume->GetName() << G4endl;
00175        G4cout << " Material     " << aMaterial          << G4endl;
00176      }
00177 
00178      G4int midx= CurrentMaterialCutsCoupleIndex();
00179      G4PhysicsVector * aVector=(*theAsymmetryTable)(midx);
00180      
00181      G4double asymmetry=0;
00182      if (aVector) {
00183        G4bool isOutRange;
00184        asymmetry = aVector->GetValue(GammaEnergy, isOutRange);
00185      } else {
00186        G4cout << " MaterialIndex     " << midx << " is out of range \n";
00187        asymmetry=0;
00188      }
00189 
00190      //  we have to determine angle between particle motion 
00191      //  and target polarisation here  
00192      //      circ pol * Vec(ElectronPol)*Vec(PhotonMomentum)
00193      //  both vectors in global reference frame
00194      
00195      G4double pol=ElectronPolarization*GammaDirection0;
00196      
00197      G4double polProduct = GammaPolarization.p3() * pol;
00198      mfp *= 1. / ( 1. + polProduct * asymmetry );
00199 
00200      if (verboseLevel>=2) {
00201        G4cout << " MeanFreePath:  " << mfp / mm << " mm " << G4endl;
00202        G4cout << " Asymmetry:     " << asymmetry          << G4endl;
00203        G4cout << " PolProduct:    " << polProduct         << G4endl;
00204      }
00205    }
00206 
00207    return mfp;
00208 }

void G4PolarizedCompton::InitialiseProcess ( const G4ParticleDefinition  )  [protected, virtual]

Implements G4VEmProcess.

Definition at line 99 of file G4PolarizedCompton.cc.

References G4VEmProcess::AddEmModel(), G4Electron::Electron(), G4VEmProcess::MaxKinEnergy(), G4VEmProcess::MinKinEnergy(), G4VEmProcess::SetBuildTableFlag(), G4VEmModel::SetHighEnergyLimit(), G4VEmModel::SetLowEnergyLimit(), and G4VEmProcess::SetSecondaryParticle().

00100 {
00101   if(!isInitialised) {
00102     isInitialised = true;
00103     SetBuildTableFlag(true);
00104     SetSecondaryParticle(G4Electron::Electron());
00105     G4double emin = MinKinEnergy();
00106     G4double emax = MaxKinEnergy();
00107     emModel = new G4PolarizedComptonModel();
00108     if(0 == mType) selectedModel = new G4KleinNishinaCompton();
00109     else if(10 == mType) selectedModel = emModel;
00110     selectedModel->SetLowEnergyLimit(emin);
00111     selectedModel->SetHighEnergyLimit(emax);
00112     AddEmModel(1, selectedModel);
00113   } 
00114 }

G4bool G4PolarizedCompton::IsApplicable ( const G4ParticleDefinition  )  [inline, virtual]

Implements G4VEmProcess.

Definition at line 138 of file G4PolarizedCompton.hh.

References G4Gamma::Gamma().

00139 {
00140   return (&p == G4Gamma::Gamma());
00141 }

G4double G4PolarizedCompton::PostStepGetPhysicalInteractionLength ( const G4Track track,
G4double  previousStepSize,
G4ForceCondition condition 
) [protected, virtual]

Reimplemented from G4VEmProcess.

Definition at line 210 of file G4PolarizedCompton.cc.

References G4VEmProcess::CurrentMaterialCutsCoupleIndex(), DBL_MAX, G4cout, G4endl, G4Track::GetDynamicParticle(), G4PolarizationManager::GetInstance(), G4DynamicParticle::GetKineticEnergy(), G4VPhysicalVolume::GetLogicalVolume(), G4Track::GetMaterial(), G4DynamicParticle::GetMomentumDirection(), G4LogicalVolume::GetName(), G4VPhysicalVolume::GetName(), G4Track::GetPolarization(), G4PhysicsVector::GetValue(), G4Track::GetVolume(), G4PolarizationManager::GetVolumePolarization(), G4PolarizationManager::IsPolarized(), G4StokesVector::p3(), G4VEmProcess::PostStepGetPhysicalInteractionLength(), and G4VProcess::verboseLevel.

00214 {
00215   // *** get unploarised mean free path from lambda table ***
00216   G4double mfp = G4VEmProcess::PostStepGetPhysicalInteractionLength(aTrack, previousStepSize, condition);
00217 
00218 
00219    if (theAsymmetryTable && useAsymmetryTable) {
00220      // *** get asymmetry, if target is polarized ***
00221      const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle();
00222      const G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
00223      const G4StokesVector GammaPolarization = aTrack.GetPolarization();
00224      const G4ParticleMomentum GammaDirection0 = aDynamicGamma->GetMomentumDirection();
00225 
00226      G4Material*         aMaterial = aTrack.GetMaterial();
00227      G4VPhysicalVolume*  aPVolume  = aTrack.GetVolume();
00228      G4LogicalVolume*    aLVolume  = aPVolume->GetLogicalVolume();
00229 
00230      //   G4Material* bMaterial = aLVolume->GetMaterial();
00231      G4PolarizationManager * polarizationManger = G4PolarizationManager::GetInstance();
00232 
00233      const G4bool VolumeIsPolarized = polarizationManger->IsPolarized(aLVolume);
00234      G4StokesVector ElectronPolarization = polarizationManger->GetVolumePolarization(aLVolume);
00235 
00236      if (!VolumeIsPolarized || mfp == DBL_MAX) return mfp;
00237      
00238      if (verboseLevel>=2) {
00239 
00240        G4cout << " Mom " << GammaDirection0  << G4endl;
00241        G4cout << " Polarization " << GammaPolarization  << G4endl;
00242        G4cout << " MaterialPol. " << ElectronPolarization  << G4endl;
00243        G4cout << " Phys. Volume " << aPVolume->GetName() << G4endl;
00244        G4cout << " Log. Volume  " << aLVolume->GetName() << G4endl;
00245        G4cout << " Material     " << aMaterial          << G4endl;
00246      }
00247 
00248      G4int midx= CurrentMaterialCutsCoupleIndex();
00249      G4PhysicsVector * aVector=(*theAsymmetryTable)(midx);
00250      
00251      G4double asymmetry=0;
00252      if (aVector) {
00253        G4bool isOutRange;
00254        asymmetry = aVector->GetValue(GammaEnergy, isOutRange);
00255      } else {
00256        G4cout << " MaterialIndex     " << midx << " is out of range \n";
00257        asymmetry=0;
00258      }
00259 
00260      //  we have to determine angle between particle motion 
00261      //  and target polarisation here  
00262      //      circ pol * Vec(ElectronPol)*Vec(PhotonMomentum)
00263      //  both vectors in global reference frame
00264      
00265      G4double pol=ElectronPolarization*GammaDirection0;
00266      
00267      G4double polProduct = GammaPolarization.p3() * pol;
00268      mfp *= 1. / ( 1. + polProduct * asymmetry );
00269 
00270      if (verboseLevel>=2) {
00271        G4cout << " MeanFreePath:  " << mfp / mm << " mm " << G4endl;
00272        G4cout << " Asymmetry:     " << asymmetry          << G4endl;
00273        G4cout << " PolProduct:    " << polProduct         << G4endl;
00274      }
00275    }
00276 
00277    return mfp;
00278 }

void G4PolarizedCompton::PreparePhysicsTable ( const G4ParticleDefinition  )  [protected, virtual]

Reimplemented from G4VEmProcess.

Definition at line 282 of file G4PolarizedCompton.cc.

References G4PhysicsTableHelper::PreparePhysicsTable(), and G4VEmProcess::PreparePhysicsTable().

00283 {
00284   G4VEmProcess::PreparePhysicsTable(part);
00285   if(buildAsymmetryTable)
00286     theAsymmetryTable = G4PhysicsTableHelper::PreparePhysicsTable(theAsymmetryTable);
00287 }

void G4PolarizedCompton::PrintInfo (  )  [virtual]

Implements G4VEmProcess.

Definition at line 118 of file G4PolarizedCompton.cc.

References G4cout, G4endl, and G4VEmModel::GetName().

00119 {
00120   G4cout << " Total cross sections has a good parametrisation"
00121          << " from 10 KeV to (100/Z) GeV" 
00122          << "\n      Sampling according " << selectedModel->GetName() << " model" 
00123          << G4endl;
00124 }         

void G4PolarizedCompton::SetModel ( const G4String name  ) 

Definition at line 128 of file G4PolarizedCompton.cc.

00129 {
00130   if(ss == "Klein-Nishina") mType = 0;
00131   if(ss == "Polarized-Compton") mType = 10;
00132 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:56 2013 for Geant4 by  doxygen 1.4.7