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
e039c47a
Commit
e039c47a
authored
4 years ago
by
Maximilian Reininghaus
Committed by
ralfulrich
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
UrQMD
parent
6f2cd749
No related branches found
No related tags found
1 merge request
!280
Refactory 2020
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
corsika/detail/modules/urqmd/UrQMD.inl
+11
-11
11 additions, 11 deletions
corsika/detail/modules/urqmd/UrQMD.inl
tests/modules/testUrQMD.cpp
+7
-10
7 additions, 10 deletions
tests/modules/testUrQMD.cpp
with
18 additions
and
21 deletions
corsika/detail/modules/urqmd/UrQMD.inl
+
11
−
11
View file @
e039c47a
...
...
@@ -38,9 +38,9 @@ namespace corsika::urqmd {
// the following is a translation of ptsigtot() into C++
if
(
vProjectileCode
!=
corsika
::
Code
::
Nucleus
&&
!
IsN
ucleus
(
vTargetCode
))
{
// both particles are "special"
auto
const
mProj
=
corsika
::
GetM
ass
(
vProjectileCode
);
auto
const
mTar
=
corsika
::
GetM
ass
(
vTargetCode
);
!
corsika
::
is_n
ucleus
(
vTargetCode
))
{
// both particles are "special"
auto
const
mProj
=
corsika
::
m
ass
(
vProjectileCode
);
auto
const
mTar
=
corsika
::
m
ass
(
vTargetCode
);
double
sqrtS
=
sqrt
(
static_pow
<
2
>
(
mProj
)
+
static_pow
<
2
>
(
mTar
)
+
2
*
vLabEnergy
*
mTar
)
*
(
1
/
1
_GeV
);
...
...
@@ -59,7 +59,7 @@ namespace corsika::urqmd {
return
::
urqmd
::
sigtot_
(
one
,
two
,
sqrtS
)
*
1
_mb
;
}
else
{
int
const
Ap
=
vAProjectile
;
int
const
At
=
IsN
ucleus
(
vTargetCode
)
?
corsika
::
GetN
ucleusA
(
vTargetCode
)
:
1
;
int
const
At
=
is_n
ucleus
(
vTargetCode
)
?
corsika
::
n
ucleus
_
A
(
vTargetCode
)
:
1
;
double
const
maxImpact
=
::
urqmd
::
nucrad_
(
Ap
)
+
::
urqmd
::
nucrad_
(
At
)
+
2
*
::
urqmd
::
options_
.
CTParam
[
30
-
1
];
...
...
@@ -147,8 +147,8 @@ namespace corsika::urqmd {
});
auto
const
targetCode
=
mediumComposition
.
SampleTarget
(
componentCrossSections
,
fRNG
);
auto
const
targetA
=
corsika
::
GetN
ucleusA
(
targetCode
);
auto
const
targetZ
=
corsika
::
GetN
ucleusZ
(
targetCode
);
auto
const
targetA
=
corsika
::
n
ucleus
_
A
(
targetCode
);
auto
const
targetZ
=
corsika
::
n
ucleus
_
Z
(
targetCode
);
::
urqmd
::
inputs_
.
nevents
=
1
;
::
urqmd
::
sys_
.
eos
=
0
;
// could be configurable in principle
...
...
@@ -192,7 +192,7 @@ namespace corsika::urqmd {
}
// initilazation regarding target
if
(
corsika
::
IsN
ucleus
(
targetCode
))
{
if
(
corsika
::
is_n
ucleus
(
targetCode
))
{
::
urqmd
::
sys_
.
Zt
=
targetZ
;
::
urqmd
::
sys_
.
At
=
targetA
;
::
urqmd
::
inputs_
.
trspflg
=
0
;
// nucleus as target
...
...
@@ -226,7 +226,7 @@ namespace corsika::urqmd {
::
urqmd
::
coor_
.
px
[
i
],
::
urqmd
::
coor_
.
py
[
i
],
::
urqmd
::
coor_
.
pz
[
i
]}
*
1
_GeV
);
auto
const
energy
=
sqrt
(
momentum
.
squaredNorm
()
+
square
(
corsika
::
GetM
ass
(
code
)));
auto
const
energy
=
sqrt
(
momentum
.
squaredNorm
()
+
square
(
corsika
::
m
ass
(
code
)));
momentum
.
rebase
(
originalCS
);
// transform back into standard lab frame
std
::
cout
<<
i
<<
" "
<<
code
<<
" "
<<
momentum
.
GetComponents
()
<<
std
::
endl
;
...
...
@@ -250,7 +250,7 @@ namespace corsika::urqmd {
throw
std
::
runtime_error
(
"UrQMD pdgid() returned 0"
);
}
auto
const
pdg
=
static_cast
<
corsika
::
PDGCode
>
(
pdgInt
);
return
corsika
::
C
onvert
F
romPDG
(
pdg
);
return
corsika
::
c
onvert
_f
rom
_
PDG
(
pdg
);
}
std
::
pair
<
int
,
int
>
ConvertToUrQMD
(
corsika
::
Code
code
)
{
...
...
@@ -310,7 +310,7 @@ namespace corsika::urqmd {
{
443
,
{
135
,
0
}},
// jpsi
};
return
mapPDGToUrQMD
.
at
(
static_cast
<
int
>
(
Get
PDG
(
code
)));
return
mapPDGToUrQMD
.
at
(
static_cast
<
int
>
(
PDG
(
code
)));
}
}
// namespace corsika::urqmd
\ No newline at end of file
}
// namespace corsika::urqmd
This diff is collapsed.
Click to expand it.
tests/modules/testUrQMD.cpp
+
7
−
10
View file @
e039c47a
...
...
@@ -36,7 +36,7 @@ template <typename TStackView>
auto
sumCharge
(
TStackView
const
&
view
)
{
int
totalCharge
=
0
;
for
(
auto
const
&
p
:
view
)
{
totalCharge
+=
corsika
::
GetC
harge
N
umber
(
p
.
GetPID
());
}
for
(
auto
const
&
p
:
view
)
{
totalCharge
+=
corsika
::
c
harge
_n
umber
(
p
.
GetPID
());
}
return
totalCharge
;
}
...
...
@@ -103,7 +103,7 @@ auto setupStack(corsika::Code vProjectileType, HEPEnergyType vMomentum,
corsika
::
MomentumVector
const
pLab
(
cs
,
{
vMomentum
,
0
_GeV
,
0
_GeV
});
HEPEnergyType
const
E0
=
sqrt
(
static_pow
<
2
>
(
corsika
::
GetM
ass
(
vProjectileType
))
+
pLab
.
squaredNorm
());
sqrt
(
static_pow
<
2
>
(
corsika
::
m
ass
(
vProjectileType
))
+
pLab
.
squaredNorm
());
auto
particle
=
stack
->
AddParticle
(
std
::
tuple
<
corsika
::
Code
,
HEPEnergyType
,
corsika
::
MomentumVector
,
corsika
::
Point
,
TimeType
>
{
vProjectileType
,
E0
,
pLab
,
origin
,
0
_ns
});
...
...
@@ -165,8 +165,7 @@ TEST_CASE("UrQMD") {
auto
const
projectileMomentum
=
projectile
.
GetMomentum
();
[[
maybe_unused
]]
corsika
::
EProcessReturn
const
ret
=
urqmd
.
DoInteraction
(
projectile
);
REQUIRE
(
sumCharge
(
*
secViewPtr
)
==
Z
+
corsika
::
GetChargeNumber
(
corsika
::
Code
::
Oxygen
));
REQUIRE
(
sumCharge
(
*
secViewPtr
)
==
Z
+
corsika
::
charge_number
(
corsika
::
Code
::
Oxygen
));
auto
const
secMomSum
=
sumMomentum
(
*
secViewPtr
,
projectileMomentum
.
GetCoordinateSystem
());
...
...
@@ -187,9 +186,8 @@ TEST_CASE("UrQMD") {
[[
maybe_unused
]]
corsika
::
EProcessReturn
const
ret
=
urqmd
.
DoInteraction
(
projectile
);
REQUIRE
(
sumCharge
(
*
secViewPtr
)
==
corsika
::
GetChargeNumber
(
corsika
::
Code
::
PiPlus
)
+
corsika
::
GetChargeNumber
(
corsika
::
Code
::
Oxygen
));
REQUIRE
(
sumCharge
(
*
secViewPtr
)
==
corsika
::
charge_number
(
corsika
::
Code
::
PiPlus
)
+
corsika
::
charge_number
(
corsika
::
Code
::
Oxygen
));
auto
const
secMomSum
=
sumMomentum
(
*
secViewPtr
,
projectileMomentum
.
GetCoordinateSystem
());
...
...
@@ -210,9 +208,8 @@ TEST_CASE("UrQMD") {
[[
maybe_unused
]]
corsika
::
EProcessReturn
const
ret
=
urqmd
.
DoInteraction
(
projectile
);
REQUIRE
(
sumCharge
(
*
secViewPtr
)
==
corsika
::
GetChargeNumber
(
corsika
::
Code
::
K0Long
)
+
corsika
::
GetChargeNumber
(
corsika
::
Code
::
Oxygen
));
REQUIRE
(
sumCharge
(
*
secViewPtr
)
==
corsika
::
charge_number
(
corsika
::
Code
::
K0Long
)
+
corsika
::
charge_number
(
corsika
::
Code
::
Oxygen
));
auto
const
secMomSum
=
sumMomentum
(
*
secViewPtr
,
projectileMomentum
.
GetCoordinateSystem
());
...
...
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