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

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/persistency/ascii/src/G4tgrUtils.cc

    r1035 r1347  
    7878G4bool G4tgrUtils::IsNumber( const G4String& str)
    7979{
    80   G4int isnum = 1;
     80  G4int isnum = true;
    8181  G4int numE = 0;
    8282  for(size_t ii=0; ii<str.length(); ii++)
     
    9090        if(numE != 0 || ii == str.length()-1)
    9191        {
    92           isnum = 0;
     92          isnum = false;
    9393          break;
    9494        }
     
    9797      else
    9898      {
    99         isnum = 0;
     99        isnum = false;
    100100        break;
    101101      }
     
    123123void G4tgrUtils::Dump3v( const G4ThreeVector& vec, const char* msg)
    124124{
    125   G4cout << msg << std::setprecision(8) << vec << G4endl;
     125  G4cout << msg << std::setprecision(8)
     126         << vec << std::setprecision(6) << G4endl;
    126127}
    127128
     
    346347        //----- Check if it is a function
    347348        G4bool bWordOK = false;     
    348         if( G4tgrUtils::WordIsFunction( word ) )
     349        if( G4tgrUtils::IsFunction( word ) )
    349350        {
    350351          //--- It must be followed by '('
     
    360361        //----- Check if it is a unit     
    361362        }
    362         else if( G4tgrUtils::WordIsUnit( word ) )
     363        else if( !G4tgrUtils::IsNumber( word ) )
    363364        {
    364365          //--- It must be preceded by a *
     
    550551
    551552//-------------------------------------------------------------
    552 G4bool G4tgrUtils::WordIsUnit( const G4String& word )
    553 {
    554   return !IsNumber(word);
    555   if(    word == "mm"
    556       || word == "cm"
    557       || word == "m"
    558       || word == "km"
    559       || word == "millimeter"
    560       || word == "centimeter"
    561       || word == "meter"
    562       || word == "kilometer"
    563       || word == "parsec"
    564       || word == "micrometer"
    565       || word == "nanometer"
    566       || word == "angstrom"
    567       || word == "fermi"
    568       || word == "nm"
    569       || word == "um"
    570       || word == "pc"
    571       || word == "radian"
    572       || word == "milliradian"
    573       || word == "degree"
    574       || word == "rad"
    575       || word == "mrad"
    576       || word == "deg"
    577       || word == "ns"
    578       || word == "curie"
    579       || word == "curie"   )
    580   {
    581     return true;
    582   }
    583   else
    584   {
    585     return false;
    586   }
    587 }
    588 
    589 
    590 //-------------------------------------------------------------
    591 G4bool G4tgrUtils::WordIsFunction( const G4String& word )
     553G4bool G4tgrUtils::IsFunction( const G4String& word )
    592554{
    593555  if(    word == "sin"
Note: See TracChangeset for help on using the changeset viewer.