12 #ifndef CbmMuchSegmentSector_H
13 #define CbmMuchSegmentSector_H 1
16 #include <RtypesCore.h>
49 virtual InitStatus
Init();
63 std::map<Int_t, Int_t>
65 std::map<Int_t, std::vector<Double_t>>
67 std::map<Int_t, std::vector<Double_t>>
69 std::map<Int_t, std::vector<Double_t>>
71 std::map<Int_t, std::vector<Double_t>>
73 std::map<Int_t, Int_t>
75 std::map<Int_t, std::vector<Int_t>>
77 std::map<Int_t, std::vector<Int_t>>
114 std::string::size_type pos1 = str.find_first_not_of(
' ');
115 std::string::size_type pos2 = str.find_last_not_of(
' ');
116 str = str.substr(pos1 == std::string::npos ? 0 : pos1,
117 pos2 == std::string::npos ? str.length() - 1
123 return str[0] ==
'#' || str.length() == 0 || str[0] ==
'\0'
128 getline(infile, str);
130 getline(infile, str);
133 std::vector<std::string>&
134 Split(
const std::string& s,
char delim, std::vector<std::string>& elems) {
135 std::stringstream ss(s);
137 while (getline(ss, item, delim)) {
138 if (item.length() != 0) elems.push_back(item);
144 std::vector<std::string>
Split(
const std::string& s,
char delim) {
145 std::vector<std::string> elems;
146 return Split(s, delim, elems);
152 std::stringstream ss(str);
153 if ((ss >> number).fail() || !(ss >> std::ws).eof())
154 throw std::bad_cast();
155 }
catch (std::bad_cast exc) { Fatal(
"",
"Invalid cast.\n"); }