Back to home page

EIC code displayed by LXR

 
 

    


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

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