Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-17 07:50:56

0001 #pragma once
0002 
0003 #include <JANA/JApplicationFwd.h>
0004 #include <JANA/JEventSourceGeneratorT.h>
0005 #include <atomic>
0006 #include <condition_variable>
0007 #include <cstddef>
0008 #include <mutex>
0009 #include <string>
0010 
0011 #include "JEventSourcePODIO.h"
0012 
0013 class JEventSourceManagedPODIO : public JEventSourcePODIO {
0014 
0015 public:
0016   JEventSourceManagedPODIO(std::string resource_name, JApplication* app);
0017   virtual ~JEventSourceManagedPODIO();
0018 
0019   void Open() override;
0020   void Close() override;
0021   Result Emit(JEvent& event) override;
0022 
0023   static std::string GetDescription();
0024 
0025   void SetCurrentFile(const std::string& input_file);
0026   bool IsFileProcessingComplete() const { return m_file_processing_complete.load(); }
0027   std::size_t GetNeventsInFile() const { return Nevents_in_file; }
0028 
0029   void ResetReader();
0030 
0031 private:
0032   // File management for managed mode
0033   std::string m_current_input_file;
0034   std::atomic<bool> m_file_available{false};
0035   std::atomic<bool> m_file_processing_complete{false};
0036   std::atomic<bool> m_closing{false};
0037 
0038   // Synchronization
0039   std::mutex m_file_mutex;
0040   std::condition_variable m_file_cv;
0041 };
0042 
0043 template <> double JEventSourceGeneratorT<JEventSourceManagedPODIO>::CheckOpenable(std::string);