IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Pranav Sampathkumar
corsika
Commits
a2328963
Commit
a2328963
authored
2 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
test QGSJet cross-sections
parent
4a580bfa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/modules/testQGSJetII.cpp
+21
-9
21 additions, 9 deletions
tests/modules/testQGSJetII.cpp
with
21 additions
and
9 deletions
tests/modules/testQGSJetII.cpp
+
21
−
9
View file @
a2328963
...
...
@@ -139,6 +139,23 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
[[
maybe_unused
]]
auto
const
&
env_dummy
=
env
;
[[
maybe_unused
]]
auto
const
&
node_dummy
=
nodePtr
;
corsika
::
qgsjetII
::
InteractionModel
model
;
SECTION
(
"cross-sections"
)
{
auto
projCode
=
GENERATE
(
Code
::
PiPlus
,
Code
::
Proton
,
Code
::
K0Long
);
auto
targetCode
=
GENERATE
(
Code
::
Oxygen
,
Code
::
Nitrogen
);
auto
projEnergy
=
GENERATE
(
100
_GeV
,
1
_PeV
,
1e20
_eV
);
auto
momMagnitude
=
calculate_momentum
(
projEnergy
,
get_mass
(
projCode
));
MomentumVector
const
projMomentum
{
*
csPtr
,
0
_eV
,
momMagnitude
,
0
_eV
};
REQUIRE
(
model
.
getCrossSection
(
projCode
,
targetCode
,
FourMomentum
{
projEnergy
,
projMomentum
},
FourMomentum
{
get_mass
(
Code
::
Oxygen
),
{
*
csPtr
,
0
_eV
,
0
_eV
,
0
_eV
}})
/
1
_mb
>
0
);
}
SECTION
(
"InteractionInterface"
)
{
auto
[
stackPtr
,
secViewPtr
]
=
setup
::
testing
::
setup_stack
(
...
...
@@ -147,7 +164,6 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
auto
projectile
=
secViewPtr
->
getProjectile
();
auto
const
projectileMomentum
=
projectile
.
getMomentum
();
corsika
::
qgsjetII
::
InteractionModel
model
;
model
.
doInteraction
(
view
,
Code
::
Proton
,
Code
::
Oxygen
,
{
sqrt
(
static_pow
<
2
>
(
110
_GeV
)
+
static_pow
<
2
>
(
Proton
::
mass
)),
MomentumVector
{
cs
,
110
_GeV
,
0
_GeV
,
0
_GeV
}},
...
...
@@ -182,7 +198,6 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
FourMomentum
const
targetP4
(
Oxygen
::
mass
,
MomentumVector
(
cs
,
{
0
_eV
,
0
_eV
,
0
_eV
}));
view
.
clear
();
corsika
::
qgsjetII
::
InteractionModel
model
;
model
.
doInteraction
(
view
,
pid
,
Code
::
Oxygen
,
projectileP4
,
targetP4
);
// this also should produce some fragments
CHECK
(
view
.
getSize
()
==
Approx
(
150
).
margin
(
150
));
// this is not physics validation
...
...
@@ -200,8 +215,6 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
auto
projectile
=
secViewPtr
->
getProjectile
();
auto
const
projectileMomentum
=
projectile
.
getMomentum
();
corsika
::
qgsjetII
::
InteractionModel
model
;
FourMomentum
const
aP4
(
100
_GeV
,
{
cs
,
99
_GeV
,
0
_GeV
,
0
_GeV
});
FourMomentum
const
bP4
(
1
_TeV
,
{
cs
,
0.9
_TeV
,
0
_GeV
,
0
_GeV
});
...
...
@@ -216,13 +229,12 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
}
SECTION
(
"Allowed Particles"
)
{
{
// pi0 is internally converted into pi+/pi-
auto
[
stackPtr
,
secViewPtr
]
=
setup
::
testing
::
setup_stack
(
Code
::
Pi0
,
1000
_GeV
,
(
DummyEnvironment
::
BaseNodeType
*
const
)
nodePtr
,
*
csPtr
);
[[
maybe_unused
]]
test
::
StackView
&
view
=
*
(
secViewPtr
.
get
());
[[
maybe_unused
]]
auto
particle
=
stackPtr
->
first
();
corsika
::
qgsjetII
::
InteractionModel
model
;
model
.
doInteraction
(
view
,
Code
::
Pi0
,
Code
::
Oxygen
,
{
sqrt
(
static_pow
<
2
>
(
1
_TeV
)
+
static_pow
<
2
>
(
Pi0
::
mass
)),
MomentumVector
{
cs
,
1
_TeV
,
0
_GeV
,
0
_GeV
}},
...
...
@@ -234,7 +246,7 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
Code
::
Rho0
,
1000
_GeV
,
(
DummyEnvironment
::
BaseNodeType
*
const
)
nodePtr
,
*
csPtr
);
[[
maybe_unused
]]
test
::
StackView
&
view
=
*
(
secViewPtr
.
get
());
[[
maybe_unused
]]
auto
particle
=
stackPtr
->
first
();
corsika
::
qgsjetII
::
InteractionModel
model
;
model
.
doInteraction
(
view
,
Code
::
Rho0
,
Code
::
Oxygen
,
{
sqrt
(
static_pow
<
2
>
(
1
_TeV
)
+
static_pow
<
2
>
(
Rho0
::
mass
)),
MomentumVector
{
cs
,
1
_TeV
,
0
_GeV
,
0
_GeV
}},
...
...
@@ -246,7 +258,7 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
Code
::
Lambda0
,
100
_GeV
,
(
DummyEnvironment
::
BaseNodeType
*
const
)
nodePtr
,
*
csPtr
);
[[
maybe_unused
]]
test
::
StackView
&
view
=
*
(
secViewPtr
.
get
());
[[
maybe_unused
]]
auto
particle
=
stackPtr
->
first
();
corsika
::
qgsjetII
::
InteractionModel
model
;
model
.
doInteraction
(
view
,
Code
::
Lambda0
,
Code
::
Oxygen
,
{
sqrt
(
static_pow
<
2
>
(
100
_GeV
)
+
static_pow
<
2
>
(
Lambda0
::
mass
)),
MomentumVector
{
cs
,
100
_GeV
,
0
_GeV
,
0
_GeV
}},
...
...
@@ -259,7 +271,7 @@ TEST_CASE("QgsjetIIInterface", "interaction,processes") {
*
csPtr
);
[[
maybe_unused
]]
test
::
StackView
&
view
=
*
(
secViewPtr
.
get
());
[[
maybe_unused
]]
auto
particle
=
stackPtr
->
first
();
corsika
::
qgsjetII
::
InteractionModel
model
;
model
.
doInteraction
(
view
,
Code
::
Lambda0Bar
,
Code
::
Oxygen
,
{
sqrt
(
static_pow
<
2
>
(
1
_TeV
)
+
static_pow
<
2
>
(
Lambda0Bar
::
mass
)),
MomentumVector
{
cs
,
1
_TeV
,
0
_GeV
,
0
_GeV
}},
...
...
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