Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:17:34

0001 
0002 // Copyright 2023, Jefferson Science Associates, LLC.
0003 // Subject to the terms in the LICENSE file found in the top-level directory.
0004 
0005 #include "JFactoryPodioT.h"
0006 #include <JANA/JEvent.h>
0007 
0008 podio::Frame* GetOrCreateFrame(const std::shared_ptr<const JEvent>& event) {
0009     podio::Frame* result = nullptr;
0010     try {
0011         result = const_cast<podio::Frame*>(event->GetSingle<podio::Frame>(""));
0012         if (result == nullptr) {
0013             result = new podio::Frame;
0014             event->Insert(result);
0015         }
0016     }
0017     catch (...) {
0018         result = new podio::Frame;
0019         event->Insert(result);
0020     }
0021     return result;
0022 }
0023