- Timestamp:
- Nov 25, 2009, 5:13:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/highenergy/src/G4AnnihiToMuPair.cc
r1007 r1196 25 25 // 26 26 // 27 // $Id: G4AnnihiToMuPair.cc,v 1. 5 2008/10/16 14:29:48vnivanch Exp $28 // GEANT4 tag $Name: geant4-09-0 2$27 // $Id: G4AnnihiToMuPair.cc,v 1.6 2009/11/09 18:24:07 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // ------------ G4AnnihiToMuPair physics process ------ … … 65 65 HighestEnergyLimit = 1000*TeV; 66 66 67 CurrentSigma = 0.0; 67 68 CrossSecFactor = 1.; 68 69 SetProcessSubType(6); … … 88 89 //here no tables, just calling PrintInfoDefinition 89 90 { 90 PrintInfoDefinition(); 91 CurrentSigma = 0.0; 92 PrintInfoDefinition(); 91 93 } 92 94 … … 117 119 G4double SigmaEl = Sig0*xi*(1.+xi/2.)*sqrt(1.-xi); // per electron 118 120 CrossSection = SigmaEl*Z; // number of electrons per atom 119 CrossSection *= CrossSecFactor; //increase the CrossSection by (default 1)120 121 return CrossSection; 121 122 } … … 123 124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 124 125 125 G4double G4AnnihiToMuPair::GetMeanFreePath(const G4Track& aTrack, 126 G4double, G4ForceCondition*) 127 128 // returns the positron mean free path in GEANT4 internal units 129 130 { 131 const G4DynamicParticle* aDynamicPositron = aTrack.GetDynamicParticle(); 132 G4double PositronEnergy = aDynamicPositron->GetKineticEnergy() 133 +electron_mass_c2; 134 G4Material* aMaterial = aTrack.GetMaterial(); 126 G4double G4AnnihiToMuPair::CrossSectionPerVolume(G4double PositronEnergy, 127 const G4Material* aMaterial) 128 { 135 129 const G4ElementVector* theElementVector = aMaterial->GetElementVector(); 136 130 const G4double* NbOfAtomsPerVolume = aMaterial->GetVecNbOfAtomsPerVolume(); 137 131 138 G4double SIGMA = 0 139 140 for ( size_t i=0 ; i < aMaterial->GetNumberOfElements() ; i++)132 G4double SIGMA = 0.0; 133 134 for ( size_t i=0 ; i < aMaterial->GetNumberOfElements() ; ++i ) 141 135 { 142 136 G4double AtomicZ = (*theElementVector)[i]->GetZ(); … … 144 138 ComputeCrossSectionPerAtom(PositronEnergy,AtomicZ); 145 139 } 146 return SIGMA > DBL_MIN ? 1./SIGMA : DBL_MAX; 140 return SIGMA; 141 } 142 143 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 144 145 G4double G4AnnihiToMuPair::GetMeanFreePath(const G4Track& aTrack, 146 G4double, G4ForceCondition*) 147 148 // returns the positron mean free path in GEANT4 internal units 149 150 { 151 const G4DynamicParticle* aDynamicPositron = aTrack.GetDynamicParticle(); 152 G4double PositronEnergy = aDynamicPositron->GetKineticEnergy() 153 +electron_mass_c2; 154 G4Material* aMaterial = aTrack.GetMaterial(); 155 CurrentSigma = CrossSectionPerVolume(PositronEnergy, aMaterial); 156 157 // increase the CrossSection by CrossSecFactor (default 1) 158 G4double mfp = DBL_MAX; 159 if(CurrentSigma > DBL_MIN) mfp = 1.0/(CurrentSigma*CrossSecFactor); 160 161 return mfp; 147 162 } 148 163 … … 162 177 // current Positron energy and direction, return if energy too low 163 178 const G4DynamicParticle *aDynamicPositron = aTrack.GetDynamicParticle(); 164 G4double Epos = aDynamicPositron->GetKineticEnergy()+Mele; 165 166 if (Epos < LowestEnergyLimit) 167 { G4cout 168 << "error in G4AnnihiToMuPair::PostStepDoIt called with energy below" 169 " threshold Epos= " 170 << Epos << G4endl; // shoud never happen 171 G4Exception(10); 179 G4double Epos = aDynamicPositron->GetKineticEnergy() + Mele; 180 181 // test of cross section 182 if(CurrentSigma*G4UniformRand() > 183 CrossSectionPerVolume(Epos, aTrack.GetMaterial())) 184 { 185 return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep); 186 } 187 188 if (Epos < LowestEnergyLimit) { 189 return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep); 172 190 } 173 174 if (Epos < LowestEnergyLimit)175 return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);176 191 177 192 G4ParticleMomentum PositronDirection =
Note: See TracChangeset
for help on using the changeset viewer.