yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.3
YODA::AOReader< BinnedEstimate< AxisT... > > Class Template Reference

#include <ReaderUtils.h>

Inheritance diagram for YODA::AOReader< BinnedEstimate< AxisT... > >:
YODA::AOReaderBase

Public Member Functions

void parse (const string &line)
 
AnalysisObjectassemble (const string &path="")
 
- Public Member Functions inherited from YODA::AOReaderBase
 AOReaderBase ()
 Default constructor.
 
virtual ~AOReaderBase ()
 Default destructor.
 
template<typename T >
void extractVector (const std::string &line, std::vector< T > &vec)
 

Additional Inherited Members

- Protected Attributes inherited from YODA::AOReaderBase
aistringstream aiss
 

Detailed Description

template<typename... AxisT>
class YODA::AOReader< BinnedEstimate< AxisT... > >

Definition at line 448 of file ReaderUtils.h.

Member Function Documentation

◆ assemble()

template<typename... AxisT>
AnalysisObject * YODA::AOReader< BinnedEstimate< AxisT... > >::assemble ( const string &  path = "")
inlinevirtual

Implements YODA::AOReaderBase.

Definition at line 527 of file ReaderUtils.h.

527 {
528
529 auto args = std::tuple_cat(edges, std::make_tuple(path));
530 BaseT* ao = make_from_tuple(std::move(args));
531
532 size_t global_index = 0;
533 for (auto&& e : estimates) {
534 ao->bin(global_index++) = std::move(e);
535 }
536
537 clearEdges<0>();
538 sources.clear();
539 estimates.clear();
540 maskedBins.clear();
541 axisCheck = 0;
542 return ao;
543 }

References YODA::BinnedStorage< BinContentT, AxisT >::bin().

◆ parse()

template<typename... AxisT>
void YODA::AOReader< BinnedEstimate< AxisT... > >::parse ( const string &  line)
inlinevirtual

Implements YODA::AOReaderBase.

Definition at line 504 of file ReaderUtils.h.

504 {
505 if (!line.rfind("Edges(A", 0)) { // parse binning
506 readEdges<0>(line);
507 ++axisCheck;
508 return;
509 }
510 if (!line.rfind("MaskedBins: ", 0)) { // parse indices of masked bins
511 extractVector<size_t>(line, maskedBins);
512 return;
513 }
514 if (!line.rfind("ErrorLabels: ", 0)) { // parse error labels
515 extractVector<std::string>(line, sources);
516 return;
517 }
518 // parse bin content
519 aiss.reset(line);
520 double val(0);
521 aiss >> val;
522 std::map<string,std::pair<double,double>> errors;
523 readErrors(errors);
524 estimates.emplace_back(val, errors);
525 }
aistringstream aiss

The documentation for this class was generated from the following file: