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
bdaf8fcd
Commit
bdaf8fcd
authored
4 years ago
by
Jean-Marco Alameddine
Committed by
Ralf Ulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix conversion of CORSIKA direction to PROPOSAL direction
parent
74a50f32
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+4
-2
4 additions, 2 deletions
Processes/Proposal/Interaction.cc
Processes/Proposal/Interaction.h
+9
-8
9 additions, 8 deletions
Processes/Proposal/Interaction.h
with
13 additions
and
10 deletions
Processes/Proposal/Interaction.cc
+
4
−
2
View file @
bdaf8fcd
...
@@ -82,8 +82,10 @@ namespace corsika::process::proposal {
...
@@ -82,8 +82,10 @@ namespace corsika::process::proposal {
auto
point
=
PROPOSAL
::
Vector3D
(
vP
.
GetPosition
().
GetX
()
/
1
_cm
,
auto
point
=
PROPOSAL
::
Vector3D
(
vP
.
GetPosition
().
GetX
()
/
1
_cm
,
vP
.
GetPosition
().
GetY
()
/
1
_cm
,
vP
.
GetPosition
().
GetY
()
/
1
_cm
,
vP
.
GetPosition
().
GetZ
()
/
1
_cm
);
vP
.
GetPosition
().
GetZ
()
/
1
_cm
);
auto
p
=
vP
.
GetMomentum
().
GetComponents
();
auto
d
=
vP
.
GetDirection
().
GetComponents
();
auto
direction
=
PROPOSAL
::
Vector3D
(
p
[
0
]
/
1
_GeV
,
p
[
1
]
/
1
_GeV
,
p
[
2
]
/
1
_GeV
);
auto
direction
=
PROPOSAL
::
Vector3D
(
d
.
GetX
().
magnitude
(),
d
.
GetY
().
magnitude
(),
d
.
GetZ
().
magnitude
());
auto
loss
=
auto
loss
=
make_tuple
(
static_cast
<
int
>
(
type
),
point
,
direction
,
v
*
primary_energy
,
0.
);
make_tuple
(
static_cast
<
int
>
(
type
),
point
,
direction
,
v
*
primary_energy
,
0.
);
auto
sec
=
std
::
get
<
SECONDARIES
>
(
calc
->
second
)
auto
sec
=
std
::
get
<
SECONDARIES
>
(
calc
->
second
)
...
...
This diff is collapsed.
Click to expand it.
Processes/Proposal/Interaction.h
+
9
−
8
View file @
bdaf8fcd
...
@@ -43,14 +43,6 @@ namespace corsika::process::proposal {
...
@@ -43,14 +43,6 @@ namespace corsika::process::proposal {
unique_ptr
<
PROPOSAL
::
Displacement
>>
;
unique_ptr
<
PROPOSAL
::
Displacement
>>
;
std
::
unordered_map
<
const
NuclearComposition
*
,
calculator_t
>
calculators
;
std
::
unordered_map
<
const
NuclearComposition
*
,
calculator_t
>
calculators
;
enum
{
SECONDARIES
,
INTERACTION
,
DISPLACEMENT
};
template
<
typename
Particle
>
auto
GetCalculator
(
Particle
&
vP
)
{
auto
&
comp
=
vP
.
GetNode
()
->
GetModelProperties
().
GetNuclearComposition
();
auto
calc_it
=
calculators
.
find
(
&
comp
);
if
(
calc_it
!=
calculators
.
end
())
return
calc_it
;
return
BuildCalculator
(
vP
.
GetPID
(),
comp
);
}
auto
BuildCalculator
(
particles
::
Code
corsika_code
,
NuclearComposition
const
&
comp
)
{
auto
BuildCalculator
(
particles
::
Code
corsika_code
,
NuclearComposition
const
&
comp
)
{
auto
medium
=
media
.
at
(
&
comp
);
auto
medium
=
media
.
at
(
&
comp
);
...
@@ -92,6 +84,15 @@ namespace corsika::process::proposal {
...
@@ -92,6 +84,15 @@ namespace corsika::process::proposal {
}
}
}
// namespace corsika::process::proposal
}
// namespace corsika::process::proposal
enum
{
SECONDARIES
,
INTERACTION
,
DISPLACEMENT
};
template
<
typename
Particle
>
auto
GetCalculator
(
Particle
&
vP
)
{
auto
&
comp
=
vP
.
GetNode
()
->
GetModelProperties
().
GetNuclearComposition
();
auto
calc_it
=
calculators
.
find
(
&
comp
);
if
(
calc_it
!=
calculators
.
end
())
return
calc_it
;
return
BuildCalculator
(
vP
.
GetPID
(),
comp
);
}
public
:
public
:
template
<
typename
TEnvironment
>
template
<
typename
TEnvironment
>
Interaction
(
TEnvironment
const
&
env
,
CORSIKA_ParticleCut
const
&
cut
);
Interaction
(
TEnvironment
const
&
env
,
CORSIKA_ParticleCut
const
&
cut
);
...
...
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