Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (14 years ago)
Author:
garnier
Message:

geant4 tag 9.4

Location:
trunk/source/processes/hadronic/models/neutron_hp/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPCaptureFS.cc

    r962 r1347  
    3131// 26-January-07 Add G4NEUTRONHP_USE_ONLY_PHOTONEVAPORATION flag
    3232// 081024 G4NucleiPropertiesTable:: to G4NucleiProperties::
     33// 101203 Bugzilla/Geant4 Problem 1155 Lack of residual in some case
    3334//
    3435#include "G4NeutronHPCaptureFS.hh"
     
    4344  G4HadFinalState * G4NeutronHPCaptureFS::ApplyYourself(const G4HadProjectile & theTrack)
    4445  {
     46
    4547    G4int i;
    4648    theResult.Clear();
     
    108110    }
    109111
     112
     113
    110114// add them to the final state
    111115
     
    114118    G4int nParticles = nPhotons;
    115119    if(1==nPhotons) nParticles = 2;
     120
     121
     122//Make at least one photon 
     123//101203 TK
     124    if ( nPhotons == 0 )
     125    {
     126       G4ReactionProduct * theOne = new G4ReactionProduct;
     127       theOne->SetDefinition( G4Gamma::Gamma() );
     128       G4double theta = pi*G4UniformRand();
     129       G4double phi = twopi*G4UniformRand();
     130       G4double sinth = std::sin(theta);
     131       G4ThreeVector direction( sinth*std::cos(phi), sinth*std::sin(phi), std::cos(theta) );
     132       theOne->SetMomentum( direction ) ;
     133       thePhotons->push_back(theOne);
     134       nPhotons++; // 0 -> 1
     135    }
     136//One photon case: energy set to Q-value
     137//101203 TK
     138    if ( nPhotons == 1 )
     139    {
     140       G4ThreeVector direction = thePhotons->operator[](0)->GetMomentum().unit();
     141       G4double Q = G4ParticleTable::GetParticleTable()->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA), 0, static_cast<G4int>(theBaseZ))->GetPDGMass() + G4Neutron::Neutron()->GetPDGMass()
     142         - G4ParticleTable::GetParticleTable()->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ))->GetPDGMass();
     143       thePhotons->operator[](0)->SetMomentum( Q*direction );
     144    }
     145//
    116146
    117147    // back to lab system
     
    156186    }
    157187    delete thePhotons;
     188
     189//101203TK
     190    G4bool residual = false;
     191    G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable()
     192                                   ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ));
     193    for ( G4int i = 0 ; i != theResult.GetNumberOfSecondaries() ; i++ )
     194    {
     195       if ( theResult.GetSecondary(i)->GetParticle()->GetDefinition() == aRecoil ) residual = true;
     196    }
     197
     198    if ( residual == false )
     199    {
     200       G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable()
     201                                        ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ));
     202       G4int nNonZero = 0;
     203       G4LorentzVector p_photons(0,0,0,0);
     204       for ( G4int i = 0 ; i != theResult.GetNumberOfSecondaries() ; i++ )
     205       {
     206          p_photons += theResult.GetSecondary(i)->GetParticle()->Get4Momentum();
     207          // To many 0 momentum photons -> Check PhotonDist
     208          if ( theResult.GetSecondary(i)->GetParticle()->Get4Momentum() > 0 ) nNonZero++;
     209       }
     210
     211       // Can we include kinetic energy here?
     212       G4double deltaE = ( theTrack.Get4Momentum().e() + theTarget.GetTotalEnergy() )
     213                       - ( p_photons.e() + aRecoil->GetPDGMass() );
     214
     215//Add photons
     216       if ( nPhotons - nNonZero > 0 )
     217       {
     218              //G4cout << "TKDB G4NeutronHPCaptureFS::ApplyYourself we will create additional " << nPhotons - nNonZero << " photons" << G4endl;
     219          std::vector<G4double> vRand;
     220          vRand.push_back( 0.0 );
     221          for ( G4int i = 0 ; i != nPhotons - nNonZero - 1 ; i++ )
     222          {
     223             vRand.push_back( G4UniformRand() );
     224          }
     225          vRand.push_back( 1.0 );
     226          std::sort( vRand.begin(), vRand.end() );
     227
     228          std::vector<G4double> vEPhoton;
     229          for ( G4int i = 0 ; i < (G4int)vRand.size() - 1 ; i++ )
     230          {
     231             vEPhoton.push_back( deltaE * ( vRand[i+1] - vRand[i] ) );
     232          }
     233          std::sort( vEPhoton.begin(), vEPhoton.end() );
     234
     235          for ( G4int i = 0 ; i < nPhotons - nNonZero - 1 ; i++ )
     236          {
     237             //Isotopic in LAB OK?
     238             G4double theta = pi*G4UniformRand();
     239             G4double phi = twopi*G4UniformRand();
     240             G4double sinth = std::sin(theta);
     241             G4double en = vEPhoton[i];
     242             G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
     243             
     244             p_photons += G4LorentzVector ( tempVector, tempVector.mag() );
     245             G4DynamicParticle * theOne = new G4DynamicParticle;
     246             theOne->SetDefinition( G4Gamma::Gamma() );
     247             theOne->SetMomentum( tempVector );
     248             theResult.AddSecondary(theOne);
     249          }
     250
     251//        Add last photon
     252          G4DynamicParticle * theOne = new G4DynamicParticle;
     253          theOne->SetDefinition( G4Gamma::Gamma() );
     254//        For better momentum conservation
     255          G4ThreeVector lastPhoton = -p_photons.vect().unit()*vEPhoton.back();
     256          p_photons += G4LorentzVector( lastPhoton , lastPhoton.mag() );
     257          theOne->SetMomentum( lastPhoton );
     258          theResult.AddSecondary(theOne);
     259       }
     260
     261//Add residual
     262       G4DynamicParticle * theOne = new G4DynamicParticle;
     263       G4ThreeVector aMomentum = theTrack.Get4Momentum().vect() + theTarget.GetMomentum()
     264                               - p_photons.vect();
     265       theOne->SetDefinition(aRecoil);
     266       theOne->SetMomentum( aMomentum );
     267       theResult.AddSecondary(theOne);
     268
     269    }
     270//101203TK END
     271
    158272// clean up the primary neutron
    159273    theResult.SetStatusChange(stopAndKill);
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPDiscreteTwoBody.cc

    r962 r1347  
    3030//080612 Bug fix contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #2,3
    3131//080709 Bug fix Sampling Legendre expansion by T. Koi   
     32//101110 Bug fix in MF=6, LAW=2 case; contribution from E. Mendoza, D. Cano-Ott (CIEMAT)
    3233//
    3334#include "G4NeutronHPDiscreteTwoBody.hh"
     
    111112       for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    112113       {
    113          theStore.SetX(i, theCoeff[it].GetCoeff(i));
    114          theStore.SetY(i, theCoeff[it].GetCoeff(i));
     114         //101110
     115         //theStore.SetX(i, theCoeff[it].GetCoeff(i));
     116         //theStore.SetY(i, theCoeff[it].GetCoeff(i));
     117         theStore.SetX(i/2, theCoeff[it].GetCoeff(i));
     118         theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1));
    115119         i++;
    116120       }
     
    125129       for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    126130       {
    127          theStore.SetX(i, theCoeff[it].GetCoeff(i));
    128          theStore.SetY(i, theCoeff[it].GetCoeff(i));
     131         //101110
     132         //theStore.SetX(i, theCoeff[it].GetCoeff(i));
     133         //theStore.SetY(i, theCoeff[it].GetCoeff(i));
     134         theStore.SetX(i/2, theCoeff[it].GetCoeff(i));
     135         theStore.SetY(i/2, theCoeff[it].GetCoeff(i+1));
    129136         i++;
    130137       }
     
    161168         for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++)
    162169         {
    163            theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
    164            theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     170           //101110
     171           //theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
     172           //theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     173           theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i));
     174           theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
    165175           i++;
    166176         }
     
    171181         for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    172182         {
     183           //theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
     184           //theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
    173185           theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
    174            theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
     186           theBuff2.SetY(i, theCoeff[it].GetCoeff(i+1));
    175187           i++;
    176188         }
     
    215227         for(i=0;i<theCoeff[it-1].GetNumberOfPoly(); i++)
    216228         {
    217            theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
    218            theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     229           //101110
     230           //theBuff1.SetX(i, theCoeff[it-1].GetCoeff(i));
     231           //theBuff1.SetY(i, theCoeff[it-1].GetCoeff(i));
     232           theBuff1.SetX(i/2, theCoeff[it-1].GetCoeff(i));
     233           theBuff1.SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
    219234           i++;
    220235         }
     
    226241         for(i=0;i<theCoeff[it].GetNumberOfPoly(); i++)
    227242         {
    228            theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
    229            theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
     243           //101110
     244           //theBuff2.SetX(i, theCoeff[it].GetCoeff(i));
     245           //theBuff2.SetY(i, theCoeff[it].GetCoeff(i));
     246           theBuff2.SetX(i/2, theCoeff[it].GetCoeff(i));
     247           theBuff2.SetY(i/2, theCoeff[it].GetCoeff(i+1));
    230248           i++;
    231249         }
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPFinalState.cc

    r968 r1347  
    2727//080721 Create adjust_final_state method by T. Koi
    2828//080801 Residual reconstruction with theNDLDataA,Z (A, Z, and momentum are adjusted) by T. Koi
     29//101110 Set lower limit for gamma energy(1keV) by T. Koi
    2930
    3031#include "G4NeutronHPFinalState.hh"
     
    3738void G4NeutronHPFinalState::adjust_final_state ( G4LorentzVector init_4p_lab )
    3839{
     40
     41   G4double minimum_energy = 1*keV;
    3942
    4043   if ( adjustResult != true ) return;
     
    175178
    176179      // Adjust p
    177       if ( dif_4p.v().mag() < 1*MeV )
     180      //if ( dif_4p.v().mag() < 1*MeV )
     181      if ( minimum_energy < dif_4p.v().mag() && dif_4p.v().mag() < 1*MeV )
    178182      {
    179183
     
    184188      else
    185189      {
    186          //G4cout << "HP_DB Difference in dif_p is too large (>1MeV) to adjust, so that give up tuning" << G4endl;
     190         //G4cout << "HP_DB Difference in dif_p is too large (>1MeV) or too small(<1keV) to adjust, so that give up tuning" << G4endl;
    187191      }
    188192
     
    213217      nSecondaries += 2;
    214218      G4double e1 = ( dif_4p.e() -dif_4p.v().mag() ) / 2;
    215       G4double costh = 2.*G4UniformRand()-1.;
    216       G4double phi = twopi*G4UniformRand();
    217       G4ThreeVector dir( std::sin(std::acos(costh))*std::cos(phi),
    218                          std::sin(std::acos(costh))*std::sin(phi),
    219                          costh);
    220       theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , e1*dir ) );   
    221       theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , -e1*dir ) );   
     219     
     220      if ( minimum_energy < e1 ) 
     221      {
     222         G4double costh = 2.*G4UniformRand()-1.;
     223         G4double phi = twopi*G4UniformRand();
     224         G4ThreeVector dir( std::sin(std::acos(costh))*std::cos(phi),
     225                            std::sin(std::acos(costh))*std::sin(phi),
     226                            costh);
     227         theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , e1*dir ) );   
     228         theResult.AddSecondary ( new G4DynamicParticle ( G4Gamma::Gamma() , -e1*dir ) );   
     229      }
     230      else
     231      {
     232         //G4cout << "HP_DB Difference is too small(<1keV) to adjust, so that neglect it" << G4endl;
     233      }
    222234
    223235   }
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticBaseFS.cc

    r962 r1347  
    3131//        Introduce theNDLDataA,Z which has A and Z of NDL data by T. Koi
    3232// 081024 G4NucleiPropertiesTable:: to G4NucleiProperties::
     33// 101111 Add Special treatment for Be9(n,2n)Be8(2a) case by T. Koi
    3334//
    3435#include "G4NeutronHPInelasticBaseFS.hh"
     
    360361  else if(theEnergyAngData!=0)
    361362  {
     363
    362364    G4double theGammaEnergy = theEnergyAngData->GetTotalMeanEnergy();
    363365    G4double anEnergy = boosted.GetKineticEnergy();
     
    371373    G4double eBindHe3 = G4NucleiProperties::GetBindingEnergy(3,2);
    372374    G4double eBindA = G4NucleiProperties::GetBindingEnergy(4,2);
     375    G4int ia=0;
    373376    for(i=0; i<tmpHadrons->size(); i++)
    374377    {
     
    396399      {
    397400        eBindProducts+=eBindA;
    398       }
    399     }
     401        ia++;
     402      }
     403    }
     404
    400405    theGammaEnergy += eBindProducts;
     406
     407//101111
     408//Special treatment for Be9 + n -> 2n + Be8 -> 2n + a + a
     409if ( (G4int)(theBaseZ+eps) == 4 && (G4int)(theBaseA+eps) == 9 )
     410{
     411   // This only valid for G4NDL3.13,,,
     412   if ( std::abs( theNuclearMassDifference -   
     413        ( G4NucleiProperties::GetBindingEnergy( 8 , 4 ) -
     414        G4NucleiProperties::GetBindingEnergy( 9 , 4 ) ) ) < 1*keV
     415      && ia == 2 )
     416   {
     417      theGammaEnergy -= (2*eBindA);
     418   }
     419}
    401420   
    402421    G4ReactionProductVector * theOtherPhotons = 0;
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticCompFS.cc

    r1340 r1347  
    4141//        add two_body_reaction
    4242// 100909 add safty
     43// 101111 add safty for _nat_ data case in Binary reaction, but break conservation 
    4344//
    4445#include "G4NeutronHPInelasticCompFS.hh"
     
    681682   G4double AA = hadron->GetDefinition()->GetPDGMass() / proj->GetDefinition()->GetPDGMass();
    682683   G4double E1 = proj->GetKineticEnergy();
    683    G4double beta = std::sqrt ( A*(A+1-AA)/AA*(1+(1+A)/A*Q/E1) );
     684
     685// 101111
     686// In _nat_ data (Q+E1) could become negative value, following line is safty for this case.
     687   //if ( (Q+E1) < 0 )
     688   if ( ( 1 + (1+A)/A*Q/E1 ) < 0 )
     689   {
     690// 1.0e-6 eV is additional safty for numeric precision
     691      Q = -( A/(1+A)*E1 ) + 1.0e-6*eV;
     692   }
     693
     694   G4double beta = std::sqrt ( A*(A+1-AA)/AA*( 1 + (1+A)/A*Q/E1 ) );
    684695   G4double gamma = AA/(A+1-AA)*beta;
    685696   G4double E3 = AA/std::pow((1+A),2)*(beta*beta+1+2*beta*mu)*E1;
  • trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPPhotonDist.cc

    r1055 r1347  
    3939//        Contribution from Chao Zhang (Chao.Zhang@usd.edu) and Dongming Mei(Dongming.Mei@usd.edu)
    4040//        But it looks like never cause real effect in G4NDL3.13 (at least Natural elements) TK
     41// 101111 Change warning message for "repFlag == 2 && isoFlag != 1" case
    4142//
    4243// there is a lot of unused (and undebugged) code in this file. Kept for the moment just in case. @@
     
    124125  if (isoFlag != 1)
    125126  {
    126 if ( repFlag == 2 ) G4cout << "TKDB repFlag == 2 && isoFlag !=1  " << G4endl;
     127if ( repFlag == 2 ) G4cout << "G4NeutronHPPhotonDist: repFlag == 2 && isoFlag != 1 is unexpected! If you use G4ND3.x, then please report to Geant4 Hyper News. Thanks." << G4endl;
    127128    aDataFile >> tabulationType >> nDiscrete2 >> nIso;
    128129//080731
Note: See TracChangeset for help on using the changeset viewer.