ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
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 <
trackbase_historic/SvtxVertexMap.h
>
4
#include <
trackbase_historic/SvtxVertexMap_v1.h
>
5
#include <
trackbase/TrkrClusterContainer.h
>
6
#include <
trackbase/TrkrHitSetContainer.h
>
7
8
#include <
fun4all/Fun4AllReturnCodes.h
>
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
23
PHInitVertexing::PHInitVertexing
(
const
std::string&
name
)
24
:
SubsysReco
(name)
25
, _cluster_map(nullptr)
26
, _hitsets(nullptr)
27
, _vertex_map(nullptr)
28
{
29
}
30
31
int
PHInitVertexing::InitRun
(
PHCompositeNode
* topNode)
32
{
33
return
Setup
(topNode);
34
}
35
36
int
PHInitVertexing::process_event
(
PHCompositeNode
* topNode)
37
{
38
return
Process
(topNode);
39
}
40
41
int
PHInitVertexing::Setup
(
PHCompositeNode
* topNode)
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
49
return
Fun4AllReturnCodes::EVENT_OK
;
50
}
51
52
int
PHInitVertexing::CreateNodes
(
PHCompositeNode
* topNode)
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;
62
return
Fun4AllReturnCodes::ABORTEVENT
;
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
78
_vertex_map
=
new
SvtxVertexMap_v1
;
79
PHIODataNode<PHObject>
* vertexes_node =
new
PHIODataNode<PHObject>
(
80
_vertex_map
,
"SvtxVertexMap"
,
"PHObject"
);
81
tb_node->
addNode
(vertexes_node);
82
if
(
Verbosity
() > 0)
83
cout <<
PHWHERE
<<
"Svtx/SvtxVertexMap node added"
<< endl;
84
85
return
Fun4AllReturnCodes::EVENT_OK
;
86
}
87
88
int
PHInitVertexing::GetNodes
(
PHCompositeNode
* topNode)
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;
98
return
Fun4AllReturnCodes::ABORTEVENT
;
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;
106
return
Fun4AllReturnCodes::ABORTEVENT
;
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;
114
return
Fun4AllReturnCodes::ABORTEVENT
;
115
}
116
117
return
Fun4AllReturnCodes::EVENT_OK
;
118
}
coresoftware
blob
master
offline
packages
trackreco
PHInitVertexing.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:39
using
1.8.2 with
ECCE GitHub integration