ECCE @ EIC 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 
3 #include "AssocInfoContainerv1.h"
4 
8 
13 
15 #include <fun4all/SubsysReco.h> // for SubsysReco
16 
17 #include <phool/PHCompositeNode.h>
18 #include <phool/PHIODataNode.h>
19 #include <phool/PHNode.h> // for PHNode
20 #include <phool/PHNodeIterator.h>
21 #include <phool/PHObject.h> // for PHObject
22 #include <phool/getClass.h>
23 #include <phool/phool.h> // for PHWHERE
24 
25 #include <iostream> // for operator<<, endl
26 
27 using namespace std;
28 
30  : SubsysReco(name)
31  , _iteration_map(nullptr)
32  , _n_iteration(0)
33 {
34 }
35 
37 {
38  return Setup(topNode);
39 }
40 
42 {
43  if(_n_iteration >0){
44  _iteration_map = findNode::getClass<TrkrClusterIterationMapv1>(topNode, "CLUSTER_ITERATION_MAP");
45  if (!_iteration_map){
46  cerr << PHWHERE << "Cluster Iteration Map missing, aborting." << endl;
48  }
49  }
50  return Process(topNode);
51 }
52 
54 {
55  return End();
56 }
57 
59 {
60  //cout << PHWHERE << "Entering Setup" << endl;
61 
62  int ret = CreateNodes(topNode);
63  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
64 
65  ret = GetNodes(topNode);
66  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
67 
69 }
70 
72 {
73  // create nodes...
74  PHNodeIterator iter(topNode);
75 
76  PHCompositeNode* dstNode = static_cast<PHCompositeNode*>(iter.findFirst(
77  "PHCompositeNode", "DST"));
78  if (!dstNode)
79  {
80  cerr << PHWHERE << "DST Node missing, doing nothing." << endl;
82  }
83  PHNodeIterator iter_dst(dstNode);
84 
85  // Create the SVTX node
86  PHCompositeNode* tb_node =
87  dynamic_cast<PHCompositeNode*>(iter_dst.findFirst("PHCompositeNode",
88  "SVTX"));
89  if (!tb_node)
90  {
91  tb_node = new PHCompositeNode("SVTX");
92  dstNode->addNode(tb_node);
93  if (Verbosity() > 0)
94  cout << PHWHERE << "SVTX node added" << endl;
95  }
96 
97 
98  _track_map = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name);
99  if (!_track_map)
100  {
102  PHIODataNode<PHObject>* tracks_node =
104  tb_node->addNode(tracks_node);
105  if (Verbosity() > 0){
106  cout << PHWHERE << "Svtx/" <<_track_map_name << " node added" << endl;
107  }
108  }
109  if(Verbosity() > 0)
110  _track_map->identify();
111 
114  _assoc_container, "AssocInfoContainer", "PHObject");
115  tb_node->addNode(assoc_node);
116  if (Verbosity() > 0)
117  cout << PHWHERE << "Svtx/AssocInfoContainer node added" << endl;
118 
120 }
121 
123 {
124  //---------------------------------
125  // Get Objects off of the Node Tree
126  //---------------------------------
128  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER_TRUTH");
129  else
130  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
131 
132  if (!_cluster_map)
133  {
134  cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTER" << endl;
136  }
137 
138  _cluster_hit_map = findNode::getClass<TrkrClusterHitAssoc>(topNode, "TRKR_CLUSTERHITASSOC");
139  if (!_cluster_hit_map)
140  {
141  cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTERHITASSOC" << endl;
142  }
143 
144  _track_map = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name);
145  if (!_track_map)
146  {
147  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name << endl;
149  }
150 
151  _assoc_container = findNode::getClass<AssocInfoContainer>(topNode, "AssocInfoContainer");
152  if (!_assoc_container)
153  {
154  cerr << PHWHERE << " ERROR: Can't find AssocInfoContainer." << endl;
156  }
157 
158  _hitsets = findNode::getClass<TrkrHitSetContainer>(topNode, "TRKR_HITSET");
159  if (!_hitsets)
160  {
161  cerr << PHWHERE << " ERROR: Can't find TrkrHitSetContainer." << endl;
163  }
164 
166 }