File indexing completed on 2026-04-01 08:19:15
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <JANA/JApplicationFwd.h>
0008 #include <JANA/JEventSource.h>
0009 #include <JANA/JEventSourceGeneratorT.h>
0010 #include <podio/Frame.h>
0011 #include <podio/Reader.h>
0012 #include <spdlog/logger.h>
0013 #include <cstddef>
0014 #include <memory>
0015 #include <string>
0016 #include <string_view>
0017 #include <vector>
0018
0019 class JEventSourcePODIO : public JEventSource {
0020
0021 public:
0022 JEventSourcePODIO(std::string resource_name, JApplication* app);
0023
0024 virtual ~JEventSourcePODIO();
0025
0026 void Open() override;
0027
0028 void Close() override;
0029
0030 Result Emit(JEvent& event) override;
0031
0032 static std::string GetDescription();
0033
0034 void PrintCollectionTypeTable(void);
0035
0036 std::vector<std::string_view> getAvailableCategories() const;
0037 std::size_t getEntries(const std::string& category) const;
0038 podio::Frame getFrame(const std::string& category, std::size_t index) const;
0039
0040 protected:
0041 std::unique_ptr<podio::Reader> m_reader;
0042
0043 std::size_t Nevents_in_file = 0;
0044 std::size_t Nevents_read = 0;
0045
0046 bool m_run_forever = false;
0047 bool m_use_event_headers = true;
0048
0049 private:
0050 std::shared_ptr<spdlog::logger> m_log;
0051 };
0052
0053 template <> double JEventSourceGeneratorT<JEventSourcePODIO>::CheckOpenable(std::string);