Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-28 08:26:57

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 Wouter Deconinck
0003 
0004 #pragma once
0005 
0006 #include <JANA/Services/JComponentManager.h>
0007 #include <memory>
0008 
0009 // JANA2 recently deprecated get_evt_srces() in favor of GetSources().
0010 // Keep compatibility with older JANA2 while avoiding deprecation warnings
0011 // on newer versions.
0012 #if defined(JANA_VERSION_MAJOR) && defined(JANA_VERSION_MINOR) && defined(JANA_VERSION_PATCH) &&   \
0013     ((JANA_VERSION_MAJOR > 2026) || (JANA_VERSION_MAJOR == 2026 && JANA_VERSION_MINOR > 2) ||      \
0014      (JANA_VERSION_MAJOR == 2026 && JANA_VERSION_MINOR == 2 && JANA_VERSION_PATCH > 0))
0015 #define EICRECON_JANA_COMPONENT_MANAGER_HAS_GETSOURCES 1
0016 #endif
0017 
0018 namespace eicrecon::jana_compat {
0019 
0020 inline std::vector<JEventSource*>& GetEventSources(JComponentManager* component_manager) {
0021 #if defined(EICRECON_JANA_COMPONENT_MANAGER_HAS_GETSOURCES)
0022   return component_manager->GetSources();
0023 #else
0024   return component_manager->get_evt_srces();
0025 #endif
0026 }
0027 
0028 inline std::vector<JEventSource*>&
0029 GetEventSources(const std::shared_ptr<JComponentManager>& component_manager) {
0030   return GetEventSources(component_manager.get());
0031 }
0032 
0033 } // namespace eicrecon::jana_compat