Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SvtxTrackInfo_v1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SvtxTrackInfo_v1.h
1 #ifndef TRACKBASEHISTORIC_SVTXTRACKINFOV1_H
2 #define TRACKBASEHISTORIC_SVTXTRACKINFOV1_H
3 
4 #include "SvtxTrackInfo.h"
5 #include "TrackStateInfo_v1.h"
6 
7 #include <trackbase/TrkrDefs.h>
8 
9 #include <cmath>
10 #include <cstddef> // for size_t
11 #include <cstdint>
12 #include <iostream>
13 #include <map>
14 #include <utility> // for pair
15 
16 class PHObject;
17 
19 {
20  public:
22 
23  //* base class copy constructor
25 
26  //* copy constructor
28  {
29  m_chisq = source.get_chisq();
30  m_ndf = source.get_ndf();
31  m_crossing = source.get_crossing();
32  m_hitbitmap = source.get_hitbitmap();
33 
34  set_x(source.get_x());
35  set_y(source.get_y());
36  set_z(source.get_z());
37  set_px(source.get_px());
38  set_py(source.get_py());
39  set_pz(source.get_pz());
40 
41  for (int i = 0; i < 6; i++)
42  {
43  for (int j = i; j < 6; j++)
44  {
45  set_covariance(i, j, source.get_covariance(i, j));
46  }
47  }
48  }
49 
50  //* assignment operator
52 
53  //* destructor
54  ~SvtxTrackInfo_v1() override {}
55 
56  // The "standard PHObject response" functions...
57  void identify(std::ostream& os = std::cout) const override
58  {
59  os << "SvtxTrackInfo_v1 class" << std::endl;
60  }
61  void Reset() override { *this = SvtxTrackInfo_v1(); }
62  // int isValid() const override;
63  PHObject* CloneMe() const override { return new SvtxTrackInfo_v1(*this); }
64 
66  using PHObject::CopyFrom;
67  // copy content from base class
68  void CopyFrom(const SvtxTrackInfo&) override;
69  void CopyFrom(SvtxTrackInfo* source) override
70  {
71  CopyFrom(*source);
72  }
73 
74  //
75  // basic track information ---------------------------------------------------
76  //
77 
78  float get_chisq() const override { return m_chisq; }
79  void set_chisq(float chisq) override { m_chisq = chisq; }
80 
81  uint8_t get_ndf() const override { return m_ndf; }
82  void set_ndf(uint8_t ndf) override { m_ndf = ndf; }
83 
84  uint64_t get_hitbitmap() const override { return m_hitbitmap; }
85  void set_hitbitmap(uint64_t hitbitmap) override { m_hitbitmap = hitbitmap; }
86 
87  short int get_crossing() const override { return m_crossing; }
88  void set_crossing(short int crossing) override { m_crossing = crossing; }
89 
90  float get_x() const override { return m_state.get_x(); }
91  void set_x(float x) override { m_state.set_x(x); }
92 
93  float get_y() const override { return m_state.get_y(); }
94  void set_y(float y) override { m_state.set_y(y); }
95 
96  float get_z() const override { return m_state.get_z(); }
97  void set_z(float z) override { m_state.set_z(z); }
98 
99  float get_pos(unsigned int i) const override { return m_state.get_pos(i); }
100 
101  float get_px() const override { return m_state.get_px(); }
102  void set_px(float px) override { m_state.set_px(px); }
103 
104  float get_py() const override { return m_state.get_py(); }
105  void set_py(float py) override { m_state.set_py(py); }
106 
107  float get_pz() const override { return m_state.get_pz(); }
108  void set_pz(float pz) override { m_state.set_pz(pz); }
109 
110  float get_mom(unsigned int i) const override { return m_state.get_mom(i); }
111 
112  float get_p() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2) + pow(get_pz(), 2)); }
113  float get_pt() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2)); }
114  float get_eta() const override { return asinh(get_pz() / get_pt()); }
115  float get_phi() const override { return atan2(get_py(), get_px()); }
116 
117  float get_covariance(int i, int j) const override { return m_state.get_covariance(i, j); }
118  void set_covariance(int i, int j, float value) override { m_state.set_covariance(i, j, value); }
119 
120  private:
121  // track information
122  unsigned int _track_id = std::numeric_limits<unsigned int>::quiet_NaN();
123  // unsigned int _vertex_id = UINT_MAX;
124  float m_chisq = std::numeric_limits<float>::quiet_NaN();
125  uint8_t m_ndf = std::numeric_limits<uint8_t>::quiet_NaN();
126  uint64_t m_hitbitmap = std::numeric_limits<uint64_t>::quiet_NaN();
127  short int m_crossing = std::numeric_limits<short int>::quiet_NaN();
128 
129  // track state information
130  TrackStateInfo_v1 m_state; //< path length => state object
131 
133 };
134 
135 #endif