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
322e29a1
Commit
322e29a1
authored
6 years ago
by
Felix Riehn
Committed by
ralfulrich
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added boost from cms to lab
parent
ecc792d9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation/Examples/cascade_example.cc
+16
-10
16 additions, 10 deletions
Documentation/Examples/cascade_example.cc
with
16 additions
and
10 deletions
Documentation/Examples/cascade_example.cc
+
16
−
10
View file @
322e29a1
...
@@ -66,34 +66,40 @@ public:
...
@@ -66,34 +66,40 @@ public:
void
DoDiscrete
(
Particle
&
p
,
Stack
&
s
)
const
{
void
DoDiscrete
(
Particle
&
p
,
Stack
&
s
)
const
{
// get energy of particle from stack
// get energy of particle from stack
// stack is in GeV in lab. frame
// stack is in GeV in lab. frame
// convert to GeV in cm. frame
// convert to GeV in cm. frame
(assuming proton at rest as target)
EnergyType
E
=
p
.
GetEnergy
();
EnergyType
E
=
p
.
GetEnergy
();
doubl
e
Ecm
=
sqrt
(
2.
*
E
*
0.93827
_GeV
)
/
1
_GeV
;
EnergyTyp
e
Ecm
=
sqrt
(
2.
*
E
*
0.93827
_GeV
);
// FOR NOW: set beam to proton
// FOR NOW: set beam to proton
int
kBeam
=
13
;
//p.GetPID();
int
kBeam
=
13
;
//p.GetPID();
// FOR NOW: set target to proton
// FOR NOW: set target to proton
int
kTarget
=
1
;
//p.GetPID();
int
kTarget
=
1
;
//p.GetPID();
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: E(GeV):"
<<
E
/
1
_GeV
<<
" Ecm(GeV): "
<<
Ecm
<<
std
::
endl
;
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: E(GeV):"
<<
E
/
1
_GeV
<<
" Ecm(GeV): "
<<
Ecm
/
1
_GeV
<<
std
::
endl
;
if
(
E
<
8.5
_GeV
||
Ecm
<
10
.
)
{
if
(
E
<
8.5
_GeV
||
Ecm
<
10
_GeV
)
{
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: dropping particle.."
<<
std
::
endl
;
std
::
cout
<<
"ProcessSplit: "
<<
" DoDiscrete: dropping particle.."
<<
std
::
endl
;
p
.
Delete
();
p
.
Delete
();
fCount
++
;
fCount
++
;
}
else
{
}
else
{
//p.SetEnergy(E / 2);
// Sibyll does not know about units..
//s.NewParticle().SetEnergy(E / 2);
double
sqs
=
Ecm
/
1
_GeV
;
// running sibyll
// running sibyll
sibyll_
(
kBeam
,
kTarget
,
Ecm
);
sibyll_
(
kBeam
,
kTarget
,
sqs
);
// print final state
int
print_unit
=
6
;
int
print_unit
=
6
;
sib_list_
(
print_unit
);
sib_list_
(
print_unit
);
// delete current particle
// delete current particle
p
.
Delete
();
p
.
Delete
();
const
EnergyType
proton_mass
=
0.93827
_GeV
;
const
double
gamma
=
(
E
+
proton_mass
)
/
(
Ecm
);
const
double
gambet
=
sqrt
(
E
*
E
-
proton_mass
*
proton_mass
)
/
Ecm
;
// add particles from sibyll to stack
// add particles from sibyll to stack
for
(
int
i
=
0
;
i
<
s_plist_
.
np
;
++
i
){
for
(
int
i
=
0
;
i
<
s_plist_
.
np
;
++
i
){
//transform to lab. frame
s
.
NewParticle
().
SetEnergy
(
s_plist_
.
p
[
3
][
i
]
*
1
_GeV
);
const
double
en_lab
=
gambet
*
s_plist_
.
p
[
2
][
i
]
+
gamma
*
s_plist_
.
p
[
3
][
i
];
// add to corsika stack
s
.
NewParticle
().
SetEnergy
(
en_lab
*
1
_GeV
);
}
}
}
}
}
}
...
...
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