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
29ec2618
Commit
29ec2618
authored
2 years ago
by
Felix Riehn
Committed by
Maximilian Reininghaus
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add convenience function to calculate center-of-mass energy
parent
b02eef1f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
corsika/framework/core/EnergyMomentumOperations.hpp
+13
-0
13 additions, 0 deletions
corsika/framework/core/EnergyMomentumOperations.hpp
with
13 additions
and
0 deletions
corsika/framework/core/EnergyMomentumOperations.hpp
+
13
−
0
View file @
29ec2618
...
...
@@ -117,4 +117,17 @@ namespace corsika {
return
(
sqrtS_sqr
-
static_pow
<
2
>
(
m_proj
)
-
static_pow
<
2
>
(
m_targ
))
/
(
2
*
m_targ
);
}
/**
* \f[E_{com}=sqrt{2 * m_{proj} * m_{targ} * E_{lab} + m_{proj}^2 + m_{targ}^2} \f]
*
* @param E lab. energy.
* @param m particle mass.
* @return HEPEnergyType
*/
HEPEnergyType
constexpr
calculate_com_energy
(
HEPEnergyType
Elab
,
HEPMassType
const
m_proj
,
HEPMassType
const
m_targ
)
{
return
sqrt
(
2
*
Elab
*
m_targ
+
static_pow
<
2
>
(
m_proj
)
+
static_pow
<
2
>
(
m_targ
));
}
}
// namespace corsika
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