Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atlas
athena
Merge requests
!36118
Herwig HepMC3 interface
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Herwig HepMC3 interface
averbyts/athena:hepmc3_herwig7
into
master
Overview
13
Commits
3
Pipelines
1
Changes
2
Merged
Andrii Verbytskyi
requested to merge
averbyts/athena:hepmc3_herwig7
into
master
4 years ago
Overview
13
Commits
3
Pipelines
1
Changes
2
Expand
Implement Herwig HepMC3 interface
Edited
4 years ago
by
Andrii Verbytskyi
0
0
Merge request reports
Compare
master
version 1
538a3b6d
4 years ago
master (base)
and
latest version
latest version
564a56bd
3 commits,
4 years ago
version 1
538a3b6d
1 commit,
4 years ago
2 files
+
93
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
Generators/Herwig7_i/src/Herwig7HepMC.cxx
+
78
−
0
Options
@@ -25,6 +25,83 @@
#include
"ThePEG/Vectors/HepMCConverter.h"
#ifdef HWVER_IS_72
#ifdef HEPMC3
#include
"HepMC3/GenEvent.h"
#include
"HepMC3/GenParticle.h"
#include
"HepMC3/GenVertex.h"
namespace
ThePEG
{
template
<
>
struct
HepMCTraits
<
HepMC3
::
GenEvent
>
:
public
HepMCTraitsBase
<
HepMC3
::
GenEvent
,
HepMC3
::
GenParticle
,
HepMC3
::
GenParticlePtr
,
HepMC3
::
GenVertex
,
HepMC3
::
GenVertexPtr
,
std
::
pair
<
double
,
double
>
,
HepMC3
::
GenPdfInfo
>
{
static
bool
hasUnits
()
{
return
true
;
}
/** Set the \a scale, \f$\alpha_S\f$ (\a aS) and \f$\alpha_{EM}\f$
(\a aEM) for the event \a e. The scale will be scaled with \a
unit before given to the GenEvent. */
static
void
setScaleAndAlphas
(
HepMC3
::
GenEvent
&
e
,
Energy2
scale
,
double
aS
,
double
aEM
,
Energy
unit
)
{
e
.
add_attribute
(
"event_scale"
,
std
::
make_shared
<
HepMC3
::
DoubleAttribute
>
(
sqrt
(
scale
)
/
unit
));
e
.
add_attribute
(
"alphaQCD"
,
std
::
make_shared
<
HepMC3
::
DoubleAttribute
>
(
aS
));
e
.
add_attribute
(
"alphaQED"
,
std
::
make_shared
<
HepMC3
::
DoubleAttribute
>
(
aEM
));
}
/** Set the primary vertex, \a v, for the event \a e. */
static
void
setSignalProcessVertex
(
HepMC3
::
GenEvent
&
e
,
HepMC3
::
GenVertexPtr
v
)
{
e
.
add_attribute
(
"signal_process_vertex"
,
std
::
make_shared
<
HepMC3
::
IntAttribute
>
(
v
->
id
()));
}
/** Set the polarization directions, \a the and \a phi, for particle
\a p. */
static
void
setPolarization
(
HepMC3
::
GenParticle
&
genp
,
double
the
,
double
phi
)
{
genp
.
add_attribute
(
"theta"
,
std
::
make_shared
<
HepMC3
::
DoubleAttribute
>
(
the
));
genp
.
add_attribute
(
"phi"
,
std
::
make_shared
<
HepMC3
::
DoubleAttribute
>
(
phi
));
}
/** Set the colour line (with index \a indx) to \a coline for
particle \a p. */
static
void
setColourLine
(
HepMC3
::
GenParticle
&
p
,
int
indx
,
int
coline
)
{
p
.
add_attribute
(
"flow"
+
std
::
to_string
(
indx
),
std
::
make_shared
<
HepMC3
::
IntAttribute
>
(
coline
));
}
/** Set the beam particles for the event.*/
static
void
setBeamParticles
(
HepMC3
::
GenEvent
&
e
,
HepMC3
::
GenParticlePtr
p1
,
HepMC3
::
GenParticlePtr
p2
)
{
p1
->
set_status
(
4
);
p2
->
set_status
(
4
);
e
.
set_beam_particles
(
p1
,
p2
);
}
static
HepMC3
::
GenParticlePtr
newParticle
(
const
Lorentz5Momentum
&
p
,
long
id
,
int
status
,
Energy
unit
)
{
// Note that according to the documentation the momentum is stored in a
// HepLorentzVector in GeV (event though the CLHEP standard is MeV).
LorentzVector
<
double
>
p_scalar
=
p
/
unit
;
HepMC3
::
GenParticlePtr
genp
=
std
::
make_shared
<
HepMC3
::
GenParticle
>
(
HepMC
::
FourVector
(
p_scalar
.
x
(),
p_scalar
.
y
(),
p_scalar
.
z
(),
p_scalar
.
e
()),
id
,
status
);
genp
->
set_generated_mass
(
p
.
mass
()
/
unit
);
return
genp
;
}
/** Set the position \a p for the vertex, \a v. The length will be
scaled with \a unit which normally should be millimeters. */
static
void
setPosition
(
HepMC3
::
GenVertex
&
v
,
const
LorentzPoint
&
p
,
Length
unit
)
{
LorentzVector
<
double
>
p_scaled
=
p
/
unit
;
v
.
set_position
(
HepMC
::
FourVector
(
p_scaled
.
x
(),
p_scaled
.
y
(),
p_scaled
.
z
(),
p_scaled
.
t
()));
}
/** Create a new vertex. */
static
HepMC3
::
GenVertexPtr
newVertex
()
{
return
std
::
make_shared
<
HepMC3
::
GenVertex
>
();
}
};
}
#else
namespace
ThePEG
{
template
<
>
struct
HepMCTraits
<
HepMC
::
GenEvent
>
@@ -41,6 +118,7 @@ namespace ThePEG {
}
};
}
#endif
#else
namespace
ThePEG
{
template
<
>
Loading