EICd
EIC data model
Track.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EICD_Track_H
4#define EICD_Track_H
5
6#include "eicd/TrackObj.h"
7
8#include "eicd/Cov3f.h"
10#include "eicd/TrackerHit.h"
11#include "edm4hep/Vector3f.h"
12#include "podio/RelationRange.h"
13#include <cstdint>
14#include <vector>
15#include "podio/ObjectID.h"
16#include <ostream>
17
18#ifdef PODIO_JSON_OUTPUT
19#include "nlohmann/json.hpp"
20#endif
21
22
23
24namespace eicd {
25
26class MutableTrack;
27
28/** @class Track
29 * Track information at the vertex
30 * @author: S. Joosten
31 */
32class Track {
33
34 friend class MutableTrack;
35 friend class TrackCollection;
37
38public:
39 /// default constructor
40 Track();
41 Track(std::int32_t type, float chi2, std::int32_t ndf, edm4hep::Vector3f momentum, eicd::Cov3f momentumError, float time, float timeError, float charge);
42
43 /// constructor from existing TrackObj
44 Track(TrackObj* obj);
45
46 /// copy constructor
47 Track(const Track& other);
48
49 /// copy-assignment operator
50 Track& operator=(Track other);
51
52 /// create a mutable deep-copy of the object with identical relations
53 MutableTrack clone() const;
54
55 /// destructor
56 ~Track();
57
58
59public:
60
61 /// Access the Flag that defines the type of track
62 const std::int32_t& getType() const;
63
64 /// Access the Total chi2 (sum) of the track fit
65 const float& getChi2() const;
66
67 /// Access the Numbers of degrees of freedom of the track fit
68 const std::int32_t& getNdf() const;
69
70 /// Access the Track 3-momentum at the vertex [GeV]
71 const edm4hep::Vector3f& getMomentum() const;
72
73 /// Access the Covariance matrix on the momentum
74 const eicd::Cov3f& getMomentumError() const;
75
76 /// Access the Track time at the vertex [ns]
77 const float& getTime() const;
78
79 /// Access the Error on the track vertex time
80 const float& getTimeError() const;
81
82 /// Access the Particle charge
83 const float& getCharge() const;
84
85
86
87 unsigned int parameters_size() const;
88 eicd::TrackParameters getParameters(unsigned int) const;
89 std::vector<eicd::TrackParameters>::const_iterator parameters_begin() const;
90 std::vector<eicd::TrackParameters>::const_iterator parameters_end() const;
91 podio::RelationRange<eicd::TrackParameters> getParameters() const;
92 unsigned int trackerHits_size() const;
93 eicd::TrackerHit getTrackerHits(unsigned int) const;
94 std::vector<eicd::TrackerHit>::const_iterator trackerHits_begin() const;
95 std::vector<eicd::TrackerHit>::const_iterator trackerHits_end() const;
96 podio::RelationRange<eicd::TrackerHit> getTrackerHits() const;
97 unsigned int tracks_size() const;
98 eicd::Track getTracks(unsigned int) const;
99 std::vector<eicd::Track>::const_iterator tracks_begin() const;
100 std::vector<eicd::Track>::const_iterator tracks_end() const;
101 podio::RelationRange<eicd::Track> getTracks() const;
102
103
104 /// check whether the object is actually available
105 bool isAvailable() const;
106 /// disconnect from TrackObj instance
107 void unlink() { m_obj = nullptr; }
108
109 bool operator==(const Track& other) const { return m_obj == other.m_obj; }
110 bool operator==(const MutableTrack& other) const;
111
112 // less comparison operator, so that objects can be e.g. stored in sets.
113 bool operator<(const Track& other) const { return m_obj < other.m_obj; }
114
115 unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
116
117 const podio::ObjectID getObjectID() const;
118
119 friend void swap(Track& a, Track& b) {
120 using std::swap;
121 swap(a.m_obj, b.m_obj); // swap out the internal pointers
122 }
123
124private:
125 TrackObj* m_obj;
126};
127
128std::ostream& operator<<(std::ostream& o, const Track& value);
129
130#ifdef PODIO_JSON_OUTPUT
131void to_json(nlohmann::json& j, const Track& value);
132#endif
133
134
135} // namespace eicd
136
137
138#endif
Definition: Cov3f.h:15
Definition: MutableTrack.h:33
Definition: TrackCollection.h:82
Definition: TrackCollection.h:35
Definition: Track.h:32
~Track()
destructor
Definition: Track.cc:51
Track & operator=(Track other)
copy-assignment operator
Definition: Track.cc:36
const float & getChi2() const
Access the Total chi2 (sum) of the track fit.
Definition: Track.cc:58
std::vector< eicd::Track >::const_iterator tracks_end() const
Definition: Track.cc:138
std::vector< eicd::TrackerHit >::const_iterator trackerHits_end() const
Definition: Track.cc:106
void unlink()
disconnect from TrackObj instance
Definition: Track.h:107
std::vector< eicd::TrackerHit >::const_iterator trackerHits_begin() const
Definition: Track.cc:100
const float & getTimeError() const
Access the Error on the track vertex time.
Definition: Track.cc:63
bool operator<(const Track &other) const
Definition: Track.h:113
friend void swap(Track &a, Track &b)
Definition: Track.h:119
std::vector< eicd::TrackParameters >::const_iterator parameters_begin() const
Definition: Track.cc:68
MutableTrack clone() const
create a mutable deep-copy of the object with identical relations
Definition: Track.cc:47
const float & getCharge() const
Access the Particle charge.
Definition: Track.cc:64
const std::int32_t & getNdf() const
Access the Numbers of degrees of freedom of the track fit.
Definition: Track.cc:59
unsigned int parameters_size() const
Definition: Track.cc:80
Track()
default constructor
Definition: Track.cc:16
unsigned int tracks_size() const
Definition: Track.cc:144
unsigned int id() const
Definition: Track.h:115
const edm4hep::Vector3f & getMomentum() const
Access the Track 3-momentum at the vertex [GeV].
Definition: Track.cc:60
podio::RelationRange< eicd::Track > getTracks() const
Definition: Track.cc:155
unsigned int trackerHits_size() const
Definition: Track.cc:112
const float & getTime() const
Access the Track time at the vertex [ns].
Definition: Track.cc:62
const std::int32_t & getType() const
Access the Flag that defines the type of track.
Definition: Track.cc:57
const podio::ObjectID getObjectID() const
Definition: Track.cc:174
podio::RelationRange< eicd::TrackParameters > getParameters() const
Definition: Track.cc:91
const eicd::Cov3f & getMomentumError() const
Access the Covariance matrix on the momentum.
Definition: Track.cc:61
podio::RelationRange< eicd::TrackerHit > getTrackerHits() const
Definition: Track.cc:123
bool isAvailable() const
check whether the object is actually available
Definition: Track.cc:167
std::vector< eicd::TrackParameters >::const_iterator parameters_end() const
Definition: Track.cc:74
std::vector< eicd::Track >::const_iterator tracks_begin() const
Definition: Track.cc:132
bool operator==(const Track &other) const
Definition: Track.h:109
Definition: TrackObj.h:20
Definition: TrackParameters.h:34
Definition: TrackerHit.h:28
Definition: CalorimeterHit.cc:13
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition: CalorimeterHit.cc:93