File indexing completed on 2025-08-06 08:18:34
0001 #include "PHTrackPropagating.h"
0002
0003 #include <trackbase_historic/SvtxTrackMap.h>
0004 #include <globalvertex/SvtxVertexMap.h>
0005
0006 #include <trackbase/TrkrClusterContainer.h>
0007 #include <trackbase/TrkrHitSet.h>
0008 #include <trackbase/TrkrDefs.h>
0009
0010 #include <fun4all/Fun4AllReturnCodes.h>
0011 #include <fun4all/SubsysReco.h> // for SubsysReco
0012
0013 #include <phool/getClass.h>
0014 #include <phool/phool.h> // for PHWHERE
0015
0016 #include <iostream> // for operator<<, basic_ostream
0017
0018 using namespace std;
0019
0020 PHTrackPropagating::PHTrackPropagating(const std::string& name)
0021 : SubsysReco(name)
0022 {}
0023
0024 int PHTrackPropagating::InitRun(PHCompositeNode* topNode)
0025 {
0026 return Setup(topNode);
0027 }
0028
0029 int PHTrackPropagating::process_event(PHCompositeNode* )
0030 {
0031 return Process();
0032 }
0033
0034 int PHTrackPropagating::End(PHCompositeNode* )
0035 {
0036 End();
0037 return Fun4AllReturnCodes::EVENT_OK;
0038 }
0039
0040 int PHTrackPropagating::Setup(PHCompositeNode* topNode)
0041 {
0042 int ret = GetNodes(topNode);
0043 if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
0044
0045 return Fun4AllReturnCodes::EVENT_OK;
0046 }
0047
0048 int PHTrackPropagating::GetNodes(PHCompositeNode* topNode)
0049 {
0050
0051
0052
0053 std::cout << "" << _use_truth_clusters << std::endl;
0054 if(_use_truth_clusters)
0055 _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER_TRUTH");
0056 else
0057 _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
0058
0059 if (!_cluster_map)
0060 {
0061 cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTER" << endl;
0062 return Fun4AllReturnCodes::ABORTEVENT;
0063 }
0064
0065 _vertex_map = findNode::getClass<SvtxVertexMap>(topNode, "SvtxVertexMap");
0066 if (!_vertex_map)
0067 {
0068 cerr << PHWHERE << " ERROR: Can't find SvtxVertexMap." << endl;
0069 return Fun4AllReturnCodes::ABORTEVENT;
0070 }
0071
0072 _track_map = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name);
0073 if (!_track_map)
0074 {
0075 cerr << PHWHERE << " ERROR: Can't find SvtxTrackMap: " << _track_map_name << endl;
0076 return Fun4AllReturnCodes::ABORTEVENT;
0077 }
0078
0079 return Fun4AllReturnCodes::EVENT_OK;
0080 }