Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:35:35

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef PODIODATAMODEL_MutableExampleHit_H
0004 #define PODIODATAMODEL_MutableExampleHit_H
0005 
0006 #include "PodioDatamodel/ExampleHitObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "PodioDatamodel/ExampleHit.h"
0009 
0010 #include <cstdint>
0011 
0012 #include "podio/utilities/MaybeSharedPtr.h"
0013 
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 
0025 
0026 /** @class MutableExampleHit
0027  *  Example Hit
0028  *  @author: B. Hegner
0029  */
0030 class MutableExampleHit {
0031 
0032   friend class ExampleHitCollection;
0033   friend class ExampleHitMutableCollectionIterator;
0034   friend class ExampleHit;
0035 
0036 public:
0037   using object_type = ExampleHit;
0038   using collection_type = ExampleHitCollection;
0039 
0040   /// default constructor
0041   MutableExampleHit();
0042 
0043   /// Constructor initializing all members
0044   MutableExampleHit(std::uint64_t cellID, double x, double y, double z, double energy, std::uint64_t time);
0045 
0046   /// copy constructor
0047   MutableExampleHit(const MutableExampleHit& other) = default;
0048 
0049   /// copy-assignment operator
0050   MutableExampleHit& operator=(MutableExampleHit other);
0051 
0052   /// create a mutable deep-copy of the object with identical relations
0053   /// if cloneRelations=false, the relations are not cloned and will be empty
0054   MutableExampleHit clone(bool cloneRelations=true) const;
0055 
0056   /// destructor
0057   ~MutableExampleHit() = default;
0058 
0059 
0060 public:
0061 
0062   /// Access the cellID
0063   std::uint64_t cellID() const;
0064 
0065   /// Access the x-coordinate
0066   double x() const;
0067 
0068   /// Access the y-coordinate
0069   double y() const;
0070 
0071   /// Access the z-coordinate
0072   double z() const;
0073 
0074   /// Access the measured energy deposit
0075   double energy() const;
0076 
0077   /// Access the ticks since start of timeframe
0078   std::uint64_t time() const;
0079 
0080 
0081 
0082   /// Set the cellID
0083   void cellID(std::uint64_t value);
0084   /// Get mutable reference to cellID
0085   std::uint64_t& cellID();
0086 
0087   /// Set the x-coordinate
0088   void x(double value);
0089   /// Get mutable reference to x-coordinate
0090   double& x();
0091 
0092   /// Set the y-coordinate
0093   void y(double value);
0094   /// Get mutable reference to y-coordinate
0095   double& y();
0096 
0097   /// Set the z-coordinate
0098   void z(double value);
0099   /// Get mutable reference to z-coordinate
0100   double& z();
0101 
0102   /// Set the measured energy deposit
0103   void energy(double value);
0104   /// Get mutable reference to measured energy deposit
0105   double& energy();
0106 
0107   /// Set the ticks since start of timeframe
0108   void time(std::uint64_t value);
0109   /// Get mutable reference to ticks since start of timeframe
0110   std::uint64_t& time();
0111 
0112 
0113 
0114 
0115 
0116 
0117   /// check whether the object is actually available
0118   bool isAvailable() const;
0119   /// disconnect from ExampleHitObj instance
0120   void unlink() { m_obj = podio::utils::MaybeSharedPtr<ExampleHitObj>{nullptr}; }
0121 
0122   bool operator==(const MutableExampleHit& other) const { return m_obj == other.m_obj; }
0123   bool operator==(const ExampleHit& other) const;
0124 
0125   bool operator!=(const MutableExampleHit& other) const { return !(*this == other); }
0126   bool operator!=(const ExampleHit& other) const { return !(*this == other); }
0127 
0128   // less comparison operator, so that objects can be e.g. stored in sets.
0129   bool operator<(const MutableExampleHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0130 
0131   podio::ObjectID id() const { return getObjectID(); }
0132 
0133   const podio::ObjectID getObjectID() const;
0134 
0135   friend void swap(MutableExampleHit& a, MutableExampleHit& b) {
0136     using std::swap;
0137     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0138   }
0139 
0140 private:
0141   /// constructor from existing ExampleHitObj
0142   explicit MutableExampleHit(podio::utils::MaybeSharedPtr<ExampleHitObj> obj);
0143 
0144   podio::utils::MaybeSharedPtr<ExampleHitObj> m_obj{nullptr};
0145 };
0146 
0147 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0148 void to_json(nlohmann::json& j, const MutableExampleHit& value);
0149 #endif
0150 
0151 
0152 
0153 
0154 #endif