Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
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
3
#include <
globalvertex/SvtxVertexMap_v1.h
>
4
5
#include <
trackbase/TrkrClusterContainer.h
>
6
7
#include <
fun4all/Fun4AllReturnCodes.h
>
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
22
PHInitVertexing::PHInitVertexing
(
const
std::string
&
name
)
23
:
SubsysReco
(name)
24
{}
25
26
int
PHInitVertexing::InitRun
(
PHCompositeNode
* topNode)
27
{
28
return
Setup
(topNode);
29
}
30
31
int
PHInitVertexing::process_event
(
PHCompositeNode
* topNode)
32
{
33
return
Process
(topNode);
34
}
35
36
int
PHInitVertexing::Setup
(
PHCompositeNode
* topNode)
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
44
return
Fun4AllReturnCodes::EVENT_OK
;
45
}
46
47
int
PHInitVertexing::CreateNodes
(
PHCompositeNode
* topNode)
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;
57
return
Fun4AllReturnCodes::ABORTEVENT
;
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
73
_vertex_map
=
new
SvtxVertexMap_v1
;
74
PHIODataNode<PHObject>
* vertexes_node =
new
PHIODataNode<PHObject>
(
75
_vertex_map
,
"SvtxVertexMap"
,
"PHObject"
);
76
tb_node->
addNode
(vertexes_node);
77
if
(
Verbosity
() > 0)
78
cout <<
PHWHERE
<<
"Svtx/SvtxVertexMap node added"
<< endl;
79
80
return
Fun4AllReturnCodes::EVENT_OK
;
81
}
82
83
int
PHInitVertexing::GetNodes
(
PHCompositeNode
* topNode)
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;
93
return
Fun4AllReturnCodes::ABORTEVENT
;
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;
101
return
Fun4AllReturnCodes::ABORTEVENT
;
102
}
103
104
return
Fun4AllReturnCodes::EVENT_OK
;
105
}
coresoftware
blob
master
offline
packages
trackreco
PHInitVertexing.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:11
using
1.8.2 with
sPHENIX GitHub integration