Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #include "DumpTpc_PolyTrackContainer.h"
0002 
0003 #include <phool/PHIODataNode.h>
0004 
0005 #include <tpctrackreco/Tpc_PolyTrack.h>
0006 #include <tpctrackreco/Tpc_PolyTrackContainer.h>
0007 
0008 #include <ostream>
0009 #include <string>
0010 
0011 using MyNode_t = PHIODataNode<Tpc_PolyTrackContainer>;
0012 
0013 DumpTpc_PolyTrackContainer::DumpTpc_PolyTrackContainer(const std::string &NodeName)
0014   : DumpObject(NodeName)
0015 {
0016 }
0017 
0018 int DumpTpc_PolyTrackContainer::process_Node(PHNode *myNode)
0019 {
0020   Tpc_PolyTrackContainer *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_PolyTrack *track = container->get_track(i);
0033       *fout << "get_event(" << i << "): " << track->get_event() << std::endl;
0034       *fout << "get_track_id(" << i << "): " << track->get_track_id() << std::endl;
0035       *fout << "get_source_assembled_track_id(" << i << "): " << track->get_source_assembled_track_id() << std::endl;
0036       *fout << "get_fit_status(" << i << "): " << track->get_fit_status() << std::endl;
0037       *fout << "get_nclusters(" << i << "): " << track->get_nclusters() << std::endl;
0038       *fout << "get_x(" << i << "): " << track->get_x() << std::endl;
0039       *fout << "get_y(" << i << "): " << track->get_y() << std::endl;
0040       *fout << "get_z(" << i << "): " << track->get_z() << std::endl;
0041       *fout << "get_px(" << i << "): " << track->get_px() << std::endl;
0042       *fout << "get_py(" << i << "): " << track->get_py() << std::endl;
0043       *fout << "get_pz(" << i << "): " << track->get_pz() << std::endl;
0044       *fout << "get_charge(" << i << "): " << track->get_charge() << std::endl;
0045       *fout << "get_chi2(" << i << "): " << track->get_chi2() << std::endl;
0046       *fout << "get_ndf(" << i << "): " << track->get_ndf() << std::endl;
0047       *fout << "get_dedx(" << i << "): " << track->get_dedx() << std::endl;
0048       *fout << "get_seed_x0(" << i << "): " << track->get_seed_x0() << std::endl;
0049       *fout << "get_seed_y0(" << i << "): " << track->get_seed_y0() << std::endl;
0050       *fout << "get_helix_x0(" << i << "): " << track->get_helix_x0() << std::endl;
0051       *fout << "get_helix_y0(" << i << "): " << track->get_helix_y0() << std::endl;
0052       *fout << "get_seed_z0(" << i << "): " << track->get_seed_z0() << std::endl;
0053       *fout << "get_seed_phi(" << i << "): " << track->get_seed_phi() << std::endl;
0054       *fout << "get_seed_slope(" << i << "): " << track->get_seed_slope() << std::endl;
0055       *fout << "get_seed_q_over_r(" << i << "): " << track->get_seed_q_over_r() << std::endl;
0056       for (unsigned int row = 0; row < 6; ++row)
0057       {
0058         for (unsigned int column = 0; column < 6; ++column)
0059         {
0060           *fout << "get_cov(" << i << ", " << row << ", " << column << "): " << track->get_cov(row, column) << std::endl;
0061         }
0062       }
0063       *fout << "size_cluster_keys(" << i << "): " << track->size_cluster_keys() << std::endl;
0064       for (unsigned int j = 0; j < track->size_cluster_keys(); ++j)
0065       {
0066         *fout << std::hex << "get_cluster_key(" << i << ", " << j << "): 0x" << track->get_cluster_key(j) << std::dec << std::endl;
0067       }
0068     }
0069   }
0070   return 0;
0071 }