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
ba25b159
Commit
ba25b159
authored
6 years ago
by
Felix Riehn
Browse files
Options
Downloads
Patches
Plain Diff
added actual decay to ProcessDecay
parent
dd6c3424
No related branches found
No related tags found
1 merge request
!28
Sibyll
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/Cascade/SibStack.h
+3
-1
3 additions, 1 deletion
Framework/Cascade/SibStack.h
Processes/Sibyll/ProcessDecay.h
+33
-1
33 additions, 1 deletion
Processes/Sibyll/ProcessDecay.h
with
36 additions
and
2 deletions
Framework/Cascade/SibStack.h
+
3
−
1
View file @
ba25b159
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include
<corsika/cascade/sibyll2.3c.h>
#include
<corsika/cascade/sibyll2.3c.h>
#include
<corsika/process/sibyll/ParticleConversion.h>
#include
<corsika/process/sibyll/ParticleConversion.h>
#include
<corsika/units/PhysicalUnits.h>
#include
<corsika/stack/Stack.h>
#include
<corsika/stack/Stack.h>
using
namespace
std
;
using
namespace
std
;
...
@@ -64,11 +65,12 @@ class ParticleInterface : public ParticleBase<StackIteratorInterface> {
...
@@ -64,11 +65,12 @@ class ParticleInterface : public ParticleBase<StackIteratorInterface> {
using
ParticleBase
<
StackIteratorInterface
>::
GetIndex
;
using
ParticleBase
<
StackIteratorInterface
>::
GetIndex
;
public:
public:
void
SetEnergy
(
const
doubl
e
v
)
{
GetStackData
().
SetEnergy
(
GetIndex
(),
v
);
}
void
SetEnergy
(
const
EnergyTyp
e
v
)
{
GetStackData
().
SetEnergy
(
GetIndex
(),
v
);
}
EnergyType
GetEnergy
()
const
{
return
GetStackData
().
GetEnergy
(
GetIndex
());
}
EnergyType
GetEnergy
()
const
{
return
GetStackData
().
GetEnergy
(
GetIndex
());
}
void
SetPID
(
const
int
v
)
{
GetStackData
().
SetId
(
GetIndex
(),
v
);
}
void
SetPID
(
const
int
v
)
{
GetStackData
().
SetId
(
GetIndex
(),
v
);
}
corsika
::
process
::
sibyll
::
SibyllCode
GetPID
()
const
{
return
static_cast
<
corsika
::
process
::
sibyll
::
SibyllCode
>
(
GetStackData
().
GetId
(
GetIndex
()));
}
corsika
::
process
::
sibyll
::
SibyllCode
GetPID
()
const
{
return
static_cast
<
corsika
::
process
::
sibyll
::
SibyllCode
>
(
GetStackData
().
GetId
(
GetIndex
()));
}
super_stupid
::
MomentumVector
GetMomentum
()
const
{
return
GetStackData
().
GetMomentum
(
GetIndex
());
}
super_stupid
::
MomentumVector
GetMomentum
()
const
{
return
GetStackData
().
GetMomentum
(
GetIndex
());
}
void
SetMomentum
(
const
super_stupid
::
MomentumVector
&
v
)
{
GetStackData
().
SetMomentum
(
GetIndex
(),
v
);
}
};
};
...
...
This diff is collapsed.
Click to expand it.
Processes/Sibyll/ProcessDecay.h
+
33
−
1
View file @
ba25b159
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include
<corsika/setup/SetupTrajectory.h>
#include
<corsika/setup/SetupTrajectory.h>
#include
<corsika/process/sibyll/ParticleConversion.h>
#include
<corsika/process/sibyll/ParticleConversion.h>
#include
<corsika/cascade/SibStack.h>
//using namespace corsika::particles;
//using namespace corsika::particles;
...
@@ -104,7 +105,38 @@ namespace corsika::process {
...
@@ -104,7 +105,38 @@ namespace corsika::process {
template
<
typename
Particle
,
typename
Stack
>
template
<
typename
Particle
,
typename
Stack
>
void
DoDiscrete
(
Particle
&
p
,
Stack
&
s
)
const
{
void
DoDiscrete
(
Particle
&
p
,
Stack
&
s
)
const
{
SibStack
ss
;
ss
.
Clear
();
// copy particle to sibyll stack
auto
pin
=
ss
.
NewParticle
();
pin
.
SetPID
(
process
::
sibyll
::
ConvertToSibyllRaw
(
p
.
GetPID
()
)
);
pin
.
SetEnergy
(
p
.
GetEnergy
()
);
pin
.
SetMomentum
(
p
.
GetMomentum
()
);
// set all particles/hadrons unstable
setHadronsUnstable
();
// call sibyll decay
std
::
cout
<<
"calling Sibyll decay routine.."
<<
std
::
endl
;
decsib_
();
// print output
int
print_unit
=
6
;
sib_list_
(
print_unit
);
// copy particles from sibyll stack to corsika
int
i
=
-
1
;
for
(
auto
&
psib
:
ss
){
++
i
;
// FOR NOW: skip particles that have decayed in Sibyll, move to iterator?
if
(
abs
(
s_plist_
.
llist
[
i
])
>
100
)
continue
;
// add to corsika stack
cout
<<
"decay product: "
<<
process
::
sibyll
::
ConvertFromSibyll
(
psib
.
GetPID
()
)
<<
endl
;
auto
pnew
=
s
.
NewParticle
();
pnew
.
SetEnergy
(
psib
.
GetEnergy
()
);
pnew
.
SetPID
(
process
::
sibyll
::
ConvertFromSibyll
(
psib
.
GetPID
()
)
);
pnew
.
SetMomentum
(
psib
.
GetMomentum
()
);
}
// empty sibyll stack
ss
.
Clear
();
// remove original particle from stack
p
.
Delete
();
}
}
template
<
typename
Particle
,
typename
Stack
>
template
<
typename
Particle
,
typename
Stack
>
...
...
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