File indexing completed on 2025-01-18 09:55:45
0001
0002
0003
0004
0005 #pragma once
0006
0007 #include <JANA/JApplication.h>
0008 #include <JANA/JEvent.h>
0009 #include <JANA/JEventSource.h>
0010 #include <JANA/JEventSourceGeneratorT.h>
0011 #include <podio/podioVersion.h>
0012 #if podio_VERSION >= PODIO_VERSION(0, 99, 0)
0013 #include <podio/ROOTReader.h>
0014 #else
0015 #include <podio/ROOTFrameReader.h>
0016 #endif
0017 #include <stddef.h>
0018 #include <string>
0019
0020 #if ((JANA_VERSION_MAJOR == 2) && (JANA_VERSION_MINOR >= 3)) || (JANA_VERSION_MAJOR > 2)
0021 #define JANA_NEW_CALLBACK_STYLE 1
0022 #else
0023 #define JANA_NEW_CALLBACK_STYLE 0
0024 #endif
0025
0026 class JEventSourcePODIO : public JEventSource {
0027
0028 public:
0029 JEventSourcePODIO(std::string resource_name, JApplication* app);
0030
0031 virtual ~JEventSourcePODIO();
0032
0033 void Open() override;
0034
0035 void Close() override;
0036
0037 #if JANA_NEW_CALLBACK_STYLE
0038 Result Emit(JEvent& event) override;
0039 #else
0040 void GetEvent(std::shared_ptr<JEvent>) override;
0041 #endif
0042
0043 static std::string GetDescription();
0044
0045 void PrintCollectionTypeTable(void);
0046
0047 protected:
0048 #if podio_VERSION >= PODIO_VERSION(0, 99, 0)
0049 podio::ROOTReader m_reader;
0050 #else
0051 podio::ROOTFrameReader m_reader;
0052 #endif
0053
0054 size_t Nevents_in_file = 0;
0055 size_t Nevents_read = 0;
0056
0057 bool m_run_forever=false;
0058 bool m_use_event_headers=true;
0059
0060 };
0061
0062 template <>
0063 double JEventSourceGeneratorT<JEventSourcePODIO>::CheckOpenable(std::string);