IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Pranav Sampathkumar
corsika
Commits
635ee0b1
Commit
635ee0b1
authored
2 years ago
by
Maximilian Reininghaus
Committed by
Maximilian Reininghaus
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
new get_name() function for printing nuclear A,Z
parent
49513970
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/framework/core/ParticleProperties.inl
+8
-0
8 additions, 0 deletions
corsika/detail/framework/core/ParticleProperties.inl
corsika/framework/core/ParticleProperties.hpp
+4
-1
4 additions, 1 deletion
corsika/framework/core/ParticleProperties.hpp
with
12 additions
and
1 deletion
corsika/detail/framework/core/ParticleProperties.inl
+
8
−
0
View file @
635ee0b1
...
...
@@ -92,6 +92,14 @@ namespace corsika {
return
particle
::
detail
::
names
[
static_cast
<
CodeIntType
>
(
code
)];
}
inline
std
::
string
get_name
(
Code
code
,
full_name
)
{
if
(
is_nucleus
(
code
))
{
return
fmt
::
format
(
"nucleus ({},{})"
,
get_nucleus_A
(
code
),
get_nucleus_Z
(
code
));
}
return
std
::
string
{
get_name
(
code
)};
}
inline
TimeType
constexpr
get_lifetime
(
Code
const
p
)
{
return
particle
::
detail
::
lifetime
[
static_cast
<
CodeIntType
>
(
p
)]
*
second
;
}
...
...
This diff is collapsed.
Click to expand it.
corsika/framework/core/ParticleProperties.hpp
+
4
−
1
View file @
635ee0b1
...
...
@@ -108,6 +108,7 @@ namespace corsika {
namespace
corsika
{
// forward declarations to be used in GeneratedParticleProperties
struct
full_name
{};
//!< tag class for get_name()
int16_t
constexpr
get_charge_number
(
Code
const
);
//!< electric charge in units of e
ElectricChargeType
constexpr
get_charge
(
Code
const
);
//!< electric charge
...
...
@@ -146,7 +147,9 @@ namespace corsika {
PDGCode
constexpr
get_PDG
(
Code
const
);
PDGCode
constexpr
get_PDG
(
unsigned
int
const
A
,
unsigned
int
const
Z
);
std
::
string_view
constexpr
get_name
(
Code
const
);
//!< name of the particle as string
TimeType
constexpr
get_lifetime
(
Code
const
);
//!< lifetime
std
::
string
get_name
(
Code
,
full_name
);
//!< get name of particle, including (A,Z) for nuclei
TimeType
constexpr
get_lifetime
(
Code
const
);
//!< lifetime
bool
constexpr
is_hadron
(
Code
const
);
//!< true if particle is hadron
bool
constexpr
is_em
(
Code
const
);
//!< true if particle is electron, positron or photon
...
...
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