Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
4a5099b5
Commit
4a5099b5
authored
11 months ago
by
Andre Sailer
Browse files
Options
Downloads
Patches
Plain Diff
EDM4hepOutput: determine edm4hep::MCParticle momentum vector type automagically
parent
0207c482
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDG4/edm4hep/Geant4Output2EDM4hep.cpp
+4
-7
4 additions, 7 deletions
DDG4/edm4hep/Geant4Output2EDM4hep.cpp
with
4 additions
and
7 deletions
DDG4/edm4hep/Geant4Output2EDM4hep.cpp
+
4
−
7
View file @
4a5099b5
...
@@ -354,14 +354,11 @@ void Geant4Output2EDM4hep::saveParticles(Geant4ParticleMap* particles) {
...
@@ -354,14 +354,11 @@ void Geant4Output2EDM4hep::saveParticles(Geant4ParticleMap* particles) {
const
G4ParticleDefinition
*
def
=
p
.
definition
();
const
G4ParticleDefinition
*
def
=
p
.
definition
();
auto
mcp
=
m_particles
.
create
();
auto
mcp
=
m_particles
.
create
();
mcp
.
setPDG
(
p
->
pdgID
);
mcp
.
setPDG
(
p
->
pdgID
);
// Because EDM4hep is switching between vector3f[loat] and vector3d[ouble]
using
MT
=
decltype
(
std
::
declval
<
edm4hep
::
MCParticle
>
().
getMomentum
().
x
);
mcp
.
setMomentum
(
{
MT
(
p
->
psx
/
CLHEP
::
GeV
),
MT
(
p
->
psy
/
CLHEP
::
GeV
),
MT
(
p
->
psz
/
CLHEP
::
GeV
)}
);
mcp
.
setMomentumAtEndpoint
(
{
MT
(
p
->
pex
/
CLHEP
::
GeV
),
MT
(
p
->
pey
/
CLHEP
::
GeV
),
MT
(
p
->
pez
/
CLHEP
::
GeV
)}
);
#if edm4hep_VERSION < EDM4HEP_VERSION(0, 10, 3)
mcp
.
setMomentum
(
{
float
(
p
->
psx
/
CLHEP
::
GeV
),
float
(
p
->
psy
/
CLHEP
::
GeV
),
float
(
p
->
psz
/
CLHEP
::
GeV
)}
);
mcp
.
setMomentumAtEndpoint
(
{
float
(
p
->
pex
/
CLHEP
::
GeV
),
float
(
p
->
pey
/
CLHEP
::
GeV
),
float
(
p
->
pez
/
CLHEP
::
GeV
)}
);
#else
mcp
.
setMomentum
(
{
p
->
psx
/
CLHEP
::
GeV
,
p
->
psy
/
CLHEP
::
GeV
,
p
->
psz
/
CLHEP
::
GeV
}
);
mcp
.
setMomentumAtEndpoint
(
{
p
->
pex
/
CLHEP
::
GeV
,
p
->
pey
/
CLHEP
::
GeV
,
p
->
pez
/
CLHEP
::
GeV
}
);
#endif
double
vs_fa
[
3
]
=
{
p
->
vsx
/
CLHEP
::
mm
,
p
->
vsy
/
CLHEP
::
mm
,
p
->
vsz
/
CLHEP
::
mm
}
;
double
vs_fa
[
3
]
=
{
p
->
vsx
/
CLHEP
::
mm
,
p
->
vsy
/
CLHEP
::
mm
,
p
->
vsz
/
CLHEP
::
mm
}
;
mcp
.
setVertex
(
vs_fa
);
mcp
.
setVertex
(
vs_fa
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment