Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:18:38

0001 
0002 #pragma once
0003 
0004 #include <JANA/JEvent.h>
0005 #include <JANA/JEventProcessor.h>
0006 #include <podio/Writer.h>
0007 #include <spdlog/logger.h>
0008 #include <memory>
0009 #include <mutex>
0010 #include <set>
0011 #include <string>
0012 #include <vector>
0013 
0014 class JEventProcessorPODIO : public JEventProcessor {
0015 
0016 public:
0017   JEventProcessorPODIO();
0018   virtual ~JEventProcessorPODIO() = default;
0019 
0020   void Init() override;
0021   void Process(const std::shared_ptr<const JEvent>& event) override;
0022   void Finish() override;
0023 
0024   void FindCollectionsToWrite(const std::shared_ptr<const JEvent>& event);
0025 
0026 protected:
0027   /// Propagate all non-"events" frames from any JEventSourcePODIO input source(s)
0028   /// to the output file.
0029   void PropagateNonEventCategories();
0030 
0031 public:
0032   std::unique_ptr<podio::Writer> m_writer;
0033   std::mutex m_mutex;
0034   std::once_flag m_is_first_event;
0035   std::shared_ptr<spdlog::logger> m_log;
0036 
0037   std::string m_output_file          = "podio_output.root";
0038   std::string m_output_file_copy_dir = "";
0039   std::string m_output_backend       = "root";
0040   std::set<std::string> m_output_collections;         // config. parameter
0041   std::set<std::string> m_output_exclude_collections; // config. parameter
0042   std::vector<std::string> m_collections_to_write;    // derived from above config. parameters
0043   std::vector<std::string> m_collections_to_print;
0044 };