EDM4eic
EIC data model
Loading...
Searching...
No Matches
TensorCollectionData.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Tensor_CollectionData_H
4#define EDM4EIC_Tensor_CollectionData_H
5
6// datamodel specific includes
8#include "edm4eic/TensorObj.h"
9#include "edm4eic/Tensor.h"
10
11// schema evolution specific includes
12
13// podio specific includes
14#include "podio/CollectionBuffers.h"
15#include "podio/ICollectionProvider.h"
16
17#include <deque>
18#include <memory>
19
20namespace edm4eic {
21
22
23using TensorObjPointerContainer = std::deque<TensorObj*>;
24using TensorDataContainer = std::vector<TensorData>;
25
26
27/**
28 * Class encapsulating everything related to storage of data that is needed by a
29 * collection.
30 */
32public:
33 /**
34 * The Objs of this collection
35 */
37
38 /**
39 * Default constructor setting up the necessary buffers
40 */
42
43 /**
44 * Constructor from existing I/O buffers
45 */
46 TensorCollectionData(podio::CollectionReadBuffers buffers, bool isSubsetColl);
47
48 /**
49 * Non copy-able, move-only class
50 */
55
56 /**
57 * Destructor
58 */
60
61 void clear(bool isSubsetColl);
62
63 podio::CollectionWriteBuffers getCollectionBuffers(bool isSubsetColl);
64
65 void prepareForWrite(bool isSubsetColl);
66
67 void prepareAfterRead(uint32_t collectionID);
68
70
71 void createRelations(TensorObj* obj);
72
73 bool setReferences(const podio::ICollectionProvider* collectionProvider, bool isSubsetColl);
74
75private:
76 // members to handle 1-to-N-relations
77
78 // members to handle vector members
79 podio::UVecPtr<std::int64_t> m_vec_shape{nullptr}; /// combined vector of all objects in collection
80 std::vector<podio::UVecPtr<std::int64_t>> m_vecs_shape{}; /// pointers to individual member vectors
81 podio::UVecPtr<float> m_vec_floatData{nullptr}; /// combined vector of all objects in collection
82 std::vector<podio::UVecPtr<float>> m_vecs_floatData{}; /// pointers to individual member vectors
83 podio::UVecPtr<std::int64_t> m_vec_int64Data{nullptr}; /// combined vector of all objects in collection
84 std::vector<podio::UVecPtr<std::int64_t>> m_vecs_int64Data{}; /// pointers to individual member vectors
85
86 // I/O related buffers
87 podio::CollRefCollection m_refCollections{};
88 podio::VectorMembersInfo m_vecmem_info{};
89 std::unique_ptr<TensorDataContainer> m_data{nullptr};
90};
91
92
93} // namespace edm4eic
94
95
96#endif
TensorCollectionData(const TensorCollectionData &)=delete
TensorCollectionData(TensorCollectionData &&other)=default
bool setReferences(const podio::ICollectionProvider *collectionProvider, bool isSubsetColl)
Definition TensorCollectionData.cc:170
podio::CollectionWriteBuffers getCollectionBuffers(bool isSubsetColl)
Definition TensorCollectionData.cc:81
void makeSubsetCollection()
Definition TensorCollectionData.cc:189
void createRelations(TensorObj *obj)
Definition TensorCollectionData.cc:161
TensorCollectionData()
Definition TensorCollectionData.cc:13
TensorObjPointerContainer entries
Definition TensorCollectionData.h:36
TensorCollectionData & operator=(const TensorCollectionData &)=delete
void clear(bool isSubsetColl)
Definition TensorCollectionData.cc:55
void prepareAfterRead(uint32_t collectionID)
Definition TensorCollectionData.cc:144
TensorCollectionData & operator=(TensorCollectionData &&other)=default
void prepareForWrite(bool isSubsetColl)
Definition TensorCollectionData.cc:97
Definition TensorObj.h:19
Definition CalorimeterHit.cc:17
std::deque< TensorObj * > TensorObjPointerContainer
Definition TensorCollectionData.h:23
std::vector< TensorData > TensorDataContainer
Definition TensorCollectionData.h:24