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
4f7e2bb8
Commit
4f7e2bb8
authored
3 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
fixed one unit test
parent
a0534868
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/modules/testUrQMD.cpp
+31
-18
31 additions, 18 deletions
tests/modules/testUrQMD.cpp
with
31 additions
and
18 deletions
tests/modules/testUrQMD.cpp
+
31
−
18
View file @
4f7e2bb8
...
...
@@ -164,29 +164,42 @@ TEST_CASE("UrQMD") {
}
SECTION
(
"
\"
special
\"
projectile and target"
)
{
auto
[
env
,
csPtr
,
nodePtr
]
=
setup
::
testing
::
setup_environment
(
Code
::
Proton
);
[[
maybe_unused
]]
auto
const
&
env_dummy
=
env
;
// against warnings
[[
maybe_unused
]]
auto
const
&
node_dummy
=
nodePtr
;
// against warnings
{
auto
[
env
,
csPtr
,
nodePtr
]
=
setup
::
testing
::
setup_environment
(
Code
::
Proton
);
[[
maybe_unused
]]
auto
const
&
env_dummy
=
env
;
// against warnings
[[
maybe_unused
]]
auto
const
&
node_dummy
=
nodePtr
;
// against warnings
auto
[
stackPtr
,
secViewPtr
]
=
setup
::
testing
::
setup_stack
(
Code
::
PiPlus
,
0
,
0
,
40
_GeV
,
(
setup
::
Environment
::
BaseNodeType
*
const
)
nodePtr
,
*
csPtr
);
CHECK_THROWS
(
urqmd
.
doInteraction
(
*
secViewPtr
));
// Code::Proton not a valid target
}
auto
[
stackPtr
,
secViewPtr
]
=
setup
::
testing
::
setup_stack
(
Code
::
PiPlus
,
0
,
0
,
40
_GeV
,
(
setup
::
Environment
::
BaseNodeType
*
const
)
nodePtr
,
*
csPtr
);
CHECK
(
stackPtr
->
getEntries
()
==
1
);
CHECK
(
secViewPtr
->
getEntries
()
==
0
);
{
auto
[
env
,
csPtr
,
nodePtr
]
=
setup
::
testing
::
setup_environment
(
Code
::
Oxygen
);
[[
maybe_unused
]]
auto
const
&
env_dummy
=
env
;
// against warnings
[[
maybe_unused
]]
auto
const
&
node_dummy
=
nodePtr
;
// against warnings
// must be assigned to variable, cannot be used as rvalue?!
auto
projectile
=
secViewPtr
->
getProjectile
();
auto
const
projectileMomentum
=
projectile
.
getMomentum
();
auto
[
stackPtr
,
secViewPtr
]
=
setup
::
testing
::
setup_stack
(
Code
::
PiPlus
,
0
,
0
,
40
_GeV
,
(
setup
::
Environment
::
BaseNodeType
*
const
)
nodePtr
,
*
csPtr
);
CHECK
(
stackPtr
->
getEntries
()
==
1
);
CHECK
(
secViewPtr
->
getEntries
()
==
0
);
urqmd
.
doInteraction
(
*
secViewPtr
);
// must be assigned to variable, cannot be used as rvalue?!
auto
projectile
=
secViewPtr
->
getProjectile
();
auto
const
projectileMomentum
=
projectile
.
getMomentum
();
CHECK
(
sumCharge
(
*
secViewPtr
)
==
get_charge_number
(
Code
::
PiPlus
)
+
get_charge_number
(
Code
::
Oxygen
));
urqmd
.
doInteraction
(
*
secViewPtr
);
auto
const
secMomSum
=
sumMomentum
(
*
secViewPtr
,
projectileMomentum
.
getCoordinateSystem
());
CHECK
((
secMomSum
-
projectileMomentum
).
getNorm
()
/
projectileMomentum
.
getNorm
()
==
Approx
(
0
).
margin
(
1e-2
));
CHECK
(
sumCharge
(
*
secViewPtr
)
==
get_charge_number
(
Code
::
PiPlus
)
+
get_charge_number
(
Code
::
Oxygen
));
auto
const
secMomSum
=
sumMomentum
(
*
secViewPtr
,
projectileMomentum
.
getCoordinateSystem
());
CHECK
((
secMomSum
-
projectileMomentum
).
getNorm
()
/
projectileMomentum
.
getNorm
()
==
Approx
(
0
).
margin
(
1e-2
));
}
}
SECTION
(
"K0Long projectile"
)
{
...
...
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