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
G4VtxNtuple.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4VtxNtuple.cc
1
#include "
G4VtxNtuple.h
"
2
3
#include <
g4main/PHG4TruthInfoContainer.h
>
4
#include <
g4main/PHG4VtxPoint.h
>
5
6
#include <
fun4all/Fun4AllHistoManager.h
>
7
#include <
fun4all/SubsysReco.h
>
// for SubsysReco
8
9
#include <
phool/getClass.h
>
10
11
#include <TNtuple.h>
12
13
#include <sstream>
14
15
using namespace
std;
16
17
G4VtxNtuple::G4VtxNtuple
(
const
std::string
&
name
,
const
std::string
&
filename
)
18
:
SubsysReco
(name)
19
, m_FileName(filename)
20
{
21
}
22
23
G4VtxNtuple::~G4VtxNtuple
()
24
{
25
delete
hm
;
26
}
27
28
int
G4VtxNtuple::Init
(
PHCompositeNode
*)
29
{
30
hm
=
new
Fun4AllHistoManager
(
Name
());
31
ntup
=
new
TNtuple(
"vtxntup"
,
"G4Vtxs"
,
"vx:vy:vz"
);
32
hm
->
registerHisto
(
ntup
);
33
return
0;
34
}
35
36
int
G4VtxNtuple::process_event
(
PHCompositeNode
*topNode)
37
{
38
PHG4TruthInfoContainer
*truthinfo = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo"
);
39
if
(truthinfo)
40
{
41
PHG4VtxPoint
*gvertex = truthinfo->
GetPrimaryVtx
(truthinfo->
GetPrimaryVertexIndex
());
42
ntup
->Fill(gvertex->
get_x
(), gvertex->
get_y
(), gvertex->
get_z
());
43
}
44
return
0;
45
}
46
47
int
G4VtxNtuple::End
(
PHCompositeNode
*
/*topNode*/
)
48
{
49
hm
->
dumpHistos
(
m_FileName
,
"RECREATE"
);
50
return
0;
51
}
coresoftware
blob
master
simulation
g4simulation
g4histos
G4VtxNtuple.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:14
using
1.8.2 with
sPHENIX GitHub integration