File indexing completed on 2025-12-16 09:21:43
0001
0002
0003
0004
0005
0006 #include "DSTTrackInfoReader.h"
0007
0008 #include <trackbase_historic/TrackInfoContainer.h>
0009
0010 #include <fun4all/Fun4AllReturnCodes.h>
0011
0012 #include <phool/PHCompositeNode.h>
0013 #include <phool/PHNodeIterator.h>
0014 #include <phool/getClass.h>
0015
0016
0017
0018
0019
0020 DSTTrackInfoReader::DSTTrackInfoReader(const std::string& name)
0021 : SubsysReco(name)
0022 {
0023 }
0024
0025
0026 int DSTTrackInfoReader::InitRun(PHCompositeNode* topNode)
0027 {
0028
0029
0030
0031
0032
0033
0034
0035
0036 m_track_info_container = findNode::getClass<TrackInfoContainer>(topNode, "TrackInfoContainer");
0037
0038
0039
0040
0041
0042
0043
0044
0045 return Fun4AllReturnCodes::EVENT_OK;
0046 }
0047
0048
0049 int DSTTrackInfoReader::process_event(PHCompositeNode* topNode)
0050 {
0051
0052
0053 auto res = load_nodes(topNode);
0054
0055
0056 if (res != Fun4AllReturnCodes::EVENT_OK)
0057 {
0058 return res;
0059 }
0060 evaluate_track_info();
0061
0062 m_track_info_container->Reset();
0063
0064 return Fun4AllReturnCodes::EVENT_OK;
0065 }
0066
0067
0068 int DSTTrackInfoReader::load_nodes(PHCompositeNode* topNode)
0069 {
0070
0071
0072
0073 m_track_info_container = findNode::getClass<TrackInfoContainer>(topNode, "TrackInfoContainer");
0074
0075 return Fun4AllReturnCodes::EVENT_OK;
0076 }
0077
0078 void DSTTrackInfoReader::evaluate_track_info()
0079 {
0080 if (Verbosity() > 1)
0081 {
0082 for (int iTrk = 0; iTrk < (int) m_track_info_container->size(); iTrk++)
0083 {
0084 std::cout << "size: " << m_track_info_container->size() << std::endl;
0085 std::cout << "hitbitmap: " << (m_track_info_container->get_trackinfo(iTrk))->get_hitbitmap() << std::endl;
0086 std::cout << "crossing: " << (m_track_info_container->get_trackinfo(iTrk))->get_crossing() << std::endl;
0087 std::cout << "chi^2: " << (m_track_info_container->get_trackinfo(iTrk))->get_chisq() << std::endl;
0088 std::cout << "NDF: " << unsigned((m_track_info_container->get_trackinfo(iTrk))->get_ndf()) << std::endl;
0089 }
0090 }
0091 }