Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHTrackSeeding.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHTrackSeeding.cc
1 #include "PHTrackSeeding.h"
2 
7 
9 
14 
16 #include <fun4all/SubsysReco.h> // for SubsysReco
17 
18 #include <phool/PHCompositeNode.h>
19 #include <phool/PHIODataNode.h>
20 #include <phool/PHNode.h> // for PHNode
21 #include <phool/PHNodeIterator.h>
22 #include <phool/PHObject.h> // for PHObject
23 #include <phool/getClass.h>
24 #include <phool/phool.h> // for PHWHERE
25 
26 #include <iostream> // for operator<<, endl
27 
28 using namespace std;
29 
31  : SubsysReco(name)
32  , _iteration_map(nullptr)
33  , _n_iteration(0)
34 {
35 }
36 
38 {
39  return Setup(topNode);
40 }
41 
43 {
44  if(_n_iteration >0){
45  _iteration_map = findNode::getClass<TrkrClusterIterationMapv1>(topNode, "CLUSTER_ITERATION_MAP");
46  if (!_iteration_map){
47  cerr << PHWHERE << "Cluster Iteration Map missing, aborting." << endl;
49  }
50  }
51  return Process(topNode);
52 }
53 
55 {
56  return End();
57 }
58 
60 {
61  //cout << PHWHERE << "Entering Setup" << endl;
62 
63  int ret = CreateNodes(topNode);
64  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
65 
66  ret = GetNodes(topNode);
67  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
68 
70 }
71 
73 {
74  // create nodes...
75  PHNodeIterator iter(topNode);
76 
77  PHCompositeNode* dstNode = static_cast<PHCompositeNode*>(iter.findFirst(
78  "PHCompositeNode", "DST"));
79  if (!dstNode)
80  {
81  cerr << PHWHERE << "DST Node missing, doing nothing." << endl;
83  }
84  PHNodeIterator iter_dst(dstNode);
85 
86  // Create the SVTX node
87  PHCompositeNode* tb_node =
88  dynamic_cast<PHCompositeNode*>(iter_dst.findFirst("PHCompositeNode",
89  "SVTX"));
90  if (!tb_node)
91  {
92  tb_node = new PHCompositeNode("SVTX");
93  dstNode->addNode(tb_node);
94  if (Verbosity() > 0)
95  cout << PHWHERE << "SVTX node added" << endl;
96  }
97 
98 
99  _track_map = findNode::getClass<TrackSeedContainer>(topNode, _track_map_name);
100  if (!_track_map)
101  {
103  PHIODataNode<PHObject>* tracks_node =
105  tb_node->addNode(tracks_node);
106  if (Verbosity() > 0){
107  cout << PHWHERE << "Svtx/" <<_track_map_name << " node added" << endl;
108  }
109  }
110  if(Verbosity() > 0)
111  _track_map->identify();
112 
114 }
115 
117 {
118  //---------------------------------
119  // Get Objects off of the Node Tree
120  //---------------------------------
122  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER_TRUTH");
123  else
124  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
125 
126  if (!_cluster_map)
127  {
128  cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTER" << endl;
130  }
131 
132  if(do_hit_assoc){
133  _cluster_hit_map = findNode::getClass<TrkrClusterHitAssoc>(topNode, "TRKR_CLUSTERHITASSOC");
134  if (!_cluster_hit_map)
135  {
136  cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTERHITASSOC" << endl;
137  }
138  }
139  _track_map = findNode::getClass<TrackSeedContainer>(topNode, _track_map_name);
140  if (!_track_map)
141  {
142  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name << endl;
144  }
145  /*
146  _hitsets = findNode::getClass<TrkrHitSetContainer>(topNode, "TRKR_HITSET");
147  if (!_hitsets)
148  {
149  cerr << PHWHERE << " ERROR: Can't find TrkrHitSetContainer." << endl;
150  return Fun4AllReturnCodes::ABORTEVENT;
151  }
152  */
154 }