Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_RawTimeSeries_H
0004 #define EDM4HEP_RawTimeSeries_H
0005 
0006 #include "edm4hep/RawTimeSeriesObj.h"
0007 
0008 #include "podio/RelationRange.h"
0009 #include <cstdint>
0010 #include <vector>
0011 
0012 #include "podio/utilities/MaybeSharedPtr.h"
0013 
0014 #include <cstdint>
0015 #include <ostream>
0016 
0017 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0018 #include "nlohmann/json_fwd.hpp"
0019 #endif
0020 
0021 namespace edm4hep {
0022 
0023 class MutableRawTimeSeries;
0024 class RawTimeSeriesCollection;
0025 class RawTimeSeriesCollectionData;
0026 
0027 /** @class RawTimeSeries
0028  *  Raw data of a detector readout
0029  *  @author: F.Gaede, DESY
0030  */
0031 class RawTimeSeries {
0032 
0033   friend class MutableRawTimeSeries;
0034   friend class RawTimeSeriesCollection;
0035   friend class edm4hep::RawTimeSeriesCollectionData;
0036   friend class RawTimeSeriesCollectionIterator;
0037 
0038 public:
0039   using mutable_type = MutableRawTimeSeries;
0040   using collection_type = RawTimeSeriesCollection;
0041 
0042   /// default constructor
0043   RawTimeSeries();
0044 
0045   /// Constructor initializing all members
0046   RawTimeSeries(std::uint64_t cellID, std::int32_t quality, float time, float charge, float interval);
0047 
0048   /// copy constructor
0049   RawTimeSeries(const RawTimeSeries& other) = default;
0050 
0051   /// copy-assignment operator
0052   RawTimeSeries& operator=(RawTimeSeries other);
0053 
0054   /// create a mutable deep-copy of the object with identical relations
0055   /// if cloneRelations=false, the relations are not cloned and will be empty
0056   MutableRawTimeSeries clone(bool cloneRelations = true) const;
0057 
0058   /// destructor
0059   ~RawTimeSeries() = default;
0060 
0061   /// converting constructor from mutable object
0062   RawTimeSeries(const MutableRawTimeSeries& other);
0063 
0064   static RawTimeSeries makeEmpty();
0065 
0066 public:
0067   /// Access the detector specific cell id.
0068   std::uint64_t getCellID() const;
0069 
0070   /// Access the quality flag for the hit.
0071   std::int32_t getQuality() const;
0072 
0073   /// Access the time of the hit [ns].
0074   float getTime() const;
0075 
0076   /// Access the integrated charge of the hit [fC].
0077   float getCharge() const;
0078 
0079   /// Access the interval of each sampling [ns].
0080   float getInterval() const;
0081 
0082   std::size_t adcCounts_size() const;
0083   std::int32_t getAdcCounts(std::size_t) const;
0084   std::vector<std::int32_t>::const_iterator adcCounts_begin() const;
0085   std::vector<std::int32_t>::const_iterator adcCounts_end() const;
0086   podio::RelationRange<std::int32_t> getAdcCounts() const;
0087 
0088   /// check whether the object is actually available
0089   bool isAvailable() const;
0090   /// disconnect from RawTimeSeriesObj instance
0091   void unlink() {
0092     m_obj = podio::utils::MaybeSharedPtr<RawTimeSeriesObj>{nullptr};
0093   }
0094 
0095   bool operator==(const RawTimeSeries& other) const {
0096     return m_obj == other.m_obj;
0097   }
0098   bool operator==(const MutableRawTimeSeries& other) const;
0099 
0100   bool operator!=(const RawTimeSeries& other) const {
0101     return !(*this == other);
0102   }
0103   bool operator!=(const MutableRawTimeSeries& other) const {
0104     return !(*this == other);
0105   }
0106 
0107   // less comparison operator, so that objects can be e.g. stored in sets.
0108   bool operator<(const RawTimeSeries& other) const {
0109     return m_obj < other.m_obj;
0110   }
0111 
0112   podio::ObjectID id() const {
0113     return getObjectID();
0114   }
0115 
0116   const podio::ObjectID getObjectID() const;
0117 
0118   friend void swap(RawTimeSeries& a, RawTimeSeries& b) {
0119     using std::swap;
0120     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0121   }
0122 
0123 private:
0124   /// constructor from existing RawTimeSeriesObj
0125   explicit RawTimeSeries(podio::utils::MaybeSharedPtr<RawTimeSeriesObj> obj);
0126   RawTimeSeries(RawTimeSeriesObj* obj);
0127 
0128   podio::utils::MaybeSharedPtr<RawTimeSeriesObj> m_obj{nullptr};
0129 };
0130 
0131 std::ostream& operator<<(std::ostream& o, const RawTimeSeries& value);
0132 
0133 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0134 void to_json(nlohmann::json& j, const RawTimeSeries& value);
0135 #endif
0136 
0137 } // namespace edm4hep
0138 
0139 #endif