Changeset 1340 for trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundFragment.cc
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/pre_equilibrium/exciton_model/src/G4PreCompoundFragment.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4PreCompoundFragment.cc,v 1. 8 2009/02/10 16:01:37vnivanch Exp $27 // GEANT4 tag $Name: geant4-09-0 4-beta-01$26 // $Id: G4PreCompoundFragment.cc,v 1.9 2010/08/28 15:16:55 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-03-ref-09 $ 28 28 // 29 29 // J. M. Quesada (August 2008). 30 30 // Based on previous work by V. Lara 31 // JMQ (06 September 2008) Also external choice has been added for:32 // - superimposed Coulomb barrier (if useSICB=true)33 31 // 32 // Modified: 33 // 06.09.2008 JMQ Also external choice has been added for: 34 // - superimposed Coulomb barrier (if useSICB=true) 35 // 20.08.2010 V.Ivanchenko cleanup 36 // 37 34 38 #include "G4PreCompoundFragment.hh" 35 39 36 40 G4PreCompoundFragment:: 37 G4PreCompoundFragment(const G4PreCompoundFragment &right) : 38 G4VPreCompoundFragment(right) 41 G4PreCompoundFragment(const G4ParticleDefinition* part, 42 G4VCoulombBarrier* aCoulombBarrier) 43 : G4VPreCompoundFragment(part,aCoulombBarrier) 39 44 {} 40 45 41 42 G4PreCompoundFragment::43 G4PreCompoundFragment(const G4double anA,44 const G4double aZ,45 G4VCoulombBarrier* aCoulombBarrier,46 const G4String & aName):47 G4VPreCompoundFragment(anA,aZ,aCoulombBarrier,aName)48 {49 }50 51 52 53 46 G4PreCompoundFragment::~G4PreCompoundFragment() 54 { 55 } 56 57 58 const G4PreCompoundFragment & G4PreCompoundFragment:: 59 operator= (const G4PreCompoundFragment & right) 60 { 61 if (&right != this) this->G4VPreCompoundFragment::operator=(right); 62 return *this; 63 } 64 65 G4int G4PreCompoundFragment::operator==(const G4PreCompoundFragment & right) const 66 { 67 return G4VPreCompoundFragment::operator==(right); 68 } 69 70 G4int G4PreCompoundFragment::operator!=(const G4PreCompoundFragment & right) const 71 { 72 return G4VPreCompoundFragment::operator!=(right); 73 } 74 47 {} 75 48 76 49 G4double G4PreCompoundFragment:: 77 50 CalcEmissionProbability(const G4Fragment & aFragment) 78 51 { 79 // If theCoulombBarrier effect is included in the emission probabilities 80 //if (GetMaximalKineticEnergy() <= 0.0) 81 G4double limit;82 if(OPTxs==0 || useSICB) limit= theCoulombBarrier;83 else limit=0.;52 //G4cout << theCoulombBarrier << " " << GetMaximalKineticEnergy() << G4endl; 53 // If theCoulombBarrier effect is included in the emission probabilities 54 //if (GetMaximalKineticEnergy() <= 0.0) 55 G4double limit = 0.0; 56 if(OPTxs==0 || useSICB) { limit = theCoulombBarrier; } 84 57 if (GetMaximalKineticEnergy() <= limit) 85 58 { 86 59 theEmissionProbability = 0.0; 87 60 return 0.0; 88 }89 // If theCoulombBarrier effect is included in the emission probabilities90 // G4double LowerLimit = 0.;91 // Coulomb barrier is the lower limit92 // of integration over kinetic energy61 } 62 // If theCoulombBarrier effect is included in the emission probabilities 63 // G4double LowerLimit = 0.; 64 // Coulomb barrier is the lower limit 65 // of integration over kinetic energy 93 66 G4double LowerLimit = limit; 94 67 95 // Excitation energy of nucleus after fragment emission is the upper limit of integration over kinetic energy 68 // Excitation energy of nucleus after fragment emission is the upper 69 //limit of integration over kinetic energy 96 70 G4double UpperLimit = GetMaximalKineticEnergy(); 97 71 98 72 theEmissionProbability = 99 73 IntegrateEmissionProbability(LowerLimit,UpperLimit,aFragment); 74 /* 75 G4cout << "## G4PreCompoundFragment::CalcEmisProb " 76 << "Z= " << aFragment.GetZ_asInt() 77 << " A= " << aFragment.GetA_asInt() 78 << " Elow= " << LowerLimit/MeV 79 << " Eup= " << UpperLimit/MeV 80 << " prob= " << theEmissionProbability 81 << G4endl; 82 */ 100 83 return theEmissionProbability; 101 84 } 102 85 103 86 G4double G4PreCompoundFragment:: 104 IntegrateEmissionProbability( const G4double & Low, const G4double &Up,87 IntegrateEmissionProbability(G4double Low, G4double Up, 105 88 const G4Fragment & aFragment) 106 89 { … … 134 117 G4double Total = 0.0; 135 118 136 137 for (G4int i = 0; i < N; i++) 119 for (G4int i = 0; i < N; ++i) 138 120 { 139 G4double KineticE = ((Up-Low)*x[i]+(Up+Low))/2.0;121 G4double KineticE = 0.5*((Up-Low)*x[i]+(Up+Low)); 140 122 Total += w[i]*ProbabilityDistributionFunction(KineticE, aFragment); 141 123 } 142 Total *= (Up-Low)/2.0;124 Total *= 0.5*(Up-Low); 143 125 return Total; 144 126 } 145 146 147 148 127 149 128 G4double G4PreCompoundFragment:: 150 129 GetKineticEnergy(const G4Fragment & aFragment) 151 130 { 131 //let's keep this way for consistency with CalcEmissionProbability method 132 G4double V = 0.0; 133 if(OPTxs==0 || useSICB) { V = theCoulombBarrier; } 152 134 153 // G4double V = this->GetCoulombBarrier();// alternative way for accessing the Coulomb barrier 154 // //should be equivalent (in fact it is) 155 G4double V; 156 if(OPTxs==0 || useSICB) V= theCoulombBarrier;//let's keep this way for consistency with CalcEmissionProbability method 157 else V=0.; 158 159 G4double Tmax = GetMaximalKineticEnergy() ; 135 G4double Tmax = GetMaximalKineticEnergy(); 136 if(Tmax < V) { return 0.0; } 160 137 G4double T(0.0); 161 G4double NormalizedProbability(1.0); 138 G4double Probability(1.0); 139 G4double maxProbability = GetEmissionProbability(); 162 140 do 163 141 { 164 T = V+ G4UniformRand()*(Tmax-V);165 NormalizedProbability = ProbabilityDistributionFunction(T,aFragment)/GetEmissionProbability();166 } while ( G4UniformRand() > NormalizedProbability);142 T = V + G4UniformRand()*(Tmax-V); 143 Probability = ProbabilityDistributionFunction(T,aFragment); 144 } while (maxProbability*G4UniformRand() > Probability); 167 145 return T; 168 146 }
Note: See TracChangeset
for help on using the changeset viewer.