Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 081024 G4NucleiPropertiesTable:: to G4Nucle 26 // 081024 G4NucleiPropertiesTable:: to G4NucleiProperties:: 27 // 27 // 28 #include <numeric> 28 #include <numeric> 29 29 30 #include "G4QMDNucleus.hh" 30 #include "G4QMDNucleus.hh" 31 #include "G4Pow.hh" << 32 #include "G4SystemOfUnits.hh" 31 #include "G4SystemOfUnits.hh" 33 #include "G4Proton.hh" 32 #include "G4Proton.hh" 34 #include "G4Neutron.hh" 33 #include "G4Neutron.hh" 35 #include "G4NucleiProperties.hh" 34 #include "G4NucleiProperties.hh" 36 #include "G4HadronicException.hh" << 37 35 38 G4QMDNucleus::G4QMDNucleus() 36 G4QMDNucleus::G4QMDNucleus() 39 { 37 { 40 G4QMDParameters* parameters = G4QMDParamete 38 G4QMDParameters* parameters = G4QMDParameters::GetInstance(); 41 hbc = parameters->Get_hbc(); 39 hbc = parameters->Get_hbc(); 42 << 43 jj = 0; // will be calcualted in CalEnergyA << 44 potentialEnergy = 0.0; // will be set throu << 45 excitationEnergy = 0.0; << 46 } 40 } 47 41 48 42 49 43 50 //G4QMDNucleus::~G4QMDNucleus() << 44 G4QMDNucleus::~G4QMDNucleus() 51 //{ << 45 { 52 // ; << 46 ; 53 //} << 47 } 54 48 55 49 56 G4LorentzVector G4QMDNucleus::Get4Momentum() 50 G4LorentzVector G4QMDNucleus::Get4Momentum() 57 { 51 { 58 G4LorentzVector p( 0 ); 52 G4LorentzVector p( 0 ); 59 std::vector< G4QMDParticipant* >::iterator 53 std::vector< G4QMDParticipant* >::iterator it; 60 for ( it = participants.begin() ; it != par 54 for ( it = participants.begin() ; it != participants.end() ; it++ ) 61 p += (*it)->Get4Momentum(); 55 p += (*it)->Get4Momentum(); 62 56 63 return p; 57 return p; 64 } 58 } 65 59 66 60 67 61 68 G4int G4QMDNucleus::GetMassNumber() 62 G4int G4QMDNucleus::GetMassNumber() 69 { 63 { 70 64 71 G4int A = 0; 65 G4int A = 0; 72 std::vector< G4QMDParticipant* >::iterator 66 std::vector< G4QMDParticipant* >::iterator it; 73 for ( it = participants.begin() ; it != par 67 for ( it = participants.begin() ; it != participants.end() ; it++ ) 74 { 68 { 75 if ( (*it)->GetDefinition() == G4Proton: 69 if ( (*it)->GetDefinition() == G4Proton::Proton() 76 || (*it)->GetDefinition() == G4Neutron 70 || (*it)->GetDefinition() == G4Neutron::Neutron() ) 77 A++; 71 A++; 78 } 72 } 79 73 80 if ( A == 0 ) { << 81 throw G4HadronicException(__FILE__, __LI << 82 } << 83 << 84 return A; 74 return A; 85 } 75 } 86 76 87 77 88 78 89 G4int G4QMDNucleus::GetAtomicNumber() 79 G4int G4QMDNucleus::GetAtomicNumber() 90 { 80 { 91 G4int Z = 0; 81 G4int Z = 0; 92 std::vector< G4QMDParticipant* >::iterator 82 std::vector< G4QMDParticipant* >::iterator it; 93 for ( it = participants.begin() ; it != par 83 for ( it = participants.begin() ; it != participants.end() ; it++ ) 94 { 84 { 95 if ( (*it)->GetDefinition() == G4Proton: 85 if ( (*it)->GetDefinition() == G4Proton::Proton() ) 96 Z++; 86 Z++; 97 } 87 } 98 return Z; 88 return Z; 99 } 89 } 100 90 101 91 102 92 103 G4double G4QMDNucleus::GetNuclearMass() 93 G4double G4QMDNucleus::GetNuclearMass() 104 { 94 { 105 95 106 G4double mass = G4NucleiProperties::GetNucl 96 G4double mass = G4NucleiProperties::GetNuclearMass( GetMassNumber() , GetAtomicNumber() ); 107 97 108 if ( mass == 0.0 ) 98 if ( mass == 0.0 ) 109 { 99 { 110 100 111 G4int Z = GetAtomicNumber(); 101 G4int Z = GetAtomicNumber(); 112 G4int A = GetMassNumber(); 102 G4int A = GetMassNumber(); 113 G4int N = A - Z; 103 G4int N = A - Z; 114 104 115 // Weizsacker-Bethe 105 // Weizsacker-Bethe 116 106 117 G4double Av = 16*MeV; 107 G4double Av = 16*MeV; 118 G4double As = 17*MeV; 108 G4double As = 17*MeV; 119 G4double Ac = 0.7*MeV; 109 G4double Ac = 0.7*MeV; 120 G4double Asym = 23*MeV; 110 G4double Asym = 23*MeV; 121 111 122 G4double BE = Av * A 112 G4double BE = Av * A 123 - As * G4Pow::GetInstance()- << 113 - As * std::pow ( G4double ( A ) , 2.0/3.0 ) 124 - Ac * Z*Z/G4Pow::GetInstanc << 114 - Ac * Z*Z/std::pow ( G4double ( A ) , 1.0/3.0 ) 125 - Asym * ( N - Z )* ( N - Z 115 - Asym * ( N - Z )* ( N - Z ) / A; 126 116 127 mass = Z * G4Proton::Proton()->GetPDGMas 117 mass = Z * G4Proton::Proton()->GetPDGMass() 128 + N * G4Neutron::Neutron()->GetPDGM 118 + N * G4Neutron::Neutron()->GetPDGMass() 129 - BE; 119 - BE; 130 120 131 } 121 } 132 122 133 return mass; 123 return mass; 134 } 124 } 135 125 136 126 137 127 138 void G4QMDNucleus::CalEnergyAndAngularMomentum 128 void G4QMDNucleus::CalEnergyAndAngularMomentumInCM() 139 { 129 { 140 130 141 //G4cout << "CalEnergyAndAngularMomentumInC 131 //G4cout << "CalEnergyAndAngularMomentumInCM " << this->GetAtomicNumber() << " " << GetMassNumber() << G4endl; 142 132 143 G4double gamma = Get4Momentum().gamma(); 133 G4double gamma = Get4Momentum().gamma(); 144 G4ThreeVector beta = Get4Momentum().v()/ Ge 134 G4ThreeVector beta = Get4Momentum().v()/ Get4Momentum().e(); 145 135 146 G4ThreeVector pcm0( 0.0 ) ; 136 G4ThreeVector pcm0( 0.0 ) ; 147 137 148 G4int n = GetTotalNumberOfParticipant(); 138 G4int n = GetTotalNumberOfParticipant(); 149 pcm.resize( n ); 139 pcm.resize( n ); 150 140 151 for ( G4int i= 0; i < n ; i++ ) 141 for ( G4int i= 0; i < n ; i++ ) 152 { 142 { 153 G4ThreeVector p_i = GetParticipant( i )- 143 G4ThreeVector p_i = GetParticipant( i )->GetMomentum(); 154 144 155 G4double trans = gamma / ( gamma + 1.0 ) 145 G4double trans = gamma / ( gamma + 1.0 ) * p_i * beta; 156 pcm[i] = p_i - trans*beta; 146 pcm[i] = p_i - trans*beta; 157 147 158 pcm0 += pcm[i]; 148 pcm0 += pcm[i]; 159 } 149 } 160 150 161 pcm0 = pcm0 / double ( n ); 151 pcm0 = pcm0 / double ( n ); 162 152 163 //G4cout << "pcm0 " << pcm0 << G4endl; 153 //G4cout << "pcm0 " << pcm0 << G4endl; 164 154 165 for ( G4int i= 0; i < n ; i++ ) 155 for ( G4int i= 0; i < n ; i++ ) 166 { 156 { 167 pcm[i] += -pcm0; 157 pcm[i] += -pcm0; 168 //G4cout << "pcm " << i << " " << pcm[i] 158 //G4cout << "pcm " << i << " " << pcm[i] << G4endl; 169 } 159 } 170 160 171 161 172 G4double tmass = 0; 162 G4double tmass = 0; 173 G4ThreeVector rcm0( 0.0 ) ; 163 G4ThreeVector rcm0( 0.0 ) ; 174 rcm.resize( n ); 164 rcm.resize( n ); 175 es.resize( n ); 165 es.resize( n ); 176 166 177 for ( G4int i= 0; i < n ; i++ ) 167 for ( G4int i= 0; i < n ; i++ ) 178 { 168 { 179 G4ThreeVector ri = GetParticipant( i )-> 169 G4ThreeVector ri = GetParticipant( i )->GetPosition(); 180 G4double trans = gamma / ( gamma + 1.0 ) 170 G4double trans = gamma / ( gamma + 1.0 ) * ri * beta; 181 171 182 es[i] = std::sqrt ( G4Pow::GetInstance() << 172 es[i] = std::sqrt ( std::pow ( GetParticipant( i )->GetMass() , 2 ) + pcm[i]*pcm[i] ); 183 173 184 rcm[i] = ri + trans*beta; 174 rcm[i] = ri + trans*beta; 185 175 186 rcm0 += rcm[i]*es[i]; 176 rcm0 += rcm[i]*es[i]; 187 177 188 tmass += es[i]; 178 tmass += es[i]; 189 } 179 } 190 180 191 rcm0 = rcm0/tmass; 181 rcm0 = rcm0/tmass; 192 182 193 for ( G4int i= 0; i < n ; i++ ) 183 for ( G4int i= 0; i < n ; i++ ) 194 { 184 { 195 rcm[i] += -rcm0; 185 rcm[i] += -rcm0; 196 //G4cout << "rcm " << i << " " << rcm[i] 186 //G4cout << "rcm " << i << " " << rcm[i] << G4endl; 197 } 187 } 198 188 199 // Angular momentum << 189 // Angluar momentum 200 190 201 G4ThreeVector rl ( 0.0 ); 191 G4ThreeVector rl ( 0.0 ); 202 for ( G4int i= 0; i < n ; i++ ) 192 for ( G4int i= 0; i < n ; i++ ) 203 { 193 { 204 rl += rcm[i].cross ( pcm[i] ); 194 rl += rcm[i].cross ( pcm[i] ); 205 } 195 } 206 196 207 // DHW: move hbc outside of sqrt to get correc << 197 jj = int ( std::sqrt ( rl*rl / hbc ) + 0.5 ); 208 // jj = int ( std::sqrt ( rl*rl / hbc ) + 0.5 << 209 198 210 jj = int (std::sqrt(rl*rl)/hbc + 0.5); << 211 199 212 // kinetic energy per nucleon in CM 200 // kinetic energy per nucleon in CM 213 201 214 G4double totalMass = 0.0; 202 G4double totalMass = 0.0; 215 for ( G4int i= 0; i < n ; i++ ) 203 for ( G4int i= 0; i < n ; i++ ) 216 { 204 { 217 // following two lines are equivalent 205 // following two lines are equivalent 218 //totalMass += GetParticipant( i )->GetD 206 //totalMass += GetParticipant( i )->GetDefinition()->GetPDGMass()/GeV; 219 totalMass += GetParticipant( i )->GetMas 207 totalMass += GetParticipant( i )->GetMass(); 220 } 208 } 221 209 222 //G4double kineticEnergyPerNucleon = ( std: << 210 kineticEnergyPerNucleon = ( std::accumulate ( es.begin() , es.end() , 0.0 ) - totalMass )/n; 223 211 224 // Total (not per nucleion ) Binding Energy 212 // Total (not per nucleion ) Binding Energy 225 G4double bindingEnergy = ( std::accumulate << 213 bindingEnergy = ( std::accumulate ( es.begin() , es.end() , 0.0 ) -totalMass ) + potentialEnergy; 226 214 227 //G4cout << "KineticEnergyPerNucleon in GeV 215 //G4cout << "KineticEnergyPerNucleon in GeV " << kineticEnergyPerNucleon << G4endl; 228 //G4cout << "KineticEnergySum in GeV " << s 216 //G4cout << "KineticEnergySum in GeV " << std::accumulate ( es.begin() , es.end() , 0.0 ) - totalMass << G4endl; 229 //G4cout << "PotentialEnergy in GeV " << po 217 //G4cout << "PotentialEnergy in GeV " << potentialEnergy << G4endl; 230 //G4cout << "BindingEnergy in GeV " << bind 218 //G4cout << "BindingEnergy in GeV " << bindingEnergy << G4endl; 231 //G4cout << "G4BindingEnergy in GeV " << G4 219 //G4cout << "G4BindingEnergy in GeV " << G4NucleiProperties::GetBindingEnergy( GetAtomicNumber() , GetMassNumber() )/GeV << G4endl; 232 220 233 excitationEnergy = bindingEnergy + G4Nuclei 221 excitationEnergy = bindingEnergy + G4NucleiProperties::GetBindingEnergy( GetMassNumber() , GetAtomicNumber() )/GeV; 234 //G4cout << "excitationEnergy in GeV " << e 222 //G4cout << "excitationEnergy in GeV " << excitationEnergy << G4endl; 235 if ( excitationEnergy < 0 ) excitationEnerg 223 if ( excitationEnergy < 0 ) excitationEnergy = 0.0; 236 224 237 } 225 } 238 226