PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
PythonEventStore.h
Go to the documentation of this file.
1#ifndef PODIO_PYTHONEVENTSTORE_H
2#define PODIO_PYTHONEVENTSTORE_H
3
4#include "podio/EventStore.h"
6#include "podio/IReader.h"
8
9#include <memory>
10
11namespace podio {
12
14public:
15 /// constructor from filename
16 PythonEventStore(const char* filename);
17
18 /// access a collection.
19 const podio::CollectionBase* get(const char* name);
20
21 /// signify end of event
22 void endOfEvent();
23
24 /// go to a given event
25 void goToEvent(unsigned ievent);
26
27 /// get number of entries in the tree
28 unsigned getEntries() const;
29
30 /// is the input file accessible?
31 bool isZombie() const {
32 return m_isZombie;
33 }
34
35 bool isValid() const {
36 return m_reader && m_reader->isValid();
37 }
38 void close() {
39 m_reader->closeFile();
40 }
41
42 /// list available collections
43 const std::vector<std::string>& getCollectionNames() const;
44
46 return m_store.getEventMetaData();
47 }
48
49private:
50 std::unique_ptr<podio::IReader> m_reader;
51 podio::EventStore m_store;
52
53 /// set to true if input root file accessible, false otherwise
54 bool m_isZombie{true};
55};
56
57} // namespace podio
58
59#endif
#define DEPR_EVTSTORE
Definition: Deprecated.h:4
bool isZombie() const
is the input file accessible?
const podio::GenericParameters & getEventMetaData()