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
839ffa38
Commit
839ffa38
authored
4 years ago
by
Maximilian Reininghaus
Committed by
Felix Riehn
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added momentum conservation test for sibyll::Interaction
parent
cc394c12
No related branches found
No related tags found
2 merge requests
!234
WIP: Initial example of python as script language from C++
,
!204
Resolve "boost & coordinate system in process::sibyll::Interaction"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Processes/Sibyll/testSibyll.cc
+23
-2
23 additions, 2 deletions
Processes/Sibyll/testSibyll.cc
with
23 additions
and
2 deletions
Processes/Sibyll/testSibyll.cc
+
23
−
2
View file @
839ffa38
...
@@ -86,6 +86,15 @@ TEST_CASE("Sibyll", "[processes]") {
...
@@ -86,6 +86,15 @@ TEST_CASE("Sibyll", "[processes]") {
using
namespace
corsika
::
units
::
si
;
using
namespace
corsika
::
units
::
si
;
using
namespace
corsika
::
units
;
using
namespace
corsika
::
units
;
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
(
"SibyllInterface"
,
"[processes]"
)
{
TEST_CASE
(
"SibyllInterface"
,
"[processes]"
)
{
// setup environment, geometry
// setup environment, geometry
...
@@ -113,10 +122,10 @@ TEST_CASE("SibyllInterface", "[processes]") {
...
@@ -113,10 +122,10 @@ TEST_CASE("SibyllInterface", "[processes]") {
SECTION
(
"InteractionInterface"
)
{
SECTION
(
"InteractionInterface"
)
{
setup
::
Stack
stack
;
setup
::
Stack
stack
;
const
HEPEnergyType
E0
=
10
0
_GeV
;
const
HEPEnergyType
E0
=
6
0
_GeV
;
HEPMomentumType
P0
=
HEPMomentumType
P0
=
sqrt
(
E0
*
E0
-
particles
::
Proton
::
GetMass
()
*
particles
::
Proton
::
GetMass
());
sqrt
(
E0
*
E0
-
particles
::
Proton
::
GetMass
()
*
particles
::
Proton
::
GetMass
());
auto
plab
=
corsika
::
stack
::
MomentumVector
(
cs
,
{
0
_
G
eV
,
0
_
G
eV
,
-
P0
});
auto
plab
=
corsika
::
stack
::
MomentumVector
(
cs
,
{
P0
,
0
_eV
,
0
_eV
});
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
,
...
@@ -130,6 +139,18 @@ TEST_CASE("SibyllInterface", "[processes]") {
...
@@ -130,6 +139,18 @@ TEST_CASE("SibyllInterface", "[processes]") {
model
.
Init
();
model
.
Init
();
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
projectile
);
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
projectile
);
auto
const
pSum
=
sumMomentum
(
view
,
cs
);
// for debugging!
std
::
cout
<<
pSum
.
GetComponents
(
cs
)
<<
std
::
endl
;
std
::
cout
<<
plab
.
GetComponents
(
cs
)
<<
std
::
endl
;
CHECK
(
pSum
.
GetComponents
(
cs
).
GetX
()
/
P0
==
Approx
(
1
).
margin
(
1e-4
));
CHECK
(
pSum
.
GetComponents
(
cs
).
GetY
()
/
1
_GeV
==
Approx
(
0
).
margin
(
1e-4
));
CHECK
(
pSum
.
GetComponents
(
cs
).
GetZ
()
/
1
_GeV
==
Approx
(
0
).
margin
(
1e-4
));
CHECK
((
pSum
-
plab
).
norm
()
/
1
_GeV
==
Approx
(
0
).
margin
(
1e-4
));
CHECK
(
pSum
.
norm
()
/
P0
==
Approx
(
1
).
margin
(
1e-4
));
[[
maybe_unused
]]
const
GrammageType
length
=
model
.
GetInteractionLength
(
particle
);
[[
maybe_unused
]]
const
GrammageType
length
=
model
.
GetInteractionLength
(
particle
);
}
}
...
...
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