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
61106845
Commit
61106845
authored
2 years ago
by
Felix Riehn
Committed by
Maximilian Reininghaus
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added tests
parent
849b2b2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!465
Resolve "SOPHIA for low energy photo-hadronic interaction"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/modules/CMakeLists.txt
+2
-1
2 additions, 1 deletion
tests/modules/CMakeLists.txt
tests/modules/testSophia.cpp
+76
-0
76 additions, 0 deletions
tests/modules/testSophia.cpp
with
78 additions
and
1 deletion
tests/modules/CMakeLists.txt
+
2
−
1
View file @
61106845
...
@@ -12,7 +12,8 @@ set (test_modules_sources
...
@@ -12,7 +12,8 @@ set (test_modules_sources
testParticleCut.cpp
testParticleCut.cpp
testSibyll.cpp
testSibyll.cpp
testEpos.cpp
testEpos.cpp
testRadio.cpp
testRadio.cpp
testSophia.cpp
)
)
CORSIKA_ADD_TEST
(
testModules SOURCES
${
test_modules_sources
}
)
CORSIKA_ADD_TEST
(
testModules SOURCES
${
test_modules_sources
}
)
...
...
This diff is collapsed.
Click to expand it.
tests/modules/testSophia.cpp
0 → 100644
+
76
−
0
View file @
61106845
/*
* (c) Copyright 2022 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
//#include <corsika/modules/Sibyll.hpp>
#include
<corsika/modules/sophia/ParticleConversion.hpp>
#include
<corsika/framework/core/ParticleProperties.hpp>
#include
<corsika/framework/core/PhysicalUnits.hpp>
#include
<corsika/framework/geometry/Point.hpp>
#include
<corsika/framework/random/RNGManager.hpp>
#include
<corsika/framework/utility/COMBoost.hpp>
#include
<SetupTestEnvironment.hpp>
#include
<catch2/catch.hpp>
#include
<tuple>
/*
NOTE, WARNING, ATTENTION
The sibyll/Random.hpp implements the hook of sibyll to the C8 random
number generator. It has to occur excatly ONCE per linked
executable. If you include the header below in multiple "tests" and
link them togehter, it will fail.
*/
#include
<corsika/modules/sophia/Random.hpp>
using
namespace
corsika
;
using
namespace
corsika
::
sophia
;
using
DummyEnvironmentInterface
=
IMediumPropertyModel
<
IMagneticFieldModel
<
IMediumModel
>>
;
using
DummyEnvironment
=
Environment
<
DummyEnvironmentInterface
>
;
TEST_CASE
(
"Sophia"
,
"modules"
)
{
logging
::
set_level
(
logging
::
level
::
info
);
SECTION
(
"Sophia -> Corsika"
)
{
CHECK
(
Code
::
Electron
==
corsika
::
sophia
::
convertFromSophia
(
corsika
::
sophia
::
SophiaCode
::
Electron
));
}
SECTION
(
"Corsika -> Sophia"
)
{
CHECK
(
corsika
::
sophia
::
convertToSophia
(
Electron
::
code
)
==
corsika
::
sophia
::
SophiaCode
::
Electron
);
CHECK
(
corsika
::
sophia
::
convertToSophiaRaw
(
Proton
::
code
)
==
13
);
}
SECTION
(
"canInteractInSophia"
)
{
CHECK
(
corsika
::
sophia
::
canInteract
(
Code
::
Photon
));
CHECK_FALSE
(
corsika
::
sophia
::
canInteract
(
Code
::
XiCPlus
));
CHECK_FALSE
(
corsika
::
sophia
::
canInteract
(
Code
::
Electron
));
CHECK_FALSE
(
corsika
::
sophia
::
canInteract
(
Code
::
Iron
));
CHECK_FALSE
(
corsika
::
sophia
::
canInteract
(
Code
::
Helium
));
}
// SECTION("cross-section type") {
// CHECK(corsika::sophia::getSophiaXSCode(Code::Proton) == 1);
// CHECK(corsika::sophia::getSophiaXSCode(Code::Electron) == 0);
// }
SECTION
(
"sophia mass"
)
{
CHECK_FALSE
(
corsika
::
sophia
::
getSophiaMass
(
Code
::
Electron
)
==
0
_GeV
);
// Nucleus not a particle
CHECK_THROWS
(
corsika
::
sophia
::
getSophiaMass
(
Code
::
Iron
));
// Higgs not a particle in Sophia
CHECK_THROWS
(
corsika
::
sophia
::
getSophiaMass
(
Code
::
H0
));
}
}
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