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
785332c9
Commit
785332c9
authored
3 years ago
by
Ralf Ulrich
Browse files
Options
Downloads
Plain Diff
Merge branch '467-repair-epos-interface' into 'master'
run EPOS in CoM Closes
#443
and
#467
See merge request
!407
parents
0c7fbcaf
5c08ca4b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
corsika/detail/modules/epos/InteractionModel.inl
+25
-49
25 additions, 49 deletions
corsika/detail/modules/epos/InteractionModel.inl
with
25 additions
and
49 deletions
corsika/detail/modules/epos/InteractionModel.inl
+
25
−
49
View file @
785332c9
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include
<string>
#include
<string>
#include
<tuple>
#include
<tuple>
#include
<cmath>
namespace
corsika
::
epos
{
namespace
corsika
::
epos
{
...
@@ -112,7 +113,7 @@ namespace corsika::epos {
...
@@ -112,7 +113,7 @@ namespace corsika::epos {
::
epos
::
nucl6_
.
infragm
=
::
epos
::
nucl6_
.
infragm
=
2
;
// 0: keep free nucleons in fragmentation,1: one fragment, 2: fragmentation
2
;
// 0: keep free nucleons in fragmentation,1: one fragment, 2: fragmentation
::
epos
::
othe2_
.
iframe
=
1
2
;
//
lab
frame
, target at rest
::
epos
::
othe2_
.
iframe
=
1
1
;
//
cms
frame
// set paths to tables in corsika data
// set paths to tables in corsika data
::
epos
::
datadir
BASE
(
data_path_
);
::
epos
::
datadir
BASE
(
data_path_
);
...
@@ -136,8 +137,8 @@ namespace corsika::epos {
...
@@ -136,8 +137,8 @@ namespace corsika::epos {
::
epos
::
nfname_
.
nfncs
=
CS
.
length
;
::
epos
::
nfname_
.
nfncs
=
CS
.
length
;
// initialiazes maximum energy and mass
// initialiazes maximum energy and mass
initializeEvent
Lab
(
Code
::
Lead
,
Lead
::
nucleus_A
,
Lead
::
nucleus_Z
,
Code
::
Lead
,
initializeEvent
CoM
(
Code
::
Lead
,
Lead
::
nucleus_A
,
Lead
::
nucleus_Z
,
Code
::
Lead
,
Lead
::
nucleus_A
,
Lead
::
nucleus_Z
,
1
_
T
eV
);
Lead
::
nucleus_A
,
Lead
::
nucleus_Z
,
1
_
P
eV
);
}
}
inline
void
InteractionModel
::
initializeEventCoM
(
Code
const
idBeam
,
int
const
iBeamA
,
inline
void
InteractionModel
::
initializeEventCoM
(
Code
const
idBeam
,
int
const
iBeamA
,
...
@@ -163,30 +164,6 @@ namespace corsika::epos {
...
@@ -163,30 +164,6 @@ namespace corsika::epos {
::
epos
::
ainit_
();
::
epos
::
ainit_
();
}
}
inline
void
InteractionModel
::
initializeEventLab
(
Code
const
idBeam
,
int
const
iBeamA
,
int
const
iBeamZ
,
Code
const
idTarget
,
int
const
iTargetA
,
int
const
iTargetZ
,
HEPEnergyType
const
Plab
)
const
{
CORSIKA_LOGGER_TRACE
(
logger_
,
"initialize event in lab. frame!"
" Plab per nuc={} GeV"
,
Plab
/
1
_GeV
);
::
epos
::
lept1_
.
engy
=
-
1.
;
::
epos
::
enrgy_
.
ecms
=
-
1.
;
::
epos
::
enrgy_
.
elab
=
-
1.
;
::
epos
::
enrgy_
.
ekin
=
-
1.
;
::
epos
::
hadr1_
.
pnll
=
-
1.
;
// hadron-nucleon momentum
::
epos
::
hadr1_
.
pnll
=
float
(
Plab
/
1
_GeV
);
// -> lab frame
CORSIKA_LOGGER_TRACE
(
logger_
,
"inside EPOS: Ecm={}, Elab={}, Pnll={}"
,
::
epos
::
enrgy_
.
ecms
,
::
epos
::
enrgy_
.
elab
,
::
epos
::
hadr1_
.
pnll
);
configureParticles
(
idBeam
,
iBeamA
,
iBeamZ
,
idTarget
,
iTargetA
,
iTargetZ
);
::
epos
::
ainit_
();
}
inline
void
InteractionModel
::
configureParticles
(
Code
const
idBeam
,
int
const
iBeamA
,
inline
void
InteractionModel
::
configureParticles
(
Code
const
idBeam
,
int
const
iBeamA
,
int
const
iBeamZ
,
Code
const
idTarget
,
int
const
iBeamZ
,
Code
const
idTarget
,
int
const
iTargetA
,
int
const
iTargetA
,
...
@@ -392,7 +369,7 @@ namespace corsika::epos {
...
@@ -392,7 +369,7 @@ namespace corsika::epos {
// define projectile
// define projectile
// define projectile, in lab frame
// define projectile, in lab frame
auto
const
sqrtS2
=
(
projectileP4
+
targetP4
).
getNormSqr
();
auto
const
sqrtS2
=
(
projectileP4
+
targetP4
).
getNormSqr
();
auto
const
sqrtS
=
sqrt
(
sqrtS2
);
HEPEnergyType
const
sqrtS
=
sqrt
(
sqrtS2
);
if
(
!
isValid
(
projectileId
,
targetId
,
sqrtS
))
{
if
(
!
isValid
(
projectileId
,
targetId
,
sqrtS
))
{
throw
std
::
runtime_error
(
"invalid projectile/target/energy combination."
);
throw
std
::
runtime_error
(
"invalid projectile/target/energy combination."
);
}
}
...
@@ -411,11 +388,14 @@ namespace corsika::epos {
...
@@ -411,11 +388,14 @@ namespace corsika::epos {
sqrt
((
Elab
-
get_mass
(
projectileId
))
*
(
Elab
+
get_mass
(
projectileId
)));
sqrt
((
Elab
-
get_mass
(
projectileId
))
*
(
Elab
+
get_mass
(
projectileId
)));
MomentumVector
pLab
(
csPrime
,
{
0
_eV
,
0
_eV
,
pLabMag
});
MomentumVector
pLab
(
csPrime
,
{
0
_eV
,
0
_eV
,
pLabMag
});
// internal EPOS lab system
CORSIKA_LOGGER_DEBUG
(
logger_
,
COMBoost
const
boostInternal
({
Elab
,
pLab
},
get_mass
(
targetId
));
"doInteraction: interaction, projectile id={}, E={}, p3={} "
,
projectileId
,
projectileP4
.
getTimeLikeComponent
(),
CORSIKA_LOGGER_DEBUG
(
logger_
,
"doInteraction: {} interaction, Elab={} "
,
projectileId
,
projectileP4
.
getSpaceLikeComponents
());
Elab
);
CORSIKA_LOGGER_DEBUG
(
logger_
,
"doInteraction: interaction, target id={}, E={}, p3={} "
,
targetId
,
targetP4
.
getTimeLikeComponent
(),
targetP4
.
getSpaceLikeComponents
());
CORSIKA_LOGGER_DEBUG
(
logger_
,
"doInteraction: Elab={}, sqrtS={} "
,
Elab
,
sqrtS
);
int
beamA
=
1
;
int
beamA
=
1
;
int
beamZ
=
1
;
int
beamZ
=
1
;
...
@@ -425,8 +405,6 @@ namespace corsika::epos {
...
@@ -425,8 +405,6 @@ namespace corsika::epos {
CORSIKA_LOGGER_DEBUG
(
logger_
,
"A={}, Z={} "
,
beamA
,
beamZ
);
CORSIKA_LOGGER_DEBUG
(
logger_
,
"A={}, Z={} "
,
beamA
,
beamZ
);
}
}
HEPMomentumType
const
projectileMomentumLabPerNucleon
=
pLabMag
/
beamA
;
// // from corsika7 interface
// // from corsika7 interface
// // NEXLNK-part
// // NEXLNK-part
int
targetA
=
1
;
int
targetA
=
1
;
...
@@ -435,8 +413,7 @@ namespace corsika::epos {
...
@@ -435,8 +413,7 @@ namespace corsika::epos {
targetA
=
get_nucleus_A
(
targetId
);
targetA
=
get_nucleus_A
(
targetId
);
targetZ
=
get_nucleus_Z
(
targetId
);
targetZ
=
get_nucleus_Z
(
targetId
);
}
}
initializeEventLab
(
projectileId
,
beamA
,
beamZ
,
targetId
,
targetA
,
targetZ
,
initializeEventCoM
(
projectileId
,
beamA
,
beamZ
,
targetId
,
targetA
,
targetZ
,
sqrtS
);
projectileMomentumLabPerNucleon
);
// create event
// create event
int
iarg
=
1
;
int
iarg
=
1
;
...
@@ -450,8 +427,8 @@ namespace corsika::epos {
...
@@ -450,8 +427,8 @@ namespace corsika::epos {
// NSTORE-part
// NSTORE-part
MomentumVector
P
lab
_final
(
originalCS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
MomentumVector
P_final
(
originalCS
,
{
0.0
_GeV
,
0.0
_GeV
,
0.0
_GeV
});
HEPEnergyType
E
lab
_final
=
0
_GeV
;
HEPEnergyType
E_final
=
0
_GeV
;
// position and time of interaction, not used in QgsjetII
// position and time of interaction, not used in QgsjetII
auto
const
&
projectile
=
view
.
getProjectile
();
auto
const
&
projectile
=
view
.
getProjectile
();
...
@@ -460,15 +437,13 @@ namespace corsika::epos {
...
@@ -460,15 +437,13 @@ namespace corsika::epos {
// secondaries
// secondaries
EposStack
es
;
EposStack
es
;
CORSIKA_LOGGER_DEBUG
(
logger_
,
"number of
particles
: {}"
,
es
.
getSize
());
CORSIKA_LOGGER_DEBUG
(
logger_
,
"number of
entries on Epos stack
: {}"
,
es
.
getSize
());
for
(
auto
&
psec
:
es
)
{
for
(
auto
&
psec
:
es
)
{
if
(
!
psec
.
isFinal
())
continue
;
if
(
!
psec
.
isFinal
())
continue
;
auto
momentum
=
psec
.
getMomentum
(
csPrime
);
auto
momentum
=
psec
.
getMomentum
(
csPrime
);
// this is not "CoM" here, but rather the system defined by projectile+target,
// transform particle output to frame defined by input 4-momenta
// which in Cascade-mode is already lab
auto
const
P4output
=
boost
.
fromCoM
(
FourVector
{
psec
.
getEnergy
(),
momentum
});
auto
const
P4com
=
boostInternal
.
toCoM
(
FourVector
{
psec
.
getEnergy
(),
momentum
});
auto
const
P4output
=
boost
.
fromCoM
(
P4com
);
auto
p3output
=
P4output
.
getSpaceLikeComponents
();
auto
p3output
=
P4output
.
getSpaceLikeComponents
();
p3output
.
rebase
(
originalCS
);
// transform back into standard lab frame
p3output
.
rebase
(
originalCS
);
// transform back into standard lab frame
...
@@ -480,14 +455,15 @@ namespace corsika::epos {
...
@@ -480,14 +455,15 @@ namespace corsika::epos {
pid
,
p3output
.
getComponents
()
/
1
_GeV
);
pid
,
p3output
.
getComponents
()
/
1
_GeV
);
auto
pnew
=
view
.
addSecondary
(
std
::
make_tuple
(
pid
,
p3output
,
pOrig
,
tOrig
));
auto
pnew
=
view
.
addSecondary
(
std
::
make_tuple
(
pid
,
p3output
,
pOrig
,
tOrig
));
P
lab
_final
+=
pnew
.
getMomentum
();
P_final
+=
pnew
.
getMomentum
();
E
lab
_final
+=
pnew
.
getEnergy
();
E_final
+=
pnew
.
getEnergy
();
}
}
CORSIKA_LOGGER_DEBUG
(
CORSIKA_LOGGER_DEBUG
(
logger_
,
logger_
,
"conservation (all GeV): Ecm_final= n/a"
/* << Ecm_final / 1_GeV*/
"conservation (all GeV): Ecm_final= n/a"
/* << Ecm_final / 1_GeV*/
", Elab_final={}"
", E_final={} GeV"
", Plab_final={}"
,
", P_final={} GeV"
Elab_final
/
1
_GeV
,
(
Plab_final
/
1
_GeV
).
getComponents
());
", no. of particles={}"
,
E_final
/
1
_GeV
,
(
P_final
/
1
_GeV
).
getComponents
(),
view
.
getSize
());
}
}
}
// namespace corsika::epos
}
// namespace corsika::epos
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