Analysis Software
Documentation for sPHENIX simulation 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 
4 
6 
8 #include <fun4all/SubsysReco.h> // for SubsysReco
9 
10 #include <phool/PHCompositeNode.h>
11 #include <phool/PHIODataNode.h>
12 #include <phool/PHNode.h> // for PHNode
13 #include <phool/PHNodeIterator.h>
14 #include <phool/PHObject.h> // for PHObject
15 #include <phool/getClass.h>
16 #include <phool/phool.h> // for PHWHERE
17 
18 #include <iostream> // for operator<<, endl
19 
20 using namespace std;
21 
23  : SubsysReco(name)
24 {}
25 
27 {
28  return Setup(topNode);
29 }
30 
32 {
33  return Process(topNode);
34 }
35 
37 {
38  int ret = CreateNodes(topNode);
39  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
40 
41  ret = GetNodes(topNode);
42  if (ret != Fun4AllReturnCodes::EVENT_OK) return ret;
43 
45 }
46 
48 {
49  // create nodes...
50  PHNodeIterator iter(topNode);
51 
52  PHCompositeNode* dstNode = static_cast<PHCompositeNode*>(iter.findFirst(
53  "PHCompositeNode", "DST"));
54  if (!dstNode)
55  {
56  cerr << PHWHERE << "DST Node missing, doing nothing." << endl;
58  }
59  PHNodeIterator iter_dst(dstNode);
60 
61  // Create the SVTX node
62  PHCompositeNode* tb_node =
63  dynamic_cast<PHCompositeNode*>(iter_dst.findFirst("PHCompositeNode",
64  "SVTX"));
65  if (!tb_node)
66  {
67  tb_node = new PHCompositeNode("SVTX");
68  dstNode->addNode(tb_node);
69  if (Verbosity() > 0)
70  cout << PHWHERE << "SVTX node added" << endl;
71  }
72 
75  _vertex_map, "SvtxVertexMap", "PHObject");
76  tb_node->addNode(vertexes_node);
77  if (Verbosity() > 0)
78  cout << PHWHERE << "Svtx/SvtxVertexMap node added" << endl;
79 
81 }
82 
84 {
85  //---------------------------------
86  // Get Objects off of the Node Tree
87  //---------------------------------
88 
89  _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode, "TRKR_CLUSTER");
90  if (!_cluster_map)
91  {
92  cerr << PHWHERE << " ERROR: Can't find node TrkrClusterContainer" << endl;
94  }
95 
96  // Pull the reconstructed track information off the node tree...
97  _vertex_map = findNode::getClass<SvtxVertexMap>(topNode, "SvtxVertexMap");
98  if (!_vertex_map)
99  {
100  cerr << PHWHERE << " ERROR: Can't find SvtxVertexMap." << endl;
102  }
103 
105 }