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
4516ac8c
Commit
4516ac8c
authored
4 years ago
by
Jean-Marco Alameddine
Committed by
Ralf Ulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Include particle mapping for ContinuousProcess as well as some unit fixing
parent
17b8be7c
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/ContinuousProcess.cc
+11
-9
11 additions, 9 deletions
Processes/Proposal/ContinuousProcess.cc
Processes/Proposal/ContinuousProcess.h
+37
-8
37 additions, 8 deletions
Processes/Proposal/ContinuousProcess.h
with
48 additions
and
17 deletions
Processes/Proposal/ContinuousProcess.cc
+
11
−
9
View file @
4516ac8c
...
@@ -36,22 +36,22 @@ namespace corsika::process::proposal {
...
@@ -36,22 +36,22 @@ namespace corsika::process::proposal {
template
<
>
template
<
>
ContinuousProcess
::
ContinuousProcess
(
SetupEnvironment
const
&
_env
,
ContinuousProcess
::
ContinuousProcess
(
SetupEnvironment
const
&
_env
,
CORSIKA_ParticleCut
const
&
_cut
)
CORSIKA_ParticleCut
const
&
_cut
)
:
cut
(
make_shared
<
const
PROPOSAL
::
EnergyCutSettings
>
(
_cut
.
GetCut
Energy
()
/
1
_
G
eV
,
1
,
:
cut
(
make_shared
<
const
PROPOSAL
::
EnergyCutSettings
>
(
_cut
.
Get
E
Cut
()
/
1
_
M
eV
,
1
,
false
))
{
false
))
{
auto
all_compositions
=
std
::
vector
<
NuclearComposition
>
();
auto
all_compositions
=
std
::
vector
<
const
NuclearComposition
*
>
();
_env
.
GetUniverse
()
->
walk
([
&
](
auto
&
vtn
)
{
_env
.
GetUniverse
()
->
walk
([
&
](
auto
&
vtn
)
{
if
(
vtn
.
HasModelProperties
())
if
(
vtn
.
HasModelProperties
())
all_compositions
.
push_back
(
vtn
.
GetModelProperties
().
GetNuclearComposition
());
all_compositions
.
push_back
(
&
vtn
.
GetModelProperties
().
GetNuclearComposition
());
});
});
for
(
auto
&
ncarg
:
all_compositions
)
{
for
(
auto
&
ncarg
:
all_compositions
)
{
auto
comp_vec
=
std
::
vector
<
PROPOSAL
::
Components
::
Component
>
();
auto
comp_vec
=
std
::
vector
<
PROPOSAL
::
Components
::
Component
>
();
auto
frac_iter
=
ncarg
.
GetFractions
().
cbegin
();
auto
frac_iter
=
ncarg
->
GetFractions
().
cbegin
();
for
(
auto
&
pcode
:
ncarg
.
GetComponents
())
{
for
(
auto
&
pcode
:
ncarg
->
GetComponents
())
{
comp_vec
.
emplace_back
(
GetName
(
pcode
),
GetNucleusZ
(
pcode
),
GetNucleusA
(
pcode
),
comp_vec
.
emplace_back
(
GetName
(
pcode
),
GetNucleusZ
(
pcode
),
GetNucleusA
(
pcode
),
*
frac_iter
);
*
frac_iter
);
++
frac_iter
;
++
frac_iter
;
}
}
media
[
&
ncarg
]
=
PROPOSAL
::
Medium
(
media
[
ncarg
]
=
PROPOSAL
::
Medium
(
"Modified Air"
,
1.
,
PROPOSAL
::
Air
().
GetI
(),
PROPOSAL
::
Air
().
GetC
(),
"Modified Air"
,
1.
,
PROPOSAL
::
Air
().
GetI
(),
PROPOSAL
::
Air
().
GetC
(),
PROPOSAL
::
Air
().
GetA
(),
PROPOSAL
::
Air
().
GetM
(),
PROPOSAL
::
Air
().
GetX0
(),
PROPOSAL
::
Air
().
GetA
(),
PROPOSAL
::
Air
().
GetM
(),
PROPOSAL
::
Air
().
GetX0
(),
PROPOSAL
::
Air
().
GetX1
(),
PROPOSAL
::
Air
().
GetD0
(),
1.0
,
comp_vec
);
PROPOSAL
::
Air
().
GetX1
(),
PROPOSAL
::
Air
().
GetD0
(),
1.0
,
comp_vec
);
...
@@ -62,14 +62,16 @@ namespace corsika::process::proposal {
...
@@ -62,14 +62,16 @@ namespace corsika::process::proposal {
GrammageType
const
vDX
)
{
GrammageType
const
vDX
)
{
auto
calc_ptr
=
GetCalculator
(
vP
);
auto
calc_ptr
=
GetCalculator
(
vP
);
auto
upper_energy
=
calc_ptr
->
second
->
UpperLimitTrackIntegral
(
auto
upper_energy
=
calc_ptr
->
second
->
UpperLimitTrackIntegral
(
vP
.
GetEnergy
()
/
1
_GeV
,
vDX
/
1
_g
*
1
_cm
*
1
_cm
);
vP
.
GetEnergy
()
/
1
_MeV
,
vDX
/
1
_g
*
1
_cm
*
1
_cm
);
return
upper_energy
*
1
_GeV
;
std
::
cout
<<
"upper_energy: "
<<
upper_energy
<<
"MeV"
<<
std
::
endl
;
return
upper_energy
*
1
_MeV
;
}
}
void
ContinuousProcess
::
Init
()
{}
template
<
>
template
<
>
EProcessReturn
ContinuousProcess
::
DoContinuous
(
SetupParticle
&
vP
,
SetupTrack
const
&
vT
)
{
EProcessReturn
ContinuousProcess
::
DoContinuous
(
SetupParticle
&
vP
,
SetupTrack
const
&
vT
)
{
if
(
vP
.
GetChargeNumber
()
==
0
)
return
process
::
EProcessReturn
::
eOk
;
if
(
vP
.
GetChargeNumber
()
==
0
)
return
process
::
EProcessReturn
::
eOk
;
std
::
cout
<<
"DoContinuous..."
<<
std
::
endl
;
GrammageType
const
dX
=
GrammageType
const
dX
=
vP
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
vT
,
vT
.
GetLength
());
vP
.
GetNode
()
->
GetModelProperties
().
IntegratedGrammage
(
vT
,
vT
.
GetLength
());
HEPEnergyType
dE
=
TotalEnergyLoss
(
vP
,
dX
);
HEPEnergyType
dE
=
TotalEnergyLoss
(
vP
,
dX
);
...
...
This diff is collapsed.
Click to expand it.
Processes/Proposal/ContinuousProcess.h
+
37
−
8
View file @
4516ac8c
...
@@ -42,18 +42,45 @@ namespace corsika::process::proposal {
...
@@ -42,18 +42,45 @@ namespace corsika::process::proposal {
bool
CanInteract
(
particles
::
Code
pcode
)
const
noexcept
;
bool
CanInteract
(
particles
::
Code
pcode
)
const
noexcept
;
unordered_map
<
const
NuclearComposition
*
,
unique_ptr
<
PROPOSAL
::
Displacement
>>
calc
;
struct
interaction_hash
{
size_t
operator
()(
const
std
::
pair
<
const
NuclearComposition
*
,
particles
::
Code
>&
p
)
const
{
auto
hash1
=
std
::
hash
<
const
NuclearComposition
*>
{}(
p
.
first
);
auto
hash2
=
std
::
hash
<
particles
::
Code
>
{}(
p
.
second
);
return
hash1
^
hash2
;
}
};
unordered_map
<
std
::
pair
<
const
NuclearComposition
*
,
particles
::
Code
>
,
unique_ptr
<
PROPOSAL
::
Displacement
>
,
interaction_hash
>
calc
;
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
[
insert_it
,
success
]
=
calc
.
insert
({
std
::
make_pair
(
&
comp
,
corsika_code
),
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
[
insert_it
,
success
]
=
calc
.
insert
({
std
::
make_pair
(
&
comp
,
corsika_code
),
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
[
insert_it
,
success
]
=
calc
.
insert
({
std
::
make_pair
(
&
comp
,
corsika_code
),
PROPOSAL
::
make_displacement
(
cross
,
true
)});
return
insert_it
;
}
}
template
<
typename
Particle
>
template
<
typename
Particle
>
auto
GetCalculator
(
Particle
&
vP
)
{
auto
GetCalculator
(
Particle
&
vP
)
{
auto
&
comp
=
vP
.
GetNode
()
->
GetModelProperties
().
GetNuclearComposition
();
auto
&
comp
=
vP
.
GetNode
()
->
GetModelProperties
().
GetNuclearComposition
();
auto
calc_it
=
calc
.
find
(
&
comp
);
auto
calc_it
=
calc
.
find
(
std
::
make_pair
(
&
comp
,
vP
.
GetPID
())
);
if
(
calc_it
!=
calc
.
end
())
return
calc_it
;
if
(
calc_it
!=
calc
.
end
())
return
calc_it
;
auto
cross
=
return
BuildCalculator
(
vP
.
GetPID
(),
comp
);
PROPOSAL
::
GetStdCrossSections
(
particles
[
vP
.
GetPID
()],
media
[
&
comp
],
cut
,
true
);
auto
[
insert_it
,
success
]
=
calc
.
insert
({
&
comp
,
PROPOSAL
::
make_displacement
(
cross
,
true
)});
return
insert_it
;
}
}
units
::
si
::
HEPEnergyType
TotalEnergyLoss
(
setup
::
Stack
::
ParticleType
const
&
,
units
::
si
::
HEPEnergyType
TotalEnergyLoss
(
setup
::
Stack
::
ParticleType
const
&
,
...
@@ -63,6 +90,8 @@ namespace corsika::process::proposal {
...
@@ -63,6 +90,8 @@ namespace corsika::process::proposal {
template
<
typename
TEnvironment
>
template
<
typename
TEnvironment
>
ContinuousProcess
(
TEnvironment
const
&
env
,
CORSIKA_ParticleCut
const
&
cut
);
ContinuousProcess
(
TEnvironment
const
&
env
,
CORSIKA_ParticleCut
const
&
cut
);
void
Init
();
template
<
typename
Particle
,
typename
Track
>
template
<
typename
Particle
,
typename
Track
>
EProcessReturn
DoContinuous
(
Particle
&
,
Track
const
&
)
;
EProcessReturn
DoContinuous
(
Particle
&
,
Track
const
&
)
;
...
...
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