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
Snippets
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
Antonio Augusto Alves Junior
corsika
Commits
112eb225
Commit
112eb225
authored
6 years ago
by
Felix Riehn
Browse files
Options
Downloads
Patches
Plain Diff
added rotation hack
parent
244cff6c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Processes/Sibyll/Interaction.h
+30
-9
30 additions, 9 deletions
Processes/Sibyll/Interaction.h
with
30 additions
and
9 deletions
Processes/Sibyll/Interaction.h
+
30
−
9
View file @
112eb225
...
@@ -128,11 +128,22 @@ namespace corsika::process::sibyll {
...
@@ -128,11 +128,22 @@ namespace corsika::process::sibyll {
<<
process
::
sibyll
::
CanInteract
(
p
.
GetPID
())
<<
endl
;
<<
process
::
sibyll
::
CanInteract
(
p
.
GetPID
())
<<
endl
;
if
(
process
::
sibyll
::
CanInteract
(
p
.
GetPID
()))
{
if
(
process
::
sibyll
::
CanInteract
(
p
.
GetPID
()))
{
const
CoordinateSystem
&
rootCS
=
const
CoordinateSystem
&
rootCS
=
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
Point
pOrig
=
p
.
GetPosition
();
Point
pOrig
=
p
.
GetPosition
();
TimeType
tOrig
=
p
.
GetTime
();
TimeType
tOrig
=
p
.
GetTime
();
// sibyll CS has z along particle momentum
// FOR NOW: hard coded z-axis for corsika frame
QuantityVector
<
length_d
>
const
zAxis
{
0
_m
,
0
_m
,
1
_m
};
QuantityVector
<
length_d
>
const
xAxis
{
1
_m
,
0
_m
,
0
_m
};
auto
pt
=
[](
MomentumVector
p
){
return
sqrt
(
p
.
GetComponents
()[
0
]
*
p
.
GetComponents
()[
0
]
+
p
.
GetComponents
()[
1
]
*
p
.
GetComponents
()[
1
]);
};
double
theta
=
acos
(
p
.
GetMomentum
().
GetComponents
()[
2
]
/
p
.
GetMomentum
().
norm
());
cout
<<
"ProcessSibyll: polar angle between sibyllCS and rootCS: "
<<
theta
<<
endl
;
double
phi
=
asin
(
p
.
GetMomentum
().
GetComponents
()[
0
]
/
pt
(
p
.
GetMomentum
()
)
);
CoordinateSystem
sibyllCS
=
rootCS
.
rotate
(
xAxis
,
theta
);
/*
/*
the target should be defined by the Environment,
the target should be defined by the Environment,
ideally as full particle object so that the four momenta
ideally as full particle object so that the four momenta
...
@@ -143,7 +154,7 @@ namespace corsika::process::sibyll {
...
@@ -143,7 +154,7 @@ namespace corsika::process::sibyll {
*/
*/
// FOR NOW: set target to oxygen
// FOR NOW: set target to oxygen
const
int
kTarget
=
corsika
::
particles
::
Oxygen
::
const
int
kTarget
=
corsika
::
particles
::
Oxygen
::
GetNucleusA
();
// env.GetTargetParticle().GetPID();
GetNucleusA
();
// env.GetTargetParticle().GetPID();
// FOR NOW: target is always at rest
// FOR NOW: target is always at rest
const
hep
::
MassType
nucleon_mass
=
0.5
*
(
corsika
::
particles
::
Proton
::
GetMass
()
+
corsika
::
particles
::
Neutron
::
GetMass
());
const
hep
::
MassType
nucleon_mass
=
0.5
*
(
corsika
::
particles
::
Proton
::
GetMass
()
+
corsika
::
particles
::
Neutron
::
GetMass
());
...
@@ -152,6 +163,9 @@ namespace corsika::process::sibyll {
...
@@ -152,6 +163,9 @@ namespace corsika::process::sibyll {
cout
<<
"target momentum (GeV/c): "
<<
pTarget
.
GetComponents
()
/
1
_GeV
<<
endl
;
cout
<<
"target momentum (GeV/c): "
<<
pTarget
.
GetComponents
()
/
1
_GeV
<<
endl
;
cout
<<
"beam momentum (GeV/c): "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
cout
<<
"beam momentum (GeV/c): "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
<<
endl
;
<<
endl
;
cout
<<
"beam momentum in sibyll frame (GeV/c): "
<<
p
.
GetMomentum
().
GetComponents
(
sibyllCS
)
/
1
_GeV
<<
endl
;
cout
<<
"position of interaction: "
<<
pOrig
.
GetCoordinates
()
<<
endl
;
cout
<<
"position of interaction: "
<<
pOrig
.
GetCoordinates
()
<<
endl
;
cout
<<
"time: "
<<
tOrig
<<
endl
;
cout
<<
"time: "
<<
tOrig
<<
endl
;
...
@@ -210,15 +224,15 @@ namespace corsika::process::sibyll {
...
@@ -210,15 +224,15 @@ namespace corsika::process::sibyll {
// add particles from sibyll to stack
// add particles from sibyll to stack
// link to sibyll stack
// link to sibyll stack
// here we need to pass projectile momentum and energy to define the local sibyll frame
// and the boosts to the lab. frame
SibStack
ss
;
SibStack
ss
;
// SibStack does not know about momentum yet so we need counter to access
// momentum array in Sibyll
// momentum array in Sibyll
int
i
=
-
1
;
MomentumVector
Plab_final
(
rootCS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
MomentumVector
Plab_final
(
rootCS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
EnergyType
E_final
=
0
_GeV
,
Ecm_final
=
0
_GeV
;
EnergyType
E_final
=
0
_GeV
,
Ecm_final
=
0
_GeV
;
for
(
auto
&
psib
:
ss
)
{
for
(
auto
&
psib
:
ss
)
{
++
i
;
// skip particles that have decayed in Sibyll
// skip particles that have decayed in Sibyll
if
(
psib
.
HasDecayed
())
continue
;
if
(
psib
.
HasDecayed
())
continue
;
...
@@ -226,7 +240,15 @@ namespace corsika::process::sibyll {
...
@@ -226,7 +240,15 @@ namespace corsika::process::sibyll {
// compute beta_vec * p_vec
// compute beta_vec * p_vec
// arbitrary Lorentz transformation based on sibyll routines
// arbitrary Lorentz transformation based on sibyll routines
const
auto
gammaBetaComponents
=
gambet
.
GetComponents
();
const
auto
gammaBetaComponents
=
gambet
.
GetComponents
();
const
auto
pSibyllComponents
=
psib
.
GetMomentum
().
GetComponents
();
// FOR NOW: fill vector in sibCS and then rotate into rootCS
// can be done in SibStack by passing sibCS
// get momentum vector in sibyllCS
const
auto
pSibyllComponentsSibCS
=
psib
.
GetMomentum
().
GetComponents
();
// temporary vector in sibyllCS
auto
SibVector
=
MomentumVector
(
sibyllCS
,
pSibyllComponentsSibCS
);
// rotatate to rootCS
const
auto
pSibyllComponents
=
SibVector
.
GetComponents
(
rootCS
);
// boost to lab. frame
hep
::
EnergyType
en_lab
=
0.
*
1
_GeV
;
hep
::
EnergyType
en_lab
=
0.
*
1
_GeV
;
hep
::
MomentumType
p_lab_components
[
3
];
hep
::
MomentumType
p_lab_components
[
3
];
en_lab
=
psib
.
GetEnergy
()
*
gamma
;
en_lab
=
psib
.
GetEnergy
()
*
gamma
;
...
@@ -245,7 +267,6 @@ namespace corsika::process::sibyll {
...
@@ -245,7 +267,6 @@ namespace corsika::process::sibyll {
auto
pnew
=
s
.
NewParticle
();
auto
pnew
=
s
.
NewParticle
();
pnew
.
SetEnergy
(
en_lab
);
pnew
.
SetEnergy
(
en_lab
);
pnew
.
SetPID
(
process
::
sibyll
::
ConvertFromSibyll
(
psib
.
GetPID
()));
pnew
.
SetPID
(
process
::
sibyll
::
ConvertFromSibyll
(
psib
.
GetPID
()));
corsika
::
geometry
::
QuantityVector
<
energy_hep_d
>
p_lab_c
{
corsika
::
geometry
::
QuantityVector
<
energy_hep_d
>
p_lab_c
{
p_lab_components
[
0
],
p_lab_components
[
1
],
p_lab_components
[
2
]};
p_lab_components
[
0
],
p_lab_components
[
1
],
p_lab_components
[
2
]};
pnew
.
SetMomentum
(
MomentumVector
(
rootCS
,
p_lab_c
));
pnew
.
SetMomentum
(
MomentumVector
(
rootCS
,
p_lab_c
));
...
...
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