Analysis Software
Documentation for sPHENIX simulation 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 
6 
8 
10 #include <fun4all/SubsysReco.h> // for SubsysReco
11 
12 #include <phool/PHCompositeNode.h>
13 #include <phool/PHIODataNode.h>
14 #include <phool/PHNode.h> // for PHNode
15 #include <phool/PHNodeIterator.h>
16 #include <phool/PHObject.h> // for PHObject
17 #include <phool/getClass.h>
18 #include <phool/phool.h> // for PHWHERE
19 
20 #include <iostream> // for operator<<, basic_os...
21 
22 using namespace std;
23 
25  : SubsysReco(name)
26 {
27 }
28 
30 {
32 }
33 
35 {
36  return Setup(topNode);
37 }
38 
40 {
41  return Process(topNode);
42 }
43 
45 {
46  return Fun4AllReturnCodes::EVENT_OK;//End();
47 }
48 
50 {
51  int ret = CreateNodes(topNode);
52  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
53 
54  ret = GetNodes(topNode);
55  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
56 
58 }
59 
61 {
62  // create nodes...
63  PHNodeIterator iter(topNode);
64 
65  PHCompositeNode* dstNode = static_cast<PHCompositeNode*>(iter.findFirst(
66  "PHCompositeNode", "DST"));
67  if (!dstNode)
68  {
69  cerr << PHWHERE << "DST Node missing, doing nothing." << endl;
71  }
72  PHNodeIterator iter_dst(dstNode);
73 
74  // Create the SVTX node
75  PHCompositeNode* tb_node =
76  dynamic_cast<PHCompositeNode*>(iter_dst.findFirst("PHCompositeNode",
77  "SVTX"));
78  if (!tb_node)
79  {
80  tb_node = new PHCompositeNode("SVTX");
81  dstNode->addNode(tb_node);
82  if (Verbosity() > 0)
83  cout << "SVTX node added" << endl;
84  }
85 
88  _track_map_out, _track_map_name_out, "PHObject");
89 
90  // PHIODataNode<PHObject>* tracks_node = new PHIODataNode<PHObject>(
91  // _track_map_out, "SvtxTrackMapOut", "PHObject");
92 
93  tb_node->addNode(tracks_node);
94  if (Verbosity() > 0){
95  cout << "Svtx/SvtxTrackMapOut node added" << endl;
96  // cout << "Svtx/" << _track_map_name << " node added" << endl;
97  }
98 
100 }
101 
103 {
104  //---------------------------------
105  // Get Objects off of the Node Tree
106  //---------------------------------
107 
108  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
109  if (!_cluster_map)
110  {
111  cerr << PHWHERE << " ERROR: Can't find node TRKR_CLUSTER" << endl;
113  }
114 
115  _vertex_map = findNode::getClass<SvtxVertexMap>(topNode, "SvtxVertexMap");
116  if (!_vertex_map)
117  {
118  cerr << PHWHERE << " ERROR: Can't find SvtxVertexMap." << endl;
120  }
121 
122 
123  _track_map_in1 = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name_in1);
124  if (!_track_map_in1)
125  {
126  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name_in1 << endl;
128  }
129 
130  _track_map_in2 = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name_in2);
131  if (!_track_map_in2)
132  {
133  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name_in2 << endl;
135  }
136 
137  _track_map_out = findNode::getClass<SvtxTrackMap>(topNode, _track_map_name_out);
138  if (!_track_map_out)
139  {
140  cerr << PHWHERE << " ERROR: Can't find " << _track_map_name_out << endl;
142  }
143 
145 }