IAP GITLAB
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
corsika
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
123
Issues
123
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Air Shower Physics
corsika
Commits
e5b751eb
Commit
e5b751eb
authored
Feb 18, 2021
by
Ralf Ulrich
☄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow all PDG codes as input
parent
9a7a8ab5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
13 deletions
+25
-13
examples/vertical_EAS.cpp
examples/vertical_EAS.cpp
+25
-13
No files found.
examples/vertical_EAS.cpp
View file @
e5b751eb
...
...
@@ -153,11 +153,20 @@ int main(int argc, char** argv) {
// setup particle stack, and add primary particle
setup
::
Stack
stack
;
stack
.
clear
();
const
Code
beamCode
=
Code
::
Nucleus
;
unsigned
short
const
A
=
std
::
stoi
(
std
::
string
(
argv
[
1
]));
unsigned
short
Z
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
auto
const
mass
=
get_nucleus_mass
(
A
,
Z
);
const
HEPEnergyType
E0
=
1
_GeV
*
std
::
stof
(
std
::
string
(
argv
[
3
]));
Code
beamCode
;
HEPEnergyType
mass
;
unsigned
short
Z
=
0
;
if
(
A
>
0
)
{
beamCode
=
Code
::
Nucleus
;
Z
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
mass
=
get_nucleus_mass
(
A
,
Z
);
}
else
{
unsigned
int
pdg
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
beamCode
=
convert_from_PDG
(
PDGCode
(
pdg
));
mass
=
get_mass
(
beamCode
);
}
HEPEnergyType
const
E0
=
1
_GeV
*
std
::
stof
(
std
::
string
(
argv
[
3
]));
double
theta
=
0.
;
auto
const
thetaRad
=
theta
/
180.
*
M_PI
;
...
...
@@ -187,17 +196,21 @@ int main(int argc, char** argv) {
std
::
cout
<<
"point of injection: "
<<
injectionPos
.
getCoordinates
()
<<
std
::
endl
;
if
(
A
!=
1
)
{
if
(
A
>
1
)
{
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
E0
,
plab
,
injectionPos
,
0
_ns
,
A
,
Z
));
}
else
{
if
(
Z
==
1
)
{
stack
.
addParticle
(
std
::
make_tuple
(
Code
::
Proton
,
E0
,
plab
,
injectionPos
,
0
_ns
));
}
else
if
(
Z
==
0
)
{
stack
.
addParticle
(
std
::
make_tuple
(
Code
::
Neutron
,
E0
,
plab
,
injectionPos
,
0
_ns
));
if
(
A
==
1
)
{
if
(
Z
==
1
)
{
stack
.
addParticle
(
std
::
make_tuple
(
Code
::
Proton
,
E0
,
plab
,
injectionPos
,
0
_ns
));
}
else
if
(
Z
==
0
)
{
stack
.
addParticle
(
std
::
make_tuple
(
Code
::
Neutron
,
E0
,
plab
,
injectionPos
,
0
_ns
));
}
else
{
std
::
cerr
<<
"illegal parameters"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
else
{
std
::
cerr
<<
"illegal parameters"
<<
std
::
endl
;
return
EXIT_FAILURE
;
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
E0
,
plab
,
injectionPos
,
0
_ns
));
}
}
...
...
@@ -210,8 +223,7 @@ int main(int argc, char** argv) {
// setup processes, decays and interactions
corsika
::
qgsjetII
::
Interaction
qgsjet
;
// corsika::qgsjetII::Interaction qgsjet;
corsika
::
sibyll
::
Interaction
sibyll
;
InteractionCounter
sibyllCounted
(
sibyll
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment