PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
ASCIIWriter.cc
Go to the documentation of this file.
1// podio specific includes
2#include "podio/ASCIIWriter.h"
4#include "podio/EventStore.h"
5
6namespace podio {
7
8ASCIIWriter::ASCIIWriter(const std::string& filename, EventStore* store) :
9 m_filename(filename), m_store(store), m_file(new std::ofstream) {
10
11 m_file->open(filename, std::ofstream::binary);
12}
13
15 delete m_file;
16}
17
19
20 unsigned i = 0;
21 for (auto& coll : m_storedCollections) {
22 coll->prepareForWrite();
23
24 const std::string& name = m_collectionNames[i++];
25 std::cout << " writing collection " << name << std::endl;
26
27 *m_file << name << " ";
28
29 ColWriterBase* wrt = m_map[name];
30
31 wrt->writeCollection(coll, *m_file);
32 }
33}
34
36
37 m_file->close();
38}
39
40} // namespace podio
ASCIIWriter(const std::string &filename, EventStore *store)
Definition: ASCIIWriter.cc:8
virtual void writeCollection(CollectionBase *, std::ostream &)=0