File indexing completed on 2025-08-06 08:17:38
0001 #include "MbdVertexv2.h"
0002
0003 #include <cmath>
0004
0005 void MbdVertexv2::identify(std::ostream& os) const
0006 {
0007 os << "---MbdVertexv2--------------------------------" << std::endl;
0008 os << "vertexid: " << get_id() << std::endl;
0009 os << " t = " << get_t() << " +/- " << get_t_err() << std::endl;
0010 os << " z = " << get_z() << " +/- " << get_z_err() << std::endl;
0011 os << "-----------------------------------------------" << std::endl;
0012
0013 return;
0014 }
0015
0016 int MbdVertexv2::isValid() const
0017 {
0018 if (_id == std::numeric_limits<unsigned int>::max())
0019 {
0020 return 0;
0021 }
0022 if (std::isnan(_t))
0023 {
0024 return 0;
0025 }
0026 if (std::isnan(_t_err))
0027 {
0028 return 0;
0029 }
0030 if (std::isnan(_z))
0031 {
0032 return 0;
0033 }
0034 if (std::isnan(_z_err))
0035 {
0036 return 0;
0037 }
0038
0039 return 1;
0040 }
0041
0042 float MbdVertexv2::get_position(unsigned int coor) const
0043 {
0044 if (coor == 0)
0045 {
0046 return get_x();
0047 }
0048 else if (coor == 1)
0049 {
0050 return get_y();
0051 }
0052 else if (coor == 2)
0053 {
0054 return get_z();
0055 }
0056 else
0057 {
0058 return std::numeric_limits<float>::quiet_NaN();
0059 }
0060 }