Changeset 1340 for trunk/source/processes/hadronic/management/src
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (15 years ago)
- Location:
- trunk/source/processes/hadronic/management/src
- Files:
-
- 3 edited
-
G4EnergyRangeManager.cc (modified) (1 diff)
-
G4HadronicProcess.cc (modified) (24 diffs)
-
G4HadronicProcessStore.cc (modified) (31 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/management/src/G4EnergyRangeManager.cc
r1337 r1340 26 26 // 27 27 // $Id: G4EnergyRangeManager.cc,v 1.15 2006/06/29 19:58:21 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04-beta-01$28 // GEANT4 tag $Name: hadr-man-V09-03-04 $ 29 29 // 30 30 // Hadronic Process: Energy Range Manager -
trunk/source/processes/hadronic/management/src/G4HadronicProcess.cc
r1315 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HadronicProcess.cc,v 1.92 2010/08/17 09:48:20 vnivanch Exp $ 27 // GEANT4 tag $Name: hadr-man-V09-03-04 $ 28 // 29 // ------------------------------------------------------------------- 30 // 31 // GEANT4 Class source file 32 // 33 // G4HadronicProcess 34 // 35 // original by H.P.Wellisch 36 // J.L. Chuma, TRIUMF, 10-Mar-1997 37 // 38 // Modifications: 39 // 05-Jul-2010 V.Ivanchenko cleanup commented lines 26 40 // 27 41 28 42 #include "G4Types.hh" 29 30 //#include <fstream>31 //#include <sstream>32 //#include <stdlib.h>33 43 #include "G4HadronicProcess.hh" 34 44 … … 47 57 #include "G4NucleiProperties.hh" 48 58 49 //VI #include "G4HadLeadBias.hh"50 59 #include "G4HadronicException.hh" 51 //VI #include "G4HadReentrentException.hh"52 //VI #include "G4HadronicWhiteBoard.hh"53 //VI #include "G4HadSignalHandler.hh"54 60 #include "G4HadronicProcessStore.hh" 55 61 56 57 /*VI 58 59 namespace G4HadronicProcess_local 60 { 61 extern "C" void G4HadronicProcessHandler_1(int) 62 { 63 G4HadronicWhiteBoard::Instance().Dump(); 64 } 65 } 66 VI*/ 62 #include <typeinfo> 67 63 68 64 G4IsoParticleChange * G4HadronicProcess::theIsoResult = 0; … … 95 91 epCheckLevels.second = DBL_MAX; 96 92 levelsSetByProcess = false; 97 98 //VI if(getenv("SwitchLeadBiasOn")) theBias.push_back(new G4HadLeadBias());99 93 } 100 94 … … 106 100 std::for_each(theProductionModels.begin(), 107 101 theProductionModels.end(), G4Delete()); 108 //VI std::for_each(theBias.begin(), theBias.end(), G4Delete());109 102 110 103 delete theOldIsoResult; … … 129 122 void G4HadronicProcess::PreparePhysicsTable(const G4ParticleDefinition& p) 130 123 { 131 if(getenv("G4HadronicProcess_debug")) G4HadronicProcess_debug_flag = true; 124 if(getenv("G4HadronicProcess_debug")) { 125 G4HadronicProcess_debug_flag = true; 126 } 132 127 G4HadronicProcessStore::Instance()->RegisterParticle(this, &p); 133 128 } … … 144 139 try 145 140 { 146 //VI ModelingState = 1;147 141 theLastCrossSection = aScaleFactor* 148 142 theCrossSectionDataStore->GetCrossSection(aTrack.GetDynamicParticle(), … … 165 159 G4double aTemp ) 166 160 { 167 return161 G4double x = 168 162 theCrossSectionDataStore->GetCrossSection(aParticle, anElement, aTemp); 163 if(x < 0.0) { x = 0.0; } 164 return x; 169 165 } 170 166 … … 172 168 const G4Track &aTrack, const G4Step &) 173 169 { 174 // Debugging stuff175 //VI if(G4HadronicProcess_debug_flag)176 //VI std::cout << "@@@@ hadronic process start "<< std::endl;177 // G4cout << theNumberOfInteractionLengthLeft<<G4endl;178 //VI #ifndef G4HadSignalHandler_off179 //VI G4HadSignalHandler aHandler(G4HadronicProcess_local::G4HadronicProcessHandler_1);180 //VI #endif181 182 170 if(aTrack.GetTrackStatus() != fAlive && aTrack.GetTrackStatus() != fSuspend) { 183 171 if (aTrack.GetTrackStatus() == fStopAndKill || … … 201 189 G4double kineticEnergy = originalEnergy; 202 190 203 /*204 // It is not needed with standard NaN check205 // More debugging206 G4Nancheck go_wild;207 if(go_wild(originalEnergy) ||208 go_wild(aParticle->Get4Momentum().x()) ||209 go_wild(aParticle->Get4Momentum().y()) ||210 go_wild(aParticle->Get4Momentum().z()) ||211 go_wild(aParticle->Get4Momentum().t())212 )213 {214 G4Exception("G4HadronicProcess", "001", JustWarning, "NaN in input energy or momentum - bailing out.");215 theTotalResult->Clear();216 theTotalResult->Initialize(aTrack);217 return theTotalResult;218 }219 */220 221 191 // Get kinetic energy per nucleon for ions 222 if(aParticle->Get Definition()->GetBaryonNumber() > 1.5)223 kineticEnergy/=aParticle->Get Definition()->GetBaryonNumber();192 if(aParticle->GetParticleDefinition()->GetBaryonNumber() > 1.5) 193 kineticEnergy/=aParticle->GetParticleDefinition()->GetBaryonNumber(); 224 194 225 195 G4Element* anElement = 0; … … 234 204 { 235 205 DumpState(aTrack,"SampleZandA"); 236 //VI G4cout << "Unrecoverable error for:"<<G4endl;237 //VI G4cout << " - Particle energy[GeV] = "<< originalEnergy/GeV<<G4endl;238 //VI G4cout << " - Material = "<<aMaterial->GetName()<<G4endl;239 //VI G4cout << " - Particle type = "240 //VI <<aParticle->GetDefinition()->GetParticleName()<<G4endl;241 206 G4Exception("G4HadronicProcess", "007", FatalException, 242 207 "PostStepDoIt failed on element selection."); … … 253 218 << targetNucleus.GetZ() << " A= " << targetNucleus.GetN() << G4endl; 254 219 DumpState(aTrack,"ChooseHadronicInteraction"); 255 //VI G4cout << " - Particle energy[GeV] = "<< originalEnergy/GeV<<G4endl;256 //VI G4cout << " - Material = "<<aMaterial->GetName()<<G4endl;257 //VI G4cout << " - Particle type = "258 //VI << aParticle->GetDefinition()->GetParticleName()<<G4endl;259 220 G4Exception("G4HadronicProcess", "007", FatalException, 260 221 "ChooseHadronicInteraction failed."); … … 276 237 ++reentryCount; 277 238 } 278 /*VI279 catch(G4HadReentrentException aR)280 {281 G4HadronicWhiteBoard & theBoard = G4HadronicWhiteBoard::Instance();282 theBoard.SetProjectile(thePro);283 theBoard.SetTargetNucleus(targetNucleus);284 theBoard.SetProcessName(GetProcessName());285 theBoard.SetModelName(theInteraction->GetModelName());286 287 aR.Report(G4cout);288 G4cout << " G4HadronicProcess re-entering the ApplyYourself call for "289 <<G4endl;290 G4cout << " - Particle energy[GeV] = "<< originalEnergy/GeV<<G4endl;291 G4cout << " - Material = "<<aMaterial->GetName()<<G4endl;292 G4cout << " - Particle type = "293 << aParticle->GetDefinition()->GetParticleName() << G4endl;294 result = 0; // here would still be leaking...295 G4Exception("G4HadronicProcess", "007", FatalException,296 "GetHadronicProcess: PostStepDoIt failed (Reentering ApplyYourself not yet supported.)");297 }298 VI*/299 239 catch(G4HadronicException aR) 300 240 { 301 //VI G4HadronicWhiteBoard & theBoard = G4HadronicWhiteBoard::Instance();302 //VI theBoard.SetProjectile(thePro);303 //VI theBoard.SetTargetNucleus(targetNucleus);304 //VI theBoard.SetProcessName(GetProcessName());305 //VI theBoard.SetModelName(theInteraction->GetModelName());306 307 241 G4cout << "Call for " << theInteraction->GetModelName() << G4endl; 308 242 G4cout << "Target element "<<anElement->GetName()<<" Z= " 309 243 << targetNucleus.GetZ() << " A= " << targetNucleus.GetN() << G4endl; 310 244 DumpState(aTrack,"ApplyYourself"); 311 //VI G4cout << " - Particle energy[GeV] = "<< originalEnergy/GeV<<G4endl;312 //VI G4cout << " - Material = "<<aMaterial->GetName()<<G4endl;313 //VI G4cout << " - Particle type = "314 //VI << aParticle->GetDefinition()->GetParticleName() << G4endl;315 245 G4Exception("G4HadronicProcess", "007", FatalException, 316 246 "PostStepDoIt failed."); … … 327 257 while(!result); 328 258 329 //VI if(!ModelingState && !getenv("BypassAllSafetyChecks") )330 //VI{331 //VI G4cout << "ERROR IN EXECUTION -- HADRONIC PROCESS STATE NOT VALID"<<G4endl;332 //VI G4cout << "Result will be of undefined quality."<<G4endl;333 //VI}334 335 // NOT USED ?? Projectile particle has changed character during interaction336 //VI if(result->GetStatusChange() == isAlive &&337 //VI thePro.GetDefinition() != aTrack.GetDefinition())338 //VI {339 //VI G4DynamicParticle * aP =340 //VI const_cast<G4DynamicParticle *>(aTrack.GetDynamicParticle());341 //VI aP->SetDefinition(const_cast<G4ParticleDefinition *>(thePro.GetDefinition()));342 //VI }343 344 259 result->SetTrafoToLab(thePro.GetTrafoToLab()); 345 346 /*VI347 if(getenv("HadronicDoitLogging") )348 {349 G4cout << "HadronicDoitLogging "350 << GetProcessName() <<" "351 << aParticle->GetDefinition()->GetPDGEncoding()<<" "352 << originalEnergy<<" "353 << aParticle->GetMomentum()<<" "354 << targetNucleus.GetN()<<" "355 << targetNucleus.GetZ()<<" "356 << G4endl;357 }358 VI*/359 260 360 261 ClearNumberOfInteractionLengthLeft(); … … 367 268 } 368 269 369 /*VI370 G4double e=aTrack.GetKineticEnergy();371 ModelingState = 0;372 if(e<5*GeV)373 {374 for(size_t i=0; i<theBias.size(); i++)375 {376 result = theBias[i]->Bias(result);377 }378 }379 VI*/380 270 // Put hadronic final state particles into G4ParticleChange 381 271 382 272 FillTotalResult(result, aTrack); 383 //VI if(G4HadronicProcess_debug_flag) 384 //VI std::cout << "@@@@ hadronic process end "<< std::endl; 385 386 if (epReportLevel > 0) CheckEnergyMomentumConservation(aTrack, targetNucleus); 387 273 274 if (epReportLevel > 0) { 275 CheckEnergyMomentumConservation(aTrack, targetNucleus); 276 } 388 277 return theTotalResult; 389 278 } 390 391 #include <typeinfo>392 279 393 280 G4HadFinalState* … … 452 339 // loop over aResult, and decrement A, Z accordingly 453 340 // cash the max 454 for(G4int i=0; i<aResult->GetNumberOfSecondaries(); i++)341 for(G4int i=0; i<aResult->GetNumberOfSecondaries(); ++i) 455 342 { 456 343 G4HadSecondary* aSecTrack = aResult->GetSecondary(i); 457 if(bufferA<aSecTrack->GetParticle()->GetDefinition()->GetBaryonNumber()) 458 { 459 bufferA = aSecTrack->GetParticle()->GetDefinition()->GetBaryonNumber(); 460 bufferZ = aSecTrack->GetParticle()->GetDefinition()->GetPDGCharge(); 461 } 462 Z-=aSecTrack->GetParticle()->GetDefinition()->GetPDGCharge(); 463 A-=aSecTrack->GetParticle()->GetDefinition()->GetBaryonNumber(); 344 const G4ParticleDefinition* part = aSecTrack->GetParticle()->GetParticleDefinition(); 345 G4double Q = part->GetPDGCharge()/eplus; 346 G4double N = part->GetBaryonNumber(); 347 if(bufferA < N) 348 { 349 bufferA = N; 350 bufferZ = Q; 351 } 352 Z -= Q; 353 A -= N; 464 354 } 465 355 … … 513 403 G4ThreeVector it(0., 0., 1.); 514 404 515 /*516 if(xBiasOn)517 {518 G4cout << "BiasDebug "<<GetProcessName()<<" "519 <<aScaleFactor<<" "520 <<XBiasSurvivalProbability()<<" "521 <<XBiasSecondaryWeight()<<" "522 <<G4endl;523 }524 */525 // if(GetProcessName() != "LElastic") std::cout << "Debug -1 "<<aR->GetStatusChange()<<std::endl;526 405 if(aR->GetStatusChange()==stopAndKill) 527 406 { … … 555 434 theTotalResult->ProposeParentWeight( XBiasSurvivalProbability()*aT.GetWeight() ); 556 435 G4double newWeight = aR->GetWeightChange()*aT.GetWeight(); 557 /* 558 if(go_wild(aR->GetEnergyChange())) 559 { 560 G4Exception("G4HadronicProcess", "007", FatalException, 561 "surviving track received NaN energy."); 562 } 563 if(go_wild(aR->GetMomentumChange().x()) || 564 go_wild(aR->GetMomentumChange().y()) || 565 go_wild(aR->GetMomentumChange().z())) 566 { 567 G4Exception("G4HadronicProcess", "007", FatalException, 568 "surviving track received NaN momentum."); 569 } 570 */ 571 G4double newM=aT.GetDefinition()->GetPDGMass(); 436 G4double newM=aT.GetParticleDefinition()->GetPDGMass(); 572 437 G4double newE=aR->GetEnergyChange() + newM; 573 438 G4double newP=std::sqrt(newE*newE - newM*newM); 574 439 G4DynamicParticle * aNew = 575 new G4DynamicParticle(aT.Get Definition(), newE, newP*aR->GetMomentumChange());440 new G4DynamicParticle(aT.GetParticleDefinition(), newE, newP*aR->GetMomentumChange()); 576 441 G4HadSecondary * theSec = new G4HadSecondary(aNew, newWeight); 577 442 aR->AddSecondary(theSec); … … 583 448 if(aR->GetEnergyChange()>-.5) 584 449 { 585 /*586 if(go_wild(aR->GetEnergyChange()))587 {588 G4Exception("G4HadronicProcess", "007", FatalException,589 "track received NaN energy.");590 }591 */592 450 theTotalResult->ProposeEnergy(aR->GetEnergyChange()); 593 451 } … … 614 472 615 473 G4double newKE = std::max(DBL_MIN, aR->GetEnergyChange()); 616 G4DynamicParticle* aNew = new G4DynamicParticle(aT.Get Definition(),474 G4DynamicParticle* aNew = new G4DynamicParticle(aT.GetParticleDefinition(), 617 475 aR->GetMomentumChange(), 618 476 newKE); … … 630 488 if(aR->GetStatusChange() != stopAndKill) 631 489 { 632 G4double newM=aT.Get Definition()->GetPDGMass();490 G4double newM=aT.GetParticleDefinition()->GetPDGMass(); 633 491 G4double newE=aR->GetEnergyChange() + newM; 634 492 G4double newP=std::sqrt(newE*newE - newM*newM); … … 640 498 } 641 499 642 for(G4int i=0; i<aR->GetNumberOfSecondaries(); i++)500 for(G4int i=0; i<aR->GetNumberOfSecondaries(); ++i) 643 501 { 644 502 G4LorentzVector theM = aR->GetSecondary(i)->GetParticle()->Get4Momentum(); 645 503 theM.rotate(rotation, it); 646 504 theM*=aR->GetTrafoToLab(); 647 /*648 if(go_wild(theM.e()))649 {650 G4Exception("G4HadronicProcess", "007", FatalException,651 "secondary track received NaN energy.");652 }653 if(go_wild(theM.x()) ||654 go_wild(theM.y()) ||655 go_wild(theM.z()))656 {657 G4Exception("G4HadronicProcess", "007", FatalException,658 "secondary track received NaN momentum.");659 }660 */661 505 aR->GetSecondary(i)->GetParticle()->Set4Momentum(theM); 662 506 G4double time = aR->GetSecondary(i)->GetTime(); … … 669 513 G4double newWeight = aT.GetWeight()*aR->GetSecondary(i)->GetWeight(); 670 514 //static G4double pinelcount=0; 671 if(xBiasOn) newWeight *= XBiasSecondaryWeight();515 if(xBiasOn) { newWeight *= XBiasSecondaryWeight(); } 672 516 // G4cout << "#### ParticleDebug " 673 517 // <<GetProcessName()<<" " … … 681 525 // <<G4endl; 682 526 track->SetWeight(newWeight); 683 /*684 G4double trackDeb = track->GetKineticEnergy();685 if( ( trackDeb<0686 || (trackDeb>aT.GetKineticEnergy()+1*GeV) ) && getenv("GHADEnergyBalanceDebug") )687 {688 G4cout << "Debugging hadronic processes: "<<track->GetKineticEnergy()689 <<" "<<aT.GetKineticEnergy()690 <<" "<<GetProcessName()691 <<" "<<aT.GetDefinition()->GetParticleName()692 <<G4endl;693 }694 */695 527 track->SetTouchableHandle(aT.GetTouchableHandle()); 696 528 theTotalResult->AddSecondary(track); … … 815 647 << GetProcessName() << G4endl; 816 648 G4cout << "TrackID= "<< aTrack.GetTrackID() << " ParentID= " << aTrack.GetParentID() 817 << " " << aTrack.Get Definition()->GetParticleName() << G4endl;649 << " " << aTrack.GetParticleDefinition()->GetParticleName() << G4endl; 818 650 G4cout << "Ekin(GeV)= " << aTrack.GetKineticEnergy()/CLHEP::GeV 819 651 << "; direction= " << aTrack.GetMomentumDirection() << G4endl; -
trunk/source/processes/hadronic/management/src/G4HadronicProcessStore.cc
r1337 r1340 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HadronicProcessStore.cc,v 1.1 4 2010/04/21 17:55:25 dennisExp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: G4HadronicProcessStore.cc,v 1.16 2010/08/17 09:47:54 vnivanch Exp $ 27 // GEANT4 tag $Name: hadr-man-V09-03-04 $ 28 28 // 29 29 // ------------------------------------------------------------------- … … 90 90 // << " Nextra= " << n_extra << G4endl; 91 91 if(n_proc > 0) { 92 for (i=0; i<n_proc; i++) {92 for (i=0; i<n_proc; ++i) { 93 93 if( process[i] ) { 94 94 //G4cout << "G4HadronicProcessStore::Clean() delete hadronic " << i << G4endl; … … 101 101 } 102 102 if(n_extra > 0) { 103 for(i=0; i<n_extra; i++) {103 for(i=0; i<n_extra; ++i) { 104 104 if(extraProcess[i]) { 105 105 //G4cout << "G4HadronicProcessStore::Clean() delete extra " … … 143 143 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume(); 144 144 size_t nelm = material->GetNumberOfElements(); 145 for (size_t i=0; i<nelm; i++) {145 for (size_t i=0; i<nelm; ++i) { 146 146 const G4Element* elm = (*theElementVector)[i]; 147 147 cross += theAtomNumDensityVector[i]* … … 159 159 { 160 160 G4HadronicProcess* hp = FindProcess(aParticle, fHadronElastic); 161 G4double cross = 0.0; 161 162 localDP.SetKineticEnergy(kineticEnergy); 162 G4double cross = 0.0; 163 if(hp) cross = hp->GetMicroscopicCrossSection(&localDP, 164 anElement, 165 STP_Temperature); 163 if(hp) { 164 cross = hp->GetMicroscopicCrossSection(&localDP, 165 anElement, 166 STP_Temperature); 167 } 166 168 return cross; 167 169 } … … 188 190 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume(); 189 191 size_t nelm = material->GetNumberOfElements(); 190 for (size_t i=0; i<nelm; i++) {192 for (size_t i=0; i<nelm; ++i) { 191 193 const G4Element* elm = (*theElementVector)[i]; 192 194 cross += theAtomNumDensityVector[i]* … … 204 206 { 205 207 G4HadronicProcess* hp = FindProcess(aParticle, fHadronInelastic); 206 localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));207 208 localDP.SetKineticEnergy(kineticEnergy); 208 209 G4double cross = 0.0; 209 if(hp) cross = hp->GetMicroscopicCrossSection(&localDP, 210 anElement, 211 STP_Temperature); 210 if(hp) { 211 cross = hp->GetMicroscopicCrossSection(&localDP, 212 anElement, 213 STP_Temperature); 214 } 212 215 return cross; 213 216 } … … 234 237 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume(); 235 238 size_t nelm = material->GetNumberOfElements(); 236 for (size_t i=0; i<nelm; i++) {239 for (size_t i=0; i<nelm; ++i) { 237 240 const G4Element* elm = (*theElementVector)[i]; 238 241 cross += theAtomNumDensityVector[i]* … … 250 253 { 251 254 G4HadronicProcess* hp = FindProcess(aParticle, fCapture); 252 localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));253 255 localDP.SetKineticEnergy(kineticEnergy); 254 256 G4double cross = 0.0; 255 if(hp) cross = hp->GetMicroscopicCrossSection(&localDP, 256 anElement, 257 STP_Temperature); 257 if(hp) { 258 cross = hp->GetMicroscopicCrossSection(&localDP, 259 anElement, 260 STP_Temperature); 261 } 258 262 return cross; 259 263 } … … 296 300 { 297 301 G4HadronicProcess* hp = FindProcess(aParticle, fFission); 298 localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));299 302 localDP.SetKineticEnergy(kineticEnergy); 300 303 G4double cross = 0.0; 301 if(hp) cross = hp->GetMicroscopicCrossSection(&localDP, 302 anElement, 303 STP_Temperature); 304 if(hp) { 305 cross = hp->GetMicroscopicCrossSection(&localDP, 306 anElement, 307 STP_Temperature); 308 } 304 309 return cross; 305 310 } … … 326 331 const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume(); 327 332 size_t nelm = material->GetNumberOfElements(); 328 for (size_t i=0; i<nelm; i++) {333 for (size_t i=0; i<nelm; ++i) { 329 334 const G4Element* elm = (*theElementVector)[i]; 330 335 cross += theAtomNumDensityVector[i]* … … 342 347 { 343 348 G4HadronicProcess* hp = FindProcess(aParticle, fChargeExchange); 344 localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));345 349 localDP.SetKineticEnergy(kineticEnergy); 346 350 G4double cross = 0.0; 347 if(hp) cross = hp->GetMicroscopicCrossSection(&localDP, 348 anElement, 349 STP_Temperature); 351 if(hp) { 352 cross = hp->GetMicroscopicCrossSection(&localDP, 353 anElement, 354 STP_Temperature); 355 } 350 356 return cross; 351 357 } … … 366 372 { 367 373 if(0 < n_proc) { 368 for(G4int i=0; i<n_proc; i++) {374 for(G4int i=0; i<n_proc; ++i) { 369 375 if(process[i] == proc) { return; } 370 376 } … … 372 378 // G4cout << "G4HadronicProcessStore::Register hadronic " << n_proc 373 379 // << " " << proc->GetProcessName() << G4endl; 374 n_proc++;380 ++n_proc; 375 381 process.push_back(proc); 376 382 } … … 382 388 { 383 389 G4int i=0; 384 for(; i<n_proc; i++) {if(process[i] == proc) break;}390 for(; i<n_proc; ++i) {if(process[i] == proc) break;} 385 391 G4int j=0; 386 for(; j<n_part; j++) {if(particle[j] == part) break;}392 for(; j<n_part; ++j) {if(particle[j] == part) break;} 387 393 388 394 if(j == n_part) { 389 n_part++;395 ++n_part; 390 396 particle.push_back(part); 391 397 wasPrinted.push_back(0); … … 398 404 if(it->first == part) { 399 405 HP process = (it->second); 400 if(proc == process) return;406 if(proc == process) { return; } 401 407 } 402 408 } … … 412 418 { 413 419 G4int i=0; 414 for(; i<n_proc; i++) {if(process[i] == proc) break;}420 for(; i<n_proc; ++i) {if(process[i] == proc) { break; }} 415 421 G4int k=0; 416 for(; k<n_model; k++) {if(model[k] == mod) break;}422 for(; k<n_model; ++k) {if(model[k] == mod) { break; }} 417 423 418 424 m_map.insert(std::multimap<HP,HI>::value_type(proc,mod)); 419 425 420 426 if(k == n_model) { 421 n_model++;427 ++n_model; 422 428 model.push_back(mod); 423 429 modelName.push_back(mod->GetModelName()); … … 430 436 { 431 437 if(0 == n_proc) return; 432 for(G4int i=0; i<n_proc; i++) {438 for(G4int i=0; i<n_proc; ++i) { 433 439 if(process[i] == proc) { 434 440 process[i] = 0; … … 443 449 { 444 450 if(0 < n_extra) { 445 for(G4int i=0; i<n_extra; i++) {446 if(extraProcess[i] == proc) return;451 for(G4int i=0; i<n_extra; ++i) { 452 if(extraProcess[i] == proc) { return; } 447 453 } 448 454 } … … 461 467 { 462 468 G4int i=0; 463 for(; i<n_extra; i++) {if(extraProcess[i] == proc) break;}469 for(; i<n_extra; ++i) { if(extraProcess[i] == proc) { break; } } 464 470 G4int j=0; 465 for(; j<n_part; j++) {if(particle[j] == part) break;}471 for(; j<n_part; ++j) { if(particle[j] == part) { break; } } 466 472 467 473 if(j == n_part) { 468 n_part++;474 ++n_part; 469 475 particle.push_back(part); 470 476 wasPrinted.push_back(0); … … 477 483 if(it->first == part) { 478 484 G4VProcess* process = (it->second); 479 if(proc == process) return;485 if(proc == process) { return; } 480 486 } 481 487 } … … 489 495 void G4HadronicProcessStore::DeRegisterExtraProcess(G4VProcess* proc) 490 496 { 491 //G4cout << "Deregister Extra Process: " << proc << " " << proc->GetProcessName()<< G4endl;492 if(0 == n_extra) return;493 for(G4int i=0; i<n_extra; i++) {497 //G4cout << "Deregister Extra Process: " << proc << " "<<proc->GetProcessName()<< G4endl; 498 if(0 == n_extra) { return; } 499 for(G4int i=0; i<n_extra; ++i) { 494 500 if(extraProcess[i] == proc) { 495 501 extraProcess[i] = 0; … … 521 527 << ")" << G4endl; 522 528 } 523 for(G4int i=0; i<n_part; i++) {529 for(G4int i=0; i<n_part; ++i) { 524 530 PD part = particle[i]; 525 531 G4String pname = part->GetParticleName(); … … 545 551 HP proc = (it->second); 546 552 G4int j=0; 547 for(; j<n_proc; j++) {553 for(; j<n_proc; ++j) { 548 554 if(process[j] == proc) { 549 555 Print(j, i); … … 597 603 hi = ih->second; 598 604 G4int i=0; 599 for(; i<n_model; i++) {600 if(model[i] == hi) break;605 for(; i<n_model; ++i) { 606 if(model[i] == hi) { break; } 601 607 } 602 608 if(!first) G4cout << " "; … … 618 624 verbose = val; 619 625 G4int i; 620 for(i=0; i<n_proc; i++) {621 if(process[i]) process[i]->SetVerboseLevel(val);622 } 623 for(i=0; i<n_model; i++) {624 if(model[i]) model[i]->SetVerboseLevel(val);626 for(i=0; i<n_proc; ++i) { 627 if(process[i]) { process[i]->SetVerboseLevel(val); } 628 } 629 for(i=0; i<n_model; ++i) { 630 if(model[i]) { model[i]->SetVerboseLevel(val); } 625 631 } 626 632 } … … 644 650 isNew = true; 645 651 currentParticle = part; 646 localDP.SetDefinition( const_cast<G4ParticleDefinition*>(part));652 localDP.SetDefinition(part); 647 653 } else if(!currentProcess) { 648 654 isNew = true; … … 667 673 } 668 674 669 670 675 void G4HadronicProcessStore::SetEpReportLevel(G4int level) 671 676 { 672 677 G4cout << " Setting energy/momentum report level to " << level 673 678 << " for " << process.size() << " hadronic processes " << G4endl; 674 for (G4int i = 0; i < G4int(process.size()); i++) {679 for (G4int i = 0; i < G4int(process.size()); ++i) { 675 680 process[i]->SetEpReportLevel(level); 676 681 } 677 682 } 678 679 683 680 684 void G4HadronicProcessStore::SetProcessAbsLevel(G4double abslevel) … … 683 687 G4double rellevel = 0.0; 684 688 G4HadronicProcess* theProcess = 0; 685 for (G4int i = 0; i < G4int(process.size()); i++) {689 for (G4int i = 0; i < G4int(process.size()); ++i) { 686 690 theProcess = process[i]; 687 691 rellevel = theProcess->GetEnergyMomentumCheckLevels().first; … … 690 694 } 691 695 692 693 696 void G4HadronicProcessStore::SetProcessRelLevel(G4double rellevel) 694 697 { … … 696 699 G4double abslevel = 0.0; 697 700 G4HadronicProcess* theProcess = 0; 698 for (G4int i = 0; i < G4int(process.size()); i++) {701 for (G4int i = 0; i < G4int(process.size()); ++i) { 699 702 theProcess = process[i]; 700 703 abslevel = theProcess->GetEnergyMomentumCheckLevels().second;
Note:
See TracChangeset
for help on using the changeset viewer.
