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
e5b751eb
Commit
e5b751eb
authored
4 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
allow all PDG codes as input
parent
9a7a8ab5
No related branches found
No related tags found
1 merge request
!321
Resolve "Weird LongitudinalProfile"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/vertical_EAS.cpp
+25
-13
25 additions, 13 deletions
examples/vertical_EAS.cpp
with
25 additions
and
13 deletions
examples/vertical_EAS.cpp
+
25
−
13
View file @
e5b751eb
...
@@ -153,11 +153,20 @@ int main(int argc, char** argv) {
...
@@ -153,11 +153,20 @@ int main(int argc, char** argv) {
// 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
Code
beamCode
=
Code
::
Nucleus
;
unsigned
short
const
A
=
std
::
stoi
(
std
::
string
(
argv
[
1
]));
unsigned
short
const
A
=
std
::
stoi
(
std
::
string
(
argv
[
1
]));
unsigned
short
Z
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
Code
beamCode
;
auto
const
mass
=
get_nucleus_mass
(
A
,
Z
);
HEPEnergyType
mass
;
const
HEPEnergyType
E0
=
1
_GeV
*
std
::
stof
(
std
::
string
(
argv
[
3
]));
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.
;
double
theta
=
0.
;
auto
const
thetaRad
=
theta
/
180.
*
M_PI
;
auto
const
thetaRad
=
theta
/
180.
*
M_PI
;
...
@@ -187,17 +196,21 @@ int main(int argc, char** argv) {
...
@@ -187,17 +196,21 @@ int main(int argc, char** argv) {
std
::
cout
<<
"point of injection: "
<<
injectionPos
.
getCoordinates
()
<<
std
::
endl
;
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
));
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
E0
,
plab
,
injectionPos
,
0
_ns
,
A
,
Z
));
}
else
{
}
else
{
if
(
Z
==
1
)
{
if
(
A
==
1
)
{
stack
.
addParticle
(
std
::
make_tuple
(
Code
::
Proton
,
E0
,
plab
,
injectionPos
,
0
_ns
));
if
(
Z
==
1
)
{
}
else
if
(
Z
==
0
)
{
stack
.
addParticle
(
std
::
make_tuple
(
Code
::
Proton
,
E0
,
plab
,
injectionPos
,
0
_ns
));
stack
.
addParticle
(
std
::
make_tuple
(
Code
::
Neutron
,
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
{
}
else
{
std
::
cerr
<<
"illegal parameters"
<<
std
::
endl
;
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
E0
,
plab
,
injectionPos
,
0
_ns
));
return
EXIT_FAILURE
;
}
}
}
}
...
@@ -210,8 +223,7 @@ int main(int argc, char** argv) {
...
@@ -210,8 +223,7 @@ int main(int argc, char** argv) {
// setup processes, decays and interactions
// setup processes, decays and interactions
corsika
::
qgsjetII
::
Interaction
qgsjet
;
// corsika::qgsjetII::Interaction qgsjet;
corsika
::
sibyll
::
Interaction
sibyll
;
corsika
::
sibyll
::
Interaction
sibyll
;
InteractionCounter
sibyllCounted
(
sibyll
);
InteractionCounter
sibyllCounted
(
sibyll
);
...
...
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