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
9d824303
Commit
9d824303
authored
4 years ago
by
Maximilian Sackel
Committed by
Ralf Ulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix medium ptr map sec fault.
parent
e0208d7c
No related branches found
No related tags found
1 merge request
!245
Include proposal process rebase
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Processes/Proposal/Interaction.cc
+7
-6
7 additions, 6 deletions
Processes/Proposal/Interaction.cc
Processes/Proposal/Interaction.h
+39
-10
39 additions, 10 deletions
Processes/Proposal/Interaction.h
with
46 additions
and
16 deletions
Processes/Proposal/Interaction.cc
+
7
−
6
View file @
9d824303
...
...
@@ -39,20 +39,21 @@ namespace corsika::process::proposal {
Interaction
::
Interaction
(
SetupEnvironment
const
&
_env
,
CORSIKA_ParticleCut
const
&
_cut
)
:
cut
(
make_shared
<
const
PROPOSAL
::
EnergyCutSettings
>
(
_cut
.
GetCutEnergy
()
/
1
_GeV
,
1
,
false
))
{
auto
all_compositions
=
std
::
vector
<
NuclearComposition
>
();
auto
all_compositions
=
std
::
vector
<
const
NuclearComposition
*
>
();
_env
.
GetUniverse
()
->
walk
([
&
](
auto
&
vtn
)
{
if
(
vtn
.
HasModelProperties
())
all_compositions
.
push_back
(
vtn
.
GetModelProperties
().
GetNuclearComposition
());
if
(
vtn
.
HasModelProperties
())
{
all_compositions
.
push_back
(
&
vtn
.
GetModelProperties
().
GetNuclearComposition
());
}
});
for
(
auto
&
ncarg
:
all_compositions
)
{
auto
comp_vec
=
std
::
vector
<
Component_PROPOSAL
>
();
auto
frac_iter
=
ncarg
.
GetFractions
().
cbegin
();
for
(
auto
&
pcode
:
ncarg
.
GetComponents
())
{
auto
frac_iter
=
ncarg
->
GetFractions
().
cbegin
();
for
(
auto
&
pcode
:
ncarg
->
GetComponents
())
{
comp_vec
.
emplace_back
(
GetName
(
pcode
),
GetNucleusZ
(
pcode
),
GetNucleusA
(
pcode
),
*
frac_iter
);
++
frac_iter
;
}
media
[
&
ncarg
]
=
PROPOSAL
::
Medium
(
media
[
ncarg
]
=
PROPOSAL
::
Medium
(
"Modified Air"
,
1.
,
PROPOSAL
::
Air
().
GetI
(),
PROPOSAL
::
Air
().
GetC
(),
PROPOSAL
::
Air
().
GetA
(),
PROPOSAL
::
Air
().
GetM
(),
PROPOSAL
::
Air
().
GetX0
(),
PROPOSAL
::
Air
().
GetX1
(),
PROPOSAL
::
Air
().
GetD0
(),
1.0
,
comp_vec
);
...
...
This diff is collapsed.
Click to expand it.
Processes/Proposal/Interaction.h
+
39
−
10
View file @
9d824303
...
...
@@ -49,17 +49,46 @@ namespace corsika::process::proposal {
auto
&
comp
=
vP
.
GetNode
()
->
GetModelProperties
().
GetNuclearComposition
();
auto
calc_it
=
calculators
.
find
(
&
comp
);
if
(
calc_it
!=
calculators
.
end
())
return
calc_it
;
auto
cross
=
PROPOSAL
::
GetStdCrossSections
(
particles
[
vP
.
GetPID
()],
media
[
&
comp
],
cut
,
true
);
auto
inter_types
=
PROPOSAL
::
CrossSectionVector
::
GetInteractionTypes
(
cross
);
auto
[
insert_it
,
success
]
=
calculators
.
insert
(
{
&
comp
,
make_tuple
(
PROPOSAL
::
SecondariesCalculator
(
inter_types
,
particles
[
vP
.
GetPID
()],
media
[
&
comp
]),
PROPOSAL
::
make_interaction
(
cross
,
true
),
PROPOSAL
::
make_displacement
(
cross
,
true
))});
return
insert_it
;
return
BuildCalculator
(
vP
.
GetPID
(),
comp
);
}
auto
BuildCalculator
(
particles
::
Code
corsika_code
,
NuclearComposition
const
&
comp
)
{
auto
medium
=
media
.
at
(
&
comp
);
if
(
corsika_code
==
particles
::
Code
::
Gamma
)
{
auto
cross
=
GetStdCrossSections
(
PROPOSAL
::
GammaDef
(),
media
.
at
(
&
comp
),
cut
,
true
);
auto
inter_types
=
PROPOSAL
::
CrossSectionVector
::
GetInteractionTypes
(
cross
);
auto
[
insert_it
,
success
]
=
calculators
.
insert
(
{
&
comp
,
make_tuple
(
PROPOSAL
::
SecondariesCalculator
(
inter_types
,
PROPOSAL
::
GammaDef
(),
media
[
&
comp
]),
PROPOSAL
::
make_interaction
(
cross
,
true
),
PROPOSAL
::
make_displacement
(
cross
,
true
))});
return
insert_it
;
}
if
(
corsika_code
==
particles
::
Code
::
Electron
)
{
auto
cross
=
GetStdCrossSections
(
PROPOSAL
::
EMinusDef
(),
media
.
at
(
&
comp
),
cut
,
true
);
auto
inter_types
=
PROPOSAL
::
CrossSectionVector
::
GetInteractionTypes
(
cross
);
auto
[
insert_it
,
success
]
=
calculators
.
insert
(
{
&
comp
,
make_tuple
(
PROPOSAL
::
SecondariesCalculator
(
inter_types
,
PROPOSAL
::
EMinusDef
(),
media
[
&
comp
]),
PROPOSAL
::
make_interaction
(
cross
,
true
),
PROPOSAL
::
make_displacement
(
cross
,
true
))});
return
insert_it
;
}
if
(
corsika_code
==
particles
::
Code
::
Positron
)
{
auto
cross
=
GetStdCrossSections
(
PROPOSAL
::
EPlusDef
(),
media
.
at
(
&
comp
),
cut
,
true
);
auto
inter_types
=
PROPOSAL
::
CrossSectionVector
::
GetInteractionTypes
(
cross
);
auto
[
insert_it
,
success
]
=
calculators
.
insert
(
{
&
comp
,
make_tuple
(
PROPOSAL
::
SecondariesCalculator
(
inter_types
,
PROPOSAL
::
EPlusDef
(),
media
[
&
comp
]),
PROPOSAL
::
make_interaction
(
cross
,
true
),
PROPOSAL
::
make_displacement
(
cross
,
true
))});
return
insert_it
;
}
}
// namespace corsika::process::proposal
public
:
template
<
typename
TEnvironment
>
Interaction
(
TEnvironment
const
&
env
,
CORSIKA_ParticleCut
const
&
cut
);
...
...
@@ -71,6 +100,6 @@ namespace corsika::process::proposal {
template
<
typename
TParticle
>
corsika
::
units
::
si
::
GrammageType
GetInteractionLength
(
TParticle
const
&
p
);
};
};
// namespace corsika::process::proposal
}
// namespace corsika::process::proposal
#endif
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