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
1762a244
Commit
1762a244
authored
6 years ago
by
Felix Riehn
Browse files
Options
Downloads
Patches
Plain Diff
added SibStack
parent
8bcaef0d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/Examples/cascade_example.cc
+25
-8
25 additions, 8 deletions
Documentation/Examples/cascade_example.cc
Framework/Cascade/SibStack.h
+53
-0
53 additions, 0 deletions
Framework/Cascade/SibStack.h
with
78 additions
and
8 deletions
Documentation/Examples/cascade_example.cc
+
25
−
8
View file @
1762a244
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include
<corsika/random/RNGManager.h>
#include
<corsika/random/RNGManager.h>
#include
<corsika/cascade/sibyll2.3c.h>
#include
<corsika/cascade/sibyll2.3c.h>
#include
<corsika/cascade/SibStack.h>
//#include <corsika/units/PhysicalConstants.h>
//#include <corsika/units/PhysicalConstants.h>
#include
<corsika/units/PhysicalUnits.h>
#include
<corsika/units/PhysicalUnits.h>
...
@@ -103,6 +104,7 @@ public:
...
@@ -103,6 +104,7 @@ public:
*/
*/
// FOR NOW: set target to proton
// FOR NOW: set target to proton
int
kTarget
=
1
;
//p.GetPID();
int
kTarget
=
1
;
//p.GetPID();
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: E(GeV):"
<<
E
/
1
_GeV
<<
" Ecm(GeV): "
<<
Ecm
/
1
_GeV
<<
std
::
endl
;
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: E(GeV):"
<<
E
/
1
_GeV
<<
" Ecm(GeV): "
<<
Ecm
/
1
_GeV
<<
std
::
endl
;
if
(
E
<
8.5
_GeV
||
Ecm
<
10
_GeV
)
{
if
(
E
<
8.5
_GeV
||
Ecm
<
10
_GeV
)
{
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: dropping particle.."
<<
std
::
endl
;
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: dropping particle.."
<<
std
::
endl
;
...
@@ -111,32 +113,45 @@ public:
...
@@ -111,32 +113,45 @@ public:
}
else
{
}
else
{
// Sibyll does not know about units..
// Sibyll does not know about units..
double
sqs
=
Ecm
/
1
_GeV
;
double
sqs
=
Ecm
/
1
_GeV
;
// running sibyll
// running sibyll
, filling stack
sibyll_
(
kBeam
,
kTarget
,
sqs
);
sibyll_
(
kBeam
,
kTarget
,
sqs
);
// running decays
// running decays
//decsib_();
//decsib_();
// print final state
// print final state
int
print_unit
=
6
;
int
print_unit
=
6
;
sib_list_
(
print_unit
);
sib_list_
(
print_unit
);
// delete current particle
// delete current particle
p
.
Delete
();
p
.
Delete
();
// add particles from sibyll to stack
// link to sibyll stack
SibStack
ss
;
/*
get transformation between Stack-frame and SibStack-frame
for EAS Stack-frame is lab. frame, could be different for CRMC-mode
the transformation should be derived from the input momenta
in general transformation is rotation + boost
*/
const
EnergyType
proton_mass
=
0.93827
_GeV
;
const
EnergyType
proton_mass
=
0.93827
_GeV
;
const
double
gamma
=
(
E
+
proton_mass
)
/
(
Ecm
);
const
double
gamma
=
(
E
+
proton_mass
)
/
(
Ecm
);
const
double
gambet
=
sqrt
(
E
*
E
-
proton_mass
*
proton_mass
)
/
Ecm
;
const
double
gambet
=
sqrt
(
E
*
E
-
proton_mass
*
proton_mass
)
/
Ecm
;
// add particles from sibyll to stack
// SibStack does not know about momentum yet so we need counter to access momentum array in Sibyll
for
(
int
i
=
0
;
i
<
s_plist_
.
np
;
++
i
){
int
i
=
-
1
;
for
(
auto
&
p
:
ss
){
++
i
;
//transform to lab. frame, primitve
//transform to lab. frame, primitve
const
double
en_lab
=
gambet
*
s_plist_
.
p
[
2
][
i
]
+
gamma
*
s_plist_
.
p
[
3
][
i
];
const
double
en_lab
=
gambet
*
s_plist_
.
p
[
2
][
i
]
+
gamma
*
p
.
GetEnergy
();
// add to corsika stack
// add to corsika stack
s
.
NewParticle
().
SetEnergy
(
en_lab
*
1
_GeV
);
s
.
NewParticle
().
SetEnergy
(
en_lab
*
1
_GeV
);
}
}
}
}
}
}
void
Init
()
//{ fCount = 0; }
void
Init
()
{
{
fCount
=
0
;
fCount
=
0
;
...
@@ -163,6 +178,7 @@ public:
...
@@ -163,6 +178,7 @@ public:
sibyll_ini_
();
sibyll_ini_
();
// set particles stable / unstable
// set particles stable / unstable
}
}
int
GetCount
()
{
return
fCount
;
}
int
GetCount
()
{
return
fCount
;
}
...
@@ -177,6 +193,7 @@ int main(){
...
@@ -177,6 +193,7 @@ int main(){
const
auto
sequence
=
p0
+
p1
;
const
auto
sequence
=
p0
+
p1
;
setup
::
Stack
stack
;
setup
::
Stack
stack
;
corsika
::
cascade
::
Cascade
EAS
(
sequence
,
stack
);
corsika
::
cascade
::
Cascade
EAS
(
sequence
,
stack
);
stack
.
Clear
();
stack
.
Clear
();
...
...
This diff is collapsed.
Click to expand it.
Framework/Cascade/SibStack.h
0 → 100644
+
53
−
0
View file @
1762a244
#ifndef _include_sibstack_h_
#define _include_sibstack_h_
#include
<vector>
#include
<string>
#include
<corsika/stack/Stack.h>
#include
<corsika/cascade/sibyll2.3c.h>
using
namespace
std
;
using
namespace
corsika
::
stack
;
class
SibStackData
{
public:
void
Init
();
void
Clear
()
{
s_plist_
.
np
=
0
;
}
int
GetSize
()
const
{
return
s_plist_
.
np
-
1
;
}
int
GetCapacity
()
const
{
return
s_plist_
.
np
-
1
;
}
void
SetId
(
const
int
i
,
const
int
v
)
{
s_plist_
.
llist
[
i
]
=
v
;
}
void
SetEnergy
(
const
int
i
,
const
double
v
)
{
s_plist_
.
p
[
3
][
i
]
=
v
;
}
int
GetId
(
const
int
i
)
const
{
return
s_plist_
.
llist
[
i
];
}
double
GetEnergy
(
const
int
i
)
const
{
return
s_plist_
.
p
[
3
][
i
];
}
void
Copy
(
const
int
i1
,
const
int
i2
)
{
s_plist_
.
llist
[
i1
]
=
s_plist_
.
llist
[
i2
];
s_plist_
.
p
[
3
][
i1
]
=
s_plist_
.
p
[
3
][
i2
];
}
protected
:
void
IncrementSize
()
{
s_plist_
.
np
++
;
}
void
DecrementSize
()
{
if
(
s_plist_
.
np
>
0
)
{
s_plist_
.
np
--
;
}
}
};
template
<
typename
StackIteratorInterface
>
class
ParticleInterface
:
public
ParticleBase
<
StackIteratorInterface
>
{
using
ParticleBase
<
StackIteratorInterface
>::
GetStackData
;
using
ParticleBase
<
StackIteratorInterface
>::
GetIndex
;
public:
void
SetEnergy
(
const
double
v
)
{
GetStackData
().
SetEnergy
(
GetIndex
(),
v
);
}
double
GetEnergy
()
const
{
return
GetStackData
().
GetEnergy
(
GetIndex
());
}
};
typedef
Stack
<
SibStackData
,
ParticleInterface
>
SibStack
;
#endif
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