File indexing completed on 2025-10-30 08:38:44
0001 
0002 
0003 #ifndef EDM4EIC_MCRecoTrackParticleAssociation_CollectionData_H
0004 #define EDM4EIC_MCRecoTrackParticleAssociation_CollectionData_H
0005 
0006 
0007 #include "edm4eic/MCRecoTrackParticleAssociationData.h"
0008 #include "edm4eic/MCRecoTrackParticleAssociationObj.h"
0009 #include "edm4eic/Track.h"
0010 #include "edm4hep/MCParticle.h"
0011 
0012 
0013 
0014 
0015 #include "podio/CollectionBuffers.h"
0016 #include "podio/ICollectionProvider.h"
0017 
0018 #include <deque>
0019 #include <memory>
0020 
0021 namespace edm4eic {
0022 
0023 
0024 using MCRecoTrackParticleAssociationObjPointerContainer = std::deque<MCRecoTrackParticleAssociationObj*>;
0025 using MCRecoTrackParticleAssociationDataContainer = std::vector<MCRecoTrackParticleAssociationData>;
0026 
0027 
0028 
0029 
0030 
0031 
0032 class MCRecoTrackParticleAssociationCollectionData {
0033 public:
0034   
0035 
0036 
0037   MCRecoTrackParticleAssociationObjPointerContainer entries{};
0038 
0039   
0040 
0041 
0042   MCRecoTrackParticleAssociationCollectionData();
0043 
0044   
0045 
0046 
0047   MCRecoTrackParticleAssociationCollectionData(podio::CollectionReadBuffers buffers, bool isSubsetColl);
0048 
0049   
0050 
0051 
0052   MCRecoTrackParticleAssociationCollectionData(const MCRecoTrackParticleAssociationCollectionData&) = delete;
0053   MCRecoTrackParticleAssociationCollectionData& operator=(const MCRecoTrackParticleAssociationCollectionData&) = delete;
0054   MCRecoTrackParticleAssociationCollectionData(MCRecoTrackParticleAssociationCollectionData&& other) = default;
0055   MCRecoTrackParticleAssociationCollectionData& operator=(MCRecoTrackParticleAssociationCollectionData&& other) = default;
0056 
0057   
0058 
0059 
0060   ~MCRecoTrackParticleAssociationCollectionData() = default;
0061 
0062   void clear(bool isSubsetColl);
0063 
0064   podio::CollectionWriteBuffers getCollectionBuffers(bool isSubsetColl);
0065 
0066   void prepareForWrite(bool isSubsetColl);
0067 
0068   void prepareAfterRead(uint32_t collectionID);
0069 
0070   void makeSubsetCollection();
0071 
0072 
0073   bool setReferences(const podio::ICollectionProvider* collectionProvider, bool isSubsetColl);
0074 
0075 private:
0076   
0077   podio::UVecPtr<edm4eic::Track> m_rel_rec{nullptr}; 
0078   podio::UVecPtr<edm4hep::MCParticle> m_rel_sim{nullptr}; 
0079 
0080   
0081 
0082   
0083   podio::CollRefCollection m_refCollections{};
0084   podio::VectorMembersInfo m_vecmem_info{};
0085   std::unique_ptr<MCRecoTrackParticleAssociationDataContainer> m_data{nullptr};
0086 };
0087 
0088 
0089 } 
0090 
0091 
0092 #endif