Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-10-15 08:25:53

0001 #include "DumpTpc_PolyClusterContainer.h"
0002 
0003 #include <phool/PHIODataNode.h>
0004 
0005 #include <tpctrackreco/Tpc_PolyCluster.h>
0006 #include <tpctrackreco/Tpc_PolyClusterContainer.h>
0007 
0008 #include <ostream>
0009 #include <string>
0010 
0011 using MyNode_t = PHIODataNode<Tpc_PolyClusterContainer>;
0012 
0013 DumpTpc_PolyClusterContainer::DumpTpc_PolyClusterContainer(const std::string &NodeName)
0014   : DumpObject(NodeName)
0015 {
0016 }
0017 
0018 int DumpTpc_PolyClusterContainer::process_Node(PHNode *myNode)
0019 {
0020   Tpc_PolyClusterContainer *container{nullptr};
0021   MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);  // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
0022   if (thisNode)
0023   {
0024     container = thisNode->getData();
0025   }
0026   if (container)
0027   {
0028     unsigned int is = container->size();
0029     *fout << "size: " << is << std::endl;
0030     for (unsigned int i = 0; i < is; ++i)
0031     {
0032       const Tpc_PolyCluster *cluster = container->get_cluster(i);
0033       *fout << "get_event(" << i << "): " << cluster->get_event() << std::endl;
0034       *fout << "get_cluster_id(" << i << "): " << cluster->get_cluster_id() << std::endl;
0035       *fout << "get_source_assembled_track_id(" << i << "): " << cluster->get_source_assembled_track_id() << std::endl;
0036       *fout << std::hex << "get_trkr_cluster_key(" << i << "): 0x" << cluster->get_trkr_cluster_key() << std::dec << std::endl;
0037       *fout << "get_side(" << i << "): " << cluster->get_side() << std::endl;
0038       *fout << "get_centroid_x(" << i << "): " << cluster->get_centroid_x() << std::endl;
0039       *fout << "get_centroid_y(" << i << "): " << cluster->get_centroid_y() << std::endl;
0040       *fout << "get_centroid_z(" << i << "): " << cluster->get_centroid_z() << std::endl;
0041       *fout << "get_rms_x(" << i << "): " << cluster->get_rms_x() << std::endl;
0042       *fout << "get_rms_y(" << i << "): " << cluster->get_rms_y() << std::endl;
0043       *fout << "get_rms_z(" << i << "): " << cluster->get_rms_z() << std::endl;
0044       *fout << "get_adc(" << i << "): " << cluster->get_adc() << std::endl;
0045       *fout << "get_phi_width(" << i << "): " << cluster->get_phi_width() << std::endl;
0046       *fout << "get_time_width(" << i << "): " << cluster->get_time_width() << std::endl;
0047       *fout << "get_phase(" << i << "): " << cluster->get_phase() << std::endl;
0048       *fout << "size_hits(" << i << "): " << cluster->size_hits() << std::endl;
0049       for (unsigned int j = 0; j < cluster->size_hits(); ++j)
0050       {
0051         const auto hit = cluster->get_hit_index(j);
0052         *fout << std::hex << "get_hit_index(" << i << ", " << j << "): hitsetkey 0x" << hit.first
0053               << ", hitkey 0x" << hit.second << std::dec << std::endl;
0054         *fout << "get_hit_x(" << i << ", " << j << "): " << cluster->get_hit_x(j) << std::endl;
0055         *fout << "get_hit_y(" << i << ", " << j << "): " << cluster->get_hit_y(j) << std::endl;
0056         *fout << "get_hit_z(" << i << ", " << j << "): " << cluster->get_hit_z(j) << std::endl;
0057       }
0058     }
0059   }
0060   return 0;
0061 }