File indexing completed on 2025-01-18 09:55:32
0001
0002
0003 #ifndef EDM4EIC_ReconstructedParticle_CollectionData_H
0004 #define EDM4EIC_ReconstructedParticle_CollectionData_H
0005
0006
0007 #include "edm4eic/ReconstructedParticleData.h"
0008 #include "edm4eic/ReconstructedParticleObj.h"
0009 #include "edm4eic/Cluster.h"
0010 #include "edm4eic/Track.h"
0011 #include "edm4eic/Vertex.h"
0012 #include "edm4hep/ParticleID.h"
0013
0014
0015
0016
0017 #include "podio/CollectionBuffers.h"
0018 #include "podio/ICollectionProvider.h"
0019
0020 #include <deque>
0021 #include <memory>
0022
0023 namespace edm4eic {
0024
0025
0026 using ReconstructedParticleObjPointerContainer = std::deque<ReconstructedParticleObj*>;
0027 using ReconstructedParticleDataContainer = std::vector<ReconstructedParticleData>;
0028
0029
0030
0031
0032
0033
0034 class ReconstructedParticleCollectionData {
0035 public:
0036
0037
0038
0039 ReconstructedParticleObjPointerContainer entries{};
0040
0041
0042
0043
0044 ReconstructedParticleCollectionData();
0045
0046
0047
0048
0049 ReconstructedParticleCollectionData(podio::CollectionReadBuffers buffers, bool isSubsetColl);
0050
0051
0052
0053
0054 ReconstructedParticleCollectionData(const ReconstructedParticleCollectionData&) = delete;
0055 ReconstructedParticleCollectionData& operator=(const ReconstructedParticleCollectionData&) = delete;
0056 ReconstructedParticleCollectionData(ReconstructedParticleCollectionData&& other) = default;
0057 ReconstructedParticleCollectionData& operator=(ReconstructedParticleCollectionData&& other) = default;
0058
0059
0060
0061
0062 ~ReconstructedParticleCollectionData() = default;
0063
0064 void clear(bool isSubsetColl);
0065
0066 podio::CollectionWriteBuffers getCollectionBuffers(bool isSubsetColl);
0067
0068 void prepareForWrite(bool isSubsetColl);
0069
0070 void prepareAfterRead(uint32_t collectionID);
0071
0072 void makeSubsetCollection();
0073
0074 void createRelations(ReconstructedParticleObj* obj);
0075
0076 bool setReferences(const podio::ICollectionProvider* collectionProvider, bool isSubsetColl);
0077
0078 private:
0079
0080 podio::UVecPtr<edm4eic::Cluster> m_rel_clusters;
0081 std::vector<podio::UVecPtr<edm4eic::Cluster>> m_rel_clusters_tmp{};
0082 podio::UVecPtr<edm4eic::Track> m_rel_tracks;
0083 std::vector<podio::UVecPtr<edm4eic::Track>> m_rel_tracks_tmp{};
0084 podio::UVecPtr<edm4eic::ReconstructedParticle> m_rel_particles;
0085 std::vector<podio::UVecPtr<edm4eic::ReconstructedParticle>> m_rel_particles_tmp{};
0086 podio::UVecPtr<edm4hep::ParticleID> m_rel_particleIDs;
0087 std::vector<podio::UVecPtr<edm4hep::ParticleID>> m_rel_particleIDs_tmp{};
0088 podio::UVecPtr<edm4eic::Vertex> m_rel_startVertex{nullptr};
0089 podio::UVecPtr<edm4hep::ParticleID> m_rel_particleIDUsed{nullptr};
0090
0091
0092
0093
0094 podio::CollRefCollection m_refCollections{};
0095 podio::VectorMembersInfo m_vecmem_info{};
0096 std::unique_ptr<ReconstructedParticleDataContainer> m_data{nullptr};
0097 };
0098
0099
0100 }
0101
0102
0103 #endif