Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NPDet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
EIC
NPDet
Commits
6429180c
Commit
6429180c
authored
3 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
Use G4IonTable to support beagle etc
parent
7f6ef5c2
No related branches found
No related tags found
2 merge requests
!273
Draft: Resolve "Support FastSim and GFlash"
,
!239
Use G4IonTable to support beagle etc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dd4pod/plugins/Geant4Output2Podio.cxx
+12
-4
12 additions, 4 deletions
src/dd4pod/plugins/Geant4Output2Podio.cxx
with
12 additions
and
4 deletions
src/dd4pod/plugins/Geant4Output2Podio.cxx
+
12
−
4
View file @
6429180c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
#include
"CLHEP/Units/SystemOfUnits.h"
#include
"CLHEP/Units/SystemOfUnits.h"
#include
"G4ParticleDefinition.hh"
#include
"G4ParticleDefinition.hh"
#include
"G4ParticleTable.hh"
#include
"G4ParticleTable.hh"
#include
"G4IonTable.hh"
#include
"G4Event.hh"
#include
"G4Event.hh"
#include
"dd4pod/TrackerHitCollection.h"
#include
"dd4pod/TrackerHitCollection.h"
...
@@ -173,13 +174,20 @@ namespace dd4hep::sim {
...
@@ -173,13 +174,20 @@ namespace dd4hep::sim {
// loop over particle and copy them to podio data model
// loop over particle and copy them to podio data model
for
(
const
auto
&
[
key
,
part
]
:
pm
)
{
for
(
const
auto
&
[
key
,
part
]
:
pm
)
{
int
charge
=
0
;
// particles
const
auto
part_def
=
m_particleTable
->
FindParticle
(
part
->
pdgID
);
const
auto
part_def
=
m_particleTable
->
FindParticle
(
part
->
pdgID
);
int
charge
=
0
;
// ions
if
(
part_def
==
nullptr
)
{
int
Z
{
0
},
A
{
0
},
L
{
0
},
J
{
0
};
double
E
{
0.
};
const
auto
is_ion
=
G4IonTable
::
GetNucleusByEncoding
(
part
->
pdgID
,
Z
,
A
,
L
,
E
,
J
);
if
(
part_def
!=
nullptr
)
{
charge
=
static_cast
<
int
>
(
std
::
lround
(
part_def
->
GetPDGCharge
()
/
CLHEP
::
eplus
));
}
else
if
(
is_ion
)
{
charge
=
Z
;
}
else
{
printout
((
part
->
genStatus
==
1
?
ERROR
:
INFO
),
"Geant4Output2Podio"
,
printout
((
part
->
genStatus
==
1
?
ERROR
:
INFO
),
"Geant4Output2Podio"
,
"++ saveEvent: pdgID %d unknown, charge set to 0"
,
part
->
pdgID
);
"++ saveEvent: pdgID %d unknown, charge set to 0"
,
part
->
pdgID
);
}
else
{
charge
=
static_cast
<
int
>
(
std
::
lround
(
part_def
->
GetPDGCharge
()
/
CLHEP
::
eplus
));
}
}
dd4pod
::
Geant4Particle
podpart
{
dd4pod
::
Geant4Particle
podpart
{
part
->
id
,
part
->
id
,
...
...
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