Read binning from stream.
79 {
82
84
85 if (getFileStatus(is.str().c_str())) {
86 is.load();
87 }
88
89 for (string name; is >> name; ) {
90
91 if (name.back() ==
SEPARATOR) { name.pop_back(); }
92
94
95 for (char axis; is >> axis; ) {
96
97 if (axis != 'x' &&
98 axis != 'X' &&
99 axis != 'y' &&
100 axis != 'Y' &&
101 axis != 'z' &&
102 axis != 'Z') {
103 is.clear();
104 is.seekg(-1, ios::cur);
105 break;
106 }
107
108 axis = char(tolower(axis));
109
110 if (is.peek() == (
int)
SEPARATOR) { is.ignore(); }
111
113
114 for (double value; is >> value; ) {
115
116 vector<double>::const_iterator i = std::lower_bound(bins.cbegin(), bins.cend(), value);
117
118 if (i == bins.cend() || *i != value) {
119 bins.insert(i, value);
120 }
121 }
122
123 binsMap.insert(make_pair(axis, bins));
124
125 is.clear();
126 }
127
128 binning.insert(make_pair(name, binsMap));
129 }
130
131 return in;
132 }
Wrapper class around STL stringstream class to facilitate optional loading of data from file.
static const char SEPARATOR
Separator for axis label.
map_type::mapped_type mapped_type
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).