Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19244783
repair_off-shell.cc
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
repair_off-shell.cc
View Options
/**
* \authors The HEJ collaboration (see AUTHORS for details)
* \date 2022
* \copyright GPLv2 or later
*/
#include
<cstddef>
#include
<iostream>
#include
<limits>
#include
"hej_test.hh"
#include
"HEJ/Event.hh"
#include
"HEJ/Particle.hh"
#include
"HEJ/EventReader.hh"
namespace
{
constexpr
double
TOLERANCE
=
0.1
;
constexpr
double
EP
=
1e-5
;
void
test_repair
(
LHEF
::
HEPEUP
const
&
hepeup
,
const
double
tolerance
)
{
HEJ
::
Event
::
EventData
ev
{
hepeup
};
ev
.
repair_momenta
(
tolerance
);
for
(
auto
const
&
in
:
ev
.
incoming
)
{
ASSERT
(
in
.
px
()
==
0.
||
std
::
abs
(
in
.
px
())
>
tolerance
);
ASSERT
(
in
.
py
()
==
0.
||
std
::
abs
(
in
.
py
())
>
tolerance
);
ASSERT
(
in
.
m
()
<
EP
||
in
.
m
()
>
tolerance
);
}
for
(
auto
const
&
out
:
ev
.
outgoing
)
{
ASSERT
(
is_massive
(
out
)
||
out
.
m
()
<
EP
||
out
.
m
()
>
tolerance
);
}
for
(
auto
const
&
decay
:
ev
.
decays
)
{
for
(
auto
const
&
out
:
decay
.
second
)
{
ASSERT
(
is_massive
(
out
)
||
out
.
m
()
<
EP
||
out
.
m
()
>
tolerance
);
}
}
}
}
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
std
::
cerr
<<
"Usage: repair_off-shell EVENTS.LHE
\n
"
;
return
EXIT_FAILURE
;
}
auto
reader
=
HEJ
::
make_reader
(
argv
[
1
]);
while
(
reader
->
read_event
())
{
for
(
auto
tolerance
:
{
0.
,
TOLERANCE
,
std
::
numeric_limits
<
double
>::
max
()})
{
test_repair
(
reader
->
hepeup
(),
tolerance
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Sep 30, 4:45 AM (16 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6550583
Default Alt Text
repair_off-shell.cc (1 KB)
Attached To
Mode
rHEJ HEJ
Attached
Detach File
Event Timeline
Log In to Comment