Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:16

0001 #ifndef TRACKBASEHISTORIC_SVTXTRACKSTATEV3_H
0002 #define TRACKBASEHISTORIC_SVTXTRACKSTATEV3_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_v3 : public SvtxTrackState
0013 {
0014  public:
0015   SvtxTrackState_v3(float pathlength = 0.0);
0016   ~SvtxTrackState_v3() override {}
0017 
0018   // The "standard PHObject response" functions...
0019   void identify(std::ostream &os = std::cout) const override;
0020   void Reset() override { *this = SvtxTrackState_v3(0.0); }
0021   int isValid() const override { return 1; }
0022   PHObject *CloneMe() const override { return new SvtxTrackState_v3(*this); }
0023 
0024   float get_pathlength() const override { return _pathlength; }
0025 
0026   float get_localX() const override { return _locpos[0]; }
0027   void set_localX(float X) override { _locpos[0] = X; }
0028 
0029   float get_localY() const override { return _locpos[1]; }
0030   void set_localY(float Y) override { _locpos[1] = Y; }
0031 
0032   float get_x() const override { return _pos[0]; }
0033   void set_x(float x) override { _pos[0] = x; }
0034 
0035   float get_y() const override { return _pos[1]; }
0036   void set_y(float y) override { _pos[1] = y; }
0037 
0038   float get_z() const override { return _pos[2]; }
0039   void set_z(float z) override { _pos[2] = z; }
0040 
0041   float get_pos(unsigned int i) const override { return _pos[i]; }
0042 
0043   float get_px() const override { return _mom[0]; }
0044   void set_px(float px) override { _mom[0] = px; }
0045 
0046   float get_py() const override { return _mom[1]; }
0047   void set_py(float py) override { _mom[1] = py; }
0048 
0049   float get_pz() const override { return _mom[2]; }
0050   void set_pz(float pz) override { _mom[2] = pz; }
0051 
0052   float get_mom(unsigned int i) const override { return _mom[i]; }
0053 
0054   float get_p() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2) + pow(get_pz(), 2)); }
0055   float get_pt() const override { return sqrt(pow(get_px(), 2) + pow(get_py(), 2)); }
0056   float get_eta() const override { return asinh(get_pz() / get_pt()); }
0057   float get_phi() const override { return atan2(get_py(), get_px()); }
0058 
0059   float get_error(unsigned int i, unsigned int j) const override;
0060   // cppcheck-suppress virtualCallInConstructor
0061   void set_error(unsigned int i, unsigned int j, float value) override;
0062 
0063   TrkrDefs::cluskey get_cluskey() const override { return _ckey; }
0064   void set_cluskey(TrkrDefs::cluskey ckey) override { _ckey = ckey; }
0065 
0066   std::string get_name() const override { return state_name; }
0067   void set_name(const std::string &name) override { state_name = name; }
0068 
0069   float get_rphi_error() const override;
0070   float get_phi_error() const override;
0071   float get_z_error() const override;
0072 
0073   //@}
0074 
0075  private:
0076   float _pathlength;
0077   float _locpos[2]{};
0078   float _pos[3]{};
0079   float _mom[3]{};
0080   float _covar[21]{};         //  6x6 triangular packed storage
0081   TrkrDefs::cluskey _ckey{};  // clusterkey that is associated with this state
0082   std::string state_name;
0083 
0084   ClassDefOverride(SvtxTrackState_v3, 1)
0085 };
0086 
0087 #endif