YODA::AOReader< BinnedDbn< DbnN, AxisT... > > Class Template Reference
Inheritance diagram for YODA::AOReader< BinnedDbn< DbnN, AxisT... > >:
![]()
Detailed Descriptiontemplate<size_t DbnN, typename... AxisT>
class YODA::AOReader< BinnedDbn< DbnN, AxisT... > > Definition at line 274 of file ReaderUtils.h. Member Function Documentation◆ assemble()
template<size_t DbnN, typename... AxisT>
Implements YODA::AOReaderBase. Definition at line 410 of file ReaderUtils.h. 410 {
411
412 auto args = std::tuple_cat(edges, std::make_tuple(path));
413 BaseT* ao = make_from_tuple(std::move(args));
414
415 size_t global_index = 0;
416 if constexpr (sizeof...(AxisT) == 2) {
417 if (isYODA1) { // 2D objects had no under-/overflows in Y1
418 for (size_t ix = 1; ix < ao->numBinsAt(0)+1; ++ix) { //< visible bins only
419 for (size_t iy = 1; iy < ao->numBinsAt(1)+1; ++iy) { //< visible bins only
420 ao->bin(ix,iy).set(std::move(dbns[global_index++]));
421 }
422 }
423 }
424 }
425 if ( !(isYODA1 && sizeof...(AxisT) == 2) ) { //< still works for Y1-style 1D
426 for (auto&& d : dbns) {
427 ao->bin(global_index++).set(std::move(d));
428 }
429 }
430
431 if constexpr (sizeof...(AxisT) == 1) { // YODA1-style overflows
432 if (isYODA1) ao->bin(global_index).set(yoda1Overflow);
433 yoda1Overflow = Dbn<DbnN>();
434 }
435
436 crossTerms.fill(0);
437 maskedBins.clear();
438 isYODA1 = false;
439 clearEdges<0>();
440 dbns.clear();
441 axisCheck = 0;
442 return ao;
443 }
References YODA::BinnedStorage< BinContentT, AxisT >::bin(), and YODA::BinnedStorage< BinContentT, AxisT >::numBinsAt(). ◆ parse()
template<size_t DbnN, typename... AxisT>
Implements YODA::AOReaderBase. Definition at line 360 of file ReaderUtils.h. 360 {
361 if (line.find("Total") != string::npos) {
362 isYODA1 = true;
363 return; // YODA1 backwards compatibility
364 }
365 if (!line.rfind("Edges(A", 0)) { // parse binning
366 readEdges<0>(line);
367 ++axisCheck;
368 return;
369 }
370 if (!line.rfind("MaskedBins: ", 0)) { // parse indices of masked bins
371 extractVector<size_t>(line, maskedBins);
372 return;
373 }
374 aiss.reset(line);
375 if (line.find("Underflow") != string::npos || line.find("Overflow") != string::npos) {
376 // This must be the YODA1-style format ...
377 if constexpr (sizeof...(AxisT) == 1) {
378 string tmp1, tmp2;
380 }
381 }
382 else if (isYODA1) readEdges<0>();
383 std::array<double,DbnN+1> sumW, sumW2;
384 readDbn<0>(sumW, sumW2);
385 for (size_t i = 0; i < crossTerms.size(); ++i) {
386 double tmp(0.);
387 aiss >> tmp;
388 crossTerms.at(i) = tmp;
389 }
390 double numEntries(0);
391 aiss >> numEntries;
392 if (line.find("Overflow") != string::npos) {
393 if constexpr (sizeof...(AxisT) == 1) {
394 if constexpr (DbnN < 2)
395 yoda1Overflow = Dbn<DbnN>(numEntries, sumW, sumW2);
396 else
397 yoda1Overflow = Dbn<DbnN>(numEntries, sumW, sumW2, crossTerms);
398 }
399 }
400 else {
401 if constexpr (DbnN < 2) {
402 dbns.emplace_back(numEntries, sumW, sumW2);
403 }
404 else {
405 dbns.emplace_back(numEntries, sumW, sumW2, crossTerms);
406 }
407 }
408 }
The documentation for this class was generated from the following file:
Generated on Sun Feb 9 2025 18:56:41 for YODA - Yet more Objects for Data Analysis by |