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
4521ae26
Commit
4521ae26
authored
5 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
fixed deletion after step-length limitation
parent
6bf6910c
No related branches found
No related tags found
1 merge request
!136
fixed deletion after step-length limitation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Cascade/Cascade.h
+48
-42
48 additions, 42 deletions
Framework/Cascade/Cascade.h
with
48 additions
and
42 deletions
Framework/Cascade/Cascade.h
+
48
−
42
View file @
4521ae26
...
...
@@ -218,19 +218,6 @@ namespace corsika::cascade {
std
::
cout
<<
"sth. happening before geometric limit ? "
<<
((
min_distance
<
geomMaxLength
)
?
"yes"
:
"no"
)
<<
std
::
endl
;
/*
Create SecondaryView object on Stack. The data container
remains untouched and identical, and 'projectil' is identical
to 'vParticle' above this line. However,
projectil.AddSecondaries populate the SecondaryView, which can
then be used afterwards for further processing. Thus: it is
important to use projectle (and not vParticle) for Interaction,
and Decay!
*/
TStackView
secondaries
(
vParticle
);
[[
maybe_unused
]]
auto
projectile
=
secondaries
.
GetProjectile
();
if
(
min_distance
<
geomMaxLength
)
{
// interaction to happen within geometric limit
// check whether decay or interaction limits this step the
...
...
@@ -238,39 +225,58 @@ namespace corsika::cascade {
// secondaries, b) the projectile particle deleted (or
// changed)
if
(
min_distance
==
distance_interact
)
{
std
::
cout
<<
"collide"
<<
std
::
endl
;
InverseGrammageType
const
current_inv_length
=
fProcessSequence
.
GetTotalInverseInteractionLength
(
vParticle
);
random
::
UniformRealDistribution
<
InverseGrammageType
>
uniDist
(
current_inv_length
);
const
auto
sample_process
=
uniDist
(
fRNG
);
InverseGrammageType
inv_lambda_count
=
0.
*
meter
*
meter
/
gram
;
fProcessSequence
.
SelectInteraction
(
vParticle
,
projectile
,
sample_process
,
inv_lambda_count
);
}
else
if
(
min_distance
==
distance_decay
)
{
std
::
cout
<<
"decay"
<<
std
::
endl
;
InverseTimeType
const
actual_decay_time
=
fProcessSequence
.
GetTotalInverseLifetime
(
vParticle
);
random
::
UniformRealDistribution
<
InverseTimeType
>
uniDist
(
actual_decay_time
);
const
auto
sample_process
=
uniDist
(
fRNG
);
InverseTimeType
inv_decay_count
=
0
/
second
;
fProcessSequence
.
SelectDecay
(
vParticle
,
projectile
,
sample_process
,
inv_decay_count
);
TStackView
secondaries
(
vParticle
);
if
(
min_distance
!=
distance_max
)
{
/*
Create SecondaryView object on Stack. The data container
remains untouched and identical, and 'projectil' is identical
to 'vParticle' above this line. However,
projectil.AddSecondaries populate the SecondaryView, which can
then be used afterwards for further processing. Thus: it is
important to use projectle (and not vParticle) for Interaction,
and Decay!
*/
[[
maybe_unused
]]
auto
projectile
=
secondaries
.
GetProjectile
();
if
(
min_distance
==
distance_interact
)
{
std
::
cout
<<
"collide"
<<
std
::
endl
;
InverseGrammageType
const
current_inv_length
=
fProcessSequence
.
GetTotalInverseInteractionLength
(
vParticle
);
random
::
UniformRealDistribution
<
InverseGrammageType
>
uniDist
(
current_inv_length
);
const
auto
sample_process
=
uniDist
(
fRNG
);
InverseGrammageType
inv_lambda_count
=
0.
*
meter
*
meter
/
gram
;
fProcessSequence
.
SelectInteraction
(
vParticle
,
projectile
,
sample_process
,
inv_lambda_count
);
}
else
{
assert
(
min_distance
==
distance_decay
);
std
::
cout
<<
"decay"
<<
std
::
endl
;
InverseTimeType
const
actual_decay_time
=
fProcessSequence
.
GetTotalInverseLifetime
(
vParticle
);
random
::
UniformRealDistribution
<
InverseTimeType
>
uniDist
(
actual_decay_time
);
const
auto
sample_process
=
uniDist
(
fRNG
);
InverseTimeType
inv_decay_count
=
0
/
second
;
fProcessSequence
.
SelectDecay
(
vParticle
,
projectile
,
sample_process
,
inv_decay_count
);
}
fProcessSequence
.
DoSecondaries
(
secondaries
);
vParticle
.
Delete
();
// todo: this should be reviewed. Where
// exactly are particles best deleted, and
// where they should NOT be
// deleted... maybe Delete function should
// be "protected" and not accessible to physics
}
else
{
// step-length limitation within volume
std
::
cout
<<
"step-length limitation"
<<
std
::
endl
;
fProcessSequence
.
DoSecondaries
(
secondaries
);
}
fProcessSequence
.
DoSecondaries
(
secondaries
);
vParticle
.
Delete
();
// todo: this should be reviewed. Where
// exactly are particles best deleted, and
// where they should NOT be
// deleted... maybe Delete function should
// be "protected" and not accessible to physics
auto
const
assertion
=
[
&
]
{
auto
const
*
numericalNodeAfterStep
=
fEnvironment
.
GetUniverse
()
->
GetContainingNode
(
vParticle
.
GetPosition
());
...
...
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