Changeset 1315 for trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4PhotonEvaporation.cc
- Timestamp:
- Jun 18, 2010, 11:42:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/de_excitation/photon_evaporation/src/G4PhotonEvaporation.cc
r962 r1315 24 24 // ******************************************************************** 25 25 // 26 26 // $Id: G4PhotonEvaporation.cc,v 1.13 2010/05/17 11:47:43 flei Exp $ 27 // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ 27 28 // 28 29 // ------------------------------------------------------------------- … … 37 38 // Creation date: 23 October 1998 38 39 // 39 // 40 // Modifications: 40 41 // 41 // 42 // 8 March 2002, Fan Lei (flei@space.qinetiq.com) 42 43 // 43 44 // Implementation of Internal Convertion process in discrete deexcitation … … 50 51 // G4ElectronOccupancy GetEOccupancy () ; 51 52 // 53 // 11 May 2010, V.Ivanchenko add implementation of EmittedFragment and 54 // BreakUpFragment methods; cleanup logic 55 // 52 56 // ------------------------------------------------------------------- 57 // 53 58 54 59 #include "G4PhotonEvaporation.hh" … … 86 91 void G4PhotonEvaporation::Initialize(const G4Fragment& fragment) 87 92 { 88 _nucleus = fragment; 89 return; 90 } 91 93 _nucleus = const_cast<G4Fragment*>(&fragment); 94 } 95 96 G4Fragment* G4PhotonEvaporation::EmittedFragment(G4Fragment* nucleus) 97 { 98 //G4cout << "G4PhotonEvaporation::EmittedFragment" << G4endl; 99 _nucleus = nucleus; 100 101 // Do one photon emission by the continues deexcitation 102 _contDeexcitation->SetNucleus(_nucleus); 103 _contDeexcitation->Initialize(); 104 105 if(_contDeexcitation->CanDoTransition()) { 106 G4Fragment* gamma = _contDeexcitation->GenerateGamma(); 107 if(gamma) { 108 if (_verbose > 0) { 109 G4cout << "G4PhotonEvaporation::EmittedFragment continium deex: " 110 << gamma << G4endl; 111 G4cout << " Residual: " << nucleus << G4endl; 112 } 113 return gamma; 114 } 115 } 116 117 // Do one photon emission by the discrete deexcitation 118 _discrDeexcitation->SetNucleus(_nucleus); 119 _discrDeexcitation->Initialize(); 120 121 if(_discrDeexcitation->CanDoTransition()) { 122 G4Fragment* gamma = _discrDeexcitation->GenerateGamma(); 123 if(gamma) { 124 if (_verbose > 0) { 125 G4cout << "G4PhotonEvaporation::EmittedFragment discrete deex: " 126 << gamma << G4endl; 127 G4cout << " Residual: " << nucleus << G4endl; 128 } 129 return gamma; 130 } 131 } 132 133 if (_verbose > 0) { 134 G4cout << "G4PhotonEvaporation unable emit gamma: " 135 << nucleus << G4endl; 136 } 137 return 0; 138 } 139 140 G4FragmentVector* G4PhotonEvaporation::BreakUpFragment(G4Fragment* nucleus) 141 { 142 //G4cout << "G4PhotonEvaporation::BreakUpFragment" << G4endl; 143 // The same pointer of primary nucleus 144 _nucleus = nucleus; 145 _contDeexcitation->SetNucleus(_nucleus); 146 _discrDeexcitation->SetNucleus(_nucleus); 147 148 // Do the whole gamma chain 149 G4FragmentVector* products = _contDeexcitation->DoChain(); 150 if( !products ) { products = new G4FragmentVector(); } 151 152 if (_verbose > 0) { 153 G4cout << "G4PhotonEvaporation::BreakUpFragment " << products->size() 154 << " gammas from ContinuumDeexcitation " << G4endl; 155 G4cout << " Residual: " << nucleus << G4endl; 156 } 157 // Products from discrete gamma transitions 158 G4FragmentVector* discrProducts = _discrDeexcitation->DoChain(); 159 if(discrProducts) { 160 _eOccupancy = _discrDeexcitation->GetEO(); 161 _vShellNumber = _discrDeexcitation->GetVacantSN(); 162 163 // not sure if the following line is needed! 164 _discrDeexcitation->SetVaccantSN(-1); 165 166 if (_verbose > 0) { 167 G4cout << "G4PhotonEvaporation::BreakUpFragment " << discrProducts->size() 168 << " gammas from DiscreteDeexcitation " << G4endl; 169 G4cout << " Residual: " << nucleus << G4endl; 170 } 171 G4FragmentVector::iterator i; 172 for (i = discrProducts->begin(); i != discrProducts->end(); ++i) 173 { 174 products->push_back(*i); 175 } 176 delete discrProducts; 177 } 178 179 if (_verbose > 0) { 180 G4cout << "*-*-* Photon evaporation: " << products->size() << G4endl; 181 } 182 return products; 183 } 92 184 93 185 G4FragmentVector* G4PhotonEvaporation::BreakUp(const G4Fragment& nucleus) 94 186 { 95 _nucleus = nucleus; 96 97 G4FragmentVector* products = new G4FragmentVector; 98 99 _contDeexcitation->SetNucleus(nucleus); 100 _discrDeexcitation->SetNucleus(nucleus); 187 //G4cout << "G4PhotonEvaporation::BreakUp" << G4endl; 188 _nucleus = new G4Fragment(nucleus); 189 190 _contDeexcitation->SetNucleus(_nucleus); 191 _discrDeexcitation->SetNucleus(_nucleus); 101 192 102 193 // Do one photon emission … … 104 195 // Products from continuum gamma transitions 105 196 106 G4FragmentVector* contProducts = _contDeexcitation->DoTransition(); 107 108 G4int nCont = 0; 109 if (contProducts != 0) nCont = contProducts->size(); 110 111 G4FragmentVector::iterator i; 112 if (nCont > 0) 113 { 114 G4Fragment modifiedNucleus = _contDeexcitation->GetNucleus(); 115 _discrDeexcitation->SetNucleus(modifiedNucleus); 116 for (i = contProducts->begin(); i != contProducts->end(); i++) 117 { 118 products->push_back(*i); 119 } 120 } 121 else 197 G4FragmentVector* products = _contDeexcitation->DoTransition(); 198 if( !products ) { products = new G4FragmentVector(); } 199 else if(_verbose > 0) { 200 G4cout << "G4PhotonEvaporation::BreakUp " << products->size() 201 << " gammas from ContinuesDeexcitation " << G4endl; 202 G4cout << " Residual: " << nucleus << G4endl; 203 } 204 205 if (0 == products->size()) 122 206 { 123 207 // Products from discrete gamma transitions 124 208 G4FragmentVector* discrProducts = _discrDeexcitation->DoTransition(); 125 126 G4int nDiscr = 0; 127 if (discrProducts != 0) nDiscr = discrProducts->size(); 128 129 if (_verbose > 0) 130 G4cout << " = BreakUp = " << nDiscr 131 << " gammas from DiscreteDeexcitation " 132 << G4endl; 133 134 for (i = discrProducts->begin(); i != discrProducts->end(); i++) 135 { 136 products->push_back(*i); 209 210 if (discrProducts) { 211 _eOccupancy = _discrDeexcitation->GetEO(); 212 _vShellNumber = _discrDeexcitation->GetVacantSN(); 213 214 // not sure if the following line is needed! 215 _discrDeexcitation->SetVaccantSN(-1); 216 // 217 if (_verbose > 0) { 218 G4cout << " = BreakUp = " << discrProducts->size() 219 << " gammas from DiscreteDeexcitation " 220 << G4endl; 221 G4cout << " Residual: " << nucleus << G4endl; 137 222 } 138 discrProducts->clear(); 139 delete discrProducts; 223 G4FragmentVector::iterator i; 224 for (i = discrProducts->begin(); i != discrProducts->end(); ++i) 225 { 226 products->push_back(*i); 227 } 228 delete discrProducts; 229 } 140 230 } 141 142 143 _gammaE = 0.; 144 if (products->size() > 0) 145 { 146 _gammaE = (*(products->begin()))->GetMomentum().e(); 147 } 148 149 contProducts->clear(); 150 delete contProducts; // delete vector, not fragments 151 231 152 232 // Add deexcited nucleus to products 153 G4Fragment* finalNucleus = new G4Fragment(_discrDeexcitation->GetNucleus()); 154 products->push_back(finalNucleus); 155 156 157 if (_verbose > 0) 233 products->push_back(_nucleus); 234 235 if (_verbose > 0) { 158 236 G4cout << "*-*-*-* Photon evaporation: " << products->size() << G4endl; 237 } 159 238 160 239 return products; 161 240 } 162 241 163 164 242 G4FragmentVector* G4PhotonEvaporation::BreakItUp(const G4Fragment& nucleus) 165 243 { 166 _nucleus = nucleus;167 168 G4FragmentVector* products = new G4FragmentVector;169 170 _contDeexcitation->SetNucleus(nucleus); 171 _discrDeexcitation->SetNucleus(nucleus);244 // The same pointer of primary nucleus 245 _nucleus = new G4Fragment(nucleus); 246 _contDeexcitation->SetNucleus(_nucleus); 247 _discrDeexcitation->SetNucleus(_nucleus); 248 249 //G4cout << "G4PhotonEvaporation::BreakItUp: " << nucleus << G4endl; 172 250 173 251 // Do the whole gamma chain 174 175 G4FragmentVector* contProducts = _contDeexcitation->DoChain();252 G4FragmentVector* products = _contDeexcitation->DoChain(); 253 if( !products ) { products = new G4FragmentVector; } 176 254 177 255 // Products from continuum gamma transitions 178 G4int nCont = 0; 179 if (contProducts != 0) nCont = contProducts->size(); 180 181 if (_verbose > 0) 182 G4cout << " = BreakItUp = " << nCont 256 if (_verbose > 0) { 257 G4cout << " = BreakItUp = " << products->size() 183 258 << " gammas from ContinuumDeexcitation " << G4endl; 184 185 G4FragmentVector::iterator i; 186 if (nCont > 0) 187 { 188 G4Fragment modifiedNucleus = _contDeexcitation->GetNucleus(); 189 _discrDeexcitation->SetNucleus(modifiedNucleus); 190 for (i = contProducts->begin(); i != contProducts->end(); i++) 191 { 192 products->push_back(*i); 193 } 194 } 259 } 195 260 196 261 // Products from discrete gamma transitions 197 262 G4FragmentVector* discrProducts = _discrDeexcitation->DoChain(); 198 _eOccupancy = _discrDeexcitation->GetEO(); 199 _vShellNumber = _discrDeexcitation->GetVacantSN(); 200 201 // not sure if the following line is needed! 202 _discrDeexcitation->SetVaccantSN(-1); 203 204 G4int nDiscr = 0; 205 if (discrProducts != 0) nDiscr = discrProducts->size(); 206 207 if (_verbose > 0) 208 G4cout << " = BreakItUp = " << nDiscr 209 << " gammas from DiscreteDeexcitation " << G4endl; 210 211 for (i = discrProducts->begin(); i != discrProducts->end(); i++) 212 { 213 products->push_back(*i); 263 if(discrProducts) { 264 _eOccupancy = _discrDeexcitation->GetEO(); 265 _vShellNumber = _discrDeexcitation->GetVacantSN(); 266 267 // not sure if the following line is needed! 268 _discrDeexcitation->SetVaccantSN(-1); 269 270 if (_verbose > 0) { 271 G4cout << " = BreakItUp = " << discrProducts->size() 272 << " gammas from DiscreteDeexcitation " << G4endl; 214 273 } 215 274 G4FragmentVector::iterator i; 275 for (i = discrProducts->begin(); i != discrProducts->end(); ++i) 276 { 277 products->push_back(*i); 278 } 279 delete discrProducts; 280 } 216 281 // Add deexcited nucleus to products 217 G4Fragment* finalNucleus = new G4Fragment(_discrDeexcitation->GetNucleus()); 218 products->push_back(finalNucleus); 219 if (_verbose > 0) 220 G4cout << " = BreakItUp = Nucleus added to products" << G4endl; 221 222 if (_verbose > 0) 282 products->push_back(_nucleus); 283 284 if (_verbose > 0) { 223 285 G4cout << "*-*-* Photon evaporation: " << products->size() << G4endl; 224 225 #ifdef debug 226 CheckConservation(nucleus,products); 227 #endif 228 contProducts->clear(); 229 discrProducts->clear(); 230 delete contProducts; // delete vector, not fragments 231 delete discrProducts; 286 } 232 287 return products; 233 288 } … … 236 291 { 237 292 G4double prob = 0.; 238 if (_probAlgorithm != 0) prob = _probAlgorithm->EmissionProbability(_nucleus,_gammaE); 293 if (_probAlgorithm != 0) { 294 prob = _probAlgorithm->EmissionProbability(*_nucleus,_gammaE); 295 } 239 296 return prob; 240 297 }
Note: See TracChangeset
for help on using the changeset viewer.