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
Snippets
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
Antonio Augusto Alves Junior
corsika
Commits
82e06a9b
Commit
82e06a9b
authored
5 years ago
by
Felix Riehn
Browse files
Options
Downloads
Patches
Plain Diff
adjust argument names in pythia
parent
4c838dec
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Processes/Pythia/Interaction.cc
+35
-35
35 additions, 35 deletions
Processes/Pythia/Interaction.cc
Processes/Pythia/Interaction.h
+5
-5
5 additions, 5 deletions
Processes/Pythia/Interaction.h
with
40 additions
and
40 deletions
Processes/Pythia/Interaction.cc
+
35
−
35
View file @
82e06a9b
...
...
@@ -76,37 +76,37 @@ namespace corsika::process::pythia {
}
void
Interaction
::
SetParticleListStable
(
std
::
vector
<
particles
::
Code
>
const
&
p
articleList
)
{
for
(
auto
p
:
p
articleList
)
Interaction
::
SetStable
(
p
);
std
::
vector
<
particles
::
Code
>
const
&
vP
articleList
)
{
for
(
auto
p
:
vP
articleList
)
Interaction
::
SetStable
(
p
);
}
void
Interaction
::
SetUnstable
(
const
particles
::
Code
p
Code
)
{
cout
<<
"Pythia::Interaction: setting "
<<
p
Code
<<
" unstable.."
<<
endl
;
fPythia
.
particleData
.
mayDecay
(
static_cast
<
int
>
(
particles
::
GetPDG
(
p
Code
)),
true
);
void
Interaction
::
SetUnstable
(
const
particles
::
Code
v
Code
)
{
cout
<<
"Pythia::Interaction: setting "
<<
v
Code
<<
" unstable.."
<<
endl
;
fPythia
.
particleData
.
mayDecay
(
static_cast
<
int
>
(
particles
::
GetPDG
(
v
Code
)),
true
);
}
void
Interaction
::
SetStable
(
const
particles
::
Code
p
Code
)
{
cout
<<
"Pythia::Interaction: setting "
<<
p
Code
<<
" stable.."
<<
endl
;
fPythia
.
particleData
.
mayDecay
(
static_cast
<
int
>
(
particles
::
GetPDG
(
p
Code
)),
false
);
void
Interaction
::
SetStable
(
const
particles
::
Code
v
Code
)
{
cout
<<
"Pythia::Interaction: setting "
<<
v
Code
<<
" stable.."
<<
endl
;
fPythia
.
particleData
.
mayDecay
(
static_cast
<
int
>
(
particles
::
GetPDG
(
v
Code
)),
false
);
}
void
Interaction
::
ConfigureLabFrameCollision
(
const
particles
::
Code
BeamId
,
const
particles
::
Code
TargetId
,
const
units
::
si
::
HEPEnergyType
BeamEnergy
)
{
const
particles
::
Code
v
BeamId
,
const
particles
::
Code
v
TargetId
,
const
units
::
si
::
HEPEnergyType
v
BeamEnergy
)
{
using
namespace
units
::
si
;
// Pythia configuration of the current event
// very clumsy. I am sure this can be done better..
// set beam
// beam id for pythia
auto
const
pdgBeam
=
static_cast
<
int
>
(
particles
::
GetPDG
(
BeamId
));
auto
const
pdgBeam
=
static_cast
<
int
>
(
particles
::
GetPDG
(
v
BeamId
));
std
::
stringstream
stBeam
;
stBeam
<<
"Beams:idA = "
<<
pdgBeam
;
fPythia
.
readString
(
stBeam
.
str
());
// set target
auto
pdgTarget
=
static_cast
<
int
>
(
particles
::
GetPDG
(
TargetId
));
auto
pdgTarget
=
static_cast
<
int
>
(
particles
::
GetPDG
(
v
TargetId
));
// replace hydrogen with proton, otherwise pythia goes into heavy ion mode!
if
(
TargetId
==
particles
::
Code
::
Hydrogen
)
if
(
v
TargetId
==
particles
::
Code
::
Hydrogen
)
pdgTarget
=
static_cast
<
int
>
(
particles
::
GetPDG
(
particles
::
Code
::
Proton
));
std
::
stringstream
stTarget
;
stTarget
<<
"Beams:idB = "
<<
pdgTarget
;
...
...
@@ -114,7 +114,7 @@ namespace corsika::process::pythia {
// set frame to lab. frame
fPythia
.
readString
(
"Beams:frameType = 2"
);
// set beam energy
const
double
Elab
=
BeamEnergy
/
1
_GeV
;
const
double
Elab
=
v
BeamEnergy
/
1
_GeV
;
std
::
stringstream
stEnergy
;
stEnergy
<<
"Beams:eA = "
<<
Elab
;
fPythia
.
readString
(
stEnergy
.
str
());
...
...
@@ -124,28 +124,28 @@ namespace corsika::process::pythia {
fPythia
.
init
();
}
bool
Interaction
::
CanInteract
(
const
corsika
::
particles
::
Code
p
Code
)
{
return
p
Code
==
corsika
::
particles
::
Code
::
Proton
||
p
Code
==
corsika
::
particles
::
Code
::
Neutron
||
p
Code
==
corsika
::
particles
::
Code
::
AntiProton
||
p
Code
==
corsika
::
particles
::
Code
::
AntiNeutron
||
p
Code
==
corsika
::
particles
::
Code
::
PiMinus
||
p
Code
==
corsika
::
particles
::
Code
::
PiPlus
;
bool
Interaction
::
CanInteract
(
const
corsika
::
particles
::
Code
v
Code
)
{
return
v
Code
==
corsika
::
particles
::
Code
::
Proton
||
v
Code
==
corsika
::
particles
::
Code
::
Neutron
||
v
Code
==
corsika
::
particles
::
Code
::
AntiProton
||
v
Code
==
corsika
::
particles
::
Code
::
AntiNeutron
||
v
Code
==
corsika
::
particles
::
Code
::
PiMinus
||
v
Code
==
corsika
::
particles
::
Code
::
PiPlus
;
}
tuple
<
units
::
si
::
CrossSectionType
,
units
::
si
::
CrossSectionType
>
Interaction
::
GetCrossSection
(
const
particles
::
Code
BeamId
,
const
particles
::
Code
TargetId
,
const
units
::
si
::
HEPEnergyType
CoMenergy
)
{
Interaction
::
GetCrossSection
(
const
particles
::
Code
v
BeamId
,
const
particles
::
Code
v
TargetId
,
const
units
::
si
::
HEPEnergyType
v
CoMenergy
)
{
using
namespace
units
::
si
;
// interaction possible in pythia?
if
(
TargetId
==
particles
::
Code
::
Proton
||
TargetId
==
particles
::
Code
::
Hydrogen
)
{
if
(
CanInteract
(
BeamId
)
&&
ValidCoMEnergy
(
CoMenergy
))
{
if
(
CanInteract
(
v
BeamId
)
&&
ValidCoMEnergy
(
v
CoMenergy
))
{
// input particle PDG
auto
const
pdgCodeBeam
=
static_cast
<
int
>
(
particles
::
GetPDG
(
BeamId
));
auto
const
pdgCodeTarget
=
static_cast
<
int
>
(
particles
::
GetPDG
(
TargetId
));
const
double
ecm
=
CoMenergy
/
1
_GeV
;
auto
const
pdgCodeBeam
=
static_cast
<
int
>
(
particles
::
GetPDG
(
v
BeamId
));
auto
const
pdgCodeTarget
=
static_cast
<
int
>
(
particles
::
GetPDG
(
v
TargetId
));
const
double
ecm
=
v
CoMenergy
/
1
_GeV
;
// calculate cross section
fSigma
.
calc
(
pdgCodeBeam
,
pdgCodeTarget
,
ecm
);
...
...
@@ -168,7 +168,7 @@ namespace corsika::process::pythia {
}
template
<
>
units
::
si
::
GrammageType
Interaction
::
GetInteractionLength
(
Particle
&
p
,
Track
&
)
{
units
::
si
::
GrammageType
Interaction
::
GetInteractionLength
(
Particle
&
vP
,
Track
&
)
{
using
namespace
units
;
using
namespace
units
::
si
;
...
...
@@ -178,7 +178,7 @@ namespace corsika::process::pythia {
CoordinateSystem
&
rootCS
=
RootCoordinateSystem
::
GetInstance
().
GetRootCoordinateSystem
();
const
particles
::
Code
corsikaBeamId
=
p
.
GetPID
();
const
particles
::
Code
corsikaBeamId
=
vP
.
GetPID
();
// beam particles for pythia : 1, 2, 3 for p, pi, k
// read from cross section code table
...
...
@@ -188,9 +188,9 @@ namespace corsika::process::pythia {
process
::
pythia
::
MomentumVector
pTarget
(
rootCS
,
{
0
_GeV
,
0
_GeV
,
0
_GeV
});
// total momentum and energy
HEPEnergyType
Elab
=
p
.
GetEnergy
()
+
constants
::
nucleonMass
;
HEPEnergyType
Elab
=
vP
.
GetEnergy
()
+
constants
::
nucleonMass
;
process
::
pythia
::
MomentumVector
pTotLab
(
rootCS
,
{
0
_GeV
,
0
_GeV
,
0
_GeV
});
pTotLab
+=
p
.
GetMomentum
();
pTotLab
+=
vP
.
GetMomentum
();
pTotLab
+=
pTarget
;
auto
const
pTotLabNorm
=
pTotLab
.
norm
();
// calculate cm. energy
...
...
@@ -198,9 +198,9 @@ namespace corsika::process::pythia {
(
Elab
+
pTotLabNorm
)
*
(
Elab
-
pTotLabNorm
));
// binomial for numerical accuracy
cout
<<
"Interaction: LambdaInt:
\n
"
<<
" input energy: "
<<
p
.
GetEnergy
()
/
1
_GeV
<<
endl
<<
" input energy: "
<<
vP
.
GetEnergy
()
/
1
_GeV
<<
endl
<<
" beam can interact:"
<<
kInteraction
<<
endl
<<
" beam pid:"
<<
p
.
GetPID
()
<<
endl
;
<<
" beam pid:"
<<
vP
.
GetPID
()
<<
endl
;
// TODO: move limits into variables
if
(
kInteraction
&&
Elab
>=
8.5
_GeV
&&
ValidCoMEnergy
(
ECoM
))
{
...
...
@@ -211,7 +211,7 @@ namespace corsika::process::pythia {
ideally as full particle object so that the four momenta
and the boosts can be defined..
*/
const
auto
*
currentNode
=
p
.
GetNode
();
const
auto
*
currentNode
=
vP
.
GetNode
();
const
auto
mediumComposition
=
currentNode
->
GetModelProperties
().
GetNuclearComposition
();
// determine average interaction length
...
...
This diff is collapsed.
Click to expand it.
Processes/Pythia/Interaction.h
+
5
−
5
View file @
82e06a9b
...
...
@@ -37,9 +37,9 @@ namespace corsika::process::pythia {
void
SetStable
(
const
corsika
::
particles
::
Code
);
bool
WasInitialized
()
{
return
fInitialized
;
}
bool
ValidCoMEnergy
(
corsika
::
units
::
si
::
HEPEnergyType
e
cm
)
{
bool
ValidCoMEnergy
(
corsika
::
units
::
si
::
HEPEnergyType
vE
cm
)
{
using
namespace
corsika
::
units
::
si
;
return
(
10
_GeV
<
e
cm
)
&&
(
e
cm
<
1
_PeV
);
return
(
10
_GeV
<
vE
cm
)
&&
(
vE
cm
<
1
_PeV
);
}
bool
CanInteract
(
const
corsika
::
particles
::
Code
);
...
...
@@ -47,9 +47,9 @@ namespace corsika::process::pythia {
const
corsika
::
particles
::
Code
,
const
corsika
::
units
::
si
::
HEPEnergyType
);
std
::
tuple
<
corsika
::
units
::
si
::
CrossSectionType
,
corsika
::
units
::
si
::
CrossSectionType
>
GetCrossSection
(
const
corsika
::
particles
::
Code
BeamId
,
const
corsika
::
particles
::
Code
TargetId
,
const
corsika
::
units
::
si
::
HEPEnergyType
CoMenergy
);
GetCrossSection
(
const
corsika
::
particles
::
Code
,
const
corsika
::
particles
::
Code
,
const
corsika
::
units
::
si
::
HEPEnergyType
);
template
<
typename
TParticle
,
typename
TTrack
>
corsika
::
units
::
si
::
GrammageType
GetInteractionLength
(
TParticle
&
,
TTrack
&
);
...
...
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