IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue 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
Air Shower Physics
corsika
Commits
17174010
Commit
17174010
authored
2 years ago
by
Felix Riehn
Committed by
Maximilian Reininghaus
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed definition of stable particles in epos. can be called only once!
parent
b7c9cd0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!449
Fix epos again again
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/modules/epos/InteractionModel.inl
+19
-4
19 additions, 4 deletions
corsika/detail/modules/epos/InteractionModel.inl
corsika/modules/epos/InteractionModel.hpp
+4
-2
4 additions, 2 deletions
corsika/modules/epos/InteractionModel.hpp
with
23 additions
and
6 deletions
corsika/detail/modules/epos/InteractionModel.inl
+
19
−
4
View file @
17174010
...
...
@@ -34,8 +34,8 @@ namespace corsika::epos {
data_path_
=
(
std
::
string
(
corsika_data
(
"EPOS"
).
c_str
())
+
"/"
).
c_str
();
}
initialize
();
setParticlesStable
();
}
setParticlesStable
();
}
inline
void
InteractionModel
::
setParticlesStable
()
const
{
...
...
@@ -45,15 +45,30 @@ namespace corsika::epos {
if
(
!
is_hadron
(
p
))
continue
;
int
const
eid
=
convertToEposRaw
(
p
);
if
(
eid
!=
0
)
{
::
epos
::
nodcy_
.
nrnody
=
::
epos
::
nodcy_
.
nrnody
+
1
;
::
epos
::
nodcy_
.
nody
[
::
epos
::
nodcy_
.
nrnody
-
1
]
=
eid
;
// LCOV_EXCL_START
// this is only a safeguard against messing up the epos internals by initializing
// more than once.
unsigned
int
const
n_particles_stable_epos
=
::
epos
::
nodcy_
.
nrnody
;
// avoid waring -Wsign-compare
if
(
n_particles_stable_epos
<
::
epos
::
mxnody
)
{
CORSIKA_LOGGER_TRACE
(
logger_
,
"setting {} with EposId={} stable inside EPOS."
,
p
,
eid
);
::
epos
::
nodcy_
.
nrnody
=
::
epos
::
nodcy_
.
nrnody
+
1
;
::
epos
::
nodcy_
.
nody
[
::
epos
::
nodcy_
.
nrnody
-
1
]
=
eid
;
}
else
{
CORSIKA_LOGGER_ERROR
(
logger_
,
"List of stable particles too long for Epos!"
);
throw
std
::
runtime_error
(
"Epos initialization error!"
);
}
// LCOV_EXCL_STOP
}
else
{
CORSIKA_LOG_
DEBUG
(
CORSIKA_LOG_
TRACE
(
"particle conversion Corsika-->Epos not known for {}. Using {}. Setting "
"unstable in Epos!"
,
p
,
eid
);
}
}
CORSIKA_LOGGER_DEBUG
(
logger_
,
"set {} particles stable inside Epos"
,
::
epos
::
nodcy_
.
nrnody
);
}
inline
bool
InteractionModel
::
isValid
(
Code
const
projectileId
,
Code
const
targetId
,
...
...
This diff is collapsed.
Click to expand it.
corsika/modules/epos/InteractionModel.hpp
+
4
−
2
View file @
17174010
...
...
@@ -89,16 +89,18 @@ namespace corsika::epos {
void
doInteraction
(
TSecondaries
&
,
Code
const
projectileId
,
Code
const
targetId
,
FourMomentum
const
&
projectileP4
,
FourMomentum
const
&
targetP4
);
void
initialize
()
const
;
void
initializeEventCoM
(
Code
const
,
int
const
,
int
const
,
Code
const
,
int
const
,
int
const
,
HEPEnergyType
const
)
const
;
void
initializeEventLab
(
Code
const
,
int
const
,
int
const
,
Code
const
,
int
const
,
int
const
,
HEPEnergyType
const
)
const
;
void
configureParticles
(
Code
const
,
int
const
,
int
const
,
Code
const
,
int
const
,
int
const
)
const
;
void
setParticlesStable
()
const
;
private
:
// initialize and setParticlesStable are private since they can only be called once at
// the beginning and are already called in the constructor!
void
initialize
()
const
;
void
setParticlesStable
()
const
;
inline
static
bool
isInitialized_
=
false
;
std
::
string
data_path_
;
...
...
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