Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19251023
test_psp.cc
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
test_psp.cc
View Options
/**
* \authors The HEJ collaboration (see AUTHORS for details)
* \date 2019
* \copyright GPLv2 or later
*/
#include
"LHEF/LHEF.h"
#include
"HEJ/stream.hh"
#include
"HEJ/config.hh"
#include
"HEJ/event_types.hh"
#include
"HEJ/Event.hh"
#include
"HEJ/PhaseSpacePoint.hh"
#include
"HEJ/Ranlux64.hh"
#include
"hej_test.hh"
namespace
{
constexpr
int
max_trials
=
100
;
constexpr
double
max_ext_soft_pt_fraction
=
0.1
;
const
fastjet
::
JetDefinition
jet_def
{
fastjet
::
kt_algorithm
,
0.4
};
constexpr
double
min_jet_pt
=
50
;
};
int
main
(
int
argn
,
char
**
argv
)
{
if
(
argn
!=
2
){
std
::
cerr
<<
"Usage: "
<<
argv
[
0
]
<<
" eventfile"
;
return
EXIT_FAILURE
;
}
HEJ
::
istream
in
{
argv
[
1
]};
LHEF
::
Reader
reader
{
in
};
LHEF
::
Writer
writer
{
std
::
cerr
};
writer
.
heprup
=
reader
.
heprup
;
HEJ
::
PhaseSpacePointConfig
conf
;
conf
.
jet_param
=
HEJ
::
JetParameters
{
jet_def
,
min_jet_pt
};
conf
.
max_ext_soft_pt_fraction
=
max_ext_soft_pt_fraction
;
HEJ
::
Ranlux64
ran
{};
while
(
reader
.
readEvent
()){
HEJ
::
Event
::
EventData
ev_data
{
reader
.
hepeup
};
shuffle_particles
(
ev_data
);
const
HEJ
::
Event
ev
{
ev_data
(
jet_def
,
min_jet_pt
)
};
for
(
int
trial
=
0
;
trial
<
max_trials
;
++
trial
){
HEJ
::
PhaseSpacePoint
psp
{
ev
,
conf
,
ran
};
if
(
psp
.
weight
()
!=
0
){
HEJ
::
Event
::
EventData
tmp_ev
;
tmp_ev
.
incoming
=
psp
.
incoming
();
tmp_ev
.
outgoing
=
psp
.
outgoing
();
tmp_ev
.
parameters
.
central
=
{
0
,
0
,
0
};
shuffle_particles
(
tmp_ev
);
HEJ
::
Event
out_ev
{
tmp_ev
(
jet_def
,
min_jet_pt
)
};
if
(
out_ev
.
type
()
!=
ev
.
type
()){
using
HEJ
::
event_type
::
name
;
std
::
cerr
<<
"Wrong class of phase space point:
\n
"
"original event of class "
<<
name
(
ev
.
type
())
<<
":
\n
"
;
writer
.
hepeup
=
reader
.
hepeup
;
writer
.
writeEvent
();
std
::
cerr
<<
"Phase space point of class "
<<
name
(
out_ev
.
type
())
<<
":
\n
"
;
writer
.
hepeup
=
to_HEPEUP
(
out_ev
,
&
writer
.
heprup
);
writer
.
writeEvent
();
return
EXIT_FAILURE
;
}
}
}
}
return
EXIT_SUCCESS
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Sep 30, 5:46 AM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6519513
Default Alt Text
test_psp.cc (2 KB)
Attached To
Mode
rHEJ HEJ
Attached
Detach File
Event Timeline
Log In to Comment