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