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
44a47f32
Commit
44a47f32
authored
3 years ago
by
ralfulrich
Committed by
Ralf Ulrich
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
very strange testEpos effect.
parent
ec68cdff
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!387
Hadronic model interface overhaul
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/modules/epos/Interaction.inl
+3
-3
3 additions, 3 deletions
corsika/detail/modules/epos/Interaction.inl
tests/modules/testEpos.cpp
+9
-31
9 additions, 31 deletions
tests/modules/testEpos.cpp
with
12 additions
and
34 deletions
corsika/detail/modules/epos/Interaction.inl
+
3
−
3
View file @
44a47f32
...
...
@@ -31,12 +31,12 @@ namespace corsika::epos {
bool
const
epos_printout_on
)
:
data_path_
(
dataPath
)
,
epos_listing_
(
epos_printout_on
)
{
if
(
dataPath
==
""
)
{
data_path_
=
(
std
::
string
(
corsika_data
(
"EPOS"
).
c_str
())
+
"/"
).
c_str
();
}
// initialize Eposlhc
static
bool
initialized
=
false
;
if
(
!
initialized
)
{
if
(
dataPath
==
""
)
{
data_path_
=
(
std
::
string
(
corsika_data
(
"EPOS"
).
c_str
())
+
"/"
).
c_str
();
}
initialize
();
initialized
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
tests/modules/testEpos.cpp
+
9
−
31
View file @
44a47f32
...
...
@@ -228,51 +228,30 @@ TEST_CASE("EposInterface", "modules") {
{
Oxygen
::
mass
,
{
cs
,
0
_GeV
,
0
_GeV
,
0
_GeV
}});
CHECK
(
xs_prod2
/
1
_mb
==
Approx
(
1076.7
).
margin
(
3.1
));
}
}
SECTION
(
"InteractionInterface - low energy
"
)
{
TEST_CASE
(
"EposDoInteractionNucleus"
,
"module
"
)
{
const
HEPEnergyType
P0
=
60
_GeV
;
auto
[
stack
,
viewPtr
]
=
setup
::
testing
::
setup_stack
(
Code
::
Proton
,
P0
,
(
setup
::
Environment
::
BaseNodeType
*
const
)
nodePtr
,
cs
);
MomentumVector
plab
=
MomentumVector
(
cs
,
{
P0
,
0
_eV
,
0
_eV
});
// this is secret knowledge about setupStack
setup
::
StackView
&
view
=
*
viewPtr
;
InteractionModel
model
;
model
.
doInteraction
(
view
,
Code
::
Proton
,
Code
::
Oxygen
,
{
sqrt
(
static_pow
<
2
>
(
P0
)
+
static_pow
<
2
>
(
Proton
::
mass
)),
{
cs
,
P0
,
0
_GeV
,
0
_GeV
}},
{
Oxygen
::
mass
,
{
cs
,
0
_GeV
,
0
_GeV
,
0
_GeV
}});
auto
const
pSum
=
sumMomentum
(
view
,
cs
);
logging
::
set_level
(
logging
::
level
::
trace
);
// this is not physics validation
CHECK
(
pSum
.
getComponents
(
cs
).
getX
()
/
P0
==
Approx
(
1
).
margin
(
0.05
));
CHECK
(
pSum
.
getComponents
(
cs
).
getY
()
/
1
_GeV
==
Approx
(
0
).
margin
(
.5
));
CHECK
(
pSum
.
getComponents
(
cs
).
getZ
()
/
1
_GeV
==
Approx
(
0
).
margin
(
.5
));
auto
[
env
,
csPtr
,
nodePtr
]
=
setup
::
testing
::
setup_environment
(
Code
::
Oxygen
);
auto
const
&
cs
=
*
csPtr
;
[[
maybe_unused
]]
auto
const
&
env_dummy
=
env
;
CHECK
((
pSum
-
plab
).
getNorm
()
/
1
_GeV
==
Approx
(
0
).
margin
(
plab
.
getNorm
()
*
0.05
/
1
_GeV
));
CHECK
(
pSum
.
getNorm
()
/
P0
==
Approx
(
1
).
margin
(
0.05
));
RNGManager
<>::
getInstance
().
registerRandomStream
(
"epos"
);
// [[maybe_unused]] const GrammageType length =
// model.getInteractionLength(particle);
// CHECK(length / 1_g * 1_cm * 1_cm == Approx(93.3).margin(0.1));
}
InteractionModel
model
;
SECTION
(
"InteractionInterface - nuclear projectile"
)
{
HEPEnergyType
const
P0
=
10
_TeV
;
Code
const
pid
=
get_nucleus_code
(
8
,
4
);
Code
const
pid
=
get_nucleus_code
(
40
,
20
);
auto
[
stack
,
viewPtr
]
=
setup
::
testing
::
setup_stack
(
pid
,
P0
,
(
setup
::
Environment
::
BaseNodeType
*
const
)
nodePtr
,
cs
);
MomentumVector
plab
=
MomentumVector
(
cs
,
{
P0
,
0
_eV
,
0
_eV
});
// this is secret knowledge about setupStack
setup
::
StackView
&
view
=
*
viewPtr
;
InteractionModel
model
;
#ifndef __clang__
// @todo This is very obscure since it fails for -O2, but for both clang and gcc ???
model
.
doInteraction
(
view
,
pid
,
Code
::
Oxygen
,
...
...
@@ -290,7 +269,6 @@ TEST_CASE("EposInterface", "modules") {
CHECK
((
pSum
-
plab
).
getNorm
()
/
1
_GeV
==
Approx
(
0
).
margin
(
plab
.
getNorm
()
*
0.05
/
1
_GeV
));
CHECK
(
pSum
.
getNorm
()
/
P0
==
Approx
(
1
).
margin
(
0.05
));
#endif
// [[maybe_unused]] const GrammageType length =
// model.getInteractionLength(particle);
// CHECK(length / 1_g * 1_cm * 1_cm ==
...
...
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