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
Merge requests
!466
Resolve "Implement thinning algorithms"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Implement thinning algorithms"
445-implement-thinning-algorithms
into
master
Overview
3
Commits
8
Pipelines
15
Changes
2
Merged
Maximilian Reininghaus
requested to merge
445-implement-thinning-algorithms
into
master
2 years ago
Overview
3
Commits
8
Pipelines
15
Changes
2
Expand
Closes
#445 (closed)
0
0
Merge request reports
Viewing commit
b951567e
Prev
Next
Show latest version
2 files
+
12
−
7
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
b951567e
implement erase particles flag
· b951567e
Nikos Karastathis
authored
2 years ago
corsika/detail/modules/thinning/EMThinning.inl
+
10
−
6
Options
@@ -13,9 +13,10 @@
@@ -13,9 +13,10 @@
namespace
corsika
{
namespace
corsika
{
EMThinning
::
EMThinning
(
HEPEnergyType
threshold
,
double
maxWeight
)
EMThinning
::
EMThinning
(
HEPEnergyType
threshold
,
double
maxWeight
,
bool
const
eraseParticles
)
:
threshold_
{
threshold
}
:
threshold_
{
threshold
}
,
maxWeight_
{
maxWeight
}
{}
,
maxWeight_
{
maxWeight
}
,
eraseParticles_
{
eraseParticles
}
{}
template
<
typename
TStackView
>
template
<
typename
TStackView
>
void
EMThinning
::
doSecondaries
(
TStackView
&
view
)
{
void
EMThinning
::
doSecondaries
(
TStackView
&
view
)
{
@@ -76,10 +77,13 @@ namespace corsika {
@@ -76,10 +77,13 @@ namespace corsika {
}
}
}
}
// erase discared particles
// erase discared particles in case of multithinning
// TODO: skip this for multithinning
if
(
eraseParticles_
)
{
for
(
auto
&
p
:
view
)
{
for
(
auto
&
p
:
view
)
{
if
(
auto
const
w
=
p
.
getWeight
();
w
==
0
)
{
p
.
erase
();
}
if
(
auto
const
w
=
p
.
getWeight
();
w
==
0
)
{
p
.
erase
();
}
}
}
else
{
return
;
}
}
}
}
Loading