File indexing completed on 2025-01-18 09:55:28
0001
0002
0003 #ifndef EDM4EIC_Cluster_CollectionData_H
0004 #define EDM4EIC_Cluster_CollectionData_H
0005
0006
0007 #include "edm4eic/ClusterData.h"
0008 #include "edm4eic/ClusterObj.h"
0009 #include "edm4eic/CalorimeterHit.h"
0010 #include "edm4hep/ParticleID.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 ClusterObjPointerContainer = std::deque<ClusterObj*>;
0025 using ClusterDataContainer = std::vector<ClusterData>;
0026
0027
0028
0029
0030
0031
0032 class ClusterCollectionData {
0033 public:
0034
0035
0036
0037 ClusterObjPointerContainer entries{};
0038
0039
0040
0041
0042 ClusterCollectionData();
0043
0044
0045
0046
0047 ClusterCollectionData(podio::CollectionReadBuffers buffers, bool isSubsetColl);
0048
0049
0050
0051
0052 ClusterCollectionData(const ClusterCollectionData&) = delete;
0053 ClusterCollectionData& operator=(const ClusterCollectionData&) = delete;
0054 ClusterCollectionData(ClusterCollectionData&& other) = default;
0055 ClusterCollectionData& operator=(ClusterCollectionData&& other) = default;
0056
0057
0058
0059
0060 ~ClusterCollectionData() = 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 void createRelations(ClusterObj* obj);
0073
0074 bool setReferences(const podio::ICollectionProvider* collectionProvider, bool isSubsetColl);
0075
0076 private:
0077
0078 podio::UVecPtr<edm4eic::Cluster> m_rel_clusters;
0079 std::vector<podio::UVecPtr<edm4eic::Cluster>> m_rel_clusters_tmp{};
0080 podio::UVecPtr<edm4eic::CalorimeterHit> m_rel_hits;
0081 std::vector<podio::UVecPtr<edm4eic::CalorimeterHit>> m_rel_hits_tmp{};
0082 podio::UVecPtr<edm4hep::ParticleID> m_rel_particleIDs;
0083 std::vector<podio::UVecPtr<edm4hep::ParticleID>> m_rel_particleIDs_tmp{};
0084
0085
0086 podio::UVecPtr<float> m_vec_shapeParameters{nullptr};
0087 std::vector<podio::UVecPtr<float>> m_vecs_shapeParameters{};
0088 podio::UVecPtr<float> m_vec_hitContributions{nullptr};
0089 std::vector<podio::UVecPtr<float>> m_vecs_hitContributions{};
0090 podio::UVecPtr<float> m_vec_subdetectorEnergies{nullptr};
0091 std::vector<podio::UVecPtr<float>> m_vecs_subdetectorEnergies{};
0092
0093
0094 podio::CollRefCollection m_refCollections{};
0095 podio::VectorMembersInfo m_vecmem_info{};
0096 std::unique_ptr<ClusterDataContainer> m_data{nullptr};
0097 };
0098
0099
0100 }
0101
0102
0103 #endif