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
d00feece
Commit
d00feece
authored
2 years ago
by
Felix Riehn
Committed by
Maximilian Reininghaus
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
added test case to document the interface inconsistency
parent
50f80c23
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!487
Harmonize calculation of sqrtSNN in `corsika_proposal::HadronicPhotonModel` with `corsika::sophia::InteractionModel`
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/modules/testSophia.cpp
+36
-0
36 additions, 0 deletions
tests/modules/testSophia.cpp
with
36 additions
and
0 deletions
tests/modules/testSophia.cpp
+
36
−
0
View file @
d00feece
...
...
@@ -28,6 +28,7 @@
link them togehter, it will fail.
*/
#include
<corsika/modules/sophia/Random.hpp>
#include
"corsika/framework/core/PhysicalConstants.hpp"
using
namespace
corsika
;
using
namespace
corsika
::
sophia
;
...
...
@@ -121,6 +122,41 @@ TEST_CASE("SophiaInterface", "modules") {
CHECK_THROWS
(
model
.
doInteraction
(
view
,
Code
::
Electron
,
Code
::
Proton
,
aP4
,
bP4
));
}
SECTION
(
"InteractionInterface - sqrtSNN inconsistency"
)
{
corsika
::
sophia
::
InteractionModel
model
;
// the pion-production threshold is given by the CoM energy of the neutron-pi+ system.
// sth = m_n**2 + 2 m_n * m_pi+ + m_pi+**2 = 1.1646 GeV**2
HEPEnergyType
const
eGamma
=
0.15145
_GeV
;
// energy of photon at pion-production threshold w proton target
FourMomentum
const
photonP4
(
eGamma
,
{
cs
,
eGamma
,
0
_GeV
,
0
_GeV
});
// nucleon case (this was implemented in the HadronicPhotonModel)
// it passes isValid and then rejects event generation when the proton is selected as
// target nucleon
FourMomentum
const
nucleonP4
(
constants
::
nucleonMass
,
{
cs
,
0
_GeV
,
0
_GeV
,
0
_GeV
});
auto
const
sqrtSNN_nuc
=
(
photonP4
+
nucleonP4
).
getNorm
();
CHECK
(
model
.
isValid
(
Code
::
Photon
,
Code
::
Neutron
,
sqrtSNN_nuc
));
view
.
clear
();
// this will not throw but SOPHIA will abort inernally. catch by checking stack size
model
.
doInteraction
(
view
,
Code
::
Photon
,
Code
::
Proton
,
photonP4
,
nucleonP4
);
CHECK_FALSE
(
view
.
getSize
()
>
0
);
// proton case (will throw in interface)
FourMomentum
const
protonP4
(
Proton
::
mass
,
{
cs
,
0
_GeV
,
0
_GeV
,
0
_GeV
});
auto
const
sqrtSNN_p
=
(
photonP4
+
protonP4
).
getNorm
();
CHECK_FALSE
(
model
.
isValid
(
Code
::
Photon
,
Code
::
Proton
,
sqrtSNN_p
));
view
.
clear
();
CHECK_THROWS
(
model
.
doInteraction
(
view
,
Code
::
Photon
,
Code
::
Proton
,
photonP4
,
protonP4
));
// neutron case
FourMomentum
const
neutronP4
(
Neutron
::
mass
,
{
cs
,
0
_GeV
,
0
_GeV
,
0
_GeV
});
auto
const
sqrtSNN_n
=
(
photonP4
+
neutronP4
).
getNorm
();
CHECK
(
model
.
isValid
(
Code
::
Photon
,
Code
::
Neutron
,
sqrtSNN_n
));
view
.
clear
();
model
.
doInteraction
(
view
,
Code
::
Photon
,
Code
::
Neutron
,
photonP4
,
neutronP4
);
}
SECTION
(
"InteractionInterface - interaction"
)
{
const
HEPEnergyType
P0
=
1.2
_GeV
;
MomentumVector
const
plab
=
MomentumVector
(
cs
,
{
P0
,
0
_eV
,
0
_eV
});
...
...
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