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
7320b195
Commit
7320b195
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
energy recalculation
parent
2b0a9ee7
No related branches found
No related tags found
1 merge request
!59
Resolve "implement ElasticModel"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Processes/HadronicElasticModel/HadronicElasticModel.h
+27
-18
27 additions, 18 deletions
Processes/HadronicElasticModel/HadronicElasticModel.h
with
27 additions
and
18 deletions
Processes/HadronicElasticModel/HadronicElasticModel.h
+
27
−
18
View file @
7320b195
...
...
@@ -13,6 +13,7 @@
#include
<corsika/environment/Environment.h>
#include
<corsika/environment/NuclearComposition.h>
#include
<corsika/geometry/FourVector.h>
#include
<corsika/particles/ParticleProperties.h>
#include
<corsika/process/InteractionProcess.h>
#include
<corsika/random/ExponentialDistribution.h>
...
...
@@ -156,16 +157,22 @@ namespace corsika::process::HadronicElasticModel {
std
::
uniform_real_distribution
phiDist
(
0.
,
2
*
M_PI
);
utl
::
COMBoost
const
boost
(
projectileEnergy
,
projectileMomentum
,
targetMass
);
auto
const
[
eProjectileCoM
,
pProjectileCoM
]
=
boost
.
toCoM
(
projectileEnergy
,
projectileMomentum
);
auto
const
[
eTargetCoM
,
pTargetCoM
]
=
boost
.
toCoM
(
geometry
::
FourVector
const
projectileLab
(
projectileEnergy
,
projectileMomentum
);
geometry
::
FourVector
const
targetLab
(
targetMass
,
geometry
::
Vector
<
units
::
si
::
hepmomentum_d
>
(
projectileMomentum
.
GetCoordinateSystem
(),
{
0
_eV
,
0
_eV
,
0
_eV
}));
utl
::
COMBoost
const
boost
(
projectileLab
,
targetMass
);
auto
const
pProjectileCoMSqNorm
=
pProjectileCoM
.
squaredNorm
();
auto
const
projectileCoM
=
boost
.
toCoM
(
projectileLab
);
auto
const
targetCoM
=
boost
.
toCoM
(
targetLab
);
auto
const
pProjectileCoMSqNorm
=
projectileCoM
.
GetSpaceLikeComponents
().
squaredNorm
();
auto
const
pProjectileCoMNorm
=
sqrt
(
pProjectileCoMSqNorm
);
auto
const
eProjectileCoM
=
projectileCoM
.
GetTimeLikeComponent
();
auto
const
eTargetCoM
=
targetCoM
.
GetTimeLikeComponent
();
auto
const
sqrtS
=
eProjectileCoM
+
eTargetCoM
;
auto
const
s
=
units
::
si
::
detail
::
static_pow
<
2
>
(
sqrtS
);
...
...
@@ -192,21 +199,23 @@ namespace corsika::process::HadronicElasticModel {
<<
" GeV² (max./GeV² = "
<<
4
*
invGeVsq
*
projectileMomentumSquaredNorm
<<
')'
<<
std
::
endl
;
auto
const
theta
=
2
*
asin
(
sqrt
(
absT
/
(
4
*
pProjectileCoMSqNorm
)));
// would work for in any frame
auto
const
theta
=
2
*
asin
(
sqrt
(
absT
/
(
4
*
pProjectileCoMSqNorm
)));
auto
const
phi
=
phiDist
(
fRNG
);
geometry
::
QuantityVector
<
units
::
si
::
hepmomentum_d
>
const
scatteredMomentum
{
pProjectileCoMNorm
*
sin
(
theta
)
*
cos
(
phi
),
pProjectileCoMNorm
*
sin
(
theta
)
*
sin
(
phi
),
pProjectileCoMNorm
*
cos
(
theta
)};
auto
const
[
eProjectileScatteredLab
,
pProjectileScatteredLab
]
=
boost
.
fromCoM
(
eProjectileCoM
,
scatteredMomentum
);
p
.
SetMomentum
(
pProjectileScatteredLab
);
p
.
SetEnergy
(
eProjectileScatteredLab
);
// alternatively recalculate energy from
// momentum and mass
auto
const
projectileScatteredLab
=
boost
.
fromCoM
(
geometry
::
FourVector
<
HEPEnergyType
,
geometry
::
Vector
<
hepmomentum_d
>>
(
eProjectileCoM
,
geometry
::
Vector
<
hepmomentum_d
>
(
projectileMomentum
.
GetCoordinateSystem
(),
{
pProjectileCoMNorm
*
sin
(
theta
)
*
cos
(
phi
),
pProjectileCoMNorm
*
sin
(
theta
)
*
sin
(
phi
),
pProjectileCoMNorm
*
cos
(
theta
)})));
p
.
SetMomentum
(
projectileScatteredLab
.
GetSpaceLikeComponents
());
p
.
SetEnergy
(
sqrt
(
projectileScatteredLab
.
GetSpaceLikeComponents
().
squaredNorm
()
+
units
::
si
::
detail
::
static_pow
<
2
>
(
corsika
::
particles
::
GetMass
(
p
.
GetPID
()))));
// Don't use energy from boost. It can be smaller than
// the momentum due to limited numerical accuracy.
return
process
::
EProcessReturn
::
eOk
;
}
...
...
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