Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:16:28

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/detail/OrderKey.h"
0013 #include "podio/utilities/MaybeSharedPtr.h"
0014 
0015 #include <cstdint>
0016 #include <ostream>
0017 
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021 
0022 // forward declarations
0023 namespace edm4hep {
0024 class RawTimeSeriesCollection;
0025 }
0026 
0027 namespace podio::detail {
0028 // Internal function used in less comparison operators of the datatypes and interface types
0029 OrderKey getOrderKey(const edm4hep::RawTimeSeries& obj);
0030 }; // namespace podio::detail
0031 
0032 namespace edm4hep {
0033 
0034 class MutableRawTimeSeries;
0035 class RawTimeSeriesCollection;
0036 class RawTimeSeriesCollectionData;
0037 
0038 /** @class RawTimeSeries
0039  *  Raw data of a detector readout
0040  *  @author: EDM4hep authors
0041  */
0042 class RawTimeSeries {
0043 
0044   friend class MutableRawTimeSeries;
0045   friend class RawTimeSeriesCollection;
0046   friend class edm4hep::RawTimeSeriesCollectionData;
0047   friend class RawTimeSeriesCollectionIterator;
0048   friend podio::detail::OrderKey podio::detail::getOrderKey(const RawTimeSeries& obj);
0049 
0050 public:
0051   using mutable_type = MutableRawTimeSeries;
0052   using collection_type = RawTimeSeriesCollection;
0053 
0054   /// default constructor
0055   RawTimeSeries() = default;
0056 
0057   /// Constructor initializing all members
0058   RawTimeSeries(const std::uint64_t cellID, const std::int32_t quality, const float time, const float charge,
0059                 const float interval);
0060 
0061   /// copy constructor
0062   RawTimeSeries(const RawTimeSeries& other) = default;
0063 
0064   /// copy-assignment operator
0065   RawTimeSeries& operator=(RawTimeSeries other) &; // Rebind this to other's internal object
0066   RawTimeSeries&
0067   operator=(RawTimeSeries other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
0068 
0069   /// create a mutable deep-copy of the object with identical relations
0070   /// if cloneRelations=false, the relations are not cloned and will be empty
0071   MutableRawTimeSeries clone(bool cloneRelations = true) const;
0072 
0073   /// destructor
0074   ~RawTimeSeries() = default;
0075 
0076   /// converting constructor from mutable object
0077   RawTimeSeries(const MutableRawTimeSeries& other);
0078 
0079   static RawTimeSeries makeEmpty();
0080 
0081 public:
0082   static constexpr std::string_view typeName = "edm4hep::RawTimeSeries";
0083 
0084   /// Access the detector specific cell id
0085   std::uint64_t getCellID() const;
0086 
0087   /// Access the quality flag for the hit
0088   std::int32_t getQuality() const;
0089 
0090   /// Access the time of the hit [ns]
0091   float getTime() const;
0092 
0093   /// Access the integrated charge of the hit [fC]
0094   float getCharge() const;
0095 
0096   /// Access the interval of each sampling [ns]
0097   float getInterval() const;
0098 
0099   std::size_t adcCounts_size() const;
0100   std::int32_t getAdcCounts(std::size_t) const;
0101   std::vector<std::int32_t>::const_iterator adcCounts_begin() const;
0102   std::vector<std::int32_t>::const_iterator adcCounts_end() const;
0103   podio::RelationRange<std::int32_t> getAdcCounts() const;
0104 
0105   /// check whether the object is actually available
0106   bool isAvailable() const;
0107   /// disconnect from RawTimeSeriesObj instance
0108   void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawTimeSeriesObj>{nullptr}; }
0109 
0110   bool operator==(const RawTimeSeries& other) const { return m_obj == other.m_obj; }
0111   bool operator==(const MutableRawTimeSeries& other) const;
0112 
0113   bool operator!=(const RawTimeSeries& other) const { return !(*this == other); }
0114   bool operator!=(const MutableRawTimeSeries& other) const { return !(*this == other); }
0115 
0116   // less comparison operator, so that objects can be e.g. stored in sets.
0117   bool operator<(const RawTimeSeries& other) const {
0118     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0119   }
0120 
0121   podio::ObjectID id() const { return getObjectID(); }
0122 
0123   const podio::ObjectID getObjectID() const;
0124 
0125   friend std::hash<RawTimeSeries>;
0126 
0127   friend void swap(RawTimeSeries& a, RawTimeSeries& b) {
0128     using std::swap;
0129     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0130   }
0131 
0132 private:
0133   /// constructor from existing RawTimeSeriesObj
0134   explicit RawTimeSeries(podio::utils::MaybeSharedPtr<RawTimeSeriesObj> obj);
0135   RawTimeSeries(RawTimeSeriesObj* obj);
0136 
0137   podio::utils::MaybeSharedPtr<RawTimeSeriesObj> m_obj{new RawTimeSeriesObj{}, podio::utils::MarkOwned};
0138 };
0139 
0140 std::ostream& operator<<(std::ostream& o, const RawTimeSeries& value);
0141 
0142 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0143 void to_json(nlohmann::json& j, const RawTimeSeries& value);
0144 #endif
0145 
0146 } // namespace edm4hep
0147 
0148 template <>
0149 struct std::hash<edm4hep::RawTimeSeries> {
0150   std::size_t operator()(const edm4hep::RawTimeSeries& obj) const {
0151     return std::hash<edm4hep::RawTimeSeriesObj*>{}(obj.m_obj.get());
0152   }
0153 };
0154 
0155 // This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
0156 // until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
0157 // and https://github.com/AIDASoft/podio/issues/770
0158 #if defined(__clang__)
0159 #pragma clang diagnostic push
0160 #pragma clang diagnostic ignored "-Wunknown-warning-option"
0161 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
0162 #pragma clang diagnostic ignored "-Wdeprecated"
0163 constexpr std::string_view edm4hep::RawTimeSeries::typeName;
0164 #pragma clang diagnostic pop
0165 #elif defined(__GNUC__)
0166 #pragma GCC diagnostic push
0167 #pragma GCC diagnostic ignored "-Wdeprecated"
0168 constexpr std::string_view edm4hep::RawTimeSeries::typeName;
0169 #pragma GCC diagnostic pop
0170 #endif
0171 
0172 #endif