Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:45

0001 
0002 #pragma once
0003 
0004 #include <JANA/JEvent.h>
0005 #include <JANA/JEventProcessor.h>
0006 #include <podio/podioVersion.h>
0007 #if podio_VERSION >= PODIO_VERSION(0, 99, 0)
0008 #include <podio/ROOTWriter.h>
0009 #else
0010 #include <podio/ROOTFrameWriter.h>
0011 #endif
0012 #include <spdlog/logger.h>
0013 #include <memory>
0014 #include <mutex>
0015 #include <set>
0016 #include <string>
0017 #include <vector>
0018 
0019 
0020 class JEventProcessorPODIO : public JEventProcessor {
0021 
0022 public:
0023 
0024     JEventProcessorPODIO();
0025     virtual ~JEventProcessorPODIO() = default;
0026 
0027     void Init() override;
0028     void Process(const std::shared_ptr<const JEvent>& event) override;
0029     void Finish() override;
0030 
0031     void FindCollectionsToWrite(const std::shared_ptr<const JEvent>& event);
0032 
0033 #if podio_VERSION >= PODIO_VERSION(0, 99, 0)
0034     std::unique_ptr<podio::ROOTWriter> m_writer;
0035 #else
0036     std::unique_ptr<podio::ROOTFrameWriter> m_writer;
0037 #endif
0038     std::mutex m_mutex;
0039     bool m_is_first_event = true;
0040     bool m_user_included_collections = false;
0041     std::shared_ptr<spdlog::logger> m_log;
0042     bool m_output_include_collections_set = false;
0043 
0044     std::string m_output_file = "podio_output.root";
0045     std::string m_output_file_copy_dir = "";
0046     std::set<std::string> m_output_collections;  // config. parameter
0047     std::set<std::string> m_output_exclude_collections;  // config. parameter
0048     std::vector<std::string> m_collections_to_write;  // derived from above config. parameters
0049     std::vector<std::string> m_collections_to_print;
0050 
0051 };