Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:53:24

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();
0056 
0057   /// Constructor initializing all members
0058   RawTimeSeries(std::uint64_t cellID, std::int32_t quality, float time, float charge, float interval);
0059 
0060   /// copy constructor
0061   RawTimeSeries(const RawTimeSeries& other) = default;
0062 
0063   /// copy-assignment operator
0064   RawTimeSeries& operator=(RawTimeSeries other);
0065 
0066   /// create a mutable deep-copy of the object with identical relations
0067   /// if cloneRelations=false, the relations are not cloned and will be empty
0068   MutableRawTimeSeries clone(bool cloneRelations = true) const;
0069 
0070   /// destructor
0071   ~RawTimeSeries() = default;
0072 
0073   /// converting constructor from mutable object
0074   RawTimeSeries(const MutableRawTimeSeries& other);
0075 
0076   static RawTimeSeries makeEmpty();
0077 
0078 public:
0079   static constexpr auto typeName = "edm4hep::RawTimeSeries";
0080 
0081   /// Access the detector specific cell id
0082   std::uint64_t getCellID() const;
0083 
0084   /// Access the quality flag for the hit
0085   std::int32_t getQuality() const;
0086 
0087   /// Access the time of the hit [ns]
0088   float getTime() const;
0089 
0090   /// Access the integrated charge of the hit [fC]
0091   float getCharge() const;
0092 
0093   /// Access the interval of each sampling [ns]
0094   float getInterval() const;
0095 
0096   std::size_t adcCounts_size() const;
0097   std::int32_t getAdcCounts(std::size_t) const;
0098   std::vector<std::int32_t>::const_iterator adcCounts_begin() const;
0099   std::vector<std::int32_t>::const_iterator adcCounts_end() const;
0100   podio::RelationRange<std::int32_t> getAdcCounts() const;
0101 
0102   /// check whether the object is actually available
0103   bool isAvailable() const;
0104   /// disconnect from RawTimeSeriesObj instance
0105   void unlink() {
0106     m_obj = podio::utils::MaybeSharedPtr<RawTimeSeriesObj>{nullptr};
0107   }
0108 
0109   bool operator==(const RawTimeSeries& other) const {
0110     return m_obj == other.m_obj;
0111   }
0112   bool operator==(const MutableRawTimeSeries& other) const;
0113 
0114   bool operator!=(const RawTimeSeries& other) const {
0115     return !(*this == other);
0116   }
0117   bool operator!=(const MutableRawTimeSeries& other) const {
0118     return !(*this == other);
0119   }
0120 
0121   // less comparison operator, so that objects can be e.g. stored in sets.
0122   bool operator<(const RawTimeSeries& other) const {
0123     return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other);
0124   }
0125 
0126   podio::ObjectID id() const {
0127     return getObjectID();
0128   }
0129 
0130   const podio::ObjectID getObjectID() const;
0131 
0132   friend void swap(RawTimeSeries& a, RawTimeSeries& b) {
0133     using std::swap;
0134     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0135   }
0136 
0137 private:
0138   /// constructor from existing RawTimeSeriesObj
0139   explicit RawTimeSeries(podio::utils::MaybeSharedPtr<RawTimeSeriesObj> obj);
0140   RawTimeSeries(RawTimeSeriesObj* obj);
0141 
0142   podio::utils::MaybeSharedPtr<RawTimeSeriesObj> m_obj{nullptr};
0143 };
0144 
0145 std::ostream& operator<<(std::ostream& o, const RawTimeSeries& value);
0146 
0147 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0148 void to_json(nlohmann::json& j, const RawTimeSeries& value);
0149 #endif
0150 
0151 } // namespace edm4hep
0152 
0153 #endif