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
6fb12887
Commit
6fb12887
authored
4 years ago
by
ralfulrich
Browse files
Options
Downloads
Patches
Plain Diff
fixed failing tests
parent
9d7f4bf5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Documentation/Examples/hybrid_MC.cc
+36
-36
36 additions, 36 deletions
Documentation/Examples/hybrid_MC.cc
Processes/QGSJetII/testQGSJetII.cc
+1
-1
1 addition, 1 deletion
Processes/QGSJetII/testQGSJetII.cc
Processes/Sibyll/testSibyll.cc
+3
-3
3 additions, 3 deletions
Processes/Sibyll/testSibyll.cc
with
40 additions
and
40 deletions
Documentation/Examples/hybrid_MC.cc
+
36
−
36
View file @
6fb12887
...
@@ -22,18 +22,19 @@
...
@@ -22,18 +22,19 @@
#include
<corsika/geometry/Sphere.h>
#include
<corsika/geometry/Sphere.h>
#include
<corsika/logging/Logging.h>
#include
<corsika/logging/Logging.h>
#include
<corsika/process/ProcessSequence.h>
#include
<corsika/process/ProcessSequence.h>
#include
<corsika/process/SwitchProcessSequence.h>
#include
<corsika/process/StackProcess.h>
#include
<corsika/process/StackProcess.h>
#include
<corsika/process/conex_source_cut/CONEXSourceCut.h>
#include
<corsika/process/energy_loss/EnergyLoss.h>
#include
<corsika/process/energy_loss/EnergyLoss.h>
#include
<corsika/process/longitudinal_profile/LongitudinalProfile.h>
#include
<corsika/process/longitudinal_profile/LongitudinalProfile.h>
#include
<corsika/process/observation_plane/ObservationPlane.h>
#include
<corsika/process/observation_plane/ObservationPlane.h>
#include
<corsika/process/on_shell_check/OnShellCheck.h>
#include
<corsika/process/on_shell_check/OnShellCheck.h>
#include
<corsika/process/energy_loss/EnergyLoss.h>
#include
<corsika/process/particle_cut/ParticleCut.h>
#include
<corsika/process/particle_cut/ParticleCut.h>
#include
<corsika/process/pythia/Decay.h>
#include
<corsika/process/pythia/Decay.h>
#include
<corsika/process/sibyll/Decay.h>
#include
<corsika/process/sibyll/Decay.h>
#include
<corsika/process/sibyll/Interaction.h>
#include
<corsika/process/sibyll/Interaction.h>
#include
<corsika/process/sibyll/NuclearInteraction.h>
#include
<corsika/process/sibyll/NuclearInteraction.h>
#include
<corsika/process/switch_process/SwitchProcess.h>
#include
<corsika/process/conex_source_cut/CONEXSourceCut.h>
#include
<corsika/process/tracking_line/TrackingLine.h>
#include
<corsika/process/tracking_line/TrackingLine.h>
#include
<corsika/process/urqmd/UrQMD.h>
#include
<corsika/process/urqmd/UrQMD.h>
#include
<corsika/random/RNGManager.h>
#include
<corsika/random/RNGManager.h>
...
@@ -73,16 +74,17 @@ void registerRandomStreams(const int seed) {
...
@@ -73,16 +74,17 @@ void registerRandomStreams(const int seed) {
}
}
template
<
typename
T
>
template
<
typename
T
>
using
MyExtraEnv
=
environment
::
MediumPropertyModel
<
environment
::
UniformMagneticField
<
T
>>
;
using
MEnv
=
environment
::
UniformMediumType
<
environment
::
UniformMagneticField
<
T
>>
;
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
logging
::
SetLevel
(
logging
::
level
::
info
);
logging
::
SetLevel
(
logging
::
level
::
info
);
C8LOG_INFO
(
"
hybrid_MC
"
);
C8LOG_INFO
(
"
vertical_EAS
"
);
if
(
argc
<
4
)
{
if
(
argc
<
4
)
{
std
::
cerr
<<
"usage:
hybrid_MC
<A> <Z> <energy/GeV> [seed]"
<<
std
::
endl
;
std
::
cerr
<<
"usage:
vertical_EAS
<A> <Z> <energy/GeV> [seed]"
<<
std
::
endl
;
std
::
cerr
<<
" if no seed is given, a random seed is chosen"
<<
std
::
endl
;
std
::
cerr
<<
" if no seed is given, a random seed is chosen"
<<
std
::
endl
;
return
1
;
return
1
;
}
}
...
@@ -98,20 +100,26 @@ int main(int argc, char** argv) {
...
@@ -98,20 +100,26 @@ int main(int argc, char** argv) {
EnvType
env
;
EnvType
env
;
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
const
CoordinateSystem
&
rootCS
=
env
.
GetCoordinateSystem
();
Point
const
center
{
rootCS
,
0
_m
,
0
_m
,
0
_m
};
Point
const
center
{
rootCS
,
0
_m
,
0
_m
,
0
_m
};
auto
builder
=
environment
::
make_layered_spherical_atmosphere_builder
<
environment
::
LayeredSphericalAtmosphereBuilder
<
setup
::
EnvironmentInterface
>
builder
{
center
};
setup
::
EnvironmentInterface
,
MyExtraEnv
>::
create
(
center
,
units
::
constants
::
EarthRadius
::
Mean
,
environment
::
Medium
::
AirDry1Atm
,
geometry
::
Vector
{
rootCS
,
0
_T
,
0
_T
,
1
_T
});
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
builder
.
addExponentialLayer
(
1222.6562
_g
/
(
1
_cm
*
1
_cm
),
994186.38
_cm
,
4
_km
);
builder
.
addExponentialLayer
<
MEnv
>
(
1222.6562
_g
/
(
1
_cm
*
1
_cm
),
994186.38
_cm
,
4
_km
,
builder
.
addExponentialLayer
(
1144.9069
_g
/
(
1
_cm
*
1
_cm
),
878153.55
_cm
,
10
_km
);
environment
::
EMediumType
::
eAir
,
builder
.
addExponentialLayer
(
1305.5948
_g
/
(
1
_cm
*
1
_cm
),
636143.04
_cm
,
40
_km
);
geometry
::
Vector
(
rootCS
,
0
_T
,
0
_T
,
1
_T
));
builder
.
addExponentialLayer
(
540.1778
_g
/
(
1
_cm
*
1
_cm
),
772170.16
_cm
,
100
_km
);
builder
.
addExponentialLayer
<
MEnv
>
(
1144.9069
_g
/
(
1
_cm
*
1
_cm
),
878153.55
_cm
,
10
_km
,
builder
.
addLinearLayer
(
1e9
_cm
,
112.8
_km
);
environment
::
EMediumType
::
eAir
,
geometry
::
Vector
(
rootCS
,
0
_T
,
0
_T
,
1
_T
));
builder
.
addExponentialLayer
<
MEnv
>
(
1305.5948
_g
/
(
1
_cm
*
1
_cm
),
636143.04
_cm
,
40
_km
,
environment
::
EMediumType
::
eAir
,
geometry
::
Vector
(
rootCS
,
0
_T
,
0
_T
,
1
_T
));
builder
.
addExponentialLayer
<
MEnv
>
(
540.1778
_g
/
(
1
_cm
*
1
_cm
),
772170.16
_cm
,
100
_km
,
environment
::
EMediumType
::
eAir
,
geometry
::
Vector
(
rootCS
,
0
_T
,
0
_T
,
1
_T
));
builder
.
addLinearLayer
<
MEnv
>
(
1e9
_cm
,
112.8
_km
,
environment
::
EMediumType
::
eAir
,
geometry
::
Vector
(
rootCS
,
0
_T
,
0
_T
,
1
_T
));
builder
.
assemble
(
env
);
builder
.
assemble
(
env
);
// setup particle stack, and add primary particle
// setup particle stack, and add primary particle
...
@@ -223,23 +231,14 @@ int main(int argc, char** argv) {
...
@@ -223,23 +231,14 @@ int main(int argc, char** argv) {
process
::
interaction_counter
::
InteractionCounter
urqmdCounted
{
urqmd
};
process
::
interaction_counter
::
InteractionCounter
urqmdCounted
{
urqmd
};
// assemble all processes into an ordered process list
// assemble all processes into an ordered process list
struct
EnergySwitch
{
HEPEnergyType
cutE_
;
auto
sibyllSequence
=
sibyllNucCounted
<<
sibyllCounted
;
EnergySwitch
(
HEPEnergyType
cutE
)
process
::
switch_process
::
SwitchProcess
switchProcess
(
urqmdCounted
,
sibyllSequence
,
:
cutE_
(
cutE
)
{}
55
_GeV
);
process
::
SwitchResult
operator
()(
const
setup
::
Stack
::
ParticleType
&
p
)
{
auto
decaySequence
=
decayPythia
<<
decaySibyll
;
if
(
p
.
GetEnergy
()
<
cutE_
)
return
process
::
SwitchResult
::
First
;
auto
sequence
=
switchProcess
<<
reset_particle_mass
<<
decaySequence
else
<<
eLoss
<<
cut
<<
conex
<<
longprof
<<
observationLevel
;
return
process
::
SwitchResult
::
Second
;
}
};
auto
hadronSequence
=
process
::
select
(
urqmdCounted
,
process
::
sequence
(
sibyllNucCounted
,
sibyllCounted
),
EnergySwitch
(
55
_GeV
));
auto
decaySequence
=
process
::
sequence
(
decayPythia
,
decaySibyll
);
auto
sequence
=
process
::
sequence
(
hadronSequence
,
reset_particle_mass
,
decaySequence
,
eLoss
,
cut
,
conex
,
longprof
,
observationLevel
);
// define air shower object, run simulation
// define air shower object, run simulation
tracking_line
::
TrackingLine
tracking
;
tracking_line
::
TrackingLine
tracking
;
...
@@ -252,21 +251,22 @@ int main(int argc, char** argv) {
...
@@ -252,21 +251,22 @@ int main(int argc, char** argv) {
EAS
.
Run
();
EAS
.
Run
();
cut
.
ShowResults
();
cut
.
ShowResults
();
eLoss
.
s
howResults
();
//
eLoss.
S
howResults();
observationLevel
.
ShowResults
();
observationLevel
.
ShowResults
();
const
HEPEnergyType
Efinal
=
cut
.
GetCutEnergy
()
+
cut
.
GetInvEnergy
()
+
const
HEPEnergyType
Efinal
=
cut
.
GetCutEnergy
()
+
cut
.
GetInvEnergy
()
+
cut
.
GetEmEnergy
()
+
eLoss
.
e
nergyLost
()
+
cut
.
GetEmEnergy
()
+
//
eLoss.
GetE
nergyLost() +
observationLevel
.
GetEnergyGround
();
observationLevel
.
GetEnergyGround
();
cout
<<
"total cut energy (GeV): "
<<
Efinal
/
1
_GeV
<<
endl
cout
<<
"total cut energy (GeV): "
<<
Efinal
/
1
_GeV
<<
endl
<<
"relative difference (%): "
<<
(
Efinal
/
E0
-
1
)
*
100
<<
endl
;
<<
"relative difference (%): "
<<
(
Efinal
/
E0
-
1
)
*
100
<<
endl
;
observationLevel
.
Reset
();
observationLevel
.
Reset
();
cut
.
Reset
();
cut
.
Reset
();
eLoss
.
r
eset
();
//
eLoss.
R
eset();
//conex.addParticle(0, E0, 0_eV, emPosition, momentum.normalized(), 0_s);
conex
.
SolveCE
();
conex
.
SolveCE
();
auto
const
hists
=
sibyllCounted
.
GetHistogram
()
+
sibyllNucCounted
.
GetHistogram
()
+
auto
const
hists
=
sibyllCounted
.
GetHistogram
()
+
sibyllNucCounted
.
GetHistogram
()
+
urqmdCounted
.
GetHistogram
();
urqmdCounted
.
GetHistogram
();
hists
.
saveLab
(
"inthist_lab.txt"
);
hists
.
saveLab
(
"inthist_lab.txt"
);
hists
.
saveCMS
(
"inthist_cms.txt"
);
hists
.
saveCMS
(
"inthist_cms.txt"
);
...
...
This diff is collapsed.
Click to expand it.
Processes/QGSJetII/testQGSJetII.cc
+
1
−
1
View file @
6fb12887
...
@@ -137,7 +137,7 @@ TEST_CASE("QgsjetIIInterface", "[processes]") {
...
@@ -137,7 +137,7 @@ TEST_CASE("QgsjetIIInterface", "[processes]") {
Interaction
model
;
Interaction
model
;
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
*
secViewPtr
);
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
view
);
[[
maybe_unused
]]
const
GrammageType
length
=
model
.
GetInteractionLength
(
particle
);
[[
maybe_unused
]]
const
GrammageType
length
=
model
.
GetInteractionLength
(
particle
);
CHECK
(
length
/
(
1
_g
/
square
(
1
_cm
))
==
Approx
(
93.04
).
margin
(
0.1
));
CHECK
(
length
/
(
1
_g
/
square
(
1
_cm
))
==
Approx
(
93.04
).
margin
(
0.1
));
...
...
This diff is collapsed.
Click to expand it.
Processes/Sibyll/testSibyll.cc
+
3
−
3
View file @
6fb12887
...
@@ -115,8 +115,8 @@ TEST_CASE("SibyllInterface", "[processes]") {
...
@@ -115,8 +115,8 @@ TEST_CASE("SibyllInterface", "[processes]") {
Interaction
model
;
Interaction
model
;
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
*
view
);
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
view
);
auto
const
pSum
=
sumMomentum
(
*
view
,
cs
);
auto
const
pSum
=
sumMomentum
(
view
,
cs
);
/*
/*
Interactions between hadrons (h) and nuclei (A) in Sibyll are treated in the
Interactions between hadrons (h) and nuclei (A) in Sibyll are treated in the
...
@@ -195,7 +195,7 @@ TEST_CASE("SibyllInterface", "[processes]") {
...
@@ -195,7 +195,7 @@ TEST_CASE("SibyllInterface", "[processes]") {
Interaction
hmodel
;
Interaction
hmodel
;
NuclearInteraction
model
(
hmodel
,
*
env
);
NuclearInteraction
model
(
hmodel
,
*
env
);
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
*
view
);
[[
maybe_unused
]]
const
process
::
EProcessReturn
ret
=
model
.
DoInteraction
(
view
);
[[
maybe_unused
]]
const
GrammageType
length
=
model
.
GetInteractionLength
(
particle
);
[[
maybe_unused
]]
const
GrammageType
length
=
model
.
GetInteractionLength
(
particle
);
CHECK
(
length
/
1
_g
*
1
_cm
*
1
_cm
==
Approx
(
44.2
).
margin
(
.1
));
CHECK
(
length
/
1
_g
*
1
_cm
*
1
_cm
==
Approx
(
44.2
).
margin
(
.1
));
CHECK
(
view
.
getSize
()
==
11
);
CHECK
(
view
.
getSize
()
==
11
);
...
...
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