File indexing completed on 2025-08-06 08:18:08
0001
0002
0003
0004
0005
0006
0007 #include "CMFlashClusterv1.h"
0008
0009 #include <cmath>
0010 #include <utility> // for swap
0011
0012 void CMFlashClusterv1::identify(std::ostream& os) const
0013 {
0014 os << "---CMFlashClusterv1--------------------" << std::endl;
0015
0016 os << " (x,y,z) = (" << m_pos[0];
0017 os << ", " << m_pos[1] << ", ";
0018 os << m_pos[2] << ") cm";
0019
0020 os << " adc = " << getAdc() << std::endl;
0021
0022 os << std::endl;
0023 os << "-----------------------------------------------" << std::endl;
0024
0025 return;
0026 }
0027
0028 int CMFlashClusterv1::isValid() const
0029 {
0030 if (std::isnan(getX()))
0031 {
0032 return 0;
0033 }
0034 if (std::isnan(getY()))
0035 {
0036 return 0;
0037 }
0038 if (std::isnan(getZ()))
0039 {
0040 return 0;
0041 }
0042
0043 if (m_adc == 0xFFFFFFFF)
0044 {
0045 return 0;
0046 }
0047
0048 return 1;
0049 }
0050
0051 void CMFlashClusterv1::CopyFrom(const CMFlashCluster& source)
0052 {
0053
0054 if (this == &source)
0055 {
0056 return;
0057 }
0058
0059
0060 CMFlashCluster::CopyFrom(source);
0061
0062 setX(source.getX());
0063 setY(source.getY());
0064 setZ(source.getZ());
0065 setAdc(source.getAdc());
0066 }