44void trim(std::string& line,
const std::string& trimChars)
47 if(line.length() == 0) {
50 std::size_t found = line.find_first_not_of(trimChars);
51 if(found != std::string::npos) {
52 line = line.substr(found, line.length());
54 found = line.find_last_not_of(trimChars);
55 if(found != std::string::npos) {
56 line = line.substr(0, found + 1);
63 line.erase(line.begin(), std::find_if(line.begin(), line.end(), [](
int ch) { return std::isspace(ch) == 0; }));
64 line.erase(std::find_if(line.rbegin(), line.rend(), [](
int ch) { return std::isspace(ch) == 0; }).base(), line.end());
69 if(fileName.length() == 0) {
72 std::size_t found = fileName.rfind(
".root");
73 if(found == std::string::npos) {
76 std::size_t found2 = fileName.rfind(
'-');
78 if(found2 == std::string::npos) {
79 found2 = fileName.rfind(
'_');
82 if(found2 == std::string::npos || fileName.compare(found2 + 4, 5,
".root") != 0) {
83 temp = fileName.substr(found - 5, 5);
85 temp = fileName.substr(found - 9, 5);
87 return atoi(temp.c_str());
92 if(fileName.length() == 0) {
96 std::size_t found = fileName.rfind(
'-');
97 if(found != std::string::npos) {
98 std::string temp = fileName.substr(found + 1, 3);
99 return atoi(temp.c_str());
101 found = fileName.rfind(
'_');
102 if(found != std::string::npos) {
103 std::string temp = fileName.substr(found + 1, 3);
104 return atoi(temp.c_str());