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
b5417890
Commit
b5417890
authored
6 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
improvements in Cascade
parent
bd26661e
No related branches found
No related tags found
2 merge requests
!96
Delete DiscreteProcess.h
,
!93
Improvements in Cascade and FlatExponential
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Cascade/Cascade.h
+10
-5
10 additions, 5 deletions
Framework/Cascade/Cascade.h
with
10 additions
and
5 deletions
Framework/Cascade/Cascade.h
+
10
−
5
View file @
b5417890
...
...
@@ -14,6 +14,7 @@
#include
<corsika/environment/Environment.h>
#include
<corsika/process/ProcessReturn.h>
#include
<corsika/random/ExponentialDistribution.h>
#include
<corsika/random/RNGManager.h>
#include
<corsika/random/UniformRealDistribution.h>
#include
<corsika/setup/SetupTrajectory.h>
...
...
@@ -21,6 +22,7 @@
#include
<cmath>
#include
<iostream>
#include
<limits>
/**
* The cascade namespace assembles all objects needed to simulate full particles cascades.
...
...
@@ -118,8 +120,8 @@ namespace corsika::cascade {
fProcessSequence
.
GetTotalInverseInteractionLength
(
particle
,
step
);
// sample random exponential step length in grammage
std
::
e
xponential
_d
istribution
expDist
(
total_inv_lambda
*
(
1
_g
/
(
1
_m
*
1
_m
))
);
GrammageType
const
next_interact
=
(
1
_g
/
(
1
_m
*
1
_m
))
*
expDist
(
fRNG
);
corsika
::
random
::
E
xponential
D
istribution
expDist
(
1
/
total_inv_lambda
);
GrammageType
const
next_interact
=
expDist
(
fRNG
);
std
::
cout
<<
"total_inv_lambda="
<<
total_inv_lambda
<<
", next_interact="
<<
next_interact
<<
std
::
endl
;
...
...
@@ -133,7 +135,10 @@ namespace corsika::cascade {
}
LengthType
const
distance_interact
=
currentNode
->
GetModelProperties
().
ArclengthFromGrammage
(
step
,
next_interact
);
(
next_interact
==
std
::
numeric_limits
<
double
>::
infinity
()
*
1
_g
/
(
1
_m
*
1
_m
))
?
std
::
numeric_limits
<
double
>::
infinity
()
*
1
_m
:
currentNode
->
GetModelProperties
().
ArclengthFromGrammage
(
step
,
next_interact
);
// determine the maximum geometric step length
LengthType
const
distance_max
=
fProcessSequence
.
MaxStepLength
(
particle
,
step
);
...
...
@@ -144,8 +149,8 @@ namespace corsika::cascade {
fProcessSequence
.
GetTotalInverseLifetime
(
particle
);
// sample random exponential decay time
std
::
e
xponential
_d
istribution
expDistDecay
(
total_inv_lifetime
*
1
_s
);
TimeType
const
next_decay
=
1
_s
*
expDistDecay
(
fRNG
);
corsika
::
random
::
E
xponential
D
istribution
expDistDecay
(
1
/
total_inv_lifetime
);
TimeType
const
next_decay
=
expDistDecay
(
fRNG
);
std
::
cout
<<
"total_inv_lifetime="
<<
total_inv_lifetime
<<
", next_decay="
<<
next_decay
<<
std
::
endl
;
...
...
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