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
76f24549
Commit
76f24549
authored
1 year ago
by
Andre Sailer
Browse files
Options
Downloads
Patches
Plain Diff
DDG4 LCIO Output: ingest potential run parameters
parent
0a294c4b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DDG4/lcio/Geant4Output2LCIO.cpp
+22
-0
22 additions, 0 deletions
DDG4/lcio/Geant4Output2LCIO.cpp
with
22 additions
and
0 deletions
DDG4/lcio/Geant4Output2LCIO.cpp
+
22
−
0
View file @
76f24549
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include
"DDG4/Geant4OutputAction.h"
#include
"DDG4/Geant4OutputAction.h"
#include
"DDG4/EventParameters.h"
#include
"DDG4/EventParameters.h"
#include
"DDG4/RunParameters.h"
// Geant4 headers
// Geant4 headers
#include
"G4Threading.hh"
#include
"G4Threading.hh"
#include
"G4AutoLock.hh"
#include
"G4AutoLock.hh"
...
@@ -62,6 +63,23 @@ namespace dd4hep {
...
@@ -62,6 +63,23 @@ namespace dd4hep {
#endif
#endif
}
}
template
<
class
T
=
lcio
::
LCRunHeaderImpl
>
void
RunParameters
::
extractParameters
(
T
&
runHeader
){
auto
&
lcparameters
=
runHeader
.
parameters
();
for
(
auto
const
&
ival
:
this
->
intParameters
())
{
lcparameters
.
setValues
(
ival
.
first
,
ival
.
second
);
}
for
(
auto
const
&
ival
:
this
->
fltParameters
())
{
lcparameters
.
setValues
(
ival
.
first
,
ival
.
second
);
}
for
(
auto
const
&
ival
:
this
->
strParameters
())
{
lcparameters
.
setValues
(
ival
.
first
,
ival
.
second
);
}
#if LCIO_VERSION_GE(2, 17)
for
(
auto
const
&
ival
:
this
->
dblParameters
())
{
lcparameters
.
setValues
(
ival
.
first
,
ival
.
second
);
}
#endif
}
class
Geant4ParticleMap
;
class
Geant4ParticleMap
;
...
@@ -250,6 +268,10 @@ void Geant4Output2LCIO::saveRun(const G4Run* run) {
...
@@ -250,6 +268,10 @@ void Geant4Output2LCIO::saveRun(const G4Run* run) {
rh
->
parameters
().
setValue
(
"DD4HEPVersion"
,
versionString
());
rh
->
parameters
().
setValue
(
"DD4HEPVersion"
,
versionString
());
rh
->
setRunNumber
(
m_runNo
);
rh
->
setRunNumber
(
m_runNo
);
rh
->
setDetectorName
(
context
()
->
detectorDescription
().
header
().
name
());
rh
->
setDetectorName
(
context
()
->
detectorDescription
().
header
().
name
());
auto
*
parameters
=
context
()
->
run
().
extension
<
RunParameters
>
(
false
);
if
(
parameters
)
{
parameters
->
extractParameters
(
*
rh
);
}
m_file
->
writeRunHeader
(
rh
);
m_file
->
writeRunHeader
(
rh
);
}
}
...
...
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