Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:41:10

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef PODIODATAMODEL_ExampleHit_H
0004 #define PODIODATAMODEL_ExampleHit_H
0005 
0006 #include "PodioDatamodel/ExampleHitObj.h"
0007 
0008 #include <cstdint>
0009 
0010 #include "podio/utilities/MaybeSharedPtr.h"
0011 #include "podio/detail/OrderKey.h"
0012 
0013 #include <ostream>
0014 #include <cstdint>
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 // forward declarations
0021 class ExampleHitCollection;
0022 
0023 
0024 namespace podio::detail {
0025 // Internal function used in less comparison operators of the datatypes and interface types
0026 OrderKey getOrderKey(const ::ExampleHit& obj);
0027 };
0028 
0029 
0030 class MutableExampleHit;
0031 class ExampleHitCollection;
0032 class ExampleHitCollectionData;
0033 
0034 /** @class ExampleHit
0035  *  Example Hit
0036  *  @author: B. Hegner
0037  */
0038 class ExampleHit {
0039 
0040   friend class MutableExampleHit;
0041   friend class ExampleHitCollection;
0042   friend class ExampleHitCollectionData;
0043   friend class ExampleHitCollectionIterator;
0044   friend podio::detail::OrderKey podio::detail::getOrderKey(const ExampleHit & obj);
0045 
0046 public:
0047   using mutable_type = MutableExampleHit;
0048   using collection_type = ExampleHitCollection;
0049 
0050   /// default constructor
0051   ExampleHit();
0052 
0053   /// Constructor initializing all members
0054   ExampleHit(std::uint64_t cellID, double x, double y, double z, double energy, std::uint64_t time);
0055 
0056   /// copy constructor
0057   ExampleHit(const ExampleHit& other) = default;
0058 
0059   /// copy-assignment operator
0060   ExampleHit& operator=(ExampleHit other);
0061 
0062   /// create a mutable deep-copy of the object with identical relations
0063   /// if cloneRelations=false, the relations are not cloned and will be empty
0064   MutableExampleHit clone(bool cloneRelations=true) const;
0065 
0066   /// destructor
0067   ~ExampleHit() = default;
0068 
0069   /// converting constructor from mutable object
0070   ExampleHit(const MutableExampleHit& other);
0071 
0072   static ExampleHit makeEmpty();
0073 
0074 public:
0075 
0076   static constexpr auto typeName = "ExampleHit";
0077 
0078   /// Access the cellID
0079   std::uint64_t cellID() const;
0080 
0081   /// Access the x-coordinate
0082   double x() const;
0083 
0084   /// Access the y-coordinate
0085   double y() const;
0086 
0087   /// Access the z-coordinate
0088   double z() const;
0089 
0090   /// Access the measured energy deposit
0091   double energy() const;
0092 
0093   /// Access the ticks since start of timeframe
0094   std::uint64_t time() const;
0095 
0096 
0097 
0098 
0099 
0100   /// check whether the object is actually available
0101   bool isAvailable() const;
0102   /// disconnect from ExampleHitObj instance
0103   void unlink() { m_obj = podio::utils::MaybeSharedPtr<ExampleHitObj>{nullptr}; }
0104 
0105   bool operator==(const ExampleHit& other) const { return m_obj == other.m_obj; }
0106   bool operator==(const MutableExampleHit& other) const;
0107 
0108   bool operator!=(const ExampleHit& other) const { return !(*this == other); }
0109   bool operator!=(const MutableExampleHit& other) const { return !(*this == other); }
0110 
0111   // less comparison operator, so that objects can be e.g. stored in sets.
0112   bool operator<(const ExampleHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0113 
0114   podio::ObjectID id() const { return getObjectID(); }
0115 
0116   const podio::ObjectID getObjectID() const;
0117 
0118   friend void swap(ExampleHit& a, ExampleHit& 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 ExampleHitObj
0125   explicit ExampleHit(podio::utils::MaybeSharedPtr<ExampleHitObj> obj);
0126   ExampleHit(ExampleHitObj* obj);
0127 
0128   podio::utils::MaybeSharedPtr<ExampleHitObj> m_obj{nullptr};
0129 };
0130 
0131 std::ostream& operator<<(std::ostream& o, const ExampleHit& value);
0132 
0133 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0134 void to_json(nlohmann::json& j, const ExampleHit& value);
0135 #endif
0136 
0137 
0138 
0139 
0140 #endif