Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-08-31 08:21:23

0001 #include "Tpc_PolyClusterv1.h"
0002 
0003 #include <cmath>
0004 
0005 Tpc_PolyClusterv1::Tpc_PolyClusterv1()
0006 {
0007   Reset();
0008 }
0009 
0010 void Tpc_PolyClusterv1::identify(std::ostream& os) const
0011 {
0012   os << "Tpc_PolyClusterv1:"
0013      << " event=" << m_event
0014      << " cluster_id=" << m_cluster_id
0015      << " source_assembled_track_id=" << m_source_assembled_track_id
0016      << " trkr_cluster_key=" << m_trkr_cluster_key
0017      << " side=" << m_side
0018      << " nhits=" << m_hit_indices.size()
0019      << " centroid_x=" << m_centroid_x
0020      << " centroid_y=" << m_centroid_y
0021      << " centroid_z=" << m_centroid_z
0022      << " rms_x=" << m_rms_x
0023      << " rms_y=" << m_rms_y
0024      << " rms_z=" << m_rms_z
0025      << " adc=" << m_adc
0026      << " phi_width=" << m_phi_width
0027      << " time_width=" << m_time_width
0028      << " phase=" << m_phase
0029      << std::endl;
0030 }
0031 
0032 void Tpc_PolyClusterv1::Reset()
0033 {
0034   m_event = 0;
0035   m_cluster_id = 0;
0036   m_source_assembled_track_id = 0;
0037   m_trkr_cluster_key = TrkrDefs::CLUSKEYMAX;
0038   m_side = 0;
0039   m_centroid_x = 0.0;
0040   m_centroid_y = 0.0;
0041   m_centroid_z = 0.0;
0042   m_rms_x = 0.0;
0043   m_rms_y = 0.0;
0044   m_rms_z = 0.0;
0045   m_adc = 0.0;
0046   m_phi_width = 0;
0047   m_time_width = 0;
0048   m_phase = 0.0;
0049   m_hit_indices.clear();
0050   m_hit_x.clear();
0051   m_hit_y.clear();
0052   m_hit_z.clear();
0053 }
0054 
0055 int Tpc_PolyClusterv1::isValid() const
0056 {
0057   return (!m_hit_indices.empty() &&
0058           std::isfinite(m_centroid_x) &&
0059           std::isfinite(m_centroid_y) &&
0060           std::isfinite(m_centroid_z))
0061              ? 1
0062              : 0;
0063 }