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
730af5f9
Commit
730af5f9
authored
4 years ago
by
Maximilian Reininghaus
Committed by
Felix Riehn
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixed coordinate systems in Sibyll::Interaction
parent
974e9909
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
Processes/Sibyll/Interaction.cc
+21
-20
21 additions, 20 deletions
Processes/Sibyll/Interaction.cc
with
21 additions
and
20 deletions
Processes/Sibyll/Interaction.cc
+
21
−
20
View file @
730af5f9
...
...
@@ -164,9 +164,8 @@ namespace corsika::process::sibyll {
template
<
>
process
::
EProcessReturn
Interaction
::
DoInteraction
(
SetupProjectile
&
vP
)
{
using
namespace
units
;
using
namespace
utl
;
using
namespace
units
;
using
namespace
units
::
si
;
using
namespace
geometry
;
...
...
@@ -181,24 +180,22 @@ namespace corsika::process::sibyll {
}
if
(
process
::
sibyll
::
CanInteract
(
corsikaBeamId
))
{
const
CoordinateSystem
&
rootCS
=
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
// position and time of interaction, not used in Sibyll
Point
pOrig
=
vP
.
GetPosition
();
TimeType
tOrig
=
vP
.
GetTime
();
Point
const
pOrig
=
vP
.
GetPosition
();
TimeType
const
tOrig
=
vP
.
GetTime
();
// define projectile
HEPEnergyType
const
eProjectileLab
=
vP
.
GetEnergy
();
auto
const
pProjectileLab
=
vP
.
GetMomentum
();
const
CoordinateSystem
&
originalCS
=
pProjectileLab
.
GetCoordinateSystem
();
// define target
// for Sibyll is always a single nucleon
// FOR NOW: target is always at rest
const
auto
eTargetLab
=
0
_GeV
+
constants
::
nucleonMass
;
const
auto
pTargetLab
=
MomentumVector
(
root
CS
,
0
_GeV
,
0
_GeV
,
0
_GeV
);
const
auto
pTargetLab
=
MomentumVector
(
original
CS
,
0
_GeV
,
0
_GeV
,
0
_GeV
);
const
FourVector
PtargLab
(
eTargetLab
,
pTargetLab
);
// define projectile
HEPEnergyType
const
eProjectileLab
=
vP
.
GetEnergy
();
auto
const
pProjectileLab
=
vP
.
GetMomentum
();
cout
<<
"Interaction: ebeam lab: "
<<
eProjectileLab
/
1
_GeV
<<
endl
<<
"Interaction: pbeam lab: "
<<
pProjectileLab
.
GetComponents
()
/
1
_GeV
<<
endl
;
...
...
@@ -211,6 +208,7 @@ namespace corsika::process::sibyll {
// define boost to and from CoM frame
// CoM frame definition in Sibyll projectile: +z
COMBoost
const
boost
(
PprojLab
,
constants
::
nucleonMass
);
auto
const
&
csPrime
=
boost
.
GetRotatedCS
();
// just for show:
// boost projecticle
...
...
@@ -222,11 +220,11 @@ namespace corsika::process::sibyll {
cout
<<
"Interaction: ebeam CoM: "
<<
PprojCoM
.
GetTimeLikeComponent
()
/
1
_GeV
<<
endl
<<
"Interaction: pbeam CoM: "
<<
PprojCoM
.
GetSpaceLikeComponents
().
GetComponents
()
/
1
_GeV
<<
endl
;
<<
PprojCoM
.
GetSpaceLikeComponents
().
GetComponents
(
csPrime
)
/
1
_GeV
<<
endl
;
cout
<<
"Interaction: etarget CoM: "
<<
PtargCoM
.
GetTimeLikeComponent
()
/
1
_GeV
<<
endl
<<
"Interaction: ptarget CoM: "
<<
PtargCoM
.
GetSpaceLikeComponents
().
GetComponents
()
/
1
_GeV
<<
endl
;
<<
PtargCoM
.
GetSpaceLikeComponents
().
GetComponents
(
csPrime
)
/
1
_GeV
<<
endl
;
cout
<<
"Interaction: position of interaction: "
<<
pOrig
.
GetCoordinates
()
<<
endl
;
cout
<<
"Interaction: time: "
<<
tOrig
<<
endl
;
...
...
@@ -247,7 +245,7 @@ namespace corsika::process::sibyll {
*/
//#warning reading interaction cross section again, should not be necessary
auto
const
&
compVec
=
mediumComposition
.
GetComponents
();
std
::
vector
<
si
::
CrossSectionType
>
cross_section_of_components
(
compVec
.
size
());
std
::
vector
<
CrossSectionType
>
cross_section_of_components
(
compVec
.
size
());
for
(
size_t
i
=
0
;
i
<
compVec
.
size
();
++
i
)
{
auto
const
targetId
=
compVec
[
i
];
...
...
@@ -303,7 +301,7 @@ namespace corsika::process::sibyll {
// link to sibyll stack
SibStack
ss
;
MomentumVector
Plab_final
(
root
CS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
MomentumVector
Plab_final
(
original
CS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
HEPEnergyType
Elab_final
=
0
_GeV
,
Ecm_final
=
0
_GeV
;
for
(
auto
&
psib
:
ss
)
{
...
...
@@ -311,18 +309,21 @@ namespace corsika::process::sibyll {
if
(
psib
.
HasDecayed
())
throw
std
::
runtime_error
(
"found particle that decayed in SIBYLL!"
);
// transform energy to lab. frame
auto
const
pCoM
=
psib
.
GetMomentum
();
// transform 4-momentum to lab. frame
// note that the momentum needs to be rotated back
auto
const
tmp
=
psib
.
GetMomentum
().
GetComponents
();
auto
const
pCoM
=
Vector
<
hepmomentum_d
>
(
csPrime
,
tmp
);
HEPEnergyType
const
eCoM
=
psib
.
GetEnergy
();
auto
const
Plab
=
boost
.
fromCoM
(
FourVector
(
eCoM
,
pCoM
));
auto
const
p3lab
=
Plab
.
GetSpaceLikeComponents
();
assert
(
p3lab
.
GetCoordinateSystem
()
==
originalCS
);
// just to be sure!
// add to corsika stack
auto
pnew
=
vP
.
AddSecondary
(
tuple
<
particles
::
Code
,
units
::
si
::
HEPEnergyType
,
stack
::
MomentumVector
,
geometry
::
Point
,
units
::
si
::
TimeType
>
{
process
::
sibyll
::
ConvertFromSibyll
(
psib
.
GetPID
()),
Plab
.
GetTimeLikeComponent
(),
Plab
.
GetSpaceLikeComponents
(),
pOrig
,
tOrig
});
Plab
.
GetTimeLikeComponent
(),
p3lab
,
pOrig
,
tOrig
});
Plab_final
+=
pnew
.
GetMomentum
();
Elab_final
+=
pnew
.
GetEnergy
();
...
...
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