EDM4eic
EIC data model
Loading...
Searching...
No Matches
Track.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Track_H
4#define EDM4EIC_Track_H
5
6#include "edm4eic/TrackObj.h"
7
8#include "edm4eic/Cov6f.h"
10#include "edm4hep/Vector3f.h"
11#include "podio/RelationRange.h"
12#include <cstdint>
13#include <vector>
14
15#include "podio/utilities/MaybeSharedPtr.h"
16
17#include <ostream>
18#include <cstddef>
19
20#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
21#include "nlohmann/json_fwd.hpp"
22#endif
23
24// forward declarations
25namespace edm4eic {
26class Trajectory;
27class MutableTrajectory;
28}
29
30
31namespace edm4eic {
32
33class MutableTrack;
34class TrackCollection;
35class TrackCollectionData;
36
37/** @class Track
38 * Track information at the vertex
39 * @author: S. Joosten, J. Osborn
40 */
41class Track {
42
43 friend class MutableTrack;
44 friend class TrackCollection;
47
48public:
51
52 /// default constructor
53 Track();
54
55 /// Constructor initializing all members
56 Track(std::int32_t type, edm4hep::Vector3f position, edm4hep::Vector3f momentum, edm4eic::Cov6f positionMomentumCovariance, float time, float timeError, float charge, float chi2, std::uint32_t ndf, std::int32_t pdg);
57
58 /// copy constructor
59 Track(const Track& other) = default;
60
61 /// copy-assignment operator
62 Track& operator=(Track other);
63
64 /// create a mutable deep-copy of the object with identical relations
65 MutableTrack clone() const;
66
67 /// destructor
68 ~Track() = default;
69
70
71 static Track makeEmpty();
72
73public:
74
75 /// Access the Flag that defines the type of track
76 std::int32_t getType() const;
77
78 /// Access the Track 3-position at the vertex
79 const edm4hep::Vector3f& getPosition() const;
80
81 /// Access the Track 3-momentum at the vertex [GeV]
82 const edm4hep::Vector3f& getMomentum() const;
83
84 /// Access the Covariance matrix in basis [x,y,z,px,py,pz]
86
87 /// Access the Track time at the vertex [ns]
88 float getTime() const;
89
90 /// Access the Error on the track vertex time
91 float getTimeError() const;
92
93 /// Access the Particle charge
94 float getCharge() const;
95
96 /// Access the Total chi2
97 float getChi2() const;
98
99 /// Access the Number of degrees of freedom
100 std::uint32_t getNdf() const;
101
102 /// Access the PDG particle ID hypothesis
103 std::int32_t getPdg() const;
104
105
106 /// Access the Trajectory of this track
108
109 std::size_t measurements_size() const;
110 edm4eic::Measurement2D getMeasurements(std::size_t) const;
111 std::vector<edm4eic::Measurement2D>::const_iterator measurements_begin() const;
112 std::vector<edm4eic::Measurement2D>::const_iterator measurements_end() const;
113 podio::RelationRange<edm4eic::Measurement2D> getMeasurements() const;
114 std::size_t tracks_size() const;
115 edm4eic::Track getTracks(std::size_t) const;
116 std::vector<edm4eic::Track>::const_iterator tracks_begin() const;
117 std::vector<edm4eic::Track>::const_iterator tracks_end() const;
118 podio::RelationRange<edm4eic::Track> getTracks() const;
119
120
121 /// check whether the object is actually available
122 bool isAvailable() const;
123 /// disconnect from TrackObj instance
124 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackObj>{nullptr}; }
125
126 bool operator==(const Track& other) const { return m_obj == other.m_obj; }
127 bool operator==(const MutableTrack& other) const;
128
129 // less comparison operator, so that objects can be e.g. stored in sets.
130 bool operator<(const Track& other) const { return m_obj < other.m_obj; }
131
132 podio::ObjectID id() const { return getObjectID(); }
133
134 const podio::ObjectID getObjectID() const;
135
136 friend void swap(Track& a, Track& b) {
137 using std::swap;
138 swap(a.m_obj, b.m_obj); // swap out the internal pointers
139 }
140
141private:
142 /// constructor from existing TrackObj
143 explicit Track(podio::utils::MaybeSharedPtr<TrackObj> obj);
144 Track(TrackObj* obj);
145
146 podio::utils::MaybeSharedPtr<TrackObj> m_obj{nullptr};
147};
148
149std::ostream& operator<<(std::ostream& o, const Track& value);
150
151#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
152void to_json(nlohmann::json& j, const Track& value);
153#endif
154
155
156} // namespace edm4eic
157
158
159#endif
Definition Cov6f.h:19
Definition Measurement2D.h:36
Definition MutableTrack.h:40
Definition TrackCollectionData.h:32
Definition TrackCollection.h:95
Definition TrackCollection.h:40
Definition Track.h:41
bool operator==(const Track &other) const
Definition Track.h:126
friend class MutableTrack
Definition Track.h:43
const edm4hep::Vector3f & getPosition() const
Access the Track 3-position at the vertex.
Definition Track.cc:57
std::int32_t getType() const
Access the Flag that defines the type of track.
Definition Track.cc:56
void unlink()
disconnect from TrackObj instance
Definition Track.h:124
Track & operator=(Track other)
copy-assignment operator
Definition Track.cc:39
float getChi2() const
Access the Total chi2.
Definition Track.cc:63
const edm4hep::Vector3f & getMomentum() const
Access the Track 3-momentum at the vertex [GeV].
Definition Track.cc:58
podio::RelationRange< edm4eic::Track > getTracks() const
Definition Track.cc:131
std::vector< edm4eic::Measurement2D >::const_iterator measurements_end() const
Definition Track.cc:82
podio::ObjectID id() const
Definition Track.h:132
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition Track.cc:114
~Track()=default
destructor
std::int32_t getPdg() const
Access the PDG particle ID hypothesis.
Definition Track.cc:65
friend void swap(Track &a, Track &b)
Definition Track.h:136
podio::RelationRange< edm4eic::Measurement2D > getMeasurements() const
Definition Track.cc:99
Track(const Track &other)=default
copy constructor
bool operator<(const Track &other) const
Definition Track.h:130
float getTime() const
Access the Track time at the vertex [ns].
Definition Track.cc:60
MutableTrack clone() const
create a mutable deep-copy of the object with identical relations
Definition Track.cc:44
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition Track.cc:108
std::size_t measurements_size() const
Definition Track.cc:88
const podio::ObjectID getObjectID() const
Definition Track.cc:150
std::uint32_t getNdf() const
Access the Number of degrees of freedom.
Definition Track.cc:64
std::size_t tracks_size() const
Definition Track.cc:120
const edm4eic::Cov6f & getPositionMomentumCovariance() const
Access the Covariance matrix in basis [x,y,z,px,py,pz].
Definition Track.cc:59
static Track makeEmpty()
Definition Track.cc:52
float getCharge() const
Access the Particle charge.
Definition Track.cc:62
const edm4eic::Trajectory getTrajectory() const
Access the Trajectory of this track.
Definition Track.cc:67
float getTimeError() const
Access the Error on the track vertex time.
Definition Track.cc:61
bool isAvailable() const
check whether the object is actually available
Definition Track.cc:143
Track()
default constructor
Definition Track.cc:22
std::vector< edm4eic::Measurement2D >::const_iterator measurements_begin() const
Definition Track.cc:76
friend class TrackCollection
Definition Track.h:44
Definition TrackObj.h:23
Definition Trajectory.h:40
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97