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
5845823f
Commit
5845823f
authored
6 years ago
by
Felix Riehn
Browse files
Options
Downloads
Patches
Plain Diff
added injection of primary particle with zentith and azimuth angle, fixed rotation in azimuth
parent
112eb225
No related branches found
No related tags found
1 merge request
!42
Resolve "missing rotation between corsika stack and sibyll stack"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/Examples/cascade_example.cc
+12
-2
12 additions, 2 deletions
Documentation/Examples/cascade_example.cc
Processes/Sibyll/Interaction.h
+17
-8
17 additions, 8 deletions
Processes/Sibyll/Interaction.h
with
29 additions
and
10 deletions
Documentation/Examples/cascade_example.cc
+
12
−
2
View file @
5845823f
...
@@ -226,12 +226,22 @@ int main() {
...
@@ -226,12 +226,22 @@ int main() {
// setup particle stack, and add primary particle
// setup particle stack, and add primary particle
setup
::
Stack
stack
;
setup
::
Stack
stack
;
stack
.
Clear
();
stack
.
Clear
();
const
hep
::
EnergyType
E0
=
100
_GeV
;
const
hep
::
EnergyType
E0
=
1000
_GeV
;
double
theta
=
45.
;
double
phi
=
20.
;
{
{
auto
particle
=
stack
.
NewParticle
();
auto
particle
=
stack
.
NewParticle
();
particle
.
SetPID
(
Code
::
Proton
);
particle
.
SetPID
(
Code
::
Proton
);
hep
::
MomentumType
P0
=
sqrt
(
E0
*
E0
-
0.93827
_GeV
*
0.93827
_GeV
);
hep
::
MomentumType
P0
=
sqrt
(
E0
*
E0
-
0.93827
_GeV
*
0.93827
_GeV
);
auto
plab
=
stack
::
super_stupid
::
MomentumVector
(
rootCS
,
0
_GeV
,
0
_GeV
,
-
P0
);
auto
momentumComponents
=
[](
double
theta
,
double
phi
,
MomentumType
&
ptot
)
{
return
std
::
make_tuple
(
ptot
*
sin
(
theta
)
*
cos
(
phi
),
ptot
*
sin
(
theta
)
*
sin
(
phi
),
ptot
*
cos
(
theta
)
);
};
auto
const
[
px
,
py
,
pz
]
=
momentumComponents
(
theta
/
180.
*
M_PI
,
phi
/
180.
*
M_PI
,
P0
);
// auto plab = stack::super_stupid::MomentumVector(rootCS, 0_GeV, 0_GeV, -P0);
auto
plab
=
stack
::
super_stupid
::
MomentumVector
(
rootCS
,
{
px
,
py
,
pz
});
cout
<<
"input angles: theta="
<<
theta
<<
" phi="
<<
phi
<<
endl
;
cout
<<
"input momentum: "
<<
plab
.
GetComponents
()
/
1
_GeV
<<
endl
;
particle
.
SetEnergy
(
E0
);
particle
.
SetEnergy
(
E0
);
particle
.
SetMomentum
(
plab
);
particle
.
SetMomentum
(
plab
);
particle
.
SetTime
(
0
_ns
);
particle
.
SetTime
(
0
_ns
);
...
...
This diff is collapsed.
Click to expand it.
Processes/Sibyll/Interaction.h
+
17
−
8
View file @
5845823f
...
@@ -135,14 +135,23 @@ namespace corsika::process::sibyll {
...
@@ -135,14 +135,23 @@ namespace corsika::process::sibyll {
// sibyll CS has z along particle momentum
// sibyll CS has z along particle momentum
// FOR NOW: hard coded z-axis for corsika frame
// FOR NOW: hard coded z-axis for corsika frame
QuantityVector
<
length_d
>
const
zAxis
{
0
_m
,
0
_m
,
1
_m
};
QuantityVector
<
length_d
>
const
zAxis
{
0
_m
,
0
_m
,
1
_m
};
QuantityVector
<
length_d
>
const
xAxis
{
1
_m
,
0
_m
,
0
_m
};
QuantityVector
<
length_d
>
const
yAxis
{
0
_m
,
1
_m
,
0
_m
};
auto
pt
=
[](
MomentumVector
p
){
auto
rotation_angles
=
[](
MomentumVector
const
&
pin
)
return
sqrt
(
p
.
GetComponents
()[
0
]
*
p
.
GetComponents
()[
0
]
+
p
.
GetComponents
()[
1
]
*
p
.
GetComponents
()[
1
]);
{
};
const
auto
p
=
pin
.
GetComponents
();
double
theta
=
acos
(
p
.
GetMomentum
().
GetComponents
()[
2
]
/
p
.
GetMomentum
().
norm
());
const
auto
th
=
acos
(
p
[
2
]
/
p
.
norm
()
);
cout
<<
"ProcessSibyll: polar angle between sibyllCS and rootCS: "
<<
theta
<<
endl
;
const
auto
ph
=
atan2
(
p
[
1
]
/
1
_GeV
,
p
[
0
]
/
1
_GeV
);
//acos( p[0] / sqrt(p[0]*p[0]+p[1]*p[1] ) );
double
phi
=
asin
(
p
.
GetMomentum
().
GetComponents
()[
0
]
/
pt
(
p
.
GetMomentum
()
)
);
return
std
::
make_tuple
(
th
,
ph
);
CoordinateSystem
sibyllCS
=
rootCS
.
rotate
(
xAxis
,
theta
);
};
// 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());
auto
const
[
theta
,
phi
]
=
rotation_angles
(
p
.
GetMomentum
()
);
cout
<<
"ProcessSibyll: zenith angle between sibyllCS and rootCS: "
<<
theta
/
M_PI
*
180.
<<
endl
;
cout
<<
"ProcessSibyll: azimuth angle between sibyllCS and rootCS: "
<<
phi
/
M_PI
*
180.
<<
endl
;
//double phi = asin( p.GetMomentum().GetComponents()[0]/pt(p.GetMomentum() ) );
CoordinateSystem
sibyllCS
=
rootCS
.
rotate
(
zAxis
,
phi
).
rotate
(
yAxis
,
theta
);
/*
/*
the target should be defined by the Environment,
the target should be defined by the Environment,
...
...
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