hej
is hosted by
Hepforge
,
IPPP Durham
HEJ
2.1.4
High energy resummation for hadron colliders
Loading...
Searching...
No Matches
include
HEJ
detail
HepMCInterface_common.hh
Go to the documentation of this file.
1
8
#pragma once
9
10
#include "
HEJ/Event.hh
"
11
#include "
HEJ/Particle.hh
"
12
13
namespace
HEJ
{
14
namespace
detail_HepMC {
15
17
template
<
class
FourVector>
18
FourVector
to_FourVector
(
Particle
const
& sp){
19
return
{sp.
px
(), sp.
py
(), sp.
pz
(), sp.
E
()};
20
}
21
namespace
status_codes {
23
enum
Status
:
unsigned
{
24
out
= 1,
25
decay
= 2,
26
beam
= 4,
27
in
= 11,
28
};
29
}
30
using
Status
=
status_codes::Status
;
31
35
template
<
int
V>
struct
HepMCVersion
;
36
template
<
int
V>
37
using
GenEvent
=
typename
HepMCVersion<V>::GenEvent
;
38
template
<
int
V>
39
using
Beam
=
typename
HepMCVersion<V>::Beam
;
40
42
template
<
int
V>
43
auto
make_particle_ptr
(
44
Particle
const
& sp,
int
status
45
);
46
48
template
<
int
V>
49
auto
make_vx_ptr
();
51
60
template
<
int
V>
61
GenEvent<V>
HepMC_init_kinematics
(
62
Event
const
& event,
Beam<V>
const
& beam,
GenEvent<V>
&& out_ev
63
){
64
out_ev.set_beam_particles(beam[0], beam[1]);
65
66
auto
vx = make_vx_ptr<V>();
67
for
(
size_t
i=0; i<
event
.incoming().size(); ++i){
68
auto
particle = make_particle_ptr<V>(event.
incoming
()[i], Status::in);
69
auto
vx_beam = make_vx_ptr<V>();
70
vx_beam->add_particle_in(beam[i]);
71
vx_beam->add_particle_out(particle);
72
out_ev.add_vertex(vx_beam);
73
vx->add_particle_in(particle);
74
}
75
for
(
size_t
i=0; i <
event
.outgoing().size(); ++i){
76
auto
const
& out =
event
.outgoing()[i];
77
auto
particle = make_particle_ptr<V>(out, Status::out);
78
const
int
status =
event
.decays().count(i)?Status::decay:Status::out;
79
particle->set_status(status);
80
if
( status == Status::decay ){
81
auto
vx_decay = make_vx_ptr<V>();
82
vx_decay->add_particle_in(particle);
83
for
(
auto
const
& decay: event.
decays
().at(i) ){
84
vx_decay->add_particle_out(
85
make_particle_ptr<V>(decay, Status::out)
86
);
87
}
88
out_ev.add_vertex(vx_decay);
89
}
90
vx->add_particle_out(particle);
91
}
92
out_ev.add_vertex(vx);
93
94
return
out_ev;
95
}
96
}
// namespace detail_HepMC
97
}
// namespace HEJ
Event.hh
Declares the Event class and helpers.
Particle.hh
Contains the particle struct.
HEJ::Event
An event with clustered jets.
Definition:
Event.hh:47
HEJ::Event::incoming
std::array< Particle, 2 > const & incoming() const
Incoming particles.
Definition:
Event.hh:74
HEJ::Event::decays
std::unordered_map< std::size_t, std::vector< Particle > > const & decays() const
Particle decays.
Definition:
Event.hh:105
HEJ::detail_HepMC::status_codes::Status
Status
Conventional status codes in HepMC.
Definition:
HepMCInterface_common.hh:23
HEJ::detail_HepMC::status_codes::decay
@ decay
Decaying.
Definition:
HepMCInterface_common.hh:25
HEJ::detail_HepMC::status_codes::out
@ out
Final outgoing.
Definition:
HepMCInterface_common.hh:24
HEJ::detail_HepMC::status_codes::in
@ in
Incoming.
Definition:
HepMCInterface_common.hh:27
HEJ::detail_HepMC::status_codes::beam
@ beam
Beam.
Definition:
HepMCInterface_common.hh:26
HEJ::detail_HepMC::make_vx_ptr
auto make_vx_ptr()
Make HepMC vetex.
HEJ::detail_HepMC::GenEvent
typename HepMCVersion< V >::GenEvent GenEvent
Definition:
HepMCInterface_common.hh:37
HEJ::detail_HepMC::HepMC_init_kinematics
GenEvent< V > HepMC_init_kinematics(Event const &event, Beam< V > const &beam, GenEvent< V > &&out_ev)
Template class to initialise the kinematics for HepMC.
Definition:
HepMCInterface_common.hh:61
HEJ::detail_HepMC::make_particle_ptr
auto make_particle_ptr(Particle const &sp, int status)
Make HepMC particle.
HEJ::detail_HepMC::Beam
typename HepMCVersion< V >::Beam Beam
Definition:
HepMCInterface_common.hh:39
HEJ::detail_HepMC::to_FourVector
FourVector to_FourVector(Particle const &sp)
Convert Particle to HepMC 4-vector (x,y,z,E)
Definition:
HepMCInterface_common.hh:18
HEJ
Main HEJ 2 Namespace.
Definition:
mainpage.dox:1
HEJ::Particle
Class representing a particle.
Definition:
Particle.hh:24
HEJ::Particle::py
double py() const
get momentum in y direction
Definition:
Particle.hh:49
HEJ::Particle::px
double px() const
get momentum in x direction
Definition:
Particle.hh:45
HEJ::Particle::E
double E() const
get energy
Definition:
Particle.hh:57
HEJ::Particle::pz
double pz() const
get momentum in z direction
Definition:
Particle.hh:53
HEJ::detail_HepMC::HepMCVersion
Definition:
HepMCInterface_common.hh:35
Generated by
1.9.5