EIC Software
Reference for
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
HiMain2.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file HiMain2.h
1
2
#ifndef HiMain2_h
3
#define HiMain2_h
4
5
extern
"C"
{
void
*
himain2_address_
(
void
); }
11
class
HiMain2
{
12
public
:
13
HiMain2
();
14
~HiMain2
();
15
16
int
&
katt
(
int
i,
int
j);
17
float
&
patt
(
int
i,
int
j);
18
float
&
vatt
(
int
i,
int
j);
19
20
void
init
(
void
);
21
22
// return common array lengths
23
inline
int
leniKatt
()
const
{
return
_leniKatt
;}
24
inline
int
lenjKatt
()
const
{
return
_lenjKatt
;}
25
inline
int
leniPatt
()
const
{
return
_leniPatt
;}
26
inline
int
lenjPatt
()
const
{
return
_lenjPatt
;}
27
inline
int
leniVatt
()
const
{
return
_leniVatt
;}
28
inline
int
lenjVatt
()
const
{
return
_lenjVatt
;}
29
30
private
:
31
32
// Lengths of array in HiMain2 common
33
static
const
int
_leniKatt
= 130000;
34
static
const
int
_lenjKatt
= 4;
35
static
const
int
_leniPatt
= 130000;
36
static
const
int
_lenjPatt
= 4;
37
static
const
int
_leniVatt
= 130000;
38
static
const
int
_lenjVatt
= 4;
39
40
struct
HIMAIN2
;
41
friend
struct
HIMAIN2
;
42
43
struct
HIMAIN2
44
{
45
int
katt[
_lenjKatt
][
_leniKatt
];
46
float
patt[
_lenjPatt
][
_leniPatt
];
47
float
vatt[
_lenjVatt
][
_leniVatt
];
48
};
49
50
int
_dummy
;
51
float
_realdummy
;
52
53
static
HIMAIN2
*
_himain2
;
54
};
55
56
// set pointer to zero at start
57
HiMain2::HIMAIN2
*
HiMain2::_himain2
=0;
58
59
inline
void
60
HiMain2::init
(
void
)
61
{
if
(!
_himain2
)
_himain2
=
static_cast<
HIMAIN2
*
>
(
himain2_address_
()); }
62
63
// Constructor
64
inline
65
HiMain2::HiMain2
()
66
: _dummy (-999),
67
_realdummy (-999.)
68
{}
69
70
// Destructor
71
inline
72
HiMain2::~HiMain2
()
73
{}
74
75
inline
int
&
76
HiMain2::katt
(
int
i,
int
j)
77
{
78
init
();
// check COMMON is initialized
79
if
( i < 1 || i >
leniKatt
() ||
80
j < 1 || j >
lenjKatt
() )
return
_dummy
;
81
82
return
_himain2
->
katt
[j-1][i-1];
83
}
84
85
inline
float
&
86
HiMain2::patt
(
int
i,
int
j)
87
{
88
init
();
// check COMMON is initialized
89
if
( i < 1 || i >
leniPatt
() ||
90
j < 1 || j >
lenjPatt
() )
return
_realdummy
;
91
92
return
_himain2
->
patt
[j-1][i-1];
93
}
94
95
inline
float
&
96
HiMain2::vatt
(
int
i,
int
j)
97
{
98
init
();
// check COMMON is initialized
99
if
( i < 1 || i >
leniVatt
() ||
100
j < 1 || j >
lenjVatt
() )
return
_realdummy
;
101
102
return
_himain2
->
vatt
[j-1][i-1];
103
}
104
105
#endif
fun4all_coresoftware
blob
master
generators
sHijing
HiMain2.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:42
using
1.8.2 with
EIC GitHub integration