Ignore:
Timestamp:
Apr 6, 2009, 12:30:29 PM (15 years ago)
Author:
garnier
Message:

update processes

File:
1 edited

Legend:

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

    r819 r962  
    2828// A prototype of the low energy neutron transport model.
    2929//
     30// 080808 Bug fix in serching mu bin and index for theBuff2b by T. Koi
     31//
    3032#include "G4NeutronHPLabAngularEnergy.hh"
    3133#include "G4Gamma.hh"
     
    111113   {
    112114     it = i;
    113      if(anEnergy<theEnergies[i]) break;
    114    }
    115    if(it==0 || it == nEnergies-1) // it marks the energy bin
    116    {
     115     if ( anEnergy < theEnergies[i] ) break;
     116   }
     117   //080808
     118   //if ( it == 0 || it == nEnergies-1 ) // it marks the energy bin
     119   if ( it == 0 ) // it marks the energy bin
     120   {
     121if(it==0) G4cout << "080808 Something unexpected is happen in G4NeutronHPLabAngularEnergy " << G4endl;
    117122     // integrate the prob for each costh, and select theta.
    118123     G4double * running = new G4double [nCosTh[it]];
     
    130135       if(random<running[i]) break;
    131136     }
    132      if(ith==0 || ith==nCosTh[it]-1)
    133      {
    134        cosTh = theData[it][ith].GetLabel();
    135        secEnergy = theData[it][ith].Sample();
    136        currentMeanEnergy = theData[it][ith].GetMeanX();
     137     //080807
     138     //if ( ith == 0 || ith == nCosTh[it]-1 ) //ith marks the angluar bin
     139     if ( ith == 0 ) //ith marks the angluar bin
     140     {
     141        cosTh = theData[it][ith].GetLabel();
     142        secEnergy = theData[it][ith].Sample();
     143        currentMeanEnergy = theData[it][ith].GetMeanX();
    137144     }
    138145     else
    139146     {
    140        G4double x1 = theData[it][ith-1].GetIntegral();
    141        G4double x2 = theData[it][ith].GetIntegral();
     147       //080808
     148       //G4double x1 = theData[it][ith-1].GetIntegral();
     149       //G4double x2 = theData[it][ith].GetIntegral();
     150       G4double x1 = running [ ith-1 ];
     151       G4double x2 = running [ ith ];
    142152       G4double x = random;
    143153       G4double y1 = theData[it][ith-1].GetLabel();
     
    157167         y1 = theData[it][ith-1].GetY(i);
    158168         y2 = theData[it][ith].GetY(mu);
     169
    159170         y = theInt.Interpolate(theSecondManager[it].GetScheme(ith),
    160171                                cosTh, x1,x2,y1,y2);
     
    298309     G4NeutronHPVector theBuff2b;
    299310     theBuff2b.SetInterpolationManager(theData[it][i2].GetInterpolationManager());
    300      for(i=0;i<theData[it][i1].GetVectorLength(); i++)
    301      {
    302        E = theData[it][i1].GetX(i);
    303        y1 = theData[it][i1-1].GetY(E);
    304        y2 = theData[it][i1].GetY(i);
     311     //080808  i1 -> i2
     312     //for(i=0;i<theData[it][i1].GetVectorLength(); i++)
     313     for(i=0;i<theData[it][i2].GetVectorLength(); i++)
     314     {
     315       //E = theData[it][i1].GetX(i);
     316       //y1 = theData[it][i1-1].GetY(E);
     317       //y2 = theData[it][i1].GetY(i);
     318       E = theData[it][i2].GetX(i);
     319       y1 = theData[it][i2-1].GetY(E);
     320       y2 = theData[it][i2].GetY(i);
    305321       y = theInt.Lin(x, x1,x2,y1,y2);
    306322       theBuff2b.SetData(i, E, y); // wrong E, right theta.
     
    339355     currentMeanEnergy = theOne.GetMeanX();
    340356   }
    341    
     357
    342358// now do random direction in phi, and fill the result.
    343359
Note: See TracChangeset for help on using the changeset viewer.