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
dc17fba5
Commit
dc17fba5
authored
4 years ago
by
ralfulrich
Committed by
Maximilian Reininghaus
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
improved class doc
parent
4756a808
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
Processes/LongitudinalProfile/LongitudinalProfile.cc
+7
-4
7 additions, 4 deletions
Processes/LongitudinalProfile/LongitudinalProfile.cc
Processes/LongitudinalProfile/LongitudinalProfile.h
+27
-13
27 additions, 13 deletions
Processes/LongitudinalProfile/LongitudinalProfile.h
with
34 additions
and
17 deletions
Processes/LongitudinalProfile/LongitudinalProfile.cc
+
7
−
4
View file @
dc17fba5
...
...
@@ -25,8 +25,10 @@ using Track = Trajectory;
using
namespace
corsika
::
process
::
longitudinal_profile
;
using
namespace
corsika
::
units
::
si
;
LongitudinalProfile
::
LongitudinalProfile
(
environment
::
ShowerAxis
const
&
shower_axis
)
:
shower_axis_
{
shower_axis
}
LongitudinalProfile
::
LongitudinalProfile
(
environment
::
ShowerAxis
const
&
shower_axis
,
units
::
si
::
GrammageType
dX
)
:
dX_
(
dX
)
,
shower_axis_
{
shower_axis
}
,
profiles_
{
static_cast
<
unsigned
int
>
(
shower_axis
.
maximumX
()
/
dX_
)
+
1
}
{}
template
<
>
...
...
@@ -59,13 +61,14 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons
return
corsika
::
process
::
EProcessReturn
::
eOk
;
}
void
LongitudinalProfile
::
save
(
std
::
string
const
&
filename
)
{
void
LongitudinalProfile
::
save
(
std
::
string
const
&
filename
,
const
int
width
,
const
int
precision
)
{
std
::
ofstream
f
{
filename
};
f
<<
"# X / g·cm¯², gamma, e+, e-, mu+, mu-, all hadrons"
<<
std
::
endl
;
for
(
size_t
b
=
0
;
b
<
profiles_
.
size
();
++
b
)
{
f
<<
std
::
setprecision
(
5
)
<<
std
::
setw
(
11
)
<<
b
*
(
dX_
/
(
1
_g
/
1
_cm
/
1
_cm
));
for
(
auto
const
&
N
:
profiles_
.
at
(
b
))
{
f
<<
std
::
setw
(
width
_
)
<<
std
::
setprecision
(
precision
_
)
<<
std
::
scientific
<<
N
;
f
<<
std
::
setw
(
width
)
<<
std
::
setprecision
(
precision
)
<<
std
::
scientific
<<
N
;
}
f
<<
std
::
endl
;
}
...
...
This diff is collapsed.
Click to expand it.
Processes/LongitudinalProfile/LongitudinalProfile.h
+
27
−
13
View file @
dc17fba5
...
...
@@ -20,27 +20,44 @@
namespace
corsika
::
process
::
longitudinal_profile
{
/**
* /class Longitudinal_Profile
*
* is a ContinuousProcess, which is constructed from a ShowerAxis
* object, and a dX in units of g/cm2
* (corsika::units::si::GrammageType). The shower axis can convert
* location in the shower into a projected grammage along the shower
* axis.
*
* LongitudinalProfile does then convert each single Track of the
* simulation into a projected grammage range and counts for
* different particle species when they cross dX (default: 10g/cm2)
* boundaries.
*
**/
class
LongitudinalProfile
:
public
corsika
::
process
::
ContinuousProcess
<
LongitudinalProfile
>
{
public:
LongitudinalProfile
(
environment
::
ShowerAxis
const
&
);
LongitudinalProfile
(
environment
::
ShowerAxis
const
&
,
units
::
si
::
GrammageType
dX
=
std
::
invoke
([]()
{
using
namespace
units
::
si
;
return
10
_g
/
square
(
1
_cm
);
}));
// profile binning);
template
<
typename
Particle
,
typename
Track
>
corsika
::
process
::
EProcessReturn
DoContinuous
(
Particle
const
&
,
Track
const
&
);
template
<
typename
T
Particle
,
typename
T
Track
>
corsika
::
process
::
EProcessReturn
DoContinuous
(
T
Particle
const
&
,
T
Track
const
&
);
template
<
typename
Particle
,
typename
Track
>
corsika
::
units
::
si
::
LengthType
MaxStepLength
(
Particle
const
&
,
Track
const
&
)
{
template
<
typename
T
Particle
,
typename
T
Track
>
corsika
::
units
::
si
::
LengthType
MaxStepLength
(
T
Particle
const
&
,
T
Track
const
&
)
{
return
units
::
si
::
meter
*
std
::
numeric_limits
<
double
>::
infinity
();
}
void
save
(
std
::
string
const
&
);
void
save
(
std
::
string
const
&
,
int
const
width
=
14
,
int
const
precision
=
6
);
private
:
units
::
si
::
GrammageType
const
dX_
=
std
::
invoke
([]()
{
using
namespace
units
::
si
;
return
10
_g
/
square
(
1
_cm
);
});
// profile binning
units
::
si
::
GrammageType
const
dX_
;
environment
::
ShowerAxis
const
&
shower_axis_
;
using
ProfileEntry
=
std
::
array
<
uint32_t
,
6
>
;
...
...
@@ -53,9 +70,6 @@ namespace corsika::process::longitudinal_profile {
Hadron
=
5
};
std
::
vector
<
ProfileEntry
>
profiles_
;
// longitudinal profile
static
int
const
width_
=
14
;
static
int
const
precision_
=
6
;
};
}
// namespace corsika::process::longitudinal_profile
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