Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef TRACKBASEHISTORIC_SVTXTRACKSTATEV1_H
0002 #define TRACKBASEHISTORIC_SVTXTRACKSTATEV1_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_v1 : public SvtxTrackState
0013 {
0014  public:
0015   SvtxTrackState_v1(float pathlength = 0.0);
0016   ~SvtxTrackState_v1() override {}
0017 
0018   // The "standard PHObject response" functions...
0019   void identify(std::ostream &os = std::cout) const override;
0020   void Reset() override { *this = SvtxTrackState_v1(0.0); }
0021   int isValid() const override { return 1; }
0022   PHObject *CloneMe() const override { return new SvtxTrackState_v1(*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   // cppcheck-suppress virtualCallInConstructor
0055   void set_error(unsigned int i, unsigned int j, float value) override;
0056 
0057   std::string get_name() const override { return state_name; }
0058   void set_name(const std::string &name) override { state_name = name; }
0059 
0060   float get_rphi_error() const override;
0061   float get_phi_error() const override;
0062   float get_z_error() const override;
0063 
0064   //@}
0065 
0066  private:
0067   float _pathlength;
0068   float _pos[3]{};
0069   float _mom[3]{};
0070   float _covar[21]{};  //  6x6 triangular packed storage
0071 
0072   std::string state_name;
0073 
0074   ClassDefOverride(SvtxTrackState_v1, 1)
0075 };
0076 
0077 #endif