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_TrackerHitPlane_H
0004 #define EDM4HEP_TrackerHitPlane_H
0005 
0006 #include "edm4hep/TrackerHitPlaneObj.h"
0007 
0008 #include "edm4hep/ObjectID.h"
0009 #include "edm4hep/Vector2f.h"
0010 #include "edm4hep/Vector3d.h"
0011 #include "podio/RelationRange.h"
0012 #include <array>
0013 #include <cstdint>
0014 #include <vector>
0015 
0016 #include "podio/utilities/MaybeSharedPtr.h"
0017 
0018 #include <cstdint>
0019 #include <ostream>
0020 
0021 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0022 #include "nlohmann/json_fwd.hpp"
0023 #endif
0024 
0025 namespace edm4hep {
0026 
0027 class MutableTrackerHitPlane;
0028 class TrackerHitPlaneCollection;
0029 class TrackerHitPlaneCollectionData;
0030 
0031 /** @class TrackerHitPlane
0032  *  Tracker hit plane
0033  *  @author: Placido Fernandez Declara, CERN
0034  */
0035 class TrackerHitPlane {
0036 
0037   friend class MutableTrackerHitPlane;
0038   friend class TrackerHitPlaneCollection;
0039   friend class edm4hep::TrackerHitPlaneCollectionData;
0040   friend class TrackerHitPlaneCollectionIterator;
0041 
0042 public:
0043   using mutable_type = MutableTrackerHitPlane;
0044   using collection_type = TrackerHitPlaneCollection;
0045 
0046   /// default constructor
0047   TrackerHitPlane();
0048 
0049   /// Constructor initializing all members
0050   TrackerHitPlane(std::uint64_t cellID, std::int32_t type, std::int32_t quality, float time, float eDep,
0051                   float eDepError, edm4hep::Vector2f u, edm4hep::Vector2f v, float du, float dv,
0052                   edm4hep::Vector3d position, std::array<float, 6> covMatrix);
0053 
0054   /// copy constructor
0055   TrackerHitPlane(const TrackerHitPlane& other) = default;
0056 
0057   /// copy-assignment operator
0058   TrackerHitPlane& operator=(TrackerHitPlane other);
0059 
0060   /// create a mutable deep-copy of the object with identical relations
0061   /// if cloneRelations=false, the relations are not cloned and will be empty
0062   MutableTrackerHitPlane clone(bool cloneRelations = true) const;
0063 
0064   /// destructor
0065   ~TrackerHitPlane() = default;
0066 
0067   /// converting constructor from mutable object
0068   TrackerHitPlane(const MutableTrackerHitPlane& other);
0069 
0070   static TrackerHitPlane makeEmpty();
0071 
0072 public:
0073   /// Access the ID of the sensor that created this hit
0074   std::uint64_t getCellID() const;
0075 
0076   /// Access the type of raw data hit, either one of edm4hep::RawTimeSeries, edm4hep::SIMTRACKERHIT - see collection
0077   /// parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
0078   std::int32_t getType() const;
0079 
0080   /// Access the quality bit flag of the hit.
0081   std::int32_t getQuality() const;
0082 
0083   /// Access the time of the hit [ns].
0084   float getTime() const;
0085 
0086   /// Access the energy deposited on the hit [GeV].
0087   float getEDep() const;
0088 
0089   /// Access the error measured on EDep [GeV].
0090   float getEDepError() const;
0091 
0092   /// Access the measurement direction vector, u lies in the x-y plane
0093   const edm4hep::Vector2f& getU() const;
0094 
0095   /// Access the measurement direction vector, v is along z
0096   const edm4hep::Vector2f& getV() const;
0097 
0098   /// Access the measurement error along the direction
0099   float getDu() const;
0100 
0101   /// Access the measurement error along the direction
0102   float getDv() const;
0103 
0104   /// Access the hit position in [mm].
0105   const edm4hep::Vector3d& getPosition() const;
0106 
0107   /// Access the covariance of the position (x,y,z), stored as lower triangle matrix. i.e. cov(x,x) , cov(y,x) ,
0108   /// cov(y,y) , cov(z,x) , cov(z,y) , cov(z,z)
0109   const std::array<float, 6>& getCovMatrix() const;
0110   /// Access item i of the covariance of the position (x,y,z), stored as lower triangle matrix. i.e. cov(x,x) , cov(y,x)
0111   /// , cov(y,y) , cov(z,x) , cov(z,y) , cov(z,z)
0112   float getCovMatrix(size_t i) const;
0113 
0114   std::size_t rawHits_size() const;
0115   edm4hep::ObjectID getRawHits(std::size_t) const;
0116   std::vector<edm4hep::ObjectID>::const_iterator rawHits_begin() const;
0117   std::vector<edm4hep::ObjectID>::const_iterator rawHits_end() const;
0118   podio::RelationRange<edm4hep::ObjectID> getRawHits() const;
0119 
0120   /// check whether the object is actually available
0121   bool isAvailable() const;
0122   /// disconnect from TrackerHitPlaneObj instance
0123   void unlink() {
0124     m_obj = podio::utils::MaybeSharedPtr<TrackerHitPlaneObj>{nullptr};
0125   }
0126 
0127   bool operator==(const TrackerHitPlane& other) const {
0128     return m_obj == other.m_obj;
0129   }
0130   bool operator==(const MutableTrackerHitPlane& other) const;
0131 
0132   bool operator!=(const TrackerHitPlane& other) const {
0133     return !(*this == other);
0134   }
0135   bool operator!=(const MutableTrackerHitPlane& other) const {
0136     return !(*this == other);
0137   }
0138 
0139   // less comparison operator, so that objects can be e.g. stored in sets.
0140   bool operator<(const TrackerHitPlane& other) const {
0141     return m_obj < other.m_obj;
0142   }
0143 
0144   podio::ObjectID id() const {
0145     return getObjectID();
0146   }
0147 
0148   const podio::ObjectID getObjectID() const;
0149 
0150   friend void swap(TrackerHitPlane& a, TrackerHitPlane& b) {
0151     using std::swap;
0152     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0153   }
0154 
0155 private:
0156   /// constructor from existing TrackerHitPlaneObj
0157   explicit TrackerHitPlane(podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> obj);
0158   TrackerHitPlane(TrackerHitPlaneObj* obj);
0159 
0160   podio::utils::MaybeSharedPtr<TrackerHitPlaneObj> m_obj{nullptr};
0161 };
0162 
0163 std::ostream& operator<<(std::ostream& o, const TrackerHitPlane& value);
0164 
0165 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0166 void to_json(nlohmann::json& j, const TrackerHitPlane& value);
0167 #endif
0168 
0169 } // namespace edm4hep
0170 
0171 #endif