1#ifndef PODIO_ROOTREADER_H
2#define PODIO_ROOTREADER_H
26class CollectionIDTable;
27class GenericParameters;
45 void openFile(
const std::string& filename)
override;
46 void openFiles(
const std::vector<std::string>& filenames);
82 std::map<int, GenericParameters>* readCollectionMetaData()
override;
85 std::map<int, GenericParameters>* readRunMetaData()
override;
88 void createCollectionBranches(
const std::vector<std::tuple<int, std::string, bool>>& collInfo);
90 std::pair<TTree*, unsigned> getLocalTreeAndEntry(
const std::string& treename);
93 using CollectionInfo = std::tuple<const TClass*, const TClass*, size_t>;
95 CollectionBase* getCollection(
const std::pair<std::string, CollectionInfo>& collInfo);
97 Long64_t entry,
const std::string& name);
100 typedef std::pair<CollectionBase*, std::string> Input;
101 std::vector<Input> m_inputs{};
105 std::map<std::string, CollectionInfo> m_storedClasses{};
107 std::shared_ptr<CollectionIDTable> m_table{
nullptr};
108 TChain* m_chain{
nullptr};
109 unsigned m_eventNumber{0};
116 size_t m_collectionIndex = 0;
117 std::vector<root_utils::CollectionBranches> m_collectionBranches{};
void openFile(const std::string &filename) override
void goToEvent(unsigned evnum) override
Preparing to read a given event.
podio::version::Version currentFileVersion() const override
Get the podio version with which the current file has been written.
unsigned getEntries() const override
Returns number of entries in the TTree.
void readEvent() override
Read all collections requested.
ROOTReader(const ROOTReader &)=delete
ROOTReader & operator=(const ROOTReader &)=delete
std::shared_ptr< CollectionIDTable > getCollectionIDTable() override
Read CollectionIDTable from ROOT file.
void openFiles(const std::vector< std::string > &filenames)
bool isValid() const override
Check if TFile is valid.
void closeFile() override
void endOfEvent() override
Preparing to read next event.