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
4042bf3d
Commit
4042bf3d
authored
3 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
found few more setMomentum
parent
e7e34470
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/detail/modules/proposal/ContinuousProcess.inl
+6
-12
6 additions, 12 deletions
corsika/detail/modules/proposal/ContinuousProcess.inl
with
6 additions
and
12 deletions
corsika/detail/modules/proposal/ContinuousProcess.inl
+
6
−
12
View file @
4042bf3d
...
@@ -81,18 +81,15 @@ namespace corsika::proposal {
...
@@ -81,18 +81,15 @@ namespace corsika::proposal {
// update particle direction after continuous loss caused by multiple
// update particle direction after continuous loss caused by multiple
// scattering
// scattering
auto
particle_momentum
=
vP
.
getMomentum
().
getNorm
();
vP
.
setDirection
(
auto
vec
=
QuantityVector
(
final_direction
.
GetX
()
*
particle_momentum
,
{
vP_dir
.
getCoordinateSystem
(),
final_direction
.
GetY
()
*
particle_momentum
,
{
final_direction
.
GetX
(),
final_direction
.
GetY
(),
final_direction
.
GetZ
()}});
final_direction
.
GetZ
()
*
particle_momentum
);
vP
.
setMomentum
(
MomentumVector
(
vP_dir
.
getCoordinateSystem
(),
vec
));
}
}
template
<
typename
TParticle
,
typename
TTrajectory
>
template
<
typename
TParticle
,
typename
TTrajectory
>
inline
ProcessReturn
ContinuousProcess
::
doContinuous
(
TParticle
&
vP
,
inline
ProcessReturn
ContinuousProcess
::
doContinuous
(
TParticle
&
vP
,
TTrajectory
const
&
vT
,
TTrajectory
const
&
vT
,
bool
const
)
{
bool
const
)
{
if
(
!
canInteract
(
vP
.
getPID
()))
return
ProcessReturn
::
Ok
;
if
(
!
canInteract
(
vP
.
getPID
()))
return
ProcessReturn
::
Ok
;
if
(
vT
.
getLength
()
==
0
_m
)
return
ProcessReturn
::
Ok
;
if
(
vT
.
getLength
()
==
0
_m
)
return
ProcessReturn
::
Ok
;
...
@@ -110,10 +107,7 @@ namespace corsika::proposal {
...
@@ -110,10 +107,7 @@ namespace corsika::proposal {
// if the particle has a charge take multiple scattering into account
// if the particle has a charge take multiple scattering into account
if
(
vP
.
getChargeNumber
()
!=
0
)
scatter
(
vP
,
dE
,
dX
);
if
(
vP
.
getChargeNumber
()
!=
0
)
scatter
(
vP
,
dE
,
dX
);
vP
.
setEnergy
(
final_energy
);
vP
.
setEnergy
(
final_energy
);
// on the stack, this is just kinetic energy, E-m
auto
new_momentum
=
sqrt
(
vP
.
getEnergy
()
*
vP
.
getEnergy
()
-
vP
.
getMass
()
*
vP
.
getMass
());
vP
.
setMomentum
(
vP
.
getMomentum
()
*
new_momentum
/
vP
.
getMomentum
().
getNorm
());
return
ProcessReturn
::
Ok
;
return
ProcessReturn
::
Ok
;
}
}
...
@@ -123,8 +117,8 @@ namespace corsika::proposal {
...
@@ -123,8 +117,8 @@ namespace corsika::proposal {
auto
const
code
=
vP
.
getPID
();
auto
const
code
=
vP
.
getPID
();
if
(
!
canInteract
(
code
))
return
meter
*
std
::
numeric_limits
<
double
>::
infinity
();
if
(
!
canInteract
(
code
))
return
meter
*
std
::
numeric_limits
<
double
>::
infinity
();
// Limit the step size of a conitnuous loss. The maximal continuous loss seems to be
a
// Limit the step size of a conitnuous loss. The maximal continuous loss seems to be
// hyper parameter which must be adjusted.
//
a
hyper parameter which must be adjusted.
//
//
auto
const
energy
=
vP
.
getEnergy
();
auto
const
energy
=
vP
.
getEnergy
();
auto
const
energy_lim
=
auto
const
energy_lim
=
...
...
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