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
407c2b31
Commit
407c2b31
authored
4 years ago
by
Maximilian Reininghaus
Committed by
Ralf Ulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
improved test of Pythia decay
parent
8acb3894
No related branches found
No related tags found
1 merge request
!194
Resolve "Pythia 8 crash during decay of particles::DsMinus and particles::DsPlus"
Pipeline
#1326
passed
4 years ago
Stage: config
Stage: quality
Stage: build_test
Stage: optional
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Geometry/testGeometry.cc
+0
-2
0 additions, 2 deletions
Framework/Geometry/testGeometry.cc
Processes/Pythia/testPythia.cc
+16
-3
16 additions, 3 deletions
Processes/Pythia/testPythia.cc
with
16 additions
and
5 deletions
Framework/Geometry/testGeometry.cc
+
0
−
2
View file @
407c2b31
...
@@ -127,7 +127,6 @@ TEST_CASE("transformations between CoordinateSystems") {
...
@@ -127,7 +127,6 @@ TEST_CASE("transformations between CoordinateSystems") {
SECTION
(
"RotateToZ positive"
)
{
SECTION
(
"RotateToZ positive"
)
{
Vector
const
v
{
rootCS
,
0
_m
,
1
_m
,
1
_m
};
Vector
const
v
{
rootCS
,
0
_m
,
1
_m
,
1
_m
};
auto
const
csPrime
=
rootCS
.
RotateToZ
(
v
);
auto
const
csPrime
=
rootCS
.
RotateToZ
(
v
);
auto
const
transform
=
csPrime
.
GetTransform
().
matrix
();
Vector
const
zPrime
{
csPrime
,
0
_m
,
0
_m
,
5
_m
};
Vector
const
zPrime
{
csPrime
,
0
_m
,
0
_m
,
5
_m
};
Vector
const
xPrime
{
csPrime
,
5
_m
,
0
_m
,
0
_m
};
Vector
const
xPrime
{
csPrime
,
5
_m
,
0
_m
,
0
_m
};
Vector
const
yPrime
{
csPrime
,
0
_m
,
5
_m
,
0
_m
};
Vector
const
yPrime
{
csPrime
,
0
_m
,
5
_m
,
0
_m
};
...
@@ -155,7 +154,6 @@ TEST_CASE("transformations between CoordinateSystems") {
...
@@ -155,7 +154,6 @@ TEST_CASE("transformations between CoordinateSystems") {
SECTION
(
"RotateToZ negative"
)
{
SECTION
(
"RotateToZ negative"
)
{
Vector
const
v
{
rootCS
,
0
_m
,
0
_m
,
-
1
_m
};
Vector
const
v
{
rootCS
,
0
_m
,
0
_m
,
-
1
_m
};
auto
const
csPrime
=
rootCS
.
RotateToZ
(
v
);
auto
const
csPrime
=
rootCS
.
RotateToZ
(
v
);
auto
const
transform
=
csPrime
.
GetTransform
().
matrix
();
Vector
const
zPrime
{
csPrime
,
0
_m
,
0
_m
,
5
_m
};
Vector
const
zPrime
{
csPrime
,
0
_m
,
0
_m
,
5
_m
};
Vector
const
xPrime
{
csPrime
,
5
_m
,
0
_m
,
0
_m
};
Vector
const
xPrime
{
csPrime
,
5
_m
,
0
_m
,
0
_m
};
Vector
const
yPrime
{
csPrime
,
0
_m
,
5
_m
,
0
_m
};
Vector
const
yPrime
{
csPrime
,
0
_m
,
5
_m
,
0
_m
};
...
...
This diff is collapsed.
Click to expand it.
Processes/Pythia/testPythia.cc
+
16
−
3
View file @
407c2b31
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include
<corsika/geometry/Point.h>
#include
<corsika/geometry/Point.h>
#include
<corsika/units/PhysicalUnits.h>
#include
<corsika/units/PhysicalUnits.h>
#include
<corsika/utl/CorsikaFenv.h>
#include
<catch2/catch.hpp>
#include
<catch2/catch.hpp>
TEST_CASE
(
"Pythia"
,
"[processes]"
)
{
TEST_CASE
(
"Pythia"
,
"[processes]"
)
{
...
@@ -88,6 +89,15 @@ TEST_CASE("Pythia", "[processes]") {
...
@@ -88,6 +89,15 @@ TEST_CASE("Pythia", "[processes]") {
using
namespace
corsika
;
using
namespace
corsika
;
using
namespace
corsika
::
units
::
si
;
using
namespace
corsika
::
units
::
si
;
template
<
typename
TStackView
>
auto
sumMomentum
(
TStackView
const
&
view
,
geometry
::
CoordinateSystem
const
&
vCS
)
{
geometry
::
Vector
<
hepenergy_d
>
sum
{
vCS
,
0
_eV
,
0
_eV
,
0
_eV
};
for
(
auto
const
&
p
:
view
)
{
sum
+=
p
.
GetMomentum
();
}
return
sum
;
}
TEST_CASE
(
"pythia process"
)
{
TEST_CASE
(
"pythia process"
)
{
// setup environment, geometry
// setup environment, geometry
...
@@ -110,12 +120,12 @@ TEST_CASE("pythia process") {
...
@@ -110,12 +120,12 @@ TEST_CASE("pythia process") {
auto
const
*
nodePtr
=
theMedium
.
get
();
// save the medium for later use before moving it
auto
const
*
nodePtr
=
theMedium
.
get
();
// save the medium for later use before moving it
SECTION
(
"pythia decay"
)
{
SECTION
(
"pythia decay"
)
{
feenableexcept
(
FE_INVALID
);
setup
::
Stack
stack
;
setup
::
Stack
stack
;
const
HEPEnergyType
E0
=
10
_GeV
;
const
HEPEnergyType
E0
=
10
_GeV
;
HEPMomentumType
P0
=
HEPMomentumType
P0
=
sqrt
(
E0
*
E0
-
particles
::
PiPlus
::
GetMass
()
*
particles
::
PiPlus
::
GetMass
());
sqrt
(
E0
*
E0
-
particles
::
PiPlus
::
GetMass
()
*
particles
::
PiPlus
::
GetMass
());
auto
plab
=
corsika
::
stack
::
MomentumVector
(
cs
,
{
0
_GeV
,
0
_GeV
,
-
P0
});
auto
plab
=
corsika
::
stack
::
MomentumVector
(
cs
,
{
0
_GeV
,
0
_GeV
,
P0
});
geometry
::
Point
pos
(
cs
,
0
_m
,
0
_m
,
0
_m
);
geometry
::
Point
pos
(
cs
,
0
_m
,
0
_m
,
0
_m
);
auto
particle
=
stack
.
AddParticle
(
auto
particle
=
stack
.
AddParticle
(
std
::
tuple
<
particles
::
Code
,
units
::
si
::
HEPEnergyType
,
std
::
tuple
<
particles
::
Code
,
units
::
si
::
HEPEnergyType
,
...
@@ -131,7 +141,10 @@ TEST_CASE("pythia process") {
...
@@ -131,7 +141,10 @@ TEST_CASE("pythia process") {
model
.
Init
();
model
.
Init
();
[[
maybe_unused
]]
const
TimeType
time
=
model
.
GetLifetime
(
particle
);
[[
maybe_unused
]]
const
TimeType
time
=
model
.
GetLifetime
(
particle
);
model
.
DoDecay
(
projectile
);
model
.
DoDecay
(
projectile
);
REQUIRE
(
stack
.
GetSize
()
==
3
);
CHECK
(
stack
.
GetSize
()
==
3
);
auto
const
pSum
=
sumMomentum
(
view
,
cs
);
CHECK
((
pSum
-
plab
).
norm
()
/
1
_GeV
==
Approx
(
0
).
margin
(
1e-4
));
CHECK
((
pSum
.
norm
()
-
plab
.
norm
())
/
1
_GeV
==
Approx
(
0
).
margin
(
1e-4
));
}
}
SECTION
(
"pythia decay config"
)
{
SECTION
(
"pythia decay config"
)
{
...
...
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