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
2745dbe0
Commit
2745dbe0
authored
5 years ago
by
ralfulrich
Committed by
Ralf Ulrich
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
c++ style, some changes
parent
cf3becbf
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/QGSJetII/Interaction.cc
+12
-12
12 additions, 12 deletions
Processes/QGSJetII/Interaction.cc
Processes/QGSJetII/Interaction.h
+11
-11
11 additions, 11 deletions
Processes/QGSJetII/Interaction.h
with
23 additions
and
23 deletions
Processes/QGSJetII/Interaction.cc
+
12
−
12
View file @
2745dbe0
...
...
@@ -49,7 +49,7 @@ namespace corsika::process::qgsjetII {
}
Interaction
::~
Interaction
()
{
cout
<<
"QgsjetII::Interaction n="
<<
fC
ount
<<
endl
;
cout
<<
"QgsjetII::Interaction n="
<<
c
ount
_
<<
endl
;
}
void
Interaction
::
Init
()
{
...
...
@@ -57,11 +57,11 @@ namespace corsika::process::qgsjetII {
using
random
::
RNGManager
;
// initialize QgsjetII
if
(
!
fI
nitialized
)
{
if
(
!
i
nitialized
_
)
{
qgset_
();
datadir
DIR
(
data_path_
);
qgaini_
(
DIR
.
data
);
fI
nitialized
=
true
;
i
nitialized
_
=
true
;
}
}
...
...
@@ -85,7 +85,7 @@ namespace corsika::process::qgsjetII {
int
iTarget
=
1
;
if
(
particles
::
IsNucleus
(
TargetId
))
{
iTarget
=
Atarget
;
if
(
iTarget
>
fM
axMassNumber
||
iTarget
<=
0
)
{
if
(
iTarget
>
m
axMassNumber
_
||
iTarget
<=
0
)
{
std
::
ostringstream
txt
;
txt
<<
"QgsjetII target outside range. iTarget="
<<
iTarget
;
throw
std
::
runtime_error
(
txt
.
str
().
c_str
());
...
...
@@ -94,7 +94,7 @@ namespace corsika::process::qgsjetII {
int
iProjectile
=
1
;
if
(
particles
::
IsNucleus
(
BeamId
))
{
iProjectile
=
Abeam
;
if
(
iProjectile
>
fM
axMassNumber
||
iProjectile
<=
0
)
if
(
iProjectile
>
m
axMassNumber
_
||
iProjectile
<=
0
)
throw
std
::
runtime_error
(
"QgsjetII target outside range. "
);
}
...
...
@@ -286,14 +286,14 @@ namespace corsika::process::qgsjetII {
if
(
particles
::
IsNucleus
(
targetCode
))
targetQgsCode
=
particles
::
GetNucleusA
(
targetCode
);
if
(
targetCode
==
particles
::
Proton
::
GetCode
())
targetQgsCode
=
1
;
cout
<<
"Interaction: target qgsjetII code/A: "
<<
targetQgsCode
<<
endl
;
if
(
targetQgsCode
>
fM
axMassNumber
||
targetQgsCode
<
1
)
if
(
targetQgsCode
>
m
axMassNumber
_
||
targetQgsCode
<
1
)
throw
std
::
runtime_error
(
"QgsjetII target outside range."
);
int
projQgsCode
=
1
;
if
(
particles
::
IsNucleus
(
corsikaBeamId
))
projQgsCode
=
vP
.
GetNuclearA
();
cout
<<
"Interaction: projectile qgsjetII code/A: "
<<
projQgsCode
<<
" "
<<
corsikaBeamId
<<
endl
;
if
(
projQgsCode
>
fM
axMassNumber
||
projQgsCode
<
1
)
if
(
projQgsCode
>
m
axMassNumber
_
||
projQgsCode
<
1
)
throw
std
::
runtime_error
(
"QgsjetII target outside range."
);
...
...
@@ -327,7 +327,7 @@ namespace corsika::process::qgsjetII {
<<
"THIS IS AN ERROR"
<<
endl
;
throw
std
::
runtime_error
(
"energy too low for QGSJETII"
);
}
else
{
fC
ount
++
;
c
ount
_
++
;
auto
Elab
=
eProjectileLab
/
projQgsCode
;
qgini_
(
Elab
/
1
_GeV
,
kBeam
,
projQgsCode
,
targetQgsCode
);
qgini_
(
Elab
/
1
_GeV
,
kBeam
,
projQgsCode
,
targetQgsCode
);
...
...
@@ -358,8 +358,8 @@ namespace corsika::process::qgsjetII {
idFragm
,
PlabRot
.
GetTimeLikeComponent
(),
PlabRot
.
GetSpaceLikeComponents
(),
pOrig
,
tOrig
});
Plab_final
+=
PlabRot
.
GetSpaceLikeCompon
ent
s
();
Elab_final
+=
Elab
;
Plab_final
+=
pnew
.
GetMom
ent
um
();
Elab_final
+=
pnew
.
GetEnergy
()
;
}
break
;
case
2
:
// deuterium
...
...
@@ -392,8 +392,8 @@ namespace corsika::process::qgsjetII {
idFragm
,
PlabRot
.
GetTimeLikeComponent
(),
PlabRot
.
GetSpaceLikeComponents
(),
pOrig
,
tOrig
,
A
,
Z
});
Plab_final
+=
PlabRot
.
GetSpaceLikeCompon
ent
s
();
Elab_final
+=
Elab
*
A
;
Plab_final
+=
pnew
.
GetMom
ent
um
();
Elab_final
+=
pnew
.
GetEnergy
()
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Processes/QGSJetII/Interaction.h
+
11
−
11
View file @
2745dbe0
...
...
@@ -24,8 +24,8 @@ namespace corsika::process::qgsjetII {
class
Interaction
:
public
corsika
::
process
::
InteractionProcess
<
Interaction
>
{
std
::
string
data_path_
;
int
fC
ount
=
0
;
bool
fI
nitialized
=
false
;
int
c
ount
_
=
0
;
bool
i
nitialized
_
=
false
;
public:
Interaction
(
const
std
::
string
&
dataPath
=
""
);
...
...
@@ -33,15 +33,15 @@ namespace corsika::process::qgsjetII {
void
Init
();
bool
WasInitialized
()
{
return
fI
nitialized
;
}
bool
WasInitialized
()
{
return
i
nitialized
_
;
}
bool
IsValidCoMEnergy
(
corsika
::
units
::
si
::
HEPEnergyType
ecm
)
const
{
return
(
fM
inEnergyCoM
<=
ecm
)
&&
(
ecm
<=
fM
axEnergyCoM
);
return
(
m
inEnergyCoM
_
<=
ecm
)
&&
(
ecm
<=
m
axEnergyCoM
_
);
}
int
GetMaxTargetMassNumber
()
const
{
return
fM
axMassNumber
;
}
corsika
::
units
::
si
::
HEPEnergyType
GetMinEnergyCoM
()
const
{
return
fM
inEnergyCoM
;
}
corsika
::
units
::
si
::
HEPEnergyType
GetMaxEnergyCoM
()
const
{
return
fM
axEnergyCoM
;
}
int
GetMaxTargetMassNumber
()
const
{
return
m
axMassNumber
_
;
}
corsika
::
units
::
si
::
HEPEnergyType
GetMinEnergyCoM
()
const
{
return
m
inEnergyCoM
_
;
}
corsika
::
units
::
si
::
HEPEnergyType
GetMaxEnergyCoM
()
const
{
return
m
axEnergyCoM
_
;
}
bool
IsValidTarget
(
corsika
::
particles
::
Code
TargetId
)
const
{
return
(
corsika
::
particles
::
GetNucleusA
(
TargetId
)
<
fM
axMassNumber
)
&&
return
(
corsika
::
particles
::
GetNucleusA
(
TargetId
)
<
m
axMassNumber
_
)
&&
corsika
::
particles
::
IsNucleus
(
TargetId
);
}
...
...
@@ -77,11 +77,11 @@ namespace corsika::process::qgsjetII {
particles
::
Code
::
DMinus
,
particles
::
Code
::
D0
,
particles
::
Code
::
MuMinus
,
particles
::
Code
::
MuPlus
,
particles
::
Code
::
D0Bar
};
const
corsika
::
units
::
si
::
HEPEnergyType
fM
inEnergyCoM
=
const
corsika
::
units
::
si
::
HEPEnergyType
m
inEnergyCoM
_
=
10.
*
1e9
*
corsika
::
units
::
si
::
electronvolt
;
const
corsika
::
units
::
si
::
HEPEnergyType
fM
axEnergyCoM
=
const
corsika
::
units
::
si
::
HEPEnergyType
m
axEnergyCoM
_
=
1.e6
*
1e9
*
corsika
::
units
::
si
::
electronvolt
;
const
int
fM
axMassNumber
=
208
;
const
int
m
axMassNumber
_
=
208
;
};
}
// namespace corsika::process::qgsjetII
...
...
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