Changeset 1347 for trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4E1Probability.cc
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4E1Probability.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4E1Probability.cc,v 1.9 2010/05/25 10:47:24 vnivanch Exp $ 28 // GEANT4 tag $Name: geant4-09-03-ref-09 $ 26 // $Id: G4E1Probability.cc,v 1.11 2010/11/23 18:05:07 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 28 // 30 29 //--------------------------------------------------------------------- … … 37 36 // 18.05.2010 V.Ivanchenko trying to speedup the most slow method 38 37 // by usage of G4Pow, integer A and introduction of const members 39 // 38 // 17.11.2010 V.Ivanchenko perform general cleanup and simplification 39 // of integration method; low-limit of integration is defined 40 // by gamma energy or is zero (was always zero before) 40 41 // 41 42 42 43 #include "G4E1Probability.hh" 43 //#include "G4ConstantLevelDensityParameter.hh"44 44 #include "Randomize.hh" 45 45 #include "G4Pow.hh" … … 63 63 64 64 G4double G4E1Probability::EmissionProbDensity(const G4Fragment& frag, 65 constG4double gammaE)65 G4double gammaE) 66 66 { 67 67 … … 77 77 G4int Afrag = frag.GetA_asInt(); 78 78 G4double Uexcite = frag.GetExcitationEnergy(); 79 G4double U = std::max(0.0,Uexcite-gammaE); 79 80 80 if( (Uexcite-gammaE) < 0.0 || gammaE <0) { return theProb; }81 if(gammaE < 0.0) { return theProb; } 81 82 82 83 // Need a level density parameter. … … 89 90 // G4double levelDensAft = std::exp(2*std::sqrt(aLevelDensityParam*(Uexcite-gammaE))); 90 91 // VI reduce number of calls to exp 91 G4double levelDens = 1.0; 92 if( aLevelDensityParam > 0.0 ) { 93 levelDens = std::exp(2*(std::sqrt(aLevelDensityParam*(Uexcite-gammaE)) 94 - std::sqrt(aLevelDensityParam*Uexcite))); 95 } 92 G4double levelDens = 93 std::exp(2*(std::sqrt(aLevelDensityParam*U)-std::sqrt(aLevelDensityParam*Uexcite))); 96 94 // Now form the probability density 97 95 … … 140 138 141 139 G4double G4E1Probability::EmissionProbability(const G4Fragment& frag, 142 constG4double gammaE)140 G4double gammaE) 143 141 { 144 145 142 // From nuclear fragment properties and the excitation energy, calculate 146 143 // the probability for photon evaporation down to last ground level. 147 144 // fragment = nuclear fragment BEFORE de-excitation 148 145 149 G4double theProb = 0.0; 146 G4double upperLim = gammaE; 147 G4double lowerLim = 0.0; 150 148 151 G4double Uafter = 0.0; 152 const G4double Uexcite = frag.GetExcitationEnergy(); 153 154 G4double normC = 3.0; 155 156 const G4double upperLim = Uexcite; 157 const G4double lowerLim = Uafter; 158 const G4int numIters = 100; 159 160 // Fall-back is a uniform random number 161 162 //G4double uniformNum = G4UniformRand(); 163 //theProb = uniformNum; 149 //G4cout << "G4E1Probability::EmissionProbability: Emin= " << lowerLim 150 // << " Emax= " << upperLim << G4endl; 151 if( upperLim - lowerLim <= CLHEP::keV ) { return 0.0; } 164 152 165 153 // Need to integrate EmissionProbDensity from lowerLim to upperLim 166 // and multiply by normC154 // and multiply by factor 3 (?!) 167 155 168 G4double integ = normC * 169 EmissionIntegration(frag,gammaE,lowerLim,upperLim,numIters); 170 if(integ > 0.0) theProb = integ/(upperLim-lowerLim); 156 G4double integ = 3.0 * EmissionIntegration(frag,lowerLim,upperLim); 171 157 172 return theProb;158 return integ; 173 159 174 160 } 175 161 176 162 G4double G4E1Probability::EmissionIntegration(const G4Fragment& frag, 177 const G4double , 178 const G4double lowLim, const G4double upLim, 179 const G4int numIters) 163 G4double lowLim, G4double upLim) 180 164 181 165 { 166 // Simple integration 167 // VI replace by direct integration over 100 point 182 168 183 // Simple Gaussian quadrature integration 169 const G4int numIters = 100; 170 G4double Step = (upLim-lowLim)/G4double(numIters); 184 171 185 G4double x;186 G4double root3 = 1.0/std::sqrt(3.0);172 G4double res = 0.0; 173 G4double x = lowLim - 0.5*Step; 187 174 188 G4double Step = (upLim-lowLim)/(2.0*numIters); 189 G4double Delta = Step*root3; 190 191 G4double mean = 0.0; 192 193 G4double theInt = 0.0; 194 195 for(G4int i = 0; i < numIters; i++) { 196 197 x = (2*i + 1)*Step; 198 G4double E1ProbDensityA = EmissionProbDensity(frag,x+Delta); 199 G4double E1ProbDensityB = EmissionProbDensity(frag,x-Delta); 200 201 mean += E1ProbDensityA + E1ProbDensityB; 202 175 for(G4int i = 0; i < numIters; ++i) { 176 x += Step; 177 res += EmissionProbDensity(frag, x); 203 178 } 204 179 205 if(mean*Step > 0.0) theInt = mean*Step; 180 if(res > 0.0) { res /= G4double(numIters); } 181 else { res = 0.0; } 206 182 207 return theInt;183 return res; 208 184 209 185 }
Note: See TracChangeset
for help on using the changeset viewer.