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
dcd26932
Commit
dcd26932
authored
6 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
a bit more cleanup
parent
61770a5f
No related branches found
No related tags found
1 merge request
!39
Resolve "cascade example debugging"
Pipeline
#80
failed
6 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Documentation/Examples/cascade_example.cc
+2
-2
2 additions, 2 deletions
Documentation/Examples/cascade_example.cc
Processes/Sibyll/Interaction.h
+14
-23
14 additions, 23 deletions
Processes/Sibyll/Interaction.h
with
16 additions
and
25 deletions
Documentation/Examples/cascade_example.cc
+
2
−
2
View file @
dcd26932
...
...
@@ -226,12 +226,12 @@ int main() {
// setup particle stack, and add primary particle
setup
::
Stack
stack
;
stack
.
Clear
();
const
EnergyType
E0
=
1
_TeV
;
const
hep
::
EnergyType
E0
=
1
_TeV
;
{
auto
particle
=
stack
.
NewParticle
();
particle
.
SetPID
(
Code
::
Proton
);
hep
::
MomentumType
P0
=
sqrt
(
E0
*
E0
-
0.93827
_GeV
*
0.93827
_GeV
);
auto
plab
=
stack
::
super_stupid
::
MomentumVector
(
rootCS
,
0
.
*
1
_GeV
,
0
.
*
1
_GeV
,
-
P0
);
auto
plab
=
stack
::
super_stupid
::
MomentumVector
(
rootCS
,
0
_GeV
,
0
_GeV
,
-
P0
);
particle
.
SetEnergy
(
E0
);
particle
.
SetMomentum
(
plab
);
particle
.
SetTime
(
0
_ns
);
...
...
This diff is collapsed.
Click to expand it.
Processes/Sibyll/Interaction.h
+
14
−
23
View file @
dcd26932
...
...
@@ -104,7 +104,6 @@ namespace corsika::process::sibyll {
<<
"nucleon mass "
<<
nucleon_mass
<<
std
::
endl
;
// calculate interaction length in medium
GrammageType
int_length
=
kTarget
*
nucleon_mass
/
sig
;
// pick random step lenth
std
::
cout
<<
"Interaction: "
<<
"interaction length (g/cm2): "
<<
int_length
<<
std
::
endl
;
...
...
@@ -112,17 +111,6 @@ namespace corsika::process::sibyll {
}
return
std
::
numeric_limits
<
double
>::
infinity
()
*
1
_g
/
(
1
_cm
*
1
_cm
);
/*
what are the units of the output? slant depth or 3space length?
*/
//
// int a = 0;
// const double next_step = -int_length * log(s_rndm_(a));
// std::cout << "Interaction: "
// << "next step (g/cm2): " << next_step << std::endl;
// return next_step;
}
template
<
typename
Particle
,
typename
Stack
>
...
...
@@ -158,12 +146,11 @@ namespace corsika::process::sibyll {
GetNucleusA
();
// env.GetTargetParticle().GetPID();
// FOR NOW: target is always at rest
const
EnergyType
Etarget
=
0
.
*
1
_GeV
+
corsika
::
particles
::
Proton
::
GetMass
();
const
EnergyType
Etarget
=
0
_GeV
+
corsika
::
particles
::
Proton
::
GetMass
();
const
auto
pTarget
=
MomentumVector
(
rootCS
,
0
_GeV
,
0
_GeV
,
0
_GeV
);
cout
<<
"target momentum (GeV/c): "
<<
pTarget
.
GetComponents
()
/
1
_GeV
*
constants
::
c
<<
endl
;
cout
<<
"beam momentum (GeV/c): "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
*
constants
::
c
<<
endl
;
cout
<<
"target momentum (GeV/c): "
<<
pTarget
.
GetComponents
()
/
1
_GeV
<<
endl
;
cout
<<
"beam momentum (GeV/c): "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
<<
endl
;
cout
<<
"position of interaction: "
<<
pOrig
.
GetCoordinates
()
<<
endl
;
cout
<<
"time: "
<<
tOrig
<<
endl
;
...
...
@@ -181,8 +168,7 @@ namespace corsika::process::sibyll {
// total momentum
MomentumVector
Ptot
=
p
.
GetMomentum
();
// invariant mass, i.e. cm. energy
EnergyType
Ecm
=
sqrt
(
Etot
*
Etot
-
Ptot
.
squaredNorm
());
// sqrt( 2. * E * 0.93827_GeV );
EnergyType
Ecm
=
sqrt
(
Etot
*
Etot
-
Ptot
.
squaredNorm
());
/*
get transformation between Stack-frame and SibStack-frame
for EAS Stack-frame is lab. frame, could be different for CRMC-mode
...
...
@@ -228,7 +214,8 @@ namespace corsika::process::sibyll {
// SibStack does not know about momentum yet so we need counter to access
// momentum array in Sibyll
int
i
=
-
1
;
MomentumVector
Ptot_final
(
rootCS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
MomentumVector
Plab_final
(
rootCS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
EnergyType
E_final
=
0
_GeV
,
Ecm_final
=
0
_GeV
;
for
(
auto
&
psib
:
ss
)
{
++
i
;
// skip particles that have decayed in Sibyll
...
...
@@ -263,10 +250,14 @@ namespace corsika::process::sibyll {
pnew
.
SetMomentum
(
MomentumVector
(
rootCS
,
p_lab_c
));
pnew
.
SetPosition
(
pOrig
);
pnew
.
SetTime
(
tOrig
);
Ptot_final
+=
pnew
.
GetMomentum
();
Plab_final
+=
pnew
.
GetMomentum
();
E_final
+=
en_lab
;
Ecm_final
+=
psib
.
GetEnergy
();
}
// cout << "tot. momentum final (GeV/c): " << Ptot_final.GetComponents() / 1_GeV
// * constants::c << endl;
std
::
cout
<<
"conservation (all GeV): E_final="
<<
E_final
/
1
_GeV
<<
", Ecm_final="
<<
Ecm_final
/
1
_GeV
<<
", Plab_final="
<<
(
Plab_final
/
1
_GeV
).
GetComponents
()
<<
std
::
endl
;
}
}
return
process
::
EProcessReturn
::
eOk
;
...
...
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