IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
corsika
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Antonio Augusto Alves Junior
corsika
Commits
1927ca9c
Commit
1927ca9c
authored
6 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
a bit more cleanup
parent
813a49b9
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
+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 @
1927ca9c
...
@@ -226,12 +226,12 @@ int main() {
...
@@ -226,12 +226,12 @@ int main() {
// 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
EnergyType
E0
=
1
_TeV
;
const
hep
::
EnergyType
E0
=
1
_TeV
;
{
{
auto
particle
=
stack
.
NewParticle
();
auto
particle
=
stack
.
NewParticle
();
particle
.
SetPID
(
Code
::
Proton
);
particle
.
SetPID
(
Code
::
Proton
);
hep
::
MomentumType
P0
=
sqrt
(
E0
*
E0
-
0.93827
_GeV
*
0.93827
_GeV
);
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
.
SetEnergy
(
E0
);
particle
.
SetMomentum
(
plab
);
particle
.
SetMomentum
(
plab
);
particle
.
SetTime
(
0
_ns
);
particle
.
SetTime
(
0
_ns
);
...
...
This diff is collapsed.
Click to expand it.
Processes/Sibyll/Interaction.h
+
14
−
23
View file @
1927ca9c
...
@@ -104,7 +104,6 @@ namespace corsika::process::sibyll {
...
@@ -104,7 +104,6 @@ namespace corsika::process::sibyll {
<<
"nucleon mass "
<<
nucleon_mass
<<
std
::
endl
;
<<
"nucleon mass "
<<
nucleon_mass
<<
std
::
endl
;
// calculate interaction length in medium
// calculate interaction length in medium
GrammageType
int_length
=
kTarget
*
nucleon_mass
/
sig
;
GrammageType
int_length
=
kTarget
*
nucleon_mass
/
sig
;
// pick random step lenth
std
::
cout
<<
"Interaction: "
std
::
cout
<<
"Interaction: "
<<
"interaction length (g/cm2): "
<<
int_length
<<
std
::
endl
;
<<
"interaction length (g/cm2): "
<<
int_length
<<
std
::
endl
;
...
@@ -112,17 +111,6 @@ namespace corsika::process::sibyll {
...
@@ -112,17 +111,6 @@ namespace corsika::process::sibyll {
}
}
return
std
::
numeric_limits
<
double
>::
infinity
()
*
1
_g
/
(
1
_cm
*
1
_cm
);
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
>
template
<
typename
Particle
,
typename
Stack
>
...
@@ -158,12 +146,11 @@ namespace corsika::process::sibyll {
...
@@ -158,12 +146,11 @@ namespace corsika::process::sibyll {
GetNucleusA
();
// env.GetTargetParticle().GetPID();
GetNucleusA
();
// env.GetTargetParticle().GetPID();
// FOR NOW: target is always at rest
// 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
);
const
auto
pTarget
=
MomentumVector
(
rootCS
,
0
_GeV
,
0
_GeV
,
0
_GeV
);
cout
<<
"target momentum (GeV/c): "
cout
<<
"target momentum (GeV/c): "
<<
pTarget
.
GetComponents
()
/
1
_GeV
<<
endl
;
<<
pTarget
.
GetComponents
()
/
1
_GeV
*
constants
::
c
<<
endl
;
cout
<<
"beam momentum (GeV/c): "
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
cout
<<
"beam momentum (GeV/c): "
<<
endl
;
<<
p
.
GetMomentum
().
GetComponents
()
/
1
_GeV
*
constants
::
c
<<
endl
;
cout
<<
"position of interaction: "
<<
pOrig
.
GetCoordinates
()
<<
endl
;
cout
<<
"position of interaction: "
<<
pOrig
.
GetCoordinates
()
<<
endl
;
cout
<<
"time: "
<<
tOrig
<<
endl
;
cout
<<
"time: "
<<
tOrig
<<
endl
;
...
@@ -181,8 +168,7 @@ namespace corsika::process::sibyll {
...
@@ -181,8 +168,7 @@ namespace corsika::process::sibyll {
// total momentum
// total momentum
MomentumVector
Ptot
=
p
.
GetMomentum
();
MomentumVector
Ptot
=
p
.
GetMomentum
();
// invariant mass, i.e. cm. energy
// invariant mass, i.e. cm. energy
EnergyType
Ecm
=
EnergyType
Ecm
=
sqrt
(
Etot
*
Etot
-
Ptot
.
squaredNorm
());
sqrt
(
Etot
*
Etot
-
Ptot
.
squaredNorm
());
// sqrt( 2. * E * 0.93827_GeV );
/*
/*
get transformation between Stack-frame and SibStack-frame
get transformation between Stack-frame and SibStack-frame
for EAS Stack-frame is lab. frame, could be different for CRMC-mode
for EAS Stack-frame is lab. frame, could be different for CRMC-mode
...
@@ -228,7 +214,8 @@ namespace corsika::process::sibyll {
...
@@ -228,7 +214,8 @@ namespace corsika::process::sibyll {
// SibStack does not know about momentum yet so we need counter to access
// SibStack does not know about momentum yet so we need counter to access
// momentum array in Sibyll
// momentum array in Sibyll
int
i
=
-
1
;
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
)
{
for
(
auto
&
psib
:
ss
)
{
++
i
;
++
i
;
// skip particles that have decayed in Sibyll
// skip particles that have decayed in Sibyll
...
@@ -263,10 +250,14 @@ namespace corsika::process::sibyll {
...
@@ -263,10 +250,14 @@ namespace corsika::process::sibyll {
pnew
.
SetMomentum
(
MomentumVector
(
rootCS
,
p_lab_c
));
pnew
.
SetMomentum
(
MomentumVector
(
rootCS
,
p_lab_c
));
pnew
.
SetPosition
(
pOrig
);
pnew
.
SetPosition
(
pOrig
);
pnew
.
SetTime
(
tOrig
);
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
std
::
cout
<<
"conservation (all GeV): E_final="
<<
E_final
/
1
_GeV
// * constants::c << endl;
<<
", Ecm_final="
<<
Ecm_final
/
1
_GeV
<<
", Plab_final="
<<
(
Plab_final
/
1
_GeV
).
GetComponents
()
<<
std
::
endl
;
}
}
}
}
return
process
::
EProcessReturn
::
eOk
;
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