Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:38

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_RawCalorimeterHit_H
0004 #define EDM4HEP_RawCalorimeterHit_H
0005 
0006 #include "edm4hep/RawCalorimeterHitObj.h"
0007 
0008 #include <cstdint>
0009 
0010 #include "podio/utilities/MaybeSharedPtr.h"
0011 
0012 #include <cstdint>
0013 #include <ostream>
0014 
0015 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0016 #include "nlohmann/json_fwd.hpp"
0017 #endif
0018 
0019 namespace edm4hep {
0020 
0021 class MutableRawCalorimeterHit;
0022 class RawCalorimeterHitCollection;
0023 class RawCalorimeterHitCollectionData;
0024 
0025 /** @class RawCalorimeterHit
0026  *  Raw calorimeter hit
0027  *  @author: F.Gaede, DESY
0028  */
0029 class RawCalorimeterHit {
0030 
0031   friend class MutableRawCalorimeterHit;
0032   friend class RawCalorimeterHitCollection;
0033   friend class edm4hep::RawCalorimeterHitCollectionData;
0034   friend class RawCalorimeterHitCollectionIterator;
0035 
0036 public:
0037   using mutable_type = MutableRawCalorimeterHit;
0038   using collection_type = RawCalorimeterHitCollection;
0039 
0040   /// default constructor
0041   RawCalorimeterHit();
0042 
0043   /// Constructor initializing all members
0044   RawCalorimeterHit(std::uint64_t cellID, std::int32_t amplitude, std::int32_t timeStamp);
0045 
0046   /// copy constructor
0047   RawCalorimeterHit(const RawCalorimeterHit& other) = default;
0048 
0049   /// copy-assignment operator
0050   RawCalorimeterHit& operator=(RawCalorimeterHit 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   MutableRawCalorimeterHit clone(bool cloneRelations = true) const;
0055 
0056   /// destructor
0057   ~RawCalorimeterHit() = default;
0058 
0059   /// converting constructor from mutable object
0060   RawCalorimeterHit(const MutableRawCalorimeterHit& other);
0061 
0062   static RawCalorimeterHit makeEmpty();
0063 
0064 public:
0065   /// Access the detector specific (geometrical) cell id.
0066   std::uint64_t getCellID() const;
0067 
0068   /// Access the amplitude of the hit in ADC counts.
0069   std::int32_t getAmplitude() const;
0070 
0071   /// Access the time stamp for the hit.
0072   std::int32_t getTimeStamp() const;
0073 
0074   /// check whether the object is actually available
0075   bool isAvailable() const;
0076   /// disconnect from RawCalorimeterHitObj instance
0077   void unlink() {
0078     m_obj = podio::utils::MaybeSharedPtr<RawCalorimeterHitObj>{nullptr};
0079   }
0080 
0081   bool operator==(const RawCalorimeterHit& other) const {
0082     return m_obj == other.m_obj;
0083   }
0084   bool operator==(const MutableRawCalorimeterHit& other) const;
0085 
0086   bool operator!=(const RawCalorimeterHit& other) const {
0087     return !(*this == other);
0088   }
0089   bool operator!=(const MutableRawCalorimeterHit& other) const {
0090     return !(*this == other);
0091   }
0092 
0093   // less comparison operator, so that objects can be e.g. stored in sets.
0094   bool operator<(const RawCalorimeterHit& other) const {
0095     return m_obj < other.m_obj;
0096   }
0097 
0098   podio::ObjectID id() const {
0099     return getObjectID();
0100   }
0101 
0102   const podio::ObjectID getObjectID() const;
0103 
0104   friend void swap(RawCalorimeterHit& a, RawCalorimeterHit& b) {
0105     using std::swap;
0106     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0107   }
0108 
0109 private:
0110   /// constructor from existing RawCalorimeterHitObj
0111   explicit RawCalorimeterHit(podio::utils::MaybeSharedPtr<RawCalorimeterHitObj> obj);
0112   RawCalorimeterHit(RawCalorimeterHitObj* obj);
0113 
0114   podio::utils::MaybeSharedPtr<RawCalorimeterHitObj> m_obj{nullptr};
0115 };
0116 
0117 std::ostream& operator<<(std::ostream& o, const RawCalorimeterHit& value);
0118 
0119 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0120 void to_json(nlohmann::json& j, const RawCalorimeterHit& value);
0121 #endif
0122 
0123 } // namespace edm4hep
0124 
0125 #endif