Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas
athena
Commits
135b60d8
Commit
135b60d8
authored
Aug 10, 2020
by
Simone Pagan Griso
Browse files
add additional early protection against failure to balance energy
parent
c58585eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Generators/Pythia8_i/src/UserHooks/DecayToSUEP.cxx
View file @
135b60d8
...
...
@@ -133,15 +133,22 @@ namespace Pythia8{
try
{
nShowerAttempts
++
;
suep_shower4momenta
=
suep_shower
.
generate_shower
();
nShowerAttempts
=
-
1
;
//exit condition
if
(
suep_shower4momenta
.
size
()
<
3
){
//Failed to balance energy or less than 3 particles in the shower
//Try again until nShowerAttempts >= 3
}
else
{
//All ok!
nShowerAttempts
=
-
1
;
//exit condition
}
}
catch
(
std
::
exception
&
e
)
{
//Failed to generate the shower!
//Can happen in some rare circumstances, try again
//Can happen in some rare circumstances,
//Try again until nShowerAttempts >= 3
}
}
while
((
nShowerAttempts
>
0
)
&&
(
nShowerAttempts
<
3
));
if
(
nShowerAttempts
>=
3
)
{
//Something is seriously wrong then, print warning and skip to next event
std
::
cout
<<
"[SUEP]
ERROR
: Something went
terribly
wrong in generating the shower. Skipping the event."
<<
std
::
endl
;
std
::
cout
<<
"[SUEP]
WARNING
: Something went wrong in generating the shower. Skipping the event."
<<
std
::
endl
;
return
true
;
//veto the event!
}
...
...
Generators/Pythia8_i/src/UserHooks/suep_shower.cxx
View file @
135b60d8
...
...
@@ -146,6 +146,13 @@ vector< Vec4 > Suep_shower::generate_shower(){
event
[
n
][
i
]
+=
correction
;
}
}
//Shield against an exception in the calculation of "p_scale" further down. If it fails, abort the event.
if
(
Suep_shower
::
reballance_func
(
2.0
,
event
)
<
0.0
){
// failed to balance energy.
event
.
clear
();
return
event
;
}
// finally, ballance the total energy, without destroying momentum conservation
tolerance
tol
=
0.00001
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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