7 #include "CLHEP/Units/PhysicalConstants.h"
14 G4cout <<
"PhysicsConfigurationHelper constructor: start" << G4endl;
29 G4cout<<
"Read in physics parameters:"<<G4endl;
38 else G4cout<<
" s"<<G4endl;
40 G4cout<<
"Mixing = "<<
m_mixing*100 <<
" %"<<G4endl;
45 G4cout <<
"WARNING: Inconsistent treatment of R-Hadron properties! Lifetime of " <<
m_hadronlifetime
73 std::ifstream physics_stream (
"PhysicsConfiguration.txt");
76 while (getline(physics_stream,
line)) {
77 std::vector<G4String>
tokens;
84 physics_stream.close();
89 std::vector<G4String>&
tokens,
90 const G4String& delimiters)
const
93 G4String::size_type lastPos =
str.find_first_not_of(delimiters, 0);
94 if (lastPos==G4String::npos)
return;
97 G4String::size_type
pos =
str.find_first_of(delimiters, lastPos);
99 while (G4String::npos !=
pos || G4String::npos != lastPos)
102 G4String temp =
str.substr(lastPos,
pos - lastPos);
103 while(temp.c_str()[0] ==
' ') temp.erase(0,1);
104 while(temp[temp.size()-1] ==
' ') temp.erase(temp.size()-1,1);
107 tokens.push_back(std::move(temp));
110 lastPos =
str.find_first_not_of(delimiters,
pos);
111 if (lastPos==G4String::npos)
continue;
114 pos =
str.find_first_of(delimiters, lastPos);