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
f21be630
Commit
f21be630
authored
6 years ago
by
Felix Riehn
Browse files
Options
Downloads
Patches
Plain Diff
added cm energy calculation for minsteplength in sibyll process
parent
8fd298e2
No related branches found
No related tags found
1 merge request
!28
Sibyll
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation/Examples/cascade_example.cc
+24
-9
24 additions, 9 deletions
Documentation/Examples/cascade_example.cc
with
24 additions
and
9 deletions
Documentation/Examples/cascade_example.cc
+
24
−
9
View file @
f21be630
...
...
@@ -44,6 +44,9 @@ public:
template
<
typename
Particle
>
double
MinStepLength
(
Particle
&
p
,
setup
::
Trajectory
&
)
const
{
// coordinate system, get global frame of reference
CoordinateSystem
&
rootCS
=
RootCoordinateSystem
::
GetInstance
().
GetRootCS
();
const
Code
corsikaBeamId
=
p
.
GetPID
();
// beam particles for sibyll : 1, 2, 3 for p, pi, k
...
...
@@ -60,13 +63,24 @@ public:
// target nuclei: A < 18
// FOR NOW: assume target is oxygen
int
kTarget
=
16
;
double
beamEnergy
=
p
.
GetEnergy
()
/
1
_GeV
;
#warning boost to cm. still missing, sibyll cross section input is cm. energy!
// proton mass in units of energy
const
EnergyType
proton_mass_en
=
0.93827
_GeV
;
EnergyType
Etot
=
p
.
GetEnergy
()
+
kTarget
*
proton_mass_en
;
super_stupid
::
MomentumVector
Ptot
(
rootCS
,
{
0.0
_newton_second
,
0.0
_newton_second
,
0.0
_newton_second
});
// FOR NOW: assume target is at rest
super_stupid
::
MomentumVector
pTarget
(
rootCS
,
{
0.0
_newton_second
,
0.0
_newton_second
,
0.0
_newton_second
});
Ptot
+=
p
.
GetMomentum
();
Ptot
+=
pTarget
;
// calculate cm. energy
EnergyType
sqs
=
sqrt
(
Etot
*
Etot
-
Ptot
.
squaredNorm
()
*
si
::
constants
::
cSquared
);
double
Ecm
=
sqs
/
1
_GeV
;
std
::
cout
<<
"ProcessSplit: "
<<
"MinStep: input en: "
<<
beam
Energy
<<
" beam can interact:"
<<
kBeam
<<
" beam XS code:"
<<
kBeam
<<
" beam pid:"
<<
p
.
GetPID
()
std
::
cout
<<
"ProcessSplit: "
<<
"MinStep: input en: "
<<
p
.
Get
Energy
()
/
1
_GeV
<<
endl
<<
" beam can interact:"
<<
kBeam
<<
endl
<<
" beam XS code:"
<<
kBeam
<<
endl
<<
" beam pid:"
<<
p
.
GetPID
()
<<
endl
<<
" target mass number:"
<<
kTarget
<<
std
::
endl
;
double
next_step
;
...
...
@@ -76,9 +90,9 @@ public:
double
dumdif
[
3
];
if
(
kTarget
==
1
)
sib_sigma_hp_
(
kBeam
,
beamEnergy
,
dum1
,
dum2
,
prodCrossSection
,
dumdif
,
dum3
,
dum4
);
sib_sigma_hp_
(
kBeam
,
Ecm
,
dum1
,
dum2
,
prodCrossSection
,
dumdif
,
dum3
,
dum4
);
else
sib_sigma_hnuc_
(
kBeam
,
kTarget
,
beamEnergy
,
prodCrossSection
,
dummy
);
sib_sigma_hnuc_
(
kBeam
,
kTarget
,
Ecm
,
prodCrossSection
,
dummy
);
std
::
cout
<<
"ProcessSplit: "
<<
"MinStep: sibyll return: "
<<
prodCrossSection
<<
std
::
endl
;
CrossSectionType
sig
=
prodCrossSection
*
1
_mbarn
;
...
...
@@ -291,6 +305,7 @@ public:
ds
.
NewParticle
().
SetPID
(
Code
::
Neutron
);
ds
.
NewParticle
().
SetPID
(
Code
::
PiPlus
);
ds
.
NewParticle
().
SetPID
(
Code
::
PiMinus
);
ds
.
NewParticle
().
SetPID
(
Code
::
Pi0
);
ds
.
NewParticle
().
SetPID
(
Code
::
KPlus
);
ds
.
NewParticle
().
SetPID
(
Code
::
KMinus
);
ds
.
NewParticle
().
SetPID
(
Code
::
K0Long
);
...
...
@@ -332,7 +347,7 @@ int main() {
stack
.
Clear
();
auto
particle
=
stack
.
NewParticle
();
EnergyType
E0
=
5
00
_GeV
;
EnergyType
E0
=
1
00
_GeV
;
MomentumType
P0
=
sqrt
(
E0
*
E0
-
0.93827
_GeV
*
0.93827
_GeV
)
/
si
::
constants
::
c
;
auto
plab
=
super_stupid
::
MomentumVector
(
rootCS
,
0.
*
1
_GeV
/
si
::
constants
::
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