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
0cf01bf1
Commit
0cf01bf1
authored
4 years ago
by
Maximilian Reininghaus
Browse files
Options
Downloads
Patches
Plain Diff
more sophisticated histogramming
parent
0984481d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Stack/History/HistoryObservationPlane.cpp
+14
-10
14 additions, 10 deletions
Stack/History/HistoryObservationPlane.cpp
Stack/History/HistoryObservationPlane.hpp
+7
-4
7 additions, 4 deletions
Stack/History/HistoryObservationPlane.hpp
with
21 additions
and
14 deletions
Stack/History/HistoryObservationPlane.cpp
+
14
−
10
View file @
0cf01bf1
...
...
@@ -11,7 +11,8 @@
#include
<boost/histogram/ostream.hpp>
#include
<fstream>
#include
<iomanip>
#include
<iostream>
using
namespace
corsika
::
units
::
si
;
using
namespace
corsika
::
history
;
...
...
@@ -65,17 +66,20 @@ LengthType HistoryObservationPlane::MaxStepLength(setup::Stack::ParticleType con
void
HistoryObservationPlane
::
fillHistoryHistogram
(
setup
::
Stack
::
ParticleType
const
&
muon
)
{
// double const muonEnergy = muon.GetEnergy() / 1_eV;
// auto parent = stack_.at(muon.GetEvent()->projectileIndex());
Event
const
*
event
=
muon
.
GetEvent
().
get
();
double
const
muon_energy
=
muon
.
GetEnergy
()
/
1
_GeV
;
int
intCounter
=
0
;
int
genctr
{
0
};
Event
const
*
event
=
muon
.
GetEvent
().
get
();
while
(
event
)
{
if
(
event
->
eventType
()
==
EventType
::
Interaction
)
intCounter
++
;
event
=
event
->
parentEvent
().
get
();
auto
const
projectile
=
stack_
.
cfirst
()
+
event
->
projectileIndex
();
if
(
event
->
eventType
()
==
EventType
::
Interaction
)
{
genctr
++
;
double
const
projEnergy
=
projectile
.
GetEnergy
()
/
1
_GeV
;
int
const
pdg
=
static_cast
<
int
>
(
particles
::
GetPDG
(
projectile
.
GetPID
()));
histogram_
(
muon_energy
,
projEnergy
,
pdg
);
}
event
=
event
->
parentEvent
().
get
();
// projectile.GetEvent().get();
}
histogram_
(
intCounter
);
}
void
HistoryObservationPlane
::
print
()
{
C8LOG_INFO
(
histogram_
);
}
This diff is collapsed.
Click to expand it.
Stack/History/HistoryObservationPlane.hpp
+
7
−
4
View file @
0cf01bf1
...
...
@@ -23,9 +23,12 @@ namespace corsika::history {
inline
auto
hist_factory
()
{
namespace
bh
=
boost
::
histogram
;
namespace
bha
=
bh
::
axis
;
auto
h
=
bh
::
make_histogram
(
bha
::
integer
<
int
,
bh
::
use_default
,
bha
::
option
::
growth_t
>
{
0
,
10
,
"hadronic generation"
});
auto
h
=
bh
::
make_histogram
(
bha
::
regular
<
float
,
bha
::
transform
::
log
>
{
11
*
5
,
1e0
,
1e11
,
"muon energy"
},
bha
::
regular
<
float
,
bha
::
transform
::
log
>
{
11
*
5
,
1e0
,
1e11
,
"projectile energy"
},
bha
::
category
<
int
,
bh
::
use_default
,
bha
::
option
::
growth_t
>
{
{
211
,
-
211
,
2212
,
-
2212
},
"projectile PDG"
});
return
h
;
}
}
// namespace detail
...
...
@@ -43,7 +46,7 @@ namespace corsika::history {
corsika
::
setup
::
Stack
::
ParticleType
const
&
vParticle
,
corsika
::
setup
::
Trajectory
const
&
vTrajectory
);
void
print
();
auto
const
&
histogram
()
const
{
return
histogram_
;
}
private
:
void
fillHistoryHistogram
(
setup
::
Stack
::
ParticleType
const
&
);
...
...
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