Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-31 08:18:22

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_Measurement2D_CollectionData_H
0004 #define EDM4EIC_Measurement2D_CollectionData_H
0005 
0006 // datamodel specific includes
0007 #include "edm4eic/Measurement2DData.h"
0008 #include "edm4eic/Measurement2DObj.h"
0009 #include "edm4eic/Measurement2D.h"
0010 #include "edm4eic/TrackerHit.h"
0011 
0012 // schema evolution specific includes
0013 
0014 // podio specific includes
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 Measurement2DObjPointerContainer = std::deque<Measurement2DObj*>;
0025 using Measurement2DDataContainer = std::vector<Measurement2DData>;
0026 
0027 
0028 /**
0029  * Class encapsulating everything related to storage of data that is needed by a
0030  * collection.
0031  */
0032 class Measurement2DCollectionData {
0033 public:
0034   /**
0035    * The Objs of this collection
0036    */
0037   Measurement2DObjPointerContainer entries{};
0038 
0039   /**
0040    * Default constructor setting up the necessary buffers
0041    */
0042   Measurement2DCollectionData();
0043 
0044   /**
0045    * Constructor from existing I/O buffers
0046    */
0047   Measurement2DCollectionData(podio::CollectionReadBuffers buffers, bool isSubsetColl);
0048 
0049   /**
0050    * Non copy-able, move-only class
0051    */
0052   Measurement2DCollectionData(const Measurement2DCollectionData&) = delete;
0053   Measurement2DCollectionData& operator=(const Measurement2DCollectionData&) = delete;
0054   Measurement2DCollectionData(Measurement2DCollectionData&& other) = default;
0055   Measurement2DCollectionData& operator=(Measurement2DCollectionData&& other) = default;
0056 
0057   /**
0058    * Destructor
0059    */
0060   ~Measurement2DCollectionData() = 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(Measurement2DObj* obj);
0073 
0074   bool setReferences(const podio::ICollectionProvider* collectionProvider, bool isSubsetColl);
0075 
0076 private:
0077   // members to handle 1-to-N-relations
0078   podio::UVecPtr<edm4eic::TrackerHit> m_rel_hits{std::make_unique<std::vector<edm4eic::TrackerHit>>()}; ///< Relation buffer for read / write
0079   std::vector<podio::UVecPtr<edm4eic::TrackerHit>> m_rel_hits_tmp{}; ///< Relation buffer for internal book-keeping
0080 
0081   // members to handle vector members
0082   podio::UVecPtr<float> m_vec_weights{nullptr}; /// combined vector of all objects in collection
0083   std::vector<podio::UVecPtr<float>> m_vecs_weights{}; /// pointers to individual member vectors
0084 
0085   // I/O related buffers
0086   podio::CollRefCollection m_refCollections{};
0087   podio::VectorMembersInfo m_vecmem_info{};
0088   std::unique_ptr<Measurement2DDataContainer> m_data{nullptr};
0089 };
0090 
0091 
0092 } // namespace edm4eic
0093 
0094 
0095 #endif