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
PHG4ParticleGun.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4ParticleGun.cc
1
#include "
PHG4ParticleGun.h
"
2
3
#include "
PHG4InEvent.h
"
4
#include "
PHG4Particlev1.h
"
5
6
#include <
phool/getClass.h
>
7
8
#include <vector>
// for vector, vector<>::const_iterator
9
10
class
PHCompositeNode
;
11
class
PHG4Particle
;
12
13
PHG4ParticleGun::PHG4ParticleGun
(
const
std::string
&
name
)
14
:
PHG4ParticleGeneratorBase
(name)
15
{
16
return
;
17
}
18
19
int
PHG4ParticleGun::process_event
(
PHCompositeNode
*topNode)
20
{
21
PHG4InEvent
*ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT"
);
22
ReuseExistingVertex
(topNode);
// checks if we should reuse existing vertex
23
int
vtxindex = ineve->
AddVtx
(
get_vtx_x
(),
get_vtx_y
(),
get_vtx_z
(),
get_t0
());
24
std::vector<PHG4Particle *>::const_iterator iter;
25
for
(iter =
particlelist_begin
(); iter !=
particlelist_end
(); ++iter)
26
{
27
PHG4Particle
*
particle
=
new
PHG4Particlev1
(*iter);
28
SetParticleId
(particle, ineve);
29
ineve->
AddParticle
(vtxindex, particle);
30
}
31
if
(
Verbosity
() > 0)
32
{
33
ineve->
identify
();
34
}
35
return
0;
36
}
coresoftware
blob
master
simulation
g4simulation
g4main
PHG4ParticleGun.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:15
using
1.8.2 with
sPHENIX GitHub integration