Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/edm4eic/SimPulseCollectionData.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_SimPulse_CollectionData_H
0004 #define EDM4EIC_SimPulse_CollectionData_H
0005 
0006 // datamodel specific includes
0007 #include "edm4eic/SimPulseData.h"
0008 #include "edm4eic/SimPulseObj.h"
0009 #include "edm4eic/SimPulse.h"
0010 #include "edm4hep/MCParticle.h"
0011 #include "edm4hep/SimCalorimeterHit.h"
0012 #include "edm4hep/SimTrackerHit.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 edm4eic {
0024 
0025 
0026 using SimPulseObjPointerContainer = std::deque<SimPulseObj*>;
0027 using SimPulseDataContainer = std::vector<SimPulseData>;
0028 
0029 
0030 /**
0031  * Class encapsulating everything related to storage of data that is needed by a
0032  * collection.
0033  */
0034 class SimPulseCollectionData {
0035 public:
0036   /**
0037    * The Objs of this collection
0038    */
0039   SimPulseObjPointerContainer entries{};
0040 
0041   /**
0042    * Default constructor setting up the necessary buffers
0043    */
0044   SimPulseCollectionData();
0045 
0046   /**
0047    * Constructor from existing I/O buffers
0048    */
0049   SimPulseCollectionData(podio::CollectionReadBuffers buffers, bool isSubsetColl);
0050 
0051   /**
0052    * Non copy-able, move-only class
0053    */
0054   SimPulseCollectionData(const SimPulseCollectionData&) = delete;
0055   SimPulseCollectionData& operator=(const SimPulseCollectionData&) = delete;
0056   SimPulseCollectionData(SimPulseCollectionData&& other) = default;
0057   SimPulseCollectionData& operator=(SimPulseCollectionData&& other) = default;
0058 
0059   /**
0060    * Destructor
0061    */
0062   ~SimPulseCollectionData() = 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(SimPulseObj* obj);
0075 
0076   bool setReferences(const podio::ICollectionProvider* collectionProvider, bool isSubsetColl);
0077 
0078 private:
0079   // members to handle 1-to-N-relations
0080   podio::UVecPtr<edm4hep::SimCalorimeterHit> m_rel_calorimeterHits{std::make_unique<std::vector<edm4hep::SimCalorimeterHit>>()}; ///< Relation buffer for read / write
0081   std::vector<podio::UVecPtr<edm4hep::SimCalorimeterHit>> m_rel_calorimeterHits_tmp{}; ///< Relation buffer for internal book-keeping
0082   podio::UVecPtr<edm4hep::SimTrackerHit> m_rel_trackerHits{std::make_unique<std::vector<edm4hep::SimTrackerHit>>()}; ///< Relation buffer for read / write
0083   std::vector<podio::UVecPtr<edm4hep::SimTrackerHit>> m_rel_trackerHits_tmp{}; ///< Relation buffer for internal book-keeping
0084   podio::UVecPtr<edm4eic::SimPulse> m_rel_pulses{std::make_unique<std::vector<edm4eic::SimPulse>>()}; ///< Relation buffer for read / write
0085   std::vector<podio::UVecPtr<edm4eic::SimPulse>> m_rel_pulses_tmp{}; ///< Relation buffer for internal book-keeping
0086   podio::UVecPtr<edm4hep::MCParticle> m_rel_particles{std::make_unique<std::vector<edm4hep::MCParticle>>()}; ///< Relation buffer for read / write
0087   std::vector<podio::UVecPtr<edm4hep::MCParticle>> m_rel_particles_tmp{}; ///< Relation buffer for internal book-keeping
0088 
0089   // members to handle vector members
0090   podio::UVecPtr<float> m_vec_amplitude{nullptr}; /// combined vector of all objects in collection
0091   std::vector<podio::UVecPtr<float>> m_vecs_amplitude{}; /// pointers to individual member vectors
0092 
0093   // I/O related buffers
0094   podio::CollRefCollection m_refCollections{};
0095   podio::VectorMembersInfo m_vecmem_info{};
0096   std::unique_ptr<SimPulseDataContainer> m_data{nullptr};
0097 };
0098 
0099 
0100 } // namespace edm4eic
0101 
0102 
0103 #endif