Ignore:
Timestamp:
Nov 5, 2010, 3:45:55 PM (15 years ago)
Author:
garnier
Message:

update ti head

Location:
trunk/source/processes/hadronic/management/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/management/src/G4EnergyRangeManager.cc

    r1337 r1340  
    2626//
    2727// $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 $
    2929//
    3030 // Hadronic Process: Energy Range Manager
  • trunk/source/processes/hadronic/management/src/G4HadronicProcess.cc

    r1315 r1340  
    2424// ********************************************************************
    2525//
     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
    2640//
    2741
    2842#include "G4Types.hh"
    29 
    30 //#include <fstream>
    31 //#include <sstream>
    32 //#include <stdlib.h>
    3343#include "G4HadronicProcess.hh"
    3444
     
    4757#include "G4NucleiProperties.hh"
    4858
    49 //VI #include "G4HadLeadBias.hh"
    5059#include "G4HadronicException.hh"
    51 //VI #include "G4HadReentrentException.hh"
    52 //VI #include "G4HadronicWhiteBoard.hh"
    53 //VI #include "G4HadSignalHandler.hh"
    5460#include "G4HadronicProcessStore.hh"
    5561
    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>
    6763
    6864G4IsoParticleChange * G4HadronicProcess::theIsoResult = 0;
     
    9591  epCheckLevels.second = DBL_MAX;
    9692  levelsSetByProcess = false;
    97 
    98   //VI   if(getenv("SwitchLeadBiasOn")) theBias.push_back(new G4HadLeadBias());
    9993}
    10094
     
    106100  std::for_each(theProductionModels.begin(),
    107101                theProductionModels.end(), G4Delete());
    108   //VI  std::for_each(theBias.begin(), theBias.end(), G4Delete());
    109102 
    110103  delete theOldIsoResult;
     
    129122void G4HadronicProcess::PreparePhysicsTable(const G4ParticleDefinition& p)
    130123{
    131   if(getenv("G4HadronicProcess_debug")) G4HadronicProcess_debug_flag = true;
     124  if(getenv("G4HadronicProcess_debug")) {
     125    G4HadronicProcess_debug_flag = true;
     126  }
    132127  G4HadronicProcessStore::Instance()->RegisterParticle(this, &p);
    133128}
     
    144139  try
    145140  {
    146     //VI ModelingState = 1;   
    147141    theLastCrossSection = aScaleFactor*
    148142      theCrossSectionDataStore->GetCrossSection(aTrack.GetDynamicParticle(),
     
    165159                           G4double aTemp )
    166160{
    167   return
     161  G4double x =
    168162    theCrossSectionDataStore->GetCrossSection(aParticle, anElement, aTemp);
     163  if(x < 0.0) { x = 0.0; }
     164  return x;
    169165}
    170166
     
    172168                   const G4Track &aTrack, const G4Step &)
    173169{
    174   // Debugging stuff
    175   //VI if(G4HadronicProcess_debug_flag)
    176   //VI       std::cout << "@@@@ hadronic process start "<< std::endl;
    177   // G4cout << theNumberOfInteractionLengthLeft<<G4endl;
    178   //VI #ifndef G4HadSignalHandler_off
    179   //VI G4HadSignalHandler aHandler(G4HadronicProcess_local::G4HadronicProcessHandler_1);
    180   //VI #endif
    181 
    182170  if(aTrack.GetTrackStatus() != fAlive && aTrack.GetTrackStatus() != fSuspend) {
    183171    if (aTrack.GetTrackStatus() == fStopAndKill ||
     
    201189  G4double kineticEnergy = originalEnergy;
    202190
    203   /*
    204   // It is not needed with standard NaN check
    205   // More debugging 
    206   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 
    221191  // Get kinetic energy per nucleon for ions
    222   if(aParticle->GetDefinition()->GetBaryonNumber() > 1.5)
    223           kineticEnergy/=aParticle->GetDefinition()->GetBaryonNumber();
     192  if(aParticle->GetParticleDefinition()->GetBaryonNumber() > 1.5)
     193          kineticEnergy/=aParticle->GetParticleDefinition()->GetBaryonNumber();
    224194
    225195  G4Element* anElement = 0;
     
    234204  {
    235205    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;
    241206    G4Exception("G4HadronicProcess", "007", FatalException,
    242207    "PostStepDoIt failed on element selection.");
     
    253218           << targetNucleus.GetZ() << "  A= " << targetNucleus.GetN() << G4endl;
    254219    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;
    259220    G4Exception("G4HadronicProcess", "007", FatalException,
    260221    "ChooseHadronicInteraction failed.");
     
    276237      ++reentryCount;
    277238    }
    278     /*VI
    279     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*/
    299239    catch(G4HadronicException aR)
    300240    {
    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 
    307241      G4cout << "Call for " << theInteraction->GetModelName() << G4endl;
    308242      G4cout << "Target element "<<anElement->GetName()<<"  Z= "
    309243             << targetNucleus.GetZ() << "  A= " << targetNucleus.GetN() << G4endl;
    310244      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;
    315245      G4Exception("G4HadronicProcess", "007", FatalException,
    316246      "PostStepDoIt failed.");
     
    327257  while(!result);
    328258
    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 interaction
    336   //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 
    344259  result->SetTrafoToLab(thePro.GetTrafoToLab());
    345 
    346   /*VI
    347   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*/
    359260
    360261  ClearNumberOfInteractionLengthLeft();
     
    367268  }
    368269 
    369   /*VI
    370   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*/
    380270  // Put hadronic final state particles into G4ParticleChange
    381271
    382272  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  }
    388277  return theTotalResult;
    389278}
    390 
    391 #include <typeinfo>
    392279
    393280G4HadFinalState*
     
    452339  // loop over aResult, and decrement A, Z accordingly
    453340  // cash the max
    454   for(G4int i=0; i<aResult->GetNumberOfSecondaries(); i++)
     341  for(G4int i=0; i<aResult->GetNumberOfSecondaries(); ++i)
    455342  {
    456343    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;
    464354  }
    465355 
     
    513403  G4ThreeVector it(0., 0., 1.);
    514404
    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;
    526405  if(aR->GetStatusChange()==stopAndKill)
    527406  {
     
    555434      theTotalResult->ProposeParentWeight( XBiasSurvivalProbability()*aT.GetWeight() );
    556435      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();
    572437      G4double newE=aR->GetEnergyChange() + newM;
    573438      G4double newP=std::sqrt(newE*newE - newM*newM);
    574439      G4DynamicParticle * aNew =
    575       new G4DynamicParticle(aT.GetDefinition(), newE, newP*aR->GetMomentumChange());
     440      new G4DynamicParticle(aT.GetParticleDefinition(), newE, newP*aR->GetMomentumChange());
    576441      G4HadSecondary * theSec = new G4HadSecondary(aNew, newWeight);
    577442      aR->AddSecondary(theSec);
     
    583448      if(aR->GetEnergyChange()>-.5)
    584449      {
    585         /*
    586         if(go_wild(aR->GetEnergyChange()))
    587         {
    588           G4Exception("G4HadronicProcess", "007", FatalException,
    589           "track received NaN energy."); 
    590         }
    591         */
    592450        theTotalResult->ProposeEnergy(aR->GetEnergyChange());
    593451      }
     
    614472
    615473    G4double newKE = std::max(DBL_MIN, aR->GetEnergyChange());
    616     G4DynamicParticle* aNew = new G4DynamicParticle(aT.GetDefinition(),
     474    G4DynamicParticle* aNew = new G4DynamicParticle(aT.GetParticleDefinition(),
    617475                                                    aR->GetMomentumChange(),
    618476                                                    newKE);
     
    630488  if(aR->GetStatusChange() != stopAndKill)
    631489  {
    632     G4double newM=aT.GetDefinition()->GetPDGMass();
     490    G4double newM=aT.GetParticleDefinition()->GetPDGMass();
    633491    G4double newE=aR->GetEnergyChange() + newM;
    634492    G4double newP=std::sqrt(newE*newE - newM*newM);
     
    640498  }
    641499
    642   for(G4int i=0; i<aR->GetNumberOfSecondaries(); i++)
     500  for(G4int i=0; i<aR->GetNumberOfSecondaries(); ++i)
    643501  {
    644502    G4LorentzVector theM = aR->GetSecondary(i)->GetParticle()->Get4Momentum();
    645503    theM.rotate(rotation, it);
    646504    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     */
    661505    aR->GetSecondary(i)->GetParticle()->Set4Momentum(theM);
    662506    G4double time = aR->GetSecondary(i)->GetTime();
     
    669513    G4double newWeight = aT.GetWeight()*aR->GetSecondary(i)->GetWeight();
    670514    //static G4double pinelcount=0;
    671     if(xBiasOn) newWeight *= XBiasSecondaryWeight();
     515    if(xBiasOn) { newWeight *= XBiasSecondaryWeight(); }
    672516    // G4cout << "#### ParticleDebug "
    673517    // <<GetProcessName()<<" "
     
    681525    // <<G4endl;
    682526    track->SetWeight(newWeight);
    683     /*
    684     G4double trackDeb = track->GetKineticEnergy();
    685     if( (  trackDeb<0
    686       || (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     */
    695527    track->SetTouchableHandle(aT.GetTouchableHandle());
    696528    theTotalResult->AddSecondary(track);
     
    815647         << GetProcessName() << G4endl;
    816648  G4cout << "TrackID= "<< aTrack.GetTrackID() << "  ParentID= " << aTrack.GetParentID()
    817          << "  " << aTrack.GetDefinition()->GetParticleName() << G4endl;
     649         << "  " << aTrack.GetParticleDefinition()->GetParticleName() << G4endl;
    818650  G4cout << "Ekin(GeV)= " << aTrack.GetKineticEnergy()/CLHEP::GeV
    819651         << ";  direction= " << aTrack.GetMomentumDirection() << G4endl;
  • trunk/source/processes/hadronic/management/src/G4HadronicProcessStore.cc

    r1337 r1340  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HadronicProcessStore.cc,v 1.14 2010/04/21 17:55:25 dennis Exp $
    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 $
    2828//
    2929// -------------------------------------------------------------------
     
    9090  //     << "  Nextra= " << n_extra << G4endl;
    9191  if(n_proc > 0) {
    92     for (i=0; i<n_proc; i++) {
     92    for (i=0; i<n_proc; ++i) {
    9393      if( process[i] ) {
    9494        //G4cout << "G4HadronicProcessStore::Clean() delete hadronic " << i << G4endl;
     
    101101  }
    102102  if(n_extra > 0) {
    103     for(i=0; i<n_extra; i++) {
     103    for(i=0; i<n_extra; ++i) {
    104104      if(extraProcess[i]) {
    105105        //G4cout << "G4HadronicProcessStore::Clean() delete extra " 
     
    143143  const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
    144144  size_t nelm = material->GetNumberOfElements();
    145   for (size_t i=0; i<nelm; i++) {
     145  for (size_t i=0; i<nelm; ++i) {
    146146    const G4Element* elm = (*theElementVector)[i];
    147147    cross += theAtomNumDensityVector[i]*
     
    159159{
    160160  G4HadronicProcess* hp = FindProcess(aParticle, fHadronElastic);
     161  G4double cross = 0.0;
    161162  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  }
    166168  return cross;
    167169}
     
    188190  const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
    189191  size_t nelm = material->GetNumberOfElements();
    190   for (size_t i=0; i<nelm; i++) {
     192  for (size_t i=0; i<nelm; ++i) {
    191193    const G4Element* elm = (*theElementVector)[i];
    192194    cross += theAtomNumDensityVector[i]*
     
    204206{
    205207  G4HadronicProcess* hp = FindProcess(aParticle, fHadronInelastic);
    206   localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));
    207208  localDP.SetKineticEnergy(kineticEnergy);
    208209  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  }
    212215  return cross;
    213216}
     
    234237  const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
    235238  size_t nelm = material->GetNumberOfElements();
    236   for (size_t i=0; i<nelm; i++) {
     239  for (size_t i=0; i<nelm; ++i) {
    237240    const G4Element* elm = (*theElementVector)[i];
    238241    cross += theAtomNumDensityVector[i]*
     
    250253{
    251254  G4HadronicProcess* hp = FindProcess(aParticle, fCapture);
    252   localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));
    253255  localDP.SetKineticEnergy(kineticEnergy);
    254256  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  }
    258262  return cross;
    259263}
     
    296300{
    297301  G4HadronicProcess* hp = FindProcess(aParticle, fFission);
    298   localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));
    299302  localDP.SetKineticEnergy(kineticEnergy);
    300303  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  }
    304309  return cross;
    305310}
     
    326331  const G4double* theAtomNumDensityVector = material->GetVecNbOfAtomsPerVolume();
    327332  size_t nelm = material->GetNumberOfElements();
    328   for (size_t i=0; i<nelm; i++) {
     333  for (size_t i=0; i<nelm; ++i) {
    329334    const G4Element* elm = (*theElementVector)[i];
    330335    cross += theAtomNumDensityVector[i]*
     
    342347{
    343348  G4HadronicProcess* hp = FindProcess(aParticle, fChargeExchange);
    344   localDP.SetDefinition(const_cast<G4ParticleDefinition*>(aParticle));
    345349  localDP.SetKineticEnergy(kineticEnergy);
    346350  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  }
    350356  return cross;
    351357}
     
    366372{
    367373  if(0 < n_proc) {
    368     for(G4int i=0; i<n_proc; i++) {
     374    for(G4int i=0; i<n_proc; ++i) {
    369375      if(process[i] == proc) { return; }
    370376    }
     
    372378  //  G4cout << "G4HadronicProcessStore::Register hadronic " << n_proc
    373379  //     << "  " << proc->GetProcessName() << G4endl;
    374   n_proc++;
     380  ++n_proc;
    375381  process.push_back(proc);
    376382}
     
    382388{
    383389  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;}
    385391  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;}
    387393
    388394  if(j == n_part) {
    389     n_part++;
     395    ++n_part;
    390396    particle.push_back(part);
    391397    wasPrinted.push_back(0);
     
    398404      if(it->first == part) {
    399405        HP process = (it->second);
    400         if(proc == process) return;
     406        if(proc == process) { return; }
    401407      }
    402408    }
     
    412418{
    413419  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; }}
    415421  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; }}
    417423   
    418424  m_map.insert(std::multimap<HP,HI>::value_type(proc,mod));
    419425   
    420426  if(k == n_model) {
    421     n_model++;
     427    ++n_model;
    422428    model.push_back(mod);
    423429    modelName.push_back(mod->GetModelName());
     
    430436{
    431437  if(0 == n_proc) return;
    432   for(G4int i=0; i<n_proc; i++) {
     438  for(G4int i=0; i<n_proc; ++i) {
    433439    if(process[i] == proc) {
    434440      process[i] = 0;
     
    443449{
    444450  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; }
    447453    }
    448454  }
     
    461467{
    462468  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; } }
    464470  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; } }
    466472
    467473  if(j == n_part) {
    468     n_part++;
     474    ++n_part;
    469475    particle.push_back(part);
    470476    wasPrinted.push_back(0);
     
    477483      if(it->first == part) {
    478484        G4VProcess* process = (it->second);
    479         if(proc == process) return;
     485        if(proc == process) { return; }
    480486      }
    481487    }
     
    489495void G4HadronicProcessStore::DeRegisterExtraProcess(G4VProcess* proc)
    490496{
    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) {
    494500    if(extraProcess[i] == proc) {
    495501      extraProcess[i] = 0;
     
    521527             << ")" << G4endl;
    522528  }
    523   for(G4int i=0; i<n_part; i++) {
     529  for(G4int i=0; i<n_part; ++i) {
    524530    PD part = particle[i];
    525531    G4String pname = part->GetParticleName();
     
    545551          HP proc = (it->second);
    546552          G4int j=0;
    547           for(; j<n_proc; j++) {
     553          for(; j<n_proc; ++j) {
    548554            if(process[j] == proc) {
    549555              Print(j, i);
     
    597603      hi = ih->second;
    598604      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; }
    601607      }
    602608      if(!first) G4cout << "                              ";
     
    618624  verbose = val;
    619625  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); }
    625631  }
    626632}
     
    644650    isNew = true;
    645651    currentParticle = part;
    646     localDP.SetDefinition(const_cast<G4ParticleDefinition*>(part));
     652    localDP.SetDefinition(part);
    647653  } else if(!currentProcess) {
    648654    isNew = true;
     
    667673}
    668674
    669 
    670675void G4HadronicProcessStore::SetEpReportLevel(G4int level)
    671676{
    672677  G4cout << " Setting energy/momentum report level to " << level
    673678         << " 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) {
    675680    process[i]->SetEpReportLevel(level);
    676681  }
    677682}
    678 
    679683
    680684void G4HadronicProcessStore::SetProcessAbsLevel(G4double abslevel)
     
    683687  G4double rellevel = 0.0;
    684688  G4HadronicProcess* theProcess = 0;
    685   for (G4int i = 0; i < G4int(process.size()); i++) {
     689  for (G4int i = 0; i < G4int(process.size()); ++i) {
    686690    theProcess = process[i];
    687691    rellevel = theProcess->GetEnergyMomentumCheckLevels().first;
     
    690694}
    691695
    692 
    693696void G4HadronicProcessStore::SetProcessRelLevel(G4double rellevel)
    694697{
     
    696699  G4double abslevel = 0.0;
    697700  G4HadronicProcess* theProcess = 0;
    698   for (G4int i = 0; i < G4int(process.size()); i++) {
     701  for (G4int i = 0; i < G4int(process.size()); ++i) {
    699702    theProcess = process[i];
    700703    abslevel = theProcess->GetEnergyMomentumCheckLevels().second;
Note: See TracChangeset for help on using the changeset viewer.