Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_TrackerPulse_H
0004 #define EDM4HEP_TrackerPulse_H
0005 
0006 #include "edm4hep/TrackerPulseObj.h"
0007 
0008 #include <array>
0009 #include <cstdint>
0010 
0011 #include "podio/utilities/MaybeSharedPtr.h"
0012 
0013 #include <cstdint>
0014 #include <ostream>
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 // forward declarations
0021 namespace edm4hep {
0022 class TimeSeries;
0023 class MutableTimeSeries;
0024 } // namespace edm4hep
0025 
0026 namespace edm4hep {
0027 
0028 class MutableTrackerPulse;
0029 class TrackerPulseCollection;
0030 class TrackerPulseCollectionData;
0031 
0032 /** @class TrackerPulse
0033  *  Reconstructed Tracker Pulse
0034  *  @author: Wenxing Fang, IHEP
0035  */
0036 class TrackerPulse {
0037 
0038   friend class MutableTrackerPulse;
0039   friend class TrackerPulseCollection;
0040   friend class edm4hep::TrackerPulseCollectionData;
0041   friend class TrackerPulseCollectionIterator;
0042 
0043 public:
0044   using mutable_type = MutableTrackerPulse;
0045   using collection_type = TrackerPulseCollection;
0046 
0047   /// default constructor
0048   TrackerPulse();
0049 
0050   /// Constructor initializing all members
0051   TrackerPulse(std::uint64_t cellID, float time, float charge, std::int16_t quality, std::array<float, 3> covMatrix);
0052 
0053   /// copy constructor
0054   TrackerPulse(const TrackerPulse& other) = default;
0055 
0056   /// copy-assignment operator
0057   TrackerPulse& operator=(TrackerPulse other);
0058 
0059   /// create a mutable deep-copy of the object with identical relations
0060   /// if cloneRelations=false, the relations are not cloned and will be empty
0061   MutableTrackerPulse clone(bool cloneRelations = true) const;
0062 
0063   /// destructor
0064   ~TrackerPulse() = default;
0065 
0066   /// converting constructor from mutable object
0067   TrackerPulse(const MutableTrackerPulse& other);
0068 
0069   static TrackerPulse makeEmpty();
0070 
0071 public:
0072   /// Access the cell id.
0073   std::uint64_t getCellID() const;
0074 
0075   /// Access the time [ns].
0076   float getTime() const;
0077 
0078   /// Access the charge [fC].
0079   float getCharge() const;
0080 
0081   /// Access the quality.
0082   std::int16_t getQuality() const;
0083 
0084   /// Access the lower triangle covariance matrix of the charge(c) and time(t) measurements.
0085   const std::array<float, 3>& getCovMatrix() const;
0086   /// Access item i of the lower triangle covariance matrix of the charge(c) and time(t) measurements.
0087   float getCovMatrix(size_t i) const;
0088 
0089   /// Access the Optionally, the timeSeries that has been used to create the pulse can be stored with the pulse.
0090   const edm4hep::TimeSeries getTimeSeries() const;
0091 
0092   /// check whether the object is actually available
0093   bool isAvailable() const;
0094   /// disconnect from TrackerPulseObj instance
0095   void unlink() {
0096     m_obj = podio::utils::MaybeSharedPtr<TrackerPulseObj>{nullptr};
0097   }
0098 
0099   bool operator==(const TrackerPulse& other) const {
0100     return m_obj == other.m_obj;
0101   }
0102   bool operator==(const MutableTrackerPulse& other) const;
0103 
0104   bool operator!=(const TrackerPulse& other) const {
0105     return !(*this == other);
0106   }
0107   bool operator!=(const MutableTrackerPulse& other) const {
0108     return !(*this == other);
0109   }
0110 
0111   // less comparison operator, so that objects can be e.g. stored in sets.
0112   bool operator<(const TrackerPulse& other) const {
0113     return m_obj < other.m_obj;
0114   }
0115 
0116   podio::ObjectID id() const {
0117     return getObjectID();
0118   }
0119 
0120   const podio::ObjectID getObjectID() const;
0121 
0122   friend void swap(TrackerPulse& a, TrackerPulse& b) {
0123     using std::swap;
0124     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0125   }
0126 
0127 private:
0128   /// constructor from existing TrackerPulseObj
0129   explicit TrackerPulse(podio::utils::MaybeSharedPtr<TrackerPulseObj> obj);
0130   TrackerPulse(TrackerPulseObj* obj);
0131 
0132   podio::utils::MaybeSharedPtr<TrackerPulseObj> m_obj{nullptr};
0133 };
0134 
0135 std::ostream& operator<<(std::ostream& o, const TrackerPulse& value);
0136 
0137 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0138 void to_json(nlohmann::json& j, const TrackerPulse& value);
0139 #endif
0140 
0141 } // namespace edm4hep
0142 
0143 #endif