Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kazuya Mochizuki
athena
Commits
9120668a
Commit
9120668a
authored
Oct 21, 2021
by
Vakhtang Tsulaia
Browse files
Merge branch 'hepmc3_20.10.21_QGSJET' into 'master'
Fix the crashes in QGSJET See merge request
atlas/athena!47420
parents
56bea546
6cd330c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Generators/QGSJet_i/src/QGSJet.cxx
View file @
9120668a
...
...
@@ -53,6 +53,32 @@ extern "C"
// cross section info
void
crmc_xsection_f_
(
double
&
xsigtot
,
double
&
xsigine
,
double
&
xsigela
,
double
&
xsigdd
,
double
&
xsigsd
,
double
&
xsloela
,
double
&
xsigtotaa
,
double
&
xsigineaa
,
double
&
xsigelaaa
);
#ifdef HEPMC3
extern
struct
eposhepevt
{
int
nevhep
;
int
nhep
;
int
isthep
[
HEPEVT_EntriesAllocation
];
int
idhep
[
HEPEVT_EntriesAllocation
];
int
jmohep
[
HEPEVT_EntriesAllocation
][
2
];
int
jdahep
[
HEPEVT_EntriesAllocation
][
2
];
double
phep
[
HEPEVT_EntriesAllocation
][
5
];
double
vhep
[
HEPEVT_EntriesAllocation
][
4
];
}
hepevt_
;
struct
hepmc3hepevt
{
int
nevhep
;
int
nhep
;
int
isthep
[
10000
];
int
idhep
[
10000
];
int
jmohep
[
10000
][
2
];
int
jdahep
[
10000
][
2
];
double
phep
[
10000
][
5
];
double
vhep
[
10000
][
4
];
}
localhepevt_
;
#endif
}
extern
"C"
{
...
...
@@ -231,8 +257,8 @@ StatusCode QGSJet::genInitialize()
// setup HepMC
#ifdef HEPMC3
/* This ifdef is used for consistency */
/*
HepMC
3 Does not need a setup here */
/// Inlined
HepMC
::
HEPEVT_Wrapper
::
set_hepevt_address
((
char
*
)(
&
localhepevt_
));
#else
HepMC
::
HEPEVT_Wrapper
::
set_sizeof_int
(
sizeof
(
int
));
HepMC
::
HEPEVT_Wrapper
::
set_sizeof_real
(
8
);
...
...
@@ -312,6 +338,30 @@ StatusCode QGSJet::fillEvt( HepMC::GenEvent* evt )
HepMC
::
HEPEVT_Wrapper
::
set_event_number
(
m_events
);
#ifdef HEPMC3
///If HepMC3 has been compiled with different block size than is used in the interface,
/// only the inlined functions can be used without restrictions.
/// The convert functions are compiled and should operate on the block of matching size.
/// The best solution would be to define a single block sze for all Athena.
localhepevt_
.
nevhep
=
m_events
;
localhepevt_
.
nhep
=
std
::
min
(
10000
,
hepevt_
.
nhep
);
for
(
int
i
=
0
;
i
<
localhepevt_
.
nhep
;
i
++
)
{
localhepevt_
.
isthep
[
i
]
=
hepevt_
.
isthep
[
i
];
localhepevt_
.
idhep
[
i
]
=
hepevt_
.
idhep
[
i
];
for
(
int
k
=
0
;
k
<
2
;
k
++
)
localhepevt_
.
jmohep
[
i
][
k
]
=
hepevt_
.
jmohep
[
i
][
k
];
for
(
int
k
=
0
;
k
<
2
;
k
++
)
localhepevt_
.
jdahep
[
i
][
k
]
=
hepevt_
.
jdahep
[
i
][
k
];
for
(
int
k
=
0
;
k
<
5
;
k
++
)
localhepevt_
.
phep
[
i
][
k
]
=
hepevt_
.
phep
[
i
][
k
];
for
(
int
k
=
0
;
k
<
4
;
k
++
)
localhepevt_
.
vhep
[
i
][
k
]
=
hepevt_
.
vhep
[
i
][
k
];
localhepevt_
.
jmohep
[
i
][
1
]
=
std
::
max
(
localhepevt_
.
jmohep
[
i
][
0
],
localhepevt_
.
jmohep
[
i
][
1
]);
localhepevt_
.
jdahep
[
i
][
1
]
=
std
::
max
(
localhepevt_
.
jdahep
[
i
][
0
],
localhepevt_
.
jdahep
[
i
][
1
]);
/// For some interesting reason EPOS marks beam particle parents as -1 -1
if
(
localhepevt_
.
jmohep
[
i
][
0
]
<=
0
&&
localhepevt_
.
jmohep
[
i
][
1
]
<=
0
)
{
localhepevt_
.
jmohep
[
i
][
0
]
=
0
;
localhepevt_
.
jmohep
[
i
][
1
]
=
0
;
localhepevt_
.
isthep
[
i
]
=
4
;
}
}
/// Compiled!
HepMC
::
HEPEVT_Wrapper
::
HEPEVT_to_GenEvent
(
evt
);
#else
HepMC
::
IO_HEPEVT
hepio
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment