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
63d562a0
Commit
63d562a0
authored
4 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
const
parent
831f9b29
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/framework/core/ParticleProperties.inl
+4
-4
4 additions, 4 deletions
corsika/detail/framework/core/ParticleProperties.inl
corsika/framework/core/ParticleProperties.hpp
+14
-14
14 additions, 14 deletions
corsika/framework/core/ParticleProperties.hpp
with
18 additions
and
18 deletions
corsika/detail/framework/core/ParticleProperties.inl
+
4
−
4
View file @
63d562a0
...
...
@@ -53,15 +53,15 @@ namespace corsika {
return
particle
::
detail
::
isHadron
[
static_cast
<
CodeIntType
>
(
p
)];
}
inline
bool
constexpr
is_em
(
Code
c
)
{
inline
bool
constexpr
is_em
(
Code
const
c
)
{
return
c
==
Code
::
Electron
||
c
==
Code
::
Positron
||
c
==
Code
::
Gamma
;
}
inline
bool
constexpr
is_muon
(
Code
c
)
{
inline
bool
constexpr
is_muon
(
Code
const
c
)
{
return
c
==
Code
::
MuPlus
||
c
==
Code
::
MuMinus
;
}
inline
bool
constexpr
is_neutrino
(
Code
c
)
{
inline
bool
constexpr
is_neutrino
(
Code
const
c
)
{
return
c
==
Code
::
NuE
||
c
==
Code
::
NuMu
||
c
==
Code
::
NuTau
||
c
==
Code
::
NuEBar
||
c
==
Code
::
NuMuBar
||
c
==
Code
::
NuTauBar
;
}
...
...
@@ -88,7 +88,7 @@ namespace corsika {
return
stream
<<
get_name
(
code
);
}
inline
Code
convert_from_PDG
(
PDGCode
p
)
{
inline
Code
convert_from_PDG
(
PDGCode
const
p
)
{
static_assert
(
particle
::
detail
::
conversionArray
.
size
()
%
2
==
1
);
// this will fail, for the strange case where the maxPDG is negative...
int
constexpr
maxPDG
{(
particle
::
detail
::
conversionArray
.
size
()
-
1
)
>>
1
};
...
...
This diff is collapsed.
Click to expand it.
corsika/framework/core/ParticleProperties.hpp
+
14
−
14
View file @
63d562a0
...
...
@@ -48,9 +48,9 @@ namespace corsika {
using
PDGCodeType
=
std
::
underlying_type
<
PDGCode
>::
type
;
// forward declarations to be used in GeneratedParticleProperties
int16_t
constexpr
get_charge_number
(
Code
);
//!< electric charge in units of e
ElectricChargeType
constexpr
get_charge
(
Code
);
//!< electric charge
HEPMassType
constexpr
get_mass
(
Code
);
//!< mass
int16_t
constexpr
get_charge_number
(
Code
const
);
//!< electric charge in units of e
ElectricChargeType
constexpr
get_charge
(
Code
const
);
//!< electric charge
HEPMassType
constexpr
get_mass
(
Code
const
);
//!< mass
HEPEnergyType
constexpr
get_energy_threshold
(
Code
const
);
//!< get energy threshold below which the particle is discarded, by
//!< default set to particle mass
...
...
@@ -67,24 +67,24 @@ namespace corsika {
}
//! Particle code according to PDG, "Monte Carlo Particle Numbering Scheme"
PDGCode
constexpr
get_PDG
(
Code
);
std
::
string_view
constexpr
get_name
(
Code
);
//!< name of the particle as string
TimeType
constexpr
get_lifetime
(
Code
);
//!< lifetime
PDGCode
constexpr
get_PDG
(
Code
const
);
std
::
string_view
constexpr
get_name
(
Code
const
);
//!< name of the particle as string
TimeType
constexpr
get_lifetime
(
Code
const
);
//!< lifetime
//! true iff the particle is a hard-coded nucleus or Code::Nucleus
bool
constexpr
is_nucleus
(
Code
);
bool
constexpr
is_hadron
(
Code
);
//!< true iff particle is hadron
bool
constexpr
is_em
(
Code
);
//!< true iff particle is electron, positron or gamma
bool
constexpr
is_muon
(
Code
);
//!< true iff particle is mu+ or mu-
bool
constexpr
is_neutrino
(
Code
);
//!< true iff particle is (anti-) neutrino
int
constexpr
get_nucleus_A
(
Code
);
//!< returns A for hard-coded nucleus, otherwise 0
int
constexpr
get_nucleus_Z
(
Code
);
//!< returns Z for hard-coded nucleus, otherwise 0
bool
constexpr
is_nucleus
(
Code
const
);
bool
constexpr
is_hadron
(
Code
const
);
//!< true iff particle is hadron
bool
constexpr
is_em
(
Code
const
);
//!< true iff particle is electron, positron or gamma
bool
constexpr
is_muon
(
Code
const
);
//!< true iff particle is mu+ or mu-
bool
constexpr
is_neutrino
(
Code
const
);
//!< true iff particle is (anti-) neutrino
int
constexpr
get_nucleus_A
(
Code
const
);
//!< returns A for hard-coded nucleus, otherwise 0
int
constexpr
get_nucleus_Z
(
Code
const
);
//!< returns Z for hard-coded nucleus, otherwise 0
//! returns mass of (A,Z) nucleus, disregarding binding energy
HEPMassType
get_nucleus_mass
(
unsigned
int
const
,
unsigned
int
const
);
//! convert PDG code to CORSIKA 8 internal code
Code
convert_from_PDG
(
PDGCode
);
Code
convert_from_PDG
(
PDGCode
const
);
std
::
initializer_list
<
Code
>
constexpr
get_all_particles
();
...
...
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