Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/electromagnetic/utils/include/G4ElectronIonPair.hh

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4ElectronIonPair.hh,v 1.2 2008/10/17 14:46:16 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4ElectronIonPair.hh,v 1.5 2010/10/25 17:23:01 vnivanch Exp $
     27// GEANT4 tag $Name: emutils-V09-03-23 $
    2828//
    2929//
     
    6262#include "G4ParticleDefinition.hh"
    6363#include "G4ThreeVector.hh"
    64 #include "G4TrackVector.hh"
    6564#include "G4VProcess.hh"
    6665#include <vector>
     
    8685  inline G4double MeanNumberOfIonsAlongStep(const G4Step*);
    8786
     87  inline G4int SampleNumberOfIonsAlongStep(const G4Step*);
     88
    8889  // returns pointer to the new vector of positions of
    8990  // ionisation points in the World coordinate system
    90   std::vector<G4ThreeVector>*
    91   SampleIonsAlongStep(const G4ThreeVector& prePosition,
    92                       const G4ThreeVector& postPosition,
    93                       G4double numberOfIonisations);
    94 
    9591  std::vector<G4ThreeVector>* SampleIonsAlongStep(const G4Step*);
    9692
     
    115111private:
    116112
     113  void Initialise();
     114
     115  G4double FindMeanEnergyPerIonPair(const G4Material*);
     116
    117117  // hide assignment operator
    118118  G4ElectronIonPair & operator=(const G4ElectronIonPair &right);
    119119  G4ElectronIonPair(const G4ElectronIonPair&);
    120120
    121   G4double FindMeanEnergyPerIonPair(const G4Material*);
     121  // cash
     122  const G4Material*  curMaterial;
     123  G4double           curMeanEnergy;
    122124
    123   void Initialise();
    124 
    125   const G4ParticleDefinition* gamma;
    126 
    127   // cash
    128   const G4Material*           curMaterial;
    129   G4double                    curMeanEnergy;
    130 
     125  G4double FanoFactor;
     126 
    131127  G4int    verbose;             
    132128  G4int    nMaterials;
    133129
    134130  // list of G4 NIST materials with mean energy per ion defined
    135   std::vector<G4double>       g4MatData;
    136   std::vector<G4String>       g4MatNames;
    137 
     131  std::vector<G4double>  g4MatData;
     132  std::vector<G4String>  g4MatNames;
    138133};
    139134
     
    141136G4ElectronIonPair::MeanNumberOfIonsAlongStep(const G4Step* step)
    142137{
    143   return MeanNumberOfIonsAlongStep(step->GetTrack()->GetDefinition(),
     138  return MeanNumberOfIonsAlongStep(step->GetTrack()->GetParticleDefinition(),
    144139                                   step->GetPreStepPoint()->GetMaterial(),
    145140                                   step->GetTotalEnergyDeposit(),
     
    147142}
    148143
    149 inline std::vector<G4ThreeVector>*
    150 G4ElectronIonPair::SampleIonsAlongStep(const G4Step* step)
     144inline
     145G4int G4ElectronIonPair::SampleNumberOfIonsAlongStep(const G4Step* step)
    151146{
    152   return SampleIonsAlongStep(step->GetPreStepPoint()->GetPosition(),
    153                              step->GetPostStepPoint()->GetPosition(),
    154                              MeanNumberOfIonsAlongStep(step));
    155 }
     147  G4double meanion = MeanNumberOfIonsAlongStep(step);
     148  G4double sig = FanoFactor*std::sqrt(meanion);
     149  G4int nion = G4int(G4RandGauss::shoot(meanion,sig) + 0.5);
     150  return nion;
     151}
    156152
    157153inline
     
    160156  G4int subtype = -1;
    161157  const G4VProcess* proc = step->GetPostStepPoint()->GetProcessDefinedStep();
    162   if(proc) subtype = proc->GetProcessSubType();
    163   return ResidualeChargePostStep(step->GetTrack()->GetDefinition(),
     158  if(proc) { subtype = proc->GetProcessSubType(); }
     159  return ResidualeChargePostStep(step->GetTrack()->GetParticleDefinition(),
    164160                                 step->GetSecondary(),
    165161                                 subtype);
Note: See TracChangeset for help on using the changeset viewer.