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
PHPythia8.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHPythia8.h
1
#ifndef PHPYTHIA8_PHPYTHIA8_H
2
#define PHPYTHIA8_PHPYTHIA8_H
3
4
#include <
fun4all/SubsysReco.h
>
5
6
#include <
phhepmc/PHHepMCGenHelper.h
>
7
8
#include <algorithm>
// for max
9
#include <cmath>
10
#include <string>
11
#include <vector>
12
13
class
PHCompositeNode
;
14
class
PHGenIntegral
;
15
class
PHPy8GenTrigger
;
16
17
namespace
HepMC
18
{
19
class
Pythia8ToHepMC;
20
}
// namespace HepMC
21
22
namespace
Pythia8
23
{
24
class
Pythia;
25
}
26
27
class
PHPythia8
:
public
SubsysReco
,
public
PHHepMCGenHelper
28
{
29
public
:
30
PHPythia8
(
const
std::string
&
name
=
"PHPythia8"
);
31
~PHPythia8
()
override
;
32
33
int
Init
(
PHCompositeNode
*topNode)
override
;
34
int
process_event
(
PHCompositeNode
*topNode)
override
;
35
int
End
(
PHCompositeNode
*topNode)
override
;
36
37
void
set_config_file
(
const
std::string
&cfg_file)
38
{
39
m_ConfigFileName
= cfg_file;
40
}
41
42
void
print_config
()
const
;
43
45
void
register_trigger
(
PHPy8GenTrigger
*theTrigger);
46
void
set_trigger_OR
()
47
{
48
m_TriggersOR
=
true
;
49
m_TriggersAND
=
false
;
50
}
// default true
51
void
set_trigger_AND
()
52
{
53
m_TriggersAND
=
true
;
54
m_TriggersOR
=
false
;
55
}
56
58
void
process_string
(
const
std::string
&
s
) {
m_Commands
.push_back(s); }
59
void
beam_vertex_parameters
(
double
beamX,
60
double
beamY,
61
double
beamZ,
62
double
beamXsigma,
63
double
beamYsigma,
64
double
beamZsigma)
65
{
66
set_vertex_distribution_mean
(beamX, beamY, beamZ, 0);
67
set_vertex_distribution_width
(beamXsigma, beamYsigma, beamZsigma, 0);
68
}
69
70
void
save_event_weight
(
const
bool
b
) {
m_SaveEventWeightFlag
=
b
; }
71
void
save_integrated_luminosity
(
const
bool
b
) {
m_SaveIntegratedLuminosityFlag
=
b
; }
72
73
private
:
74
int
read_config
(
const
std::string
&cfg_file);
75
int
create_node_tree
(
PHCompositeNode
*topNode)
final
;
76
double
percent_diff
(
const
double
a
,
const
double
b
) {
return
fabs((a - b) / a); }
77
int
m_EventCount
;
78
79
// event selection
80
std::vector<PHPy8GenTrigger *>
m_RegisteredTriggers
;
81
bool
m_TriggersOR
;
82
bool
m_TriggersAND
;
83
84
// PYTHIA
85
Pythia8::Pythia *
m_Pythia8
;
86
87
std::string
m_ConfigFileName
;
88
std::vector<std::string>
m_Commands
;
89
90
// HepMC
91
HepMC::Pythia8ToHepMC *
m_Pythia8ToHepMC
;
92
94
bool
m_SaveEventWeightFlag
;
95
97
bool
m_SaveIntegratedLuminosityFlag
;
98
100
PHGenIntegral
*
m_IntegralNode
;
101
};
102
103
#endif
/* PHPYTHIA8_PHPYTHIA8_H */
coresoftware
blob
master
generators
PHPythia8
PHPythia8.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:03
using
1.8.2 with
sPHENIX GitHub integration