G4ElectronIonPair Class Reference

#include <G4ElectronIonPair.hh>


Public Member Functions

 G4ElectronIonPair ()
virtual ~G4ElectronIonPair ()
G4double MeanNumberOfIonsAlongStep (const G4ParticleDefinition *, const G4Material *, G4double edepTotal, G4double edepNIEL=0.0)
G4double MeanNumberOfIonsAlongStep (const G4Step *)
G4int SampleNumberOfIonsAlongStep (const G4Step *)
std::vector< G4ThreeVector > * SampleIonsAlongStep (const G4Step *)
G4int ResidualeChargePostStep (const G4ParticleDefinition *, const G4TrackVector *secondary=0, G4int processSubType=-1)
G4int ResidualeChargePostStep (const G4Step *)
G4double FindG4MeanEnergyPerIonPair (const G4Material *)
void DumpMeanEnergyPerIonPair ()
void DumpG4MeanEnergyPerIonPair ()
void SetVerbose (G4int)


Detailed Description

Definition at line 73 of file G4ElectronIonPair.hh.


Constructor & Destructor Documentation

G4ElectronIonPair::G4ElectronIonPair (  ) 

Definition at line 58 of file G4ElectronIonPair.cc.

00059 {
00060   verbose = 1;
00061   curMaterial = 0;
00062   curMeanEnergy = 0.0;
00063   nMaterials = 0;
00064   invFanoFactor = 1.0/0.2;
00065   Initialise();
00066 }

G4ElectronIonPair::~G4ElectronIonPair (  )  [virtual]

Definition at line 70 of file G4ElectronIonPair.cc.

00071 {}


Member Function Documentation

void G4ElectronIonPair::DumpG4MeanEnergyPerIonPair (  ) 

Definition at line 187 of file G4ElectronIonPair.cc.

References G4cout, and G4endl.

00188 {
00189   if(nMaterials > 0) {
00190     G4cout << "### G4ElectronIonPair: mean energy per ion pair "
00191            << " for Geant4 materials" << G4endl;
00192     for(G4int i=0; i<nMaterials; ++i) {
00193       G4cout << "   " << g4MatNames[i] << "    Epair= " 
00194              << g4MatData[i]/eV << " eV" << G4endl;
00195     }
00196   }
00197 }

void G4ElectronIonPair::DumpMeanEnergyPerIonPair (  ) 

Definition at line 168 of file G4ElectronIonPair.cc.

References G4cout, G4endl, G4Material::GetMaterialTable(), and G4Material::GetNumberOfMaterials().

00169 {
00170   G4int nmat = G4Material::GetNumberOfMaterials();
00171   const G4MaterialTable* mtable = G4Material::GetMaterialTable();
00172   if(nmat > 0) {
00173     G4cout << "### G4ElectronIonPair: mean energy per ion pair avalable:" << G4endl;
00174     for(G4int i=0; i<nmat; ++i) {
00175       const G4Material* mat = (*mtable)[i];
00176       G4double x = mat->GetIonisation()->GetMeanEnergyPerIonPair();
00177       if(x > 0.0) {
00178         G4cout << "   " << mat->GetName() << "   Epair=  " 
00179                << x/eV << " eV" << G4endl;
00180       }
00181     }
00182   }
00183 }

G4double G4ElectronIonPair::FindG4MeanEnergyPerIonPair ( const G4Material  ) 

Definition at line 145 of file G4ElectronIonPair.cc.

References G4cout, G4endl, G4Material::GetIonisation(), G4Material::GetName(), and G4IonisParamMat::SetMeanEnergyPerIonPair().

Referenced by MeanNumberOfIonsAlongStep().

00146 {
00147   G4String name = mat->GetName();
00148   G4double res  = 0.0;
00149 
00150   // is this material in the vector?  
00151   for(G4int j=0; j<nMaterials; j++) {
00152     if(name == g4MatNames[j]) {
00153       res = g4MatData[j];
00154       mat->GetIonisation()->SetMeanEnergyPerIonPair(res);
00155       if(verbose > 0) {
00156         G4cout << "### G4ElectronIonPair::FindG4MeanEnergyPerIonPair for "
00157                << name << " Epair= " << res/eV << " eV is set"
00158                << G4endl;
00159       }
00160       break;
00161     }
00162   }
00163   return res;
00164 }

G4double G4ElectronIonPair::MeanNumberOfIonsAlongStep ( const G4Step  )  [inline]

Definition at line 138 of file G4ElectronIonPair.hh.

References G4StepPoint::GetMaterial(), G4Step::GetNonIonizingEnergyDeposit(), G4Track::GetParticleDefinition(), G4Step::GetPreStepPoint(), G4Step::GetTotalEnergyDeposit(), G4Step::GetTrack(), and MeanNumberOfIonsAlongStep().

00139 {
00140   return MeanNumberOfIonsAlongStep(step->GetTrack()->GetParticleDefinition(),
00141                                    step->GetPreStepPoint()->GetMaterial(),
00142                                    step->GetTotalEnergyDeposit(),
00143                                    step->GetNonIonizingEnergyDeposit());
00144 }

G4double G4ElectronIonPair::MeanNumberOfIonsAlongStep ( const G4ParticleDefinition ,
const G4Material ,
G4double  edepTotal,
G4double  edepNIEL = 0.0 
)

Definition at line 75 of file G4ElectronIonPair.cc.

References FindG4MeanEnergyPerIonPair(), G4Material::GetIonisation(), G4IonisParamMat::GetMeanEnergyPerIonPair(), and G4ParticleDefinition::GetPDGCharge().

Referenced by MeanNumberOfIonsAlongStep(), and SampleNumberOfIonsAlongStep().

00080 {
00081   G4double nion = 0.0;
00082 
00083   // NIEL does not provide ionisation clusters
00084   if(edep > niel) {
00085 
00086     // neutral particles do not produce ionisation along step
00087     if(part->GetPDGCharge() != 0.0) {
00088 
00089       // select material
00090       if(material != curMaterial) {
00091         curMaterial = material;
00092         curMeanEnergy = material->GetIonisation()->GetMeanEnergyPerIonPair();
00093 
00094         // if mean energy is not defined then look into G4 DB
00095         if(0.0 == curMeanEnergy) {
00096           curMeanEnergy = FindG4MeanEnergyPerIonPair(material);
00097         } 
00098       }
00099       if(curMeanEnergy > 0.0) { nion = (edep - niel)/curMeanEnergy; }
00100     }
00101   }
00102   return nion;
00103 }

G4int G4ElectronIonPair::ResidualeChargePostStep ( const G4Step  )  [inline]

Definition at line 156 of file G4ElectronIonPair.hh.

References G4Track::GetParticleDefinition(), G4Step::GetPostStepPoint(), G4StepPoint::GetProcessDefinedStep(), G4VProcess::GetProcessSubType(), G4Step::GetSecondary(), G4Step::GetTrack(), and ResidualeChargePostStep().

00157 {
00158   G4int subtype = -1;
00159   const G4VProcess* proc = step->GetPostStepPoint()->GetProcessDefinedStep();
00160   if(proc) { subtype = proc->GetProcessSubType(); }
00161   return ResidualeChargePostStep(step->GetTrack()->GetParticleDefinition(),
00162                                  step->GetSecondary(),
00163                                  subtype);
00164 }

G4int G4ElectronIonPair::ResidualeChargePostStep ( const G4ParticleDefinition ,
const G4TrackVector secondary = 0,
G4int  processSubType = -1 
)

Definition at line 133 of file G4ElectronIonPair.cc.

Referenced by ResidualeChargePostStep().

00136 {
00137   G4int nholes = 0;
00138 
00139   if(2 == subType || 12 == subType || 13 == subType) { nholes = 1; }
00140   return nholes;
00141 }

std::vector< G4ThreeVector > * G4ElectronIonPair::SampleIonsAlongStep ( const G4Step  ) 

Definition at line 108 of file G4ElectronIonPair.cc.

References G4cout, G4endl, G4UniformRand, G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), and SampleNumberOfIonsAlongStep().

00109 {
00110   std::vector<G4ThreeVector>* v = 0;
00111 
00112   G4int nion = SampleNumberOfIonsAlongStep(step);
00113 
00114   // sample ionisation along step
00115   if(nion > 0) {
00116 
00117     v = new std::vector<G4ThreeVector>;
00118     G4ThreeVector prePos = step->GetPreStepPoint()->GetPosition();
00119     G4ThreeVector deltaPos = step->GetPostStepPoint()->GetPosition() - prePos;  
00120     for(G4int i=0; i<nion; ++i) {
00121       v->push_back( prePos + deltaPos*G4UniformRand() );
00122     }
00123     if(verbose > 1 ) { 
00124       G4cout << "### G4ElectronIonPair::SampleIonisationPoints: "
00125              << v->size() << "  ion pairs are added" << G4endl;
00126     }
00127   }
00128   return v;
00129 }

G4int G4ElectronIonPair::SampleNumberOfIonsAlongStep ( const G4Step  )  [inline]

Definition at line 147 of file G4ElectronIonPair.hh.

References G4lrint(), and MeanNumberOfIonsAlongStep().

Referenced by SampleIonsAlongStep().

00148 {
00149   // use gamma distribution with mean value n=meanion and 
00150   // dispersion D=meanion/invFanoFactor
00151   G4double meanion = MeanNumberOfIonsAlongStep(step);
00152   return G4lrint(CLHEP::RandGamma::shoot(meanion*invFanoFactor,invFanoFactor));
00153 } 

void G4ElectronIonPair::SetVerbose ( G4int   )  [inline]

Definition at line 166 of file G4ElectronIonPair.hh.

Referenced by G4LossTableManager::SetVerbose().

00167 {
00168   verbose = val;
00169 }


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