Changeset 1347 for trunk/source/persistency/ascii/src/G4tgrUtils.cc
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/persistency/ascii/src/G4tgrUtils.cc
r1035 r1347 78 78 G4bool G4tgrUtils::IsNumber( const G4String& str) 79 79 { 80 G4int isnum = 1;80 G4int isnum = true; 81 81 G4int numE = 0; 82 82 for(size_t ii=0; ii<str.length(); ii++) … … 90 90 if(numE != 0 || ii == str.length()-1) 91 91 { 92 isnum = 0;92 isnum = false; 93 93 break; 94 94 } … … 97 97 else 98 98 { 99 isnum = 0;99 isnum = false; 100 100 break; 101 101 } … … 123 123 void G4tgrUtils::Dump3v( const G4ThreeVector& vec, const char* msg) 124 124 { 125 G4cout << msg << std::setprecision(8) << vec << G4endl; 125 G4cout << msg << std::setprecision(8) 126 << vec << std::setprecision(6) << G4endl; 126 127 } 127 128 … … 346 347 //----- Check if it is a function 347 348 G4bool bWordOK = false; 348 if( G4tgrUtils:: WordIsFunction( word ) )349 if( G4tgrUtils::IsFunction( word ) ) 349 350 { 350 351 //--- It must be followed by '(' … … 360 361 //----- Check if it is a unit 361 362 } 362 else if( G4tgrUtils::WordIsUnit( word ) )363 else if( !G4tgrUtils::IsNumber( word ) ) 363 364 { 364 365 //--- It must be preceded by a * … … 550 551 551 552 //------------------------------------------------------------- 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 ) 553 G4bool G4tgrUtils::IsFunction( const G4String& word ) 592 554 { 593 555 if( word == "sin"
Note: See TracChangeset
for help on using the changeset viewer.