yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.0
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 443 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 522 of file ReaderUtils.h.

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

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 499 of file ReaderUtils.h.

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

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