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

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterpolator.icc

    r1337 r1340  
     1#ifndef G4CASCADE_INTERPOLATOR_ICC
     2#define G4CASCADE_INTERPOLATOR_ICC
    13//
    24// ********************************************************************
     
    2426// ********************************************************************
    2527//
    26 // $Id: G4CascadeInterpolator.icc,v 1.6 2010/06/25 09:42:02 gunter Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     28// $Id: G4CascadeInterpolator.icc,v 1.8 2010/10/19 19:48:00 mkelsey Exp $
     29// GEANT4 tag $Name: hadr-casc-V09-03-85 $
    2830//
    2931// Author:  Michael Kelsey <kelsey@slac.stanford.edu>
     
    4345// 20100520  M. Kelsey -- Second bug fix:  Loop in bin search should start at
    4446//              i=1, not i=0 (since i-1 is the key).
     47// 20100803  M. Kelsey -- Add printBins() function for debugging
     48// 20101019  M. Kelsey -- CoVerity reports: recursive #include, index overrun
    4549
     50#include "globals.hh"
    4651#include "G4CascadeInterpolator.hh"
     52#include <iomanip>
    4753
    4854
     
    6672  } else {                              // Assume nBins small; linear search
    6773    int i;
    68     for (i=1; i<nBins && x>xBins[i]; i++) {;}   // Stops when x within bin i-1
     74    for (i=1; i<last && x>xBins[i]; i++) {;}    // Stops when x within bin i-1
    6975    xindex = i-1;
    7076    xbin = xBins[i] - xBins[i-1];
     
    102108  return (i==last) ? yb[last] : (yb[i] + frac*(yb[i+1]-yb[i]));
    103109}
     110
     111
     112// Print bin edges for debugging
     113
     114template <int NBINS>
     115void G4CascadeInterpolator<NBINS>::printBins() const {
     116  G4cout << " G4CascadeInterpolator<" << NBINS << "> : " << G4endl;
     117  for (G4int k=0; k<NBINS; k++) {
     118    G4cout << " " << std::setw(5) << xBins[k];
     119    if ((k+1)%12 == 0) G4cout << G4endl;
     120  }
     121  G4cout << G4endl;
     122}
     123
     124#endif  /* G4CASCADE_INTERPOLATOR_ICC */
Note: See TracChangeset for help on using the changeset viewer.