YODA is hosted by Hepforge, IPPP Durham

Persistency writer for YODA flat text format. More...

#include <WriterYODA.h>

Inheritance diagram for YODA::WriterYODA:
YODA::Writer

Static Public Member Functions

static Writercreate ()
 Singleton creation function. More...
 
Writing a single analysis object.
static void write (std::ostream &stream, const AnalysisObject &ao)
 Write out object ao to output stream stream. More...
 
static void write (const std::string &filename, const AnalysisObject &ao)
 Write out object ao to file filename. More...
 
Writing multiple analysis objects by collection.
static void write (std::ostream &stream, const std::vector< AnalysisObject * > &aos)
 Write out a collection of objects objs to output stream stream. More...
 
static void write (const std::string &filename, const std::vector< AnalysisObject * > &aos)
 Write out a collection of objects objs to file filename. More...
 
static void write (std::ostream &stream, const std::list< AnalysisObject * > &aos)
 Write out a collection of objects objs to output stream stream. More...
 
static void write (const std::string &filename, const std::list< AnalysisObject * > &aos)
 Write out a collection of objects objs to file filename. More...
 
static void write (std::ostream &stream, const std::set< AnalysisObject * > &aos)
 Write out a collection of objects objs to output stream stream. More...
 
static void write (const std::string &filename, const std::set< AnalysisObject * > &aos)
 Write out a collection of objects objs to file filename. More...
 
static void write (std::ostream &stream, const std::deque< AnalysisObject * > &aos)
 Write out a collection of objects objs to output stream stream. More...
 
static void write (const std::string &filename, const std::deque< AnalysisObject * > &aos)
 Write out a collection of objects objs to file filename. More...
 
Writing multiple analysis objects by iterator range.
template<typename AOITER >
static void write (std::ostream &stream, const AOITER &begin, const AOITER &end)
 
template<typename AOITER >
static void write (const std::string &filename, const AOITER &begin, const AOITER &end)
 

Protected Member Functions

void writeHeader (std::ostream &stream)
 Main writer elements. More...
 
void writeFooter (std::ostream &stream)
 
void writeCounter (std::ostream &stream, const Counter &c)
 Specific AO type writer implementations. More...
 
void writeHisto1D (std::ostream &stream, const Histo1D &h)
 
void writeHisto2D (std::ostream &stream, const Histo2D &h)
 
void writeProfile1D (std::ostream &stream, const Profile1D &p)
 
void writeProfile2D (std::ostream &stream, const Profile2D &p)
 
void writeScatter1D (std::ostream &stream, const Scatter1D &s)
 
void writeScatter2D (std::ostream &stream, const Scatter2D &s)
 
void writeScatter3D (std::ostream &stream, const Scatter3D &s)
 
- Protected Member Functions inherited from YODA::Writer
virtual void writeBody (std::ostream &stream, const AnalysisObject &ao)
 

Additional Inherited Members

- Public Member Functions inherited from YODA::Writer
virtual ~Writer ()
 Virtual destructor. More...
 
void setPrecision (int precision)
 Set precision of numerical quantities in this writer's output. More...
 
void write (std::ostream &stream, const AnalysisObject &ao)
 Write out object ao to output stream stream. More...
 
void write (const std::string &filename, const AnalysisObject &ao)
 Write out object ao to file filename. More...
 
template<typename RANGE >
void write (std::ostream &stream, const RANGE &aos)
 Write out a collection of objects objs to output stream stream. More...
 
template<typename RANGE >
void write (const std::string &filename, const RANGE &aos)
 Write out a collection of objects objs to file filename. More...
 
template<typename AOITER >
void write (std::ostream &stream, const AOITER &begin, const AOITER &end)
 
template<typename AOITER >
void write (const std::string &filename, const AOITER &begin, const AOITER &end)
 

Detailed Description

Persistency writer for YODA flat text format.

Definition at line 21 of file WriterYODA.h.

Member Function Documentation

static Writer& YODA::WriterYODA::create ( )
inlinestatic

Singleton creation function.

Definition at line 25 of file WriterYODA.h.

References YODA::Writer::setPrecision().

25  {
26  static WriterYODA _instance;
27  _instance.setPrecision(6);
28  return _instance;
29  }
static void YODA::WriterYODA::write ( std::ostream &  stream,
const AnalysisObject ao 
)
inlinestatic

Write out object ao to output stream stream.

Definition at line 12 of file WriterYODA.h.

17  {
static void YODA::WriterYODA::write ( const std::string &  filename,
const AnalysisObject ao 
)
inlinestatic

Write out object ao to file filename.

Definition at line 17 of file WriterYODA.h.

17  {
18 
19 
static void YODA::WriterYODA::write ( std::ostream &  stream,
const std::vector< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to output stream stream.

Definition at line 28 of file WriterYODA.h.

36  :
37 
static void YODA::WriterYODA::write ( const std::string &  filename,
const std::vector< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to file filename.

Definition at line 32 of file WriterYODA.h.

36  :
37 
static void YODA::WriterYODA::write ( std::ostream &  stream,
const std::list< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to output stream stream.

Definition at line 38 of file WriterYODA.h.

static void YODA::WriterYODA::write ( const std::string &  filename,
const std::list< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to file filename.

Definition at line 42 of file WriterYODA.h.

static void YODA::WriterYODA::write ( std::ostream &  stream,
const std::set< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to output stream stream.

Definition at line 48 of file WriterYODA.h.

51  :
52 
static void YODA::WriterYODA::write ( const std::string &  filename,
const std::set< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to file filename.

Definition at line 52 of file WriterYODA.h.

56  { }
static void YODA::WriterYODA::write ( std::ostream &  stream,
const std::deque< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to output stream stream.

Definition at line 58 of file WriterYODA.h.

static void YODA::WriterYODA::write ( const std::string &  filename,
const std::deque< AnalysisObject * > &  aos 
)
inlinestatic

Write out a collection of objects objs to file filename.

Definition at line 62 of file WriterYODA.h.

template<typename AOITER >
static void YODA::WriterYODA::write ( std::ostream &  stream,
const AOITER &  begin,
const AOITER &  end 
)
inlinestatic

Write out the objects specified by start iterator begin and end iterator end to output stream stream.

Definition at line 75 of file WriterYODA.h.

template<typename AOITER >
static void YODA::WriterYODA::write ( const std::string &  filename,
const AOITER &  begin,
const AOITER &  end 
)
inlinestatic

Write out the objects specified by start iterator begin and end iterator end to file filename.

Definition at line 83 of file WriterYODA.h.

void YODA::WriterYODA::writeCounter ( std::ostream &  stream,
const Counter c 
)
protectedvirtual

Specific AO type writer implementations.

Implements YODA::Writer.

Definition at line 36 of file WriterYODA.cc.

References YODA::Counter::numEntries(), YODA::AnalysisObject::path(), YODA::Counter::sumW(), and YODA::Counter::sumW2().

36  {
37  ios_base::fmtflags oldflags = os.flags();
38  os << scientific << showpoint << setprecision(_precision);
39 
40  os << "# BEGIN YODA_COUNTER " << c.path() << "\n";
41  _writeAnnotations(os, c);
42  os << "# sumW\t sumW2\t numEntries\n";
43  os << c.sumW() << "\t" << c.sumW2() << "\t" << c.numEntries() << "\n";
44  os << "# END YODA_COUNTER\n\n";
45 
46  os.flags(oldflags);
47  }
void YODA::WriterYODA::writeFooter ( std::ostream &  stream)
protectedvirtual

Implements YODA::Writer.

Definition at line 21 of file WriterYODA.cc.

21  {
22  os << flush;
23  }
void YODA::WriterYODA::writeHeader ( std::ostream &  stream)
protectedvirtual

Main writer elements.

Implements YODA::Writer.

Definition at line 16 of file WriterYODA.cc.

16  {
17  os << flush;
18  }
void YODA::WriterYODA::writeHisto1D ( std::ostream &  stream,
const Histo1D h 
)
protectedvirtual

Implements YODA::Writer.

Definition at line 50 of file WriterYODA.cc.

References YODA::Histo1D::bins(), YODA::Dbn1D::effNumEntries(), YODA::Histo1D::integral(), YODA::Dbn1D::numEntries(), YODA::Bin1D< DBN >::numEntries(), YODA::Histo1D::overflow(), YODA::AnalysisObject::path(), YODA::Dbn1D::sumW(), YODA::Bin1D< DBN >::sumW(), YODA::Dbn1D::sumW2(), YODA::Bin1D< DBN >::sumW2(), YODA::Dbn1D::sumWX(), YODA::Bin1D< DBN >::sumWX(), YODA::Dbn1D::sumWX2(), YODA::Bin1D< DBN >::sumWX2(), YODA::Histo1D::totalDbn(), YODA::Histo1D::underflow(), YODA::Bin1D< DBN >::xMax(), YODA::Histo1D::xMean(), and YODA::Bin1D< DBN >::xMin().

50  {
51  ios_base::fmtflags oldflags = os.flags();
52  os << scientific << showpoint << setprecision(_precision);
53 
54  os << "# BEGIN YODA_HISTO1D " << h.path() << "\n";
55  _writeAnnotations(os, h);
56  if ( h.totalDbn().effNumEntries() > 0 ) {
57  os << "# Mean: " << h.xMean() << "\n";
58  }
59  os << "# Area: " << h.integral() << "\n";
60  os << "# ID\t ID\t sumw\t sumw2\t sumwx\t sumwx2\t numEntries\n";
61  os << "Total \tTotal \t";
62  os << h.totalDbn().sumW() << "\t" << h.totalDbn().sumW2() << "\t";
63  os << h.totalDbn().sumWX() << "\t" << h.totalDbn().sumWX2() << "\t";
64  os << h.totalDbn().numEntries() << "\n";
65  os << "Underflow\tUnderflow\t";
66  os << h.underflow().sumW() << "\t" << h.underflow().sumW2() << "\t";
67  os << h.underflow().sumWX() << "\t" << h.underflow().sumWX2() << "\t";
68  os << h.underflow().numEntries() << "\n";
69  os << "Overflow\tOverflow\t";
70  os << h.overflow().sumW() << "\t" << h.overflow().sumW2() << "\t";
71  os << h.overflow().sumWX() << "\t" << h.overflow().sumWX2() << "\t";
72  os << h.overflow().numEntries() << "\n";
73  os << "# xlow\t xhigh\t sumw\t sumw2\t sumwx\t sumwx2\t numEntries\n";
74  BOOST_FOREACH (const HistoBin1D& b, h.bins()) {
75  os << b.xMin() << "\t" << b.xMax() << "\t";
76  os << b.sumW() << "\t" << b.sumW2() << "\t";
77  os << b.sumWX() << "\t" << b.sumWX2() << "\t";
78  os << b.numEntries() << "\n";
79  }
80  os << "# END YODA_HISTO1D\n\n";
81 
82  os.flags(oldflags);
83  }
void YODA::WriterYODA::writeHisto2D ( std::ostream &  stream,
const Histo2D h 
)
protectedvirtual
Todo:
Disabled for now, reinstate with a full set of outflow info to allow marginalisation

Implements YODA::Writer.

Definition at line 86 of file WriterYODA.cc.

References YODA::Histo2D::bins(), YODA::Histo2D::integral(), YODA::Dbn2D::numEntries(), YODA::Bin2D< DBN >::numEntries(), YODA::AnalysisObject::path(), YODA::Dbn2D::sumW(), YODA::Bin2D< DBN >::sumW(), YODA::Dbn2D::sumW2(), YODA::Bin2D< DBN >::sumW2(), YODA::Dbn2D::sumWX(), YODA::Bin2D< DBN >::sumWX(), YODA::Dbn2D::sumWX2(), YODA::Bin2D< DBN >::sumWX2(), YODA::Dbn2D::sumWXY(), YODA::Bin2D< DBN >::sumWXY(), YODA::Dbn2D::sumWY(), YODA::Bin2D< DBN >::sumWY(), YODA::Dbn2D::sumWY2(), YODA::Bin2D< DBN >::sumWY2(), YODA::Histo2D::totalDbn(), YODA::Bin2D< DBN >::xMax(), YODA::Histo2D::xMean(), YODA::Bin2D< DBN >::xMin(), YODA::Bin2D< DBN >::yMax(), YODA::Histo2D::yMean(), and YODA::Bin2D< DBN >::yMin().

86  {
87  ios_base::fmtflags oldflags = os.flags();
88  os << scientific << showpoint << setprecision(_precision);
89 
90  os << "# BEGIN YODA_HISTO2D " << h.path() << "\n";
91  _writeAnnotations(os, h);
92  if ( h.totalDbn().numEntries() > 0 )
93  os << "# Mean: (" << h.xMean() << ", " << h.yMean() << ")\n";
94  os << "# Volume: " << h.integral() << "\n";
95  os << "# ID\t ID\t sumw\t sumw2\t sumwx\t sumwx2\t sumwy\t sumwy2\t sumwxy\t numEntries\n";
96  // Total distribution
97  const Dbn2D& td = h.totalDbn();
98  os << "Total \tTotal \t";
99  os << td.sumW() << "\t" << td.sumW2() << "\t";
100  os << td.sumWX() << "\t" << td.sumWX2() << "\t";
101  os << td.sumWY() << "\t" << td.sumWY2() << "\t";
102  os << td.sumWXY() << "\t";
103  os << td.numEntries() << "\n";
104  // Outflows
106  os << "# 2D outflow persistency not currently supported until API is stable\n";
107  // for (int ix = -1; ix <= 1; ++ix) {
108  // for (int iy = -1; iy <= 1; ++iy) {
109  // if (ix == 0 && iy == 0) continue;
110  // os << "Outflow\t" << ix << ":" << iy << "\t";
111  // const Dbn2D& d = h.outflow(ix, iy);
112  // os << d.sumW() << "\t" << d.sumW2() << "\t";
113  // os << d.sumWX() << "\t" << d.sumWX2() << "\t";
114  // os << d.sumWY() << "\t" << d.sumWY2() << "\t";
115  // os << d.sumWXY() << "\t";
116  // os << d.numEntries() << "\n";
117  // }
118  // }
119  // Bins
120  os << "# xlow\t xhigh\t ylow\t yhigh\t sumw\t sumw2\t sumwx\t sumwx2\t sumwy\t sumwy2\t sumwxy\t numEntries\n";
121  BOOST_FOREACH (const HistoBin2D& b, h.bins()) {
122  os << b.xMin() << "\t" << b.xMax() << "\t";
123  os << b.yMin() << "\t" << b.yMax() << "\t";
124  os << b.sumW() << "\t" << b.sumW2() << "\t";
125  os << b.sumWX() << "\t" << b.sumWX2() << "\t";
126  os << b.sumWY() << "\t" << b.sumWY2() << "\t";
127  os << b.sumWXY() << "\t";
128  os << b.numEntries() << "\n";
129  }
130  os << "# END YODA_HISTO2D\n\n";
131 
132  os.flags(oldflags);
133  }
void YODA::WriterYODA::writeProfile1D ( std::ostream &  stream,
const Profile1D p 
)
protectedvirtual

Implements YODA::Writer.

Definition at line 136 of file WriterYODA.cc.

References YODA::Profile1D::bins(), YODA::Dbn2D::numEntries(), YODA::Bin1D< DBN >::numEntries(), YODA::Profile1D::overflow(), YODA::AnalysisObject::path(), YODA::Dbn2D::sumW(), YODA::Bin1D< DBN >::sumW(), YODA::Dbn2D::sumW2(), YODA::Bin1D< DBN >::sumW2(), YODA::Dbn2D::sumWX(), YODA::Bin1D< DBN >::sumWX(), YODA::Dbn2D::sumWX2(), YODA::Bin1D< DBN >::sumWX2(), YODA::ProfileBin1D::sumWY(), YODA::Dbn2D::sumWY(), YODA::ProfileBin1D::sumWY2(), YODA::Dbn2D::sumWY2(), YODA::Profile1D::totalDbn(), YODA::Profile1D::underflow(), YODA::Bin1D< DBN >::xMax(), and YODA::Bin1D< DBN >::xMin().

136  {
137  ios_base::fmtflags oldflags = os.flags();
138  os << scientific << showpoint << setprecision(_precision);
139 
140  os << "# BEGIN YODA_PROFILE1D " << p.path() << "\n";
141  _writeAnnotations(os, p);
142  os << "# ID\t ID\t sumw\t sumw2\t sumwx\t sumwx2\t sumwy\t sumwy2\t numEntries\n";
143  os << "Total \tTotal \t";
144  os << p.totalDbn().sumW() << "\t" << p.totalDbn().sumW2() << "\t";
145  os << p.totalDbn().sumWX() << "\t" << p.totalDbn().sumWX2() << "\t";
146  os << p.totalDbn().sumWY() << "\t" << p.totalDbn().sumWY2() << "\t";
147  os << p.totalDbn().numEntries() << "\n";
148  os << "Underflow\tUnderflow\t";
149  os << p.underflow().sumW() << "\t" << p.underflow().sumW2() << "\t";
150  os << p.underflow().sumWX() << "\t" << p.underflow().sumWX2() << "\t";
151  os << p.underflow().sumWY() << "\t" << p.underflow().sumWY2() << "\t";
152  os << p.underflow().numEntries() << "\n";
153  os << "Overflow\tOverflow\t";
154  os << p.overflow().sumW() << "\t" << p.overflow().sumW2() << "\t";
155  os << p.overflow().sumWX() << "\t" << p.overflow().sumWX2() << "\t";
156  os << p.overflow().sumWY() << "\t" << p.overflow().sumWY2() << "\t";
157  os << p.overflow().numEntries() << "\n";
158  os << "# xlow\t xhigh\t sumw\t sumw2\t sumwx\t sumwx2\t sumwy\t sumwy2\t numEntries\n";
159  BOOST_FOREACH (const ProfileBin1D& b, p.bins()) {
160  os << b.xMin() << "\t" << b.xMax() << "\t";
161  os << b.sumW() << "\t" << b.sumW2() << "\t";
162  os << b.sumWX() << "\t" << b.sumWX2() << "\t";
163  os << b.sumWY() << "\t" << b.sumWY2() << "\t";
164  os << b.numEntries() << "\n";
165  }
166  os << "# END YODA_PROFILE1D\n\n";
167 
168  os.flags(oldflags);
169  }
void YODA::WriterYODA::writeProfile2D ( std::ostream &  stream,
const Profile2D p 
)
protectedvirtual
Todo:
Disabled for now, reinstate with a full set of outflow info to allow marginalisation

Implements YODA::Writer.

Definition at line 172 of file WriterYODA.cc.

References YODA::Profile2D::bins(), YODA::Dbn3D::numEntries(), YODA::Bin2D< DBN >::numEntries(), YODA::AnalysisObject::path(), YODA::Dbn3D::sumW(), YODA::Bin2D< DBN >::sumW(), YODA::Dbn3D::sumW2(), YODA::Bin2D< DBN >::sumW2(), YODA::Dbn3D::sumWX(), YODA::Bin2D< DBN >::sumWX(), YODA::Dbn3D::sumWX2(), YODA::Bin2D< DBN >::sumWX2(), YODA::Dbn3D::sumWXY(), YODA::Bin2D< DBN >::sumWXY(), YODA::Dbn3D::sumWY(), YODA::Bin2D< DBN >::sumWY(), YODA::Dbn3D::sumWY2(), YODA::Bin2D< DBN >::sumWY2(), YODA::ProfileBin2D::sumWZ(), YODA::Dbn3D::sumWZ(), YODA::ProfileBin2D::sumWZ2(), YODA::Dbn3D::sumWZ2(), YODA::Profile2D::totalDbn(), YODA::Bin2D< DBN >::xMax(), YODA::Bin2D< DBN >::xMin(), YODA::Bin2D< DBN >::yMax(), and YODA::Bin2D< DBN >::yMin().

172  {
173  ios_base::fmtflags oldflags = os.flags();
174  os << scientific << showpoint << setprecision(_precision);
175 
176  os << "# BEGIN YODA_PROFILE2D " << h.path() << "\n";
177  _writeAnnotations(os, h);
178  os << "# sumw\t sumw2\t sumwx\t sumwx2\t sumwy\t sumwy2\t sumwz\t sumwz2\t sumwxy\t numEntries\n";
179  // Total distribution
180  const Dbn3D& td = h.totalDbn();
181  os << "Total \tTotal \t";
182  os << td.sumW() << "\t" << td.sumW2() << "\t";
183  os << td.sumWX() << "\t" << td.sumWX2() << "\t";
184  os << td.sumWY() << "\t" << td.sumWY2() << "\t";
185  os << td.sumWZ() << "\t" << td.sumWZ2() << "\t";
186  os << td.sumWXY() << "\t"; // << td.sumWXZ() << "\t" << td.sumWYZ() << "\t";
187  os << td.numEntries() << "\n";
188  // Outflows
190  os << "# 2D outflow persistency not currently supported until API is stable\n";
191  // for (int ix = -1; ix <= 1; ++ix) {
192  // for (int iy = -1; iy <= 1; ++iy) {
193  // if (ix == 0 && iy == 0) continue;
194  // os << "Outflow\t" << ix << ":" << iy << "\t";
195  // const Dbn3D& d = h.outflow(ix, iy);
196  // os << d.sumW() << "\t" << d.sumW2() << "\t";
197  // os << d.sumWX() << "\t" << d.sumWX2() << "\t";
198  // os << d.sumWY() << "\t" << d.sumWY2() << "\t";
199  // os << d.sumWZ() << "\t" << d.sumWZ2() << "\t";
200  // os << d.sumWXY() << "\t"; // << d.sumWXZ() << "\t" << d.sumWYZ() << "\t";
201  // os << d.numEntries() << "\n";
202  // }
203  // }
204  // Bins
205  os << "# xlow\t xhigh\t ylow\t yhigh\t sumw\t sumw2\t sumwx\t sumwx2\t sumwy\t sumwy2\t sumwz\t sumwz2\t sumwxy\t numEntries\n";
206  BOOST_FOREACH (const ProfileBin2D& b, h.bins()) {
207  os << b.xMin() << "\t" << b.xMax() << "\t";
208  os << b.yMin() << "\t" << b.yMax() << "\t";
209  os << b.sumW() << "\t" << b.sumW2() << "\t";
210  os << b.sumWX() << "\t" << b.sumWX2() << "\t";
211  os << b.sumWY() << "\t" << b.sumWY2() << "\t";
212  os << b.sumWZ() << "\t" << b.sumWZ2() << "\t";
213  os << b.sumWXY() << "\t"; // << b.sumWXZ() << "\t" << b.sumWYZ() << "\t";
214  os << b.numEntries() << "\n";
215  }
216  os << "# END YODA_PROFILE2D\n\n";
217 
218  os.flags(oldflags);
219  }
void YODA::WriterYODA::writeScatter1D ( std::ostream &  stream,
const Scatter1D s 
)
protectedvirtual

Implements YODA::Writer.

Definition at line 222 of file WriterYODA.cc.

References YODA::AnalysisObject::path(), YODA::Scatter1D::points(), YODA::Point1D::x(), and YODA::Point1D::xErrMinus().

222  {
223  ios_base::fmtflags oldflags = os.flags();
224  os << scientific << showpoint << setprecision(_precision);
225 
226  os << "# BEGIN YODA_SCATTER1D " << s.path() << "\n";
227  _writeAnnotations(os, s);
228  os << "# xval\t xerr-\t xerr+\n";
229  BOOST_FOREACH (const Point1D& pt, s.points()) {
230  os << pt.x() << "\t" << pt.xErrMinus() << "\t" << pt.xErrMinus() << "\t";
231  }
232  os << "# END YODA_SCATTER1D\n";
233 
234  os << flush;
235  os.flags(oldflags);
236  }
void YODA::WriterYODA::writeScatter2D ( std::ostream &  stream,
const Scatter2D s 
)
protectedvirtual
Todo:
Change ordering to {vals} {errs} {errs} ...
Todo:
Change ordering to {vals} {errs} {errs} ...

Implements YODA::Writer.

Definition at line 239 of file WriterYODA.cc.

References YODA::AnalysisObject::path(), YODA::Scatter2D::points(), YODA::Point2D::x(), YODA::Point2D::xErrMinus(), YODA::Point2D::xErrPlus(), YODA::Point2D::y(), YODA::Point2D::yErrMinus(), and YODA::Point2D::yErrPlus().

239  {
240  ios_base::fmtflags oldflags = os.flags();
241  os << scientific << showpoint << setprecision(_precision);
242 
243  os << "# BEGIN YODA_SCATTER2D " << s.path() << "\n";
244  _writeAnnotations(os, s);
246  os << "# xval\t xerr-\t xerr+\t yval\t yerr-\t yerr+\n";
247  BOOST_FOREACH (const Point2D& pt, s.points()) {
249  os << pt.x() << "\t" << pt.xErrMinus() << "\t" << pt.xErrPlus() << "\t";
250  os << pt.y() << "\t" << pt.yErrMinus() << "\t" << pt.yErrPlus() << "\n";
251  }
252  os << "# END YODA_SCATTER2D\n\n";
253 
254  os << flush;
255  os.flags(oldflags);
256  }
void YODA::WriterYODA::writeScatter3D ( std::ostream &  stream,
const Scatter3D s 
)
protectedvirtual
Todo:
Change ordering to {vals} {errs} {errs} ...
Todo:
Change ordering to {vals} {errs} {errs} ...

Implements YODA::Writer.

Definition at line 259 of file WriterYODA.cc.

References YODA::AnalysisObject::path(), YODA::Scatter3D::points(), YODA::Point3D::x(), YODA::Point3D::xErrMinus(), YODA::Point3D::y(), YODA::Point3D::yErrMinus(), YODA::Point3D::z(), and YODA::Point3D::zErrMinus().

259  {
260  ios_base::fmtflags oldflags = os.flags();
261  os << scientific << showpoint << setprecision(_precision);
262 
263  os << "# BEGIN YODA_SCATTER3D " << s.path() << "\n";
264  _writeAnnotations(os, s);
266  os << "# xval\t xerr-\t xerr+\t yval\t yerr-\t yerr+\t zval\t zerr-\t zerr+\n";
267  BOOST_FOREACH (const Point3D& pt, s.points()) {
269  os << pt.x() << "\t" << pt.xErrMinus() << "\t" << pt.xErrMinus() << "\t";
270  os << pt.y() << "\t" << pt.yErrMinus() << "\t" << pt.yErrMinus() << "\t";
271  os << pt.z() << "\t" << pt.zErrMinus() << "\t" << pt.zErrMinus() << "\n";
272  }
273  os << "# END YODA_SCATTER3D\n\n";
274 
275  os << flush;
276  os.flags(oldflags);
277  }

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