Changeset 962 for trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPLabAngularEnergy.cc
- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPLabAngularEnergy.cc
r819 r962 28 28 // A prototype of the low energy neutron transport model. 29 29 // 30 // 080808 Bug fix in serching mu bin and index for theBuff2b by T. Koi 31 // 30 32 #include "G4NeutronHPLabAngularEnergy.hh" 31 33 #include "G4Gamma.hh" … … 111 113 { 112 114 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 { 121 if(it==0) G4cout << "080808 Something unexpected is happen in G4NeutronHPLabAngularEnergy " << G4endl; 117 122 // integrate the prob for each costh, and select theta. 118 123 G4double * running = new G4double [nCosTh[it]]; … … 130 135 if(random<running[i]) break; 131 136 } 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(); 137 144 } 138 145 else 139 146 { 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 ]; 142 152 G4double x = random; 143 153 G4double y1 = theData[it][ith-1].GetLabel(); … … 157 167 y1 = theData[it][ith-1].GetY(i); 158 168 y2 = theData[it][ith].GetY(mu); 169 159 170 y = theInt.Interpolate(theSecondManager[it].GetScheme(ith), 160 171 cosTh, x1,x2,y1,y2); … … 298 309 G4NeutronHPVector theBuff2b; 299 310 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); 305 321 y = theInt.Lin(x, x1,x2,y1,y2); 306 322 theBuff2b.SetData(i, E, y); // wrong E, right theta. … … 339 355 currentMeanEnergy = theOne.GetMeanX(); 340 356 } 341 357 342 358 // now do random direction in phi, and fill the result. 343 359
Note: See TracChangeset
for help on using the changeset viewer.