yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.0
Scatter.cc
Go to the documentation of this file.
1#include "YODA/Scatter.h"
2#include "YODA/Counter.h"
3
4namespace YODA {
5
6
9 Scatter1D rtn;
10 for (const std::string& a : c.annotations())
11 rtn.setAnnotation(a, c.annotation(a));
12 rtn.setAnnotation("Type", c.type()); // might override the copied ones
13 Point1D pt(c.val(), c.err());
14 rtn.addPoint(pt);
15 return rtn;
16 }
17
18}
virtual std::string type() const
Get name of the analysis object type.
void setAnnotation(const std::string &name, const T &value)
Add or set an annotation by name (templated for remaining types)
std::vector< std::string > annotations() const
const std::string & annotation(const std::string &name) const
Get an annotation by name (as a string)
A weighted counter.
Definition Counter.h:26
double err() const
Definition Counter.h:193
double val(bool=false) const
Get the value.
Definition Counter.h:189
A 1D data point to be contained in a Scatter1D.
Definition Point.h:544
A generic data type which is just a collection of n-dim data points with errors.
Definition Scatter.h:154
ScatterND< N > & addPoint(const PointND< N > &pt)
Insert a new point.
Definition Scatter.h:369
Anonymous namespace to limit visibility.
Scatter1D mkScatter(const Counter &c)
Make a Scatter1D representation of a Histo1D.
Definition Scatter.cc:8