ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHInitVertexing.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHInitVertexing.cc
1 #include "PHInitVertexing.h"
2 
7 
9 #include <fun4all/SubsysReco.h> // for SubsysReco
10 
11 #include <phool/PHCompositeNode.h>
12 #include <phool/PHIODataNode.h>
13 #include <phool/PHNode.h> // for PHNode
14 #include <phool/PHNodeIterator.h>
15 #include <phool/PHObject.h> // for PHObject
16 #include <phool/getClass.h>
17 #include <phool/phool.h> // for PHWHERE
18 
19 #include <iostream> // for operator<<, endl
20 
21 using namespace std;
22 
24  : SubsysReco(name)
25  , _cluster_map(nullptr)
26  , _hitsets(nullptr)
27  , _vertex_map(nullptr)
28 {
29 }
30 
32 {
33  return Setup(topNode);
34 }
35 
37 {
38  return Process(topNode);
39 }
40 
42 {
43  int ret = CreateNodes(topNode);
44  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
45 
46  ret = GetNodes(topNode);
47  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
48 
50 }
51 
53 {
54  // create nodes...
55  PHNodeIterator iter(topNode);
56 
57  PHCompositeNode* dstNode = static_cast<PHCompositeNode*>(iter.findFirst(
58  "PHCompositeNode", "DST"));
59  if (!dstNode)
60  {
61  cerr << PHWHERE << "DST Node missing, doing nothing." << endl;
63  }
64  PHNodeIterator iter_dst(dstNode);
65 
66  // Create the SVTX node
67  PHCompositeNode* tb_node =
68  dynamic_cast<PHCompositeNode*>(iter_dst.findFirst("PHCompositeNode",
69  "SVTX"));
70  if (!tb_node)
71  {
72  tb_node = new PHCompositeNode("SVTX");
73  dstNode->addNode(tb_node);
74  if (Verbosity() > 0)
75  cout << PHWHERE << "SVTX node added" << endl;
76  }
77 
80  _vertex_map, "SvtxVertexMap", "PHObject");
81  tb_node->addNode(vertexes_node);
82  if (Verbosity() > 0)
83  cout << PHWHERE << "Svtx/SvtxVertexMap node added" << endl;
84 
86 }
87 
89 {
90  //---------------------------------
91  // Get Objects off of the Node Tree
92  //---------------------------------
93 
94  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
95  if (!_cluster_map)
96  {
97  cerr << PHWHERE << " ERROR: Can't find node TrkrClusterContainer" << endl;
99  }
100 
101  _hitsets = findNode::getClass<TrkrHitSetContainer>(topNode, "TRKR_HITSET");
102  if(!_hitsets)
103  {
104  cerr << PHWHERE << "No hitset container on node tree. Bailing."
105  << endl;
107  }
108 
109  // Pull the reconstructed track information off the node tree...
110  _vertex_map = findNode::getClass<SvtxVertexMap>(topNode, "SvtxVertexMap");
111  if (!_vertex_map)
112  {
113  cerr << PHWHERE << " ERROR: Can't find SvtxVertexMap." << endl;
115  }
116 
118 }