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
86d4a2d6
Commit
86d4a2d6
authored
4 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
better documentation and Max comment
parent
d3e58cb7
No related branches found
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/Cascade.inl
+18
-10
18 additions, 10 deletions
corsika/detail/framework/core/Cascade.inl
examples/vertical_EAS.cpp
+2
-2
2 additions, 2 deletions
examples/vertical_EAS.cpp
with
20 additions
and
12 deletions
corsika/detail/framework/core/Cascade.inl
+
18
−
10
View file @
86d4a2d6
...
...
@@ -121,16 +121,21 @@ namespace corsika {
ContinuousProcessStepLength
const
continuousMaxStep
=
sequence_
.
getMaxStepLength
(
vParticle
,
step
);
LengthType
const
continuous_max_dist
=
continuousMaxStep
;
ContinuousProcessIndex
limitingId
;
// take minimum of geometry, interaction, decay for next step
LengthType
const
min_discrete
=
std
::
min
(
distance_interact
,
distance_decay
);
LengthType
const
min_non_continuous
=
std
::
min
(
min_discrete
,
geomMaxLength
);
LengthType
const
min_distance
=
std
::
min
(
min_non_continuous
,
continuous_max_dist
);
if
(
continuous_max_dist
<
min_non_continuous
)
{
// inform ContinuousProcesses (if applicable) that it is responsible for step-limit
// this would become simpler if we follow the idea of Max to enumerate ALL types of
// processes. Then non-contunuous are included and no further logic is needed to
// distinguish between continuous and non-continuous limit.
ContinuousProcessIndex
limitingId
;
bool
const
isContinuous
=
continuous_max_dist
<
min_non_continuous
;
if
(
isContinuous
)
{
limitingId
=
continuousMaxStep
;
// the current step IS limited by known continuous process
continuousMaxStep
;
// the current step IS limited by
a
known continuous process
}
CORSIKA_LOG_DEBUG
(
...
...
@@ -142,10 +147,12 @@ namespace corsika {
min_distance
/
1
_m
,
geomMaxLength
/
1
_m
,
distance_decay
/
1
_m
,
distance_interact
/
1
_m
,
continuous_max_dist
/
1
_m
);
// here the particle is actually moved along the trajectory to new position:
// move particle along the trajectory to new position
// also update momentum/direction/time
step
.
setLength
(
min_distance
);
vParticle
.
setPosition
(
step
.
getPosition
(
1
));
// assumption: tracking does not change absolute momentum:
// assumption: tracking does not change absolute momentum (continuous physics can and
// will):
vParticle
.
setMomentum
(
step
.
getDirection
(
1
)
*
vParticle
.
getMomentum
().
getNorm
());
vParticle
.
setTime
(
vParticle
.
getTime
()
+
step
.
getDuration
());
...
...
@@ -163,11 +170,11 @@ namespace corsika {
}
return
;
}
if
(
continuous_max_dist
<
min_non_c
ontinuous
)
{
return
;
// there is nothing further
furt
he
r
if
(
isC
ontinuous
)
{
return
;
// there is nothing further
, step is finis
he
d
}
CORSIKA_LOG_DEBUG
(
"
sth. happening
before geometric limit ? {}"
,
CORSIKA_LOG_DEBUG
(
"
discrete process
before geometric limit ? {}"
,
((
min_distance
<
geomMaxLength
)
?
"yes"
:
"no"
));
if
(
geomMaxLength
<
min_discrete
)
{
...
...
@@ -195,10 +202,10 @@ namespace corsika {
*/
sequence_
.
doBoundaryCrossing
(
vParticle
,
*
currentLogicalNode
,
*
nextVol
);
return
;
return
;
// step finished
}
CORSIKA_LOG_DEBUG
(
"step limit reached. nothing further happens."
);
CORSIKA_LOG_DEBUG
(
"step limit reached
(e.g. deflection)
. nothing further happens."
);
[[
maybe_unused
]]
auto
const
assertion
=
[
&
]
{
auto
const
*
numericalNodeAfterStep
=
...
...
@@ -240,6 +247,7 @@ namespace corsika {
}
else
{
decay
(
secondaries
);
// make sure particle actually did decay if it should have done so
// \todo this should go to a validation code and not be included here
if
(
secondaries
.
getSize
()
==
1
&&
projectile
.
getPID
()
==
secondaries
.
getNextParticle
().
getPID
())
throw
std
::
runtime_error
(
fmt
::
format
(
"Particle {} decays into itself!"
,
...
...
This diff is collapsed.
Click to expand it.
examples/vertical_EAS.cpp
+
2
−
2
View file @
86d4a2d6
...
...
@@ -162,7 +162,7 @@ int main(int argc, char** argv) {
Z
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
mass
=
get_nucleus_mass
(
A
,
Z
);
}
else
{
unsigned
int
pdg
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
int
pdg
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
beamCode
=
convert_from_PDG
(
PDGCode
(
pdg
));
mass
=
get_mass
(
beamCode
);
}
...
...
@@ -271,7 +271,7 @@ int main(int argc, char** argv) {
corsika
::
urqmd
::
UrQMD
urqmd
;
InteractionCounter
urqmdCounted
{
urqmd
};
StackInspector
<
setup
::
Stack
>
stackInspect
(
1
000
,
false
,
E0
);
StackInspector
<
setup
::
Stack
>
stackInspect
(
50
000
,
false
,
E0
);
// assemble all processes into an ordered process list
struct
EnergySwitch
{
...
...
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