IAP GITLAB
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
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
Model registry
Operate
Environments
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
Air Shower Physics
corsika
Commits
eb1267f2
Commit
eb1267f2
authored
5 years ago
by
Maximilian Reininghaus
Committed by
Felix Riehn
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
coding style
parent
d687a903
No related branches found
No related tags found
1 merge request
!115
Resolve "create ParticleCut process"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Processes/ParticleCut/ParticleCut.cc
+12
-25
12 additions, 25 deletions
Processes/ParticleCut/ParticleCut.cc
Processes/ParticleCut/ParticleCut.h
+11
-15
11 additions, 15 deletions
Processes/ParticleCut/ParticleCut.h
with
23 additions
and
40 deletions
Processes/ParticleCut/ParticleCut.cc
+
12
−
25
View file @
eb1267f2
...
...
@@ -22,44 +22,31 @@ using namespace corsika::setup;
namespace
corsika
::
process
{
namespace
particle_cut
{
template
<
typename
Particle
>
bool
ParticleCut
::
ParticleIsBelowEnergyCut
(
Particle
&
vP
)
const
{
template
<
typename
T
Particle
>
bool
ParticleCut
::
ParticleIsBelowEnergyCut
(
T
Particle
const
&
vP
)
const
{
auto
const
energyLab
=
vP
.
GetEnergy
();
// nuclei
if
(
vP
.
GetPID
()
==
particles
::
Code
::
Nucleus
)
{
auto
const
ElabNuc
=
energyLab
/
vP
.
GetNuclearA
();
auto
const
EcmNN
=
sqrt
(
2.
*
ElabNuc
*
0.93827
_GeV
);
if
(
ElabNuc
<
fECut
||
EcmNN
<
10
_GeV
)
return
true
;
else
return
false
;
auto
const
EcmNN
=
sqrt
(
2.
*
units
::
constants
::
nucleonMass
*
ElabNuc
);
return
(
ElabNuc
<
fECut
||
EcmNN
<
10
_GeV
);
}
else
{
// TODO: center-of-mass energy hard coded
const
HEPEnergyType
Ecm
=
sqrt
(
2.
*
energyLab
*
0.93827
_GeV
);
if
(
energyLab
<
fECut
||
Ecm
<
10
_GeV
)
return
true
;
else
return
false
;
const
HEPEnergyType
Ecm
=
sqrt
(
2.
*
units
::
constants
::
nucleonMass
*
energyLab
);
return
(
energyLab
<
fECut
||
Ecm
<
10
_GeV
);
}
}
bool
ParticleCut
::
ParticleIsEmParticle
(
Code
vCode
)
const
{
bool
is_em
=
false
;
// FOR NOW: switch
switch
(
vCode
)
{
case
Code
::
Gamma
:
case
Code
::
Electron
:
is_em
=
true
;
break
;
case
Code
::
Positron
:
is_em
=
true
;
break
;
case
Code
::
Gamma
:
is_em
=
true
;
break
;
return
true
;
default:
b
re
ak
;
re
turn
false
;
}
return
is_em
;
}
bool
ParticleCut
::
ParticleIsInvisible
(
Code
vCode
)
const
{
...
...
@@ -134,11 +121,11 @@ namespace corsika::process {
}
void
ParticleCut
::
Init
()
{
fEmEnergy
=
0.
*
1
_GeV
;
fEmEnergy
=
0.
_GeV
;
fEmCount
=
0
;
fInvEnergy
=
0.
*
1
_GeV
;
fInvEnergy
=
0.
_GeV
;
fInvCount
=
0
;
fEnergy
=
0.
*
1
_GeV
;
fEnergy
=
0.
_GeV
;
// defineEmParticles();
}
...
...
This diff is collapsed.
Click to expand it.
Processes/ParticleCut/ParticleCut.h
+
11
−
15
View file @
eb1267f2
...
...
@@ -15,43 +15,39 @@
#include
<corsika/process/SecondariesProcess.h>
#include
<corsika/units/PhysicalUnits.h>
using
namespace
corsika
;
using
namespace
corsika
::
units
;
using
namespace
corsika
::
units
::
si
;
namespace
corsika
::
process
{
namespace
particle_cut
{
class
ParticleCut
:
public
process
::
SecondariesProcess
<
ParticleCut
>
{
HEPEnergyType
fECut
;
units
::
si
::
HEPEnergyType
const
fECut
;
HEPEnergyType
fEnergy
=
0
_GeV
;
HEPEnergyType
fEmEnergy
=
0
_GeV
;
units
::
si
::
HEPEnergyType
fEnergy
=
0
*
units
::
si
::
electronvolt
;
units
::
si
::
HEPEnergyType
fEmEnergy
=
0
*
units
::
si
::
electronvolt
;
int
fEmCount
=
0
;
HEPEnergyType
fInvEnergy
=
0
_GeV
;
units
::
si
::
HEPEnergyType
fInvEnergy
=
0
*
units
::
si
::
electronvolt
;
int
fInvCount
=
0
;
public:
ParticleCut
(
const
HEPEnergyType
vCut
)
ParticleCut
(
const
units
::
si
::
HEPEnergyType
vCut
)
:
fECut
(
vCut
)
{}
bool
ParticleIsInvisible
(
particles
::
Code
)
const
;
template
<
typename
TSecondaries
>
EProcessReturn
DoSecondaries
(
TSecondaries
&
);
template
<
typename
Particle
>
bool
ParticleIsBelowEnergyCut
(
Particle
&
)
const
;
template
<
typename
T
Particle
>
bool
ParticleIsBelowEnergyCut
(
T
Particle
const
&
)
const
;
bool
ParticleIsEmParticle
(
particles
::
Code
)
const
;
void
Init
();
void
ShowResults
();
HEPEnergyType
GetInvEnergy
()
const
{
return
fInvEnergy
;
}
HEPEnergyType
GetCutEnergy
()
const
{
return
fEnergy
;
}
HEPEnergyType
GetEmEnergy
()
const
{
return
fEmEnergy
;
}
units
::
si
::
HEPEnergyType
GetInvEnergy
()
const
{
return
fInvEnergy
;
}
units
::
si
::
HEPEnergyType
GetCutEnergy
()
const
{
return
fEnergy
;
}
units
::
si
::
HEPEnergyType
GetEmEnergy
()
const
{
return
fEmEnergy
;
}
};
}
// namespace particlecut
}
// namespace particle
_
cut
}
// namespace corsika::process
#endif
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