G4ElectronIonPair.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 //
00029 #ifndef G4ElectronIonPair_h
00030 #define G4ElectronIonPair_h 1
00031 
00032 // -------------------------------------------------------------
00033 //
00034 // GEANT4 Class header file
00035 //
00036 //
00037 // File name:     G4ElectronIonPair
00038 //
00039 // Author:        Vladimir Ivanchenko
00040 //
00041 // Creation date: 08.07.2008
00042 //
00043 // Modifications:
00044 //
00045 //
00046 // Class Description:
00047 //   Compution on number of electon-ion or electorn-hole pairs
00048 //   at the step of a particle and sampling ionisation points 
00049 //   in space
00050 //
00051 // Based on ICRU Report 31, 1979
00052 // "Average Energy Required to Produce an Ion Pair" 
00053 //
00054 // 06.04.2010 V. Grichine, substitute Gauss by Gamma for ionisation 
00055 //                         distribution at fixed energy deposition
00056 // 
00057 // -------------------------------------------------------------
00058 
00059 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00060 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00061 
00062 #include "globals.hh"
00063 #include "G4Step.hh"
00064 #include "G4ParticleDefinition.hh"
00065 #include "G4ThreeVector.hh"
00066 #include "G4VProcess.hh"
00067 #include <vector>
00068 
00069 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
00070 
00071 class G4Material;
00072 
00073 class G4ElectronIonPair
00074 {
00075 public: 
00076 
00077   G4ElectronIonPair();
00078 
00079   virtual ~G4ElectronIonPair();
00080 
00081   // compute mean number of ionisation points at a step
00082   G4double MeanNumberOfIonsAlongStep(const G4ParticleDefinition*, 
00083                                      const G4Material*,
00084                                      G4double edepTotal,
00085                                      G4double edepNIEL = 0.0);
00086 
00087   inline G4double MeanNumberOfIonsAlongStep(const G4Step*); 
00088 
00089   inline G4int SampleNumberOfIonsAlongStep(const G4Step*); 
00090 
00091   // returns pointer to the new vector of positions of
00092   // ionisation points in the World coordinate system 
00093   std::vector<G4ThreeVector>* SampleIonsAlongStep(const G4Step*);
00094 
00095   // compute number of holes in the atom after PostStep interaction
00096   G4int ResidualeChargePostStep(const G4ParticleDefinition*,
00097                                 const G4TrackVector* secondary = 0,
00098                                 G4int processSubType = -1);
00099 
00100   inline G4int ResidualeChargePostStep(const G4Step*);
00101 
00102   // find mean energies per ionisation 
00103   G4double FindG4MeanEnergyPerIonPair(const G4Material*);
00104 
00105   // dump mean energies per ionisation used in run time
00106   void DumpMeanEnergyPerIonPair();
00107 
00108   // dump G4 list
00109   void DumpG4MeanEnergyPerIonPair();
00110 
00111   inline void SetVerbose(G4int);
00112 
00113 private:
00114 
00115   void Initialise();
00116 
00117   G4double FindMeanEnergyPerIonPair(const G4Material*);
00118 
00119   // hide assignment operator
00120   G4ElectronIonPair & operator=(const G4ElectronIonPair &right);
00121   G4ElectronIonPair(const G4ElectronIonPair&);
00122 
00123   // cash
00124   const G4Material*  curMaterial;
00125   G4double           curMeanEnergy;
00126 
00127   G4double invFanoFactor;
00128   
00129   G4int    verbose;             
00130   G4int    nMaterials;
00131 
00132   // list of G4 NIST materials with mean energy per ion defined 
00133   std::vector<G4double>  g4MatData;
00134   std::vector<G4String>  g4MatNames;
00135 };
00136 
00137 inline G4double 
00138 G4ElectronIonPair::MeanNumberOfIonsAlongStep(const G4Step* step)
00139 {
00140   return MeanNumberOfIonsAlongStep(step->GetTrack()->GetParticleDefinition(),
00141                                    step->GetPreStepPoint()->GetMaterial(),
00142                                    step->GetTotalEnergyDeposit(),
00143                                    step->GetNonIonizingEnergyDeposit());
00144 }
00145 
00146 inline 
00147 G4int G4ElectronIonPair::SampleNumberOfIonsAlongStep(const G4Step* step)
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 } 
00154 
00155 inline 
00156 G4int G4ElectronIonPair::ResidualeChargePostStep(const G4Step* step)
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 }
00165 
00166 inline void G4ElectronIonPair::SetVerbose(G4int val)
00167 {
00168   verbose = val;
00169 }
00170 
00171 #endif
00172 

Generated on Mon May 27 17:48:07 2013 for Geant4 by  doxygen 1.4.7