Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:28

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