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
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
Pranav Sampathkumar
corsika
Commits
826f0f04
Commit
826f0f04
authored
4 years ago
by
Maximilian Reininghaus
Committed by
Maximilian Reininghaus
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
proper calculation for inclined shower
parent
23db971f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation/Examples/vertical_EAS.cc
+26
-44
26 additions, 44 deletions
Documentation/Examples/vertical_EAS.cc
with
26 additions
and
44 deletions
Documentation/Examples/vertical_EAS.cc
+
26
−
44
View file @
826f0f04
...
@@ -75,8 +75,8 @@ int main(int argc, char** argv) {
...
@@ -75,8 +75,8 @@ int main(int argc, char** argv) {
using
EnvType
=
Environment
<
setup
::
IEnvironmentModel
>
;
using
EnvType
=
Environment
<
setup
::
IEnvironmentModel
>
;
EnvType
env
;
EnvType
env
;
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
Point
const
center
{
rootCS
,
0
_m
,
0
_m
,
0
_m
};
environment
::
LayeredSphericalAtmosphereBuilder
builder
(
Point
{
rootCS
,
0
_m
,
0
_m
,
0
_m
})
;
environment
::
LayeredSphericalAtmosphereBuilder
builder
{
center
}
;
builder
.
setNuclearComposition
(
builder
.
setNuclearComposition
(
{{
particles
::
Code
::
Nitrogen
,
particles
::
Code
::
Oxygen
},
{{
particles
::
Code
::
Nitrogen
,
particles
::
Code
::
Oxygen
},
{
0.7847
f
,
1.
f
-
0.7847
f
}});
// values taken from AIRES manual, Ar removed for now
{
0.7847
f
,
1.
f
-
0.7847
f
}});
// values taken from AIRES manual, Ar removed for now
...
@@ -97,29 +97,31 @@ int main(int argc, char** argv) {
...
@@ -97,29 +97,31 @@ int main(int argc, char** argv) {
unsigned
short
Z
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
unsigned
short
Z
=
std
::
stoi
(
std
::
string
(
argv
[
2
]));
auto
const
mass
=
particles
::
GetNucleusMass
(
A
,
Z
);
auto
const
mass
=
particles
::
GetNucleusMass
(
A
,
Z
);
const
HEPEnergyType
E0
=
1
_GeV
*
std
::
stof
(
std
::
string
(
argv
[
3
]));
const
HEPEnergyType
E0
=
1
_GeV
*
std
::
stof
(
std
::
string
(
argv
[
3
]));
double
theta
=
0.
;
double
theta
=
75.
;
double
phi
=
0.
;
auto
const
thetaRad
=
theta
/
180.
*
M_PI
;
Point
const
injectionPos
(
rootCS
,
0
_m
,
0
_m
,
112.7
_km
+
builder
.
earthRadius
);
// this is the CORSIKA 7 start of atmosphere/universe
// {
auto
elab2plab
=
[](
HEPEnergyType
Elab
,
HEPMassType
m
)
{
auto
elab2plab
=
[](
HEPEnergyType
Elab
,
HEPMassType
m
)
{
return
sqrt
((
Elab
-
m
)
*
(
Elab
+
m
));
return
sqrt
((
Elab
-
m
)
*
(
Elab
+
m
));
};
};
HEPMomentumType
P0
=
elab2plab
(
E0
,
mass
);
HEPMomentumType
P0
=
elab2plab
(
E0
,
mass
);
auto
momentumComponents
=
[](
double
theta
,
double
phi
,
HEPMomentumType
ptot
)
{
auto
momentumComponents
=
[](
double
thetaRad
,
HEPMomentumType
ptot
)
{
return
std
::
make_tuple
(
ptot
*
sin
(
theta
)
*
cos
(
phi
),
ptot
*
sin
(
theta
)
*
sin
(
phi
),
return
std
::
make_tuple
(
ptot
*
sin
(
thetaRad
),
0
_eV
,
-
ptot
*
cos
(
thetaRad
));
-
ptot
*
cos
(
theta
));
};
};
auto
const
[
px
,
py
,
pz
]
=
auto
const
[
px
,
py
,
pz
]
=
momentumComponents
(
theta
/
180.
*
M_PI
,
phi
/
180.
*
M_PI
,
P0
);
momentumComponents
(
theta
Rad
,
P0
);
auto
plab
=
corsika
::
stack
::
MomentumVector
(
rootCS
,
{
px
,
py
,
pz
});
auto
plab
=
corsika
::
stack
::
MomentumVector
(
rootCS
,
{
px
,
py
,
pz
});
cout
<<
"input particle: "
<<
beamCode
<<
endl
;
cout
<<
"input particle: "
<<
beamCode
<<
endl
;
cout
<<
"input angles: theta="
<<
theta
<<
" phi="
<<
phi
<<
endl
;
cout
<<
"input angles: theta="
<<
theta
<<
endl
;
cout
<<
"input momentum: "
<<
plab
.
GetComponents
()
/
1
_GeV
<<
endl
;
cout
<<
"input momentum: "
<<
plab
.
GetComponents
()
/
1
_GeV
<<
", norm = "
<<
plab
.
norm
()
<<
endl
;
auto
const
observationHeight
=
1.4
_km
+
builder
.
earthRadius
;
auto
const
injectionHeight
=
112.75
_km
+
builder
.
earthRadius
;
auto
const
t
=
-
observationHeight
*
cos
(
thetaRad
)
+
sqrt
(
-
si
::
detail
::
static_pow
<
2
>
(
sin
(
thetaRad
)
*
observationHeight
)
+
si
::
detail
::
static_pow
<
2
>
(
injectionHeight
));
Point
const
showerCore
{
rootCS
,
0
_m
,
0
_m
,
observationHeight
};
Point
const
injectionPos
=
showerCore
+
Vector
<
dimensionless_d
>
{
rootCS
,
{
-
sin
(
thetaRad
),
0
,
cos
(
thetaRad
)}}
*
t
;
std
::
cout
<<
"point of injection: "
<<
injectionPos
.
GetCoordinates
()
<<
std
::
endl
;
if
(
A
!=
1
)
{
if
(
A
!=
1
)
{
stack
.
AddParticle
(
std
::
tuple
<
particles
::
Code
,
units
::
si
::
HEPEnergyType
,
stack
.
AddParticle
(
std
::
tuple
<
particles
::
Code
,
units
::
si
::
HEPEnergyType
,
...
@@ -136,10 +138,7 @@ int main(int argc, char** argv) {
...
@@ -136,10 +138,7 @@ int main(int argc, char** argv) {
Line
const
line
(
injectionPos
,
plab
.
normalized
()
*
1
_m
*
1
_Hz
);
Line
const
line
(
injectionPos
,
plab
.
normalized
()
*
1
_m
*
1
_Hz
);
auto
const
velocity
=
line
.
GetV0
().
norm
();
auto
const
velocity
=
line
.
GetV0
().
norm
();
setup
::
Trajectory
const
showerAxis
(
line
,
(
injectionPos
-
showerCore
).
norm
()
/
velocity
);
auto
const
observationHeight
=
1.4
_km
+
builder
.
earthRadius
;
setup
::
Trajectory
const
showerAxis
(
line
,
(
112.7
_km
-
observationHeight
)
/
velocity
);
// setup processes, decays and interactions
// setup processes, decays and interactions
...
@@ -152,32 +151,14 @@ int main(int argc, char** argv) {
...
@@ -152,32 +151,14 @@ int main(int argc, char** argv) {
process
::
pythia
::
Decay
decayPythia
;
process
::
pythia
::
Decay
decayPythia
;
// use sibyll decay routine for decays of particles unknown to pythia
// use sibyll decay routine for decays of particles unknown to pythia
process
::
sibyll
::
Decay
decaySibyll
({
process
::
sibyll
::
Decay
decaySibyll
;
Code
::
N1440Plus
,
Code
::
N1440MinusBar
,
Code
::
N1440_0
,
Code
::
N1440_0Bar
,
Code
::
N1710Plus
,
Code
::
N1710MinusBar
,
Code
::
N1710_0
,
Code
::
N1710_0Bar
,
Code
::
Pi1300Plus
,
Code
::
Pi1300Minus
,
Code
::
Pi1300_0
,
Code
::
KStar0_1430_0
,
Code
::
KStar0_1430_0Bar
,
Code
::
KStar0_1430_Plus
,
Code
::
KStar0_1430_MinusBar
,
});
decaySibyll
.
PrintDecayConfig
();
decaySibyll
.
PrintDecayConfig
();
process
::
particle_cut
::
ParticleCut
cut
(
10
0
_GeV
)
;
process
::
particle_cut
::
ParticleCut
cut
{
6
0
_GeV
}
;
process
::
energy_loss
::
EnergyLoss
eLoss
(
showerAxis
);
process
::
energy_loss
::
EnergyLoss
eLoss
(
showerAxis
);
Plane
const
obsPlane
(
Point
(
rootCS
,
0
_m
,
0
_m
,
observationHeight
)
,
Plane
const
obsPlane
(
showerCore
,
Vector
<
dimensionless_d
>
(
rootCS
,
{
0.
,
0.
,
1.
}));
Vector
<
dimensionless_d
>
(
rootCS
,
{
0.
,
0.
,
1.
}));
process
::
observation_plane
::
ObservationPlane
observationLevel
(
obsPlane
,
process
::
observation_plane
::
ObservationPlane
observationLevel
(
obsPlane
,
"particles.dat"
);
"particles.dat"
);
...
@@ -185,9 +166,10 @@ int main(int argc, char** argv) {
...
@@ -185,9 +166,10 @@ int main(int argc, char** argv) {
// assemble all processes into an ordered process list
// assemble all processes into an ordered process list
process
::
UrQMD
::
UrQMD
urqmd
;
process
::
UrQMD
::
UrQMD
urqmd
;
process
::
interaction_counter
::
InteractionCounter
urqmdCounted
{
urqmd
};
auto
sibyllSequence
=
sibyllNucCounted
<<
sibyllCounted
;
auto
sibyllSequence
=
sibyllNucCounted
<<
sibyllCounted
;
process
::
switch_process
::
SwitchProcess
switchProcess
(
urqmd
,
sibyllSequence
,
55
_GeV
);
process
::
switch_process
::
SwitchProcess
switchProcess
(
urqmd
Counted
,
sibyllSequence
,
55
_GeV
);
auto
decaySequence
=
decayPythia
<<
decaySibyll
;
auto
decaySequence
=
decayPythia
<<
decaySibyll
;
auto
sequence
=
switchProcess
<<
decaySequence
<<
eLoss
<<
cut
<<
observationLevel
;
auto
sequence
=
switchProcess
<<
decaySequence
<<
eLoss
<<
cut
<<
observationLevel
;
...
@@ -212,10 +194,10 @@ int main(int argc, char** argv) {
...
@@ -212,10 +194,10 @@ int main(int argc, char** argv) {
cout
<<
"total dEdX energy (GeV): "
<<
eLoss
.
GetTotal
()
/
1
_GeV
<<
endl
cout
<<
"total dEdX energy (GeV): "
<<
eLoss
.
GetTotal
()
/
1
_GeV
<<
endl
<<
"relative difference (%): "
<<
eLoss
.
GetTotal
()
/
E0
*
100
<<
endl
;
<<
"relative difference (%): "
<<
eLoss
.
GetTotal
()
/
E0
*
100
<<
endl
;
auto
const
hists
=
sibyllCounted
.
GetHistogram
()
+
sibyllNucCounted
.
GetHistogram
();
auto
const
hists
=
sibyllCounted
.
GetHistogram
()
+
sibyllNucCounted
.
GetHistogram
()
+
urqmdCounted
.
GetHistogram
()
;
hists
.
saveLab
(
"inthist_lab.txt"
);
hists
.
saveLab
(
"inthist_lab.txt"
);
hists
.
saveCMS
(
"inthist_cms.txt"
);
hists
.
saveCMS
(
"inthist_cms.txt"
);
std
::
ofstream
finish
(
"finished"
);
std
::
ofstream
finish
(
"finished"
);
finish
<<
"run completed without error"
<<
std
::
endl
;
finish
<<
"run completed without error"
<<
std
::
endl
;
}
}
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