Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackStateInfo_v1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackStateInfo_v1.h
1 #ifndef TRACKBASEHISTORIC_TRACKSTATEINFOV1_H
2 #define TRACKBASEHISTORIC_TRACKSTATEINFOV1_H
3 
4 #include <trackbase/TrkrDefs.h>
5 #include "TrackStateInfo.h"
6 
7 #include <cmath>
8 #include <cstddef> // for size_t
9 #include <cstdint>
10 #include <iostream>
11 #include <map>
12 #include <utility> // for pair
13 
14 class PHObject;
15 
17 {
18  public:
19  TrackStateInfo_v1() = default;
20 
21  //* base class copy constructor
22  // TrackStateInfo_v1( const TrackStateInfo& ) {}
23 
24  //* copy constructor
25  // TrackStateInfo_v1(const TrackStateInfo_v1& ) {}
26 
27  //* assignment operator
28  // TrackStateInfo_v1& operator=(const TrackStateInfo_v1& source);
29 
30  //* destructor
31  ~TrackStateInfo_v1() override = default;
32 
33  // The "standard PHObject response" functions...
34  void identify(std::ostream& os = std::cout) const override
35  {
36  os << "TrackStateInfo_v1 class" << std::endl;
37  }
38  void Reset() override { *this = TrackStateInfo_v1(); }
39  // int isValid() const override;
40  PHObject* CloneMe() const override { return new TrackStateInfo_v1(*this); }
41 
43  using PHObject::CopyFrom;
44  // copy content from base class
45  void CopyFrom(const TrackStateInfo&) override {}
46  void CopyFrom(TrackStateInfo* source) override
47  {
48  CopyFrom(*source);
49  }
50 
51  //
52  // basic track information ---------------------------------------------------
53  //
54 
55  float get_x() const override { return m_Position[0]; }
56  void set_x(float x) override { m_Position[0] = x; }
57 
58  float get_y() const override { return m_Position[1]; }
59  void set_y(float y) override { m_Position[1] = y; }
60 
61  float get_z() const override { return m_Position[2]; }
62  void set_z(float z) override { m_Position[2] = z; }
63 
64  float get_pos(unsigned int i) const override { return m_Position[i]; }
65 
66  float get_px() const override { return m_Momentum[0]; }
67  void set_px(float px) override { m_Momentum[0] = px; }
68 
69  float get_py() const override { return m_Momentum[1]; }
70  void set_py(float py) override { m_Momentum[1] = py; }
71 
72  float get_pz() const override { return m_Momentum[2]; }
73  void set_pz(float pz) override { m_Momentum[2] = pz; }
74 
75  float get_mom(unsigned int i) const override { return m_Momentum[i]; }
76 
77  float get_p() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2) + pow(get_pz(), 2)); }
78  float get_pt() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2)); }
79  float get_eta() const override { return asinh(get_pz() / get_pt()); }
80  float get_phi() const override { return atan2(get_py(), get_px()); }
81 
82  // float get_error(int i, int j) const override { return _states.find(0.0)->second->get_error(i, j); }
83  // void set_error(int i, int j, float value) override { return _states[0.0]->set_error(i, j, value); }
84 
85  float get_covariance(int i, int j) const override;
86  void set_covariance(int i, int j, float value) override;
87 
88  private:
89  float m_Momentum[3] = {std::numeric_limits<float>::quiet_NaN()}; //[-100,100,16] //[x,y,z]
90  float m_Position[3] = {std::numeric_limits<float>::quiet_NaN()}; //[-30,30,20] //[px,py,pz]
91  float m_Covariance[21] = {std::numeric_limits<float>::quiet_NaN()};
92 
93  // Use m_Covariance[21] instead of [15] for now
94  // later on may convert to rotated and then cut to 5X5
95 
97 };
98 
99 #endif