ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHTrackSetMerging.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHTrackSetMerging.cc
1 #include "PHTrackSetMerging.h"
2 
3 #include "AssocInfoContainerv1.h"
4 
8 
10 
12 #include <fun4all/SubsysReco.h> // for SubsysReco
13 
14 #include <phool/PHCompositeNode.h>
15 #include <phool/PHIODataNode.h>
16 #include <phool/PHNode.h> // for PHNode
17 #include <phool/PHNodeIterator.h>
18 #include <phool/PHObject.h> // for PHObject
19 #include <phool/getClass.h>
20 #include <phool/phool.h> // for PHWHERE
21 
22 #include <iostream> // for operator<<, basic_os...
23 
24 using namespace std;
25 
27  : SubsysReco(name)
28 {
29 }
30 
32 {
34 }
35 
37 {
38  return Setup(topNode);
39 }
40 
42 {
43  return Process(topNode);
44 }
45 
47 {
48  return Fun4AllReturnCodes::EVENT_OK;//End();
49 }
50 
52 {
53  int ret = CreateNodes(topNode);
54  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
55 
56  ret = GetNodes(topNode);
57  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
58 
60 }
61 
63 {
64  // create nodes...
65  PHNodeIterator iter(topNode);
66 
67  PHCompositeNode* dstNode = static_cast<PHCompositeNode*>(iter.findFirst(
68  "PHCompositeNode", "DST"));
69  if (!dstNode)
70  {
71  cerr << PHWHERE << "DST Node missing, doing nothing." << endl;
73  }
74  PHNodeIterator iter_dst(dstNode);
75 
76  // Create the SVTX node
77  PHCompositeNode* tb_node =
78  dynamic_cast<PHCompositeNode*>(iter_dst.findFirst("PHCompositeNode",
79  "SVTX"));
80  if (!tb_node)
81  {
82  tb_node = new PHCompositeNode("SVTX");
83  dstNode->addNode(tb_node);
84  if (Verbosity() > 0)
85  cout << "SVTX node added" << endl;
86  }
87 
90  _track_map_out, _track_map_name_out, "PHObject");
91 
92  // PHIODataNode<PHObject>* tracks_node = new PHIODataNode<PHObject>(
93  // _track_map_out, "SvtxTrackMapOut", "PHObject");
94 
95  tb_node->addNode(tracks_node);
96  if (Verbosity() > 0){
97  cout << "Svtx/SvtxTrackMapOut node added" << endl;
98  // cout << "Svtx/" << _track_map_name << " node added" << endl;
99  }
100  /*
101  _assoc_container = new AssocInfoContainerv1;
102  PHIODataNode<PHObject>* assoc_node = new PHIODataNode<PHObject>(
103  _assoc_container, "AssocInfoContainer", "PHObject");
104  tb_node->addNode(assoc_node);
105  if (Verbosity() > 0)
106  cout << "Svtx/AssocInfoContainer node added" << endl;
107  */
109 }
110 
112 {
113  //---------------------------------
114  // Get Objects off of the Node Tree
115  //---------------------------------
116 
117  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
118  if (!_cluster_map)
119  {
120  cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTER" << endl;
122  }
123 
124  _vertex_map = findNode::getClass<SvtxVertexMap>(topNode, "SvtxVertexMap");
125  if (!_vertex_map)
126  {
127  cerr << PHWHERE << " ERROR: Can't find SvtxVertexMap." << endl;
129  }
130 
131 
132  _track_map_in1 = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name_in1);
133  if (!_track_map_in1)
134  {
135  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name_in1 << endl;
137  }
138 
139  _track_map_in2 = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name_in2);
140  if (!_track_map_in2)
141  {
142  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name_in2 << endl;
144  }
145 
146  _track_map_out = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name_out);
147  if (!_track_map_out)
148  {
149  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name_out << endl;
151  }
152  /*
153  _assoc_container = findNode::getClass<AssocInfoContainer>(topNode, "AssocInfoContainer");
154 
155  {
156  cerr << PHWHERE << " ERROR: Can't find AssocInfoContainer." << endl;
157  return Fun4AllReturnCodes::ABORTEVENT;
158  }
159  */
161 }