166 {
167 std::string help;
168 help = "";
169 std::getline(in, help, '\t');
170 if (help.length() < 2) {return in;}
171 dset.exp = std::stoi(help);
172 help = "";
173 std::getline(in, help, '\t');
174 dset.run = std::stoi(help);
175 help = "";
176 std::getline(in, help, '\t');
177 dset.subrun = std::stoi(help);
178 help = "";
179 std::getline(in, help, '\t');
180 dset.evt = std::stoi(help);
181 help = "";
182 std::getline(in, help, '\t');
183 dset.track = std::stoi(help);
184 help = "";
185 std::getline(in, help, '\t');
186 dset.ntracks = std::stoi(help);
187 help = "";
188 std::getline(in, help, '\t');
189 dset.expert = std::stoul(help);
190
191 std::string insize = "";
192 std::string outsize = "";
193 std::getline(in, insize, '\t');
194 if (std::stoul(insize) != inLen) {
195 B2ERROR("Input and output format of neurotrigger training data does not match!");
196 }
197 std::getline(in, outsize, '\t');
198 if (std::stoul(outsize) != outLen) {
199 B2ERROR("Input and output format of neurotrigger training data does not match!");
200 }
201 for (unsigned i = 0; i < inLen; ++i) {
202 help = "";
203 std::getline(in, help, '\t');
204 try {
205 dset.input[i] = std::stof(help);
206 } catch (const std::out_of_range& oor) {
207 B2WARNING("out of range error: " << help << " is not in float range!");
208 dset.input[i] = 0.;
209 }
210 }
211 for (unsigned i = 0; i < outLen; ++i) {
212 help = "";
213 std::getline(in, help, '\t');
214 try {
215 dset.target[i] = std::stof(help);
216 } catch (const std::out_of_range& oor) {
217 B2WARNING("out of range error: " << help << " is not in float range!");
218 dset.target[i] = 0.;
219 }
220 }
221 help = "";
222 std::getline(in, help, '\t');
223 dset.nnscalez = std::stof(help);
224 help = "";
225 std::getline(in, help, '\t');
226 dset.nnrawz = std::stoi(help);
227 help = "";
228 std::getline(in, help, '\t');
229 dset.nnscaletheta = std::stof(help);
230 help = "";
231 std::getline(in, help, '\t');
232 dset.nnrawtheta = std::stoi(help);
233 help = "";
234 std::getline(in, help, '\t');
235 dset.inphi = std::stof(help);
236 help = "";
237 std::getline(in, help, '\t');
238 dset.intheta = std::stof(help);
239 help = "";
240 std::getline(in, help, '\t');
241 dset.ininvpt = std::stof(help);
242 help = "";
243 return in;
244 }