Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:39

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_ReconstructedParticle_CollectionData_H
0004 #define EDM4HEP_ReconstructedParticle_CollectionData_H
0005 
0006 // datamodel specific includes
0007 #include "edm4hep/Cluster.h"
0008 #include "edm4hep/ParticleID.h"
0009 #include "edm4hep/ReconstructedParticleData.h"
0010 #include "edm4hep/ReconstructedParticleObj.h"
0011 #include "edm4hep/Track.h"
0012 #include "edm4hep/Vertex.h"
0013 
0014 // schema evolution specific includes
0015 
0016 // podio specific includes
0017 #include "podio/CollectionBuffers.h"
0018 #include "podio/ICollectionProvider.h"
0019 
0020 #include <deque>
0021 #include <memory>
0022 
0023 namespace edm4hep {
0024 
0025 using ReconstructedParticleObjPointerContainer = std::deque<ReconstructedParticleObj*>;
0026 using ReconstructedParticleDataContainer = std::vector<ReconstructedParticleData>;
0027 
0028 /**
0029  * Class encapsulating everything related to storage of data that is needed by a
0030  * collection.
0031  */
0032 class ReconstructedParticleCollectionData {
0033 public:
0034   /**
0035    * The Objs of this collection
0036    */
0037   ReconstructedParticleObjPointerContainer entries{};
0038 
0039   /**
0040    * Default constructor setting up the necessary buffers
0041    */
0042   ReconstructedParticleCollectionData();
0043 
0044   /**
0045    * Constructor from existing I/O buffers
0046    */
0047   ReconstructedParticleCollectionData(podio::CollectionReadBuffers buffers, bool isSubsetColl);
0048 
0049   /**
0050    * Non copy-able, move-only class
0051    */
0052   ReconstructedParticleCollectionData(const ReconstructedParticleCollectionData&) = delete;
0053   ReconstructedParticleCollectionData& operator=(const ReconstructedParticleCollectionData&) = delete;
0054   ReconstructedParticleCollectionData(ReconstructedParticleCollectionData&& other) = default;
0055   ReconstructedParticleCollectionData& operator=(ReconstructedParticleCollectionData&& other) = default;
0056 
0057   /**
0058    * Destructor
0059    */
0060   ~ReconstructedParticleCollectionData() = 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(ReconstructedParticleObj* 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<edm4hep::Cluster> m_rel_clusters;                    ///< Relation buffer for read / write
0079   std::vector<podio::UVecPtr<edm4hep::Cluster>> m_rel_clusters_tmp{}; ///< Relation buffer for internal book-keeping
0080   podio::UVecPtr<edm4hep::Track> m_rel_tracks;                        ///< Relation buffer for read / write
0081   std::vector<podio::UVecPtr<edm4hep::Track>> m_rel_tracks_tmp{};     ///< Relation buffer for internal book-keeping
0082   podio::UVecPtr<edm4hep::ReconstructedParticle> m_rel_particles;     ///< Relation buffer for read / write
0083   std::vector<podio::UVecPtr<edm4hep::ReconstructedParticle>> m_rel_particles_tmp{}; ///< Relation buffer for internal
0084                                                                                      ///< book-keeping
0085   podio::UVecPtr<edm4hep::ParticleID> m_rel_particleIDs;                    ///< Relation buffer for read / write
0086   std::vector<podio::UVecPtr<edm4hep::ParticleID>> m_rel_particleIDs_tmp{}; ///< Relation buffer for internal
0087                                                                             ///< book-keeping
0088   podio::UVecPtr<edm4hep::Vertex> m_rel_startVertex{nullptr};               ///< Relation buffer for read / write
0089   podio::UVecPtr<edm4hep::ParticleID> m_rel_particleIDUsed{nullptr};        ///< Relation buffer for read / write
0090 
0091   // members to handle vector members
0092 
0093   // I/O related buffers
0094   podio::CollRefCollection m_refCollections{};
0095   podio::VectorMembersInfo m_vecmem_info{};
0096   std::unique_ptr<ReconstructedParticleDataContainer> m_data{nullptr};
0097 };
0098 
0099 } // namespace edm4hep
0100 
0101 #endif