File indexing completed on 2025-08-06 08:18:16
0001 #ifndef TRACKBASEHISTORIC_SVTXTRACKSTATEV2_H
0002 #define TRACKBASEHISTORIC_SVTXTRACKSTATEV2_H
0003
0004 #include "SvtxTrackState.h"
0005
0006 #include <cmath>
0007 #include <iostream>
0008 #include <string> // for string, basic_string
0009
0010 class PHObject;
0011
0012 class SvtxTrackState_v2 : public SvtxTrackState
0013 {
0014 public:
0015 SvtxTrackState_v2(float pathlength = 0.0);
0016 ~SvtxTrackState_v2() override {}
0017
0018
0019 void identify(std::ostream &os = std::cout) const override;
0020 void Reset() override { *this = SvtxTrackState_v2(0.0); }
0021 int isValid() const override { return 1; }
0022 PHObject *CloneMe() const override { return new SvtxTrackState_v2(*this); }
0023
0024 float get_pathlength() const override { return _pathlength; }
0025
0026 float get_x() const override { return _pos[0]; }
0027 void set_x(float x) override { _pos[0] = x; }
0028
0029 float get_y() const override { return _pos[1]; }
0030 void set_y(float y) override { _pos[1] = y; }
0031
0032 float get_z() const override { return _pos[2]; }
0033 void set_z(float z) override { _pos[2] = z; }
0034
0035 float get_pos(unsigned int i) const override { return _pos[i]; }
0036
0037 float get_px() const override { return _mom[0]; }
0038 void set_px(float px) override { _mom[0] = px; }
0039
0040 float get_py() const override { return _mom[1]; }
0041 void set_py(float py) override { _mom[1] = py; }
0042
0043 float get_pz() const override { return _mom[2]; }
0044 void set_pz(float pz) override { _mom[2] = pz; }
0045
0046 float get_mom(unsigned int i) const override { return _mom[i]; }
0047
0048 float get_p() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2) + pow(get_pz(), 2)); }
0049 float get_pt() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2)); }
0050 float get_eta() const override { return asinh(get_pz() / get_pt()); }
0051 float get_phi() const override { return atan2(get_py(), get_px()); }
0052
0053 float get_error(unsigned int i, unsigned int j) const override;
0054
0055 void set_error(unsigned int i, unsigned int j, float value) override;
0056
0057 TrkrDefs::cluskey get_cluskey() const override { return _ckey; }
0058 void set_cluskey(TrkrDefs::cluskey ckey) override { _ckey = ckey; }
0059
0060 std::string get_name() const override { return state_name; }
0061 void set_name(const std::string &name) override { state_name = name; }
0062
0063 float get_rphi_error() const override;
0064 float get_phi_error() const override;
0065 float get_z_error() const override;
0066
0067
0068
0069 private:
0070 float _pathlength;
0071 float _pos[3]{};
0072 float _mom[3]{};
0073 float _covar[21]{};
0074 TrkrDefs::cluskey _ckey{};
0075 std::string state_name;
0076
0077 ClassDefOverride(SvtxTrackState_v2, 1)
0078 };
0079
0080 #endif