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
cfca107c
Commit
cfca107c
authored
3 years ago
by
Nikos Karastathis
Committed by
Nikos Karastathis
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Synchrotron radiation calculates period
parent
b67371db
No related branches found
No related tags found
1 merge request
!329
Radio interface
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/radio_shower2.cpp
+18
-26
18 additions, 26 deletions
examples/radio_shower2.cpp
with
18 additions
and
26 deletions
examples/radio_shower2.cpp
+
18
−
26
View file @
cfca107c
...
@@ -89,8 +89,11 @@ int main() {
...
@@ -89,8 +89,11 @@ int main() {
using
MyHomogeneousModel
=
UniformRefractiveIndex
<
MediumPropertyModel
<
using
MyHomogeneousModel
=
UniformRefractiveIndex
<
MediumPropertyModel
<
UniformMagneticField
<
HomogeneousMedium
<
setup
::
EnvironmentInterface
>>>>
;
UniformMagneticField
<
HomogeneousMedium
<
setup
::
EnvironmentInterface
>>>>
;
auto
const
Bmag
{
0.3809
_T
};
MagneticFieldVector
B
{
rootCS
,
0
_T
,
0
_T
,
Bmag
};
world
->
setModelProperties
<
MyHomogeneousModel
>
(
1
,
world
->
setModelProperties
<
MyHomogeneousModel
>
(
1
,
Medium
::
AirDry1Atm
,
MagneticFieldVector
(
rootCS
,
0
_T
,
0
_T
,
0.3809
_T
)
,
Medium
::
AirDry1Atm
,
B
,
1
_kg
/
(
1
_m
*
1
_m
*
1
_m
),
1
_kg
/
(
1
_m
*
1
_m
*
1
_m
),
NuclearComposition
(
std
::
vector
<
Code
>
{
Code
::
Nitrogen
},
NuclearComposition
(
std
::
vector
<
Code
>
{
Code
::
Nitrogen
},
std
::
vector
<
float
>
{(
float
)
1.
}));
std
::
vector
<
float
>
{(
float
)
1.
}));
...
@@ -145,39 +148,28 @@ int main() {
...
@@ -145,39 +148,28 @@ int main() {
setup
::
Stack
stack
;
setup
::
Stack
stack
;
stack
.
clear
();
stack
.
clear
();
const
Code
beamCode
=
Code
::
Electron
;
const
Code
beamCode
=
Code
::
Electron
;
const
HEPMassType
mass
=
Electron
::
mass
;
auto
const
gyroradius
=
100
_m
;
const
HEPEnergyType
E0
=
11.4
_MeV
;
auto
const
pLabMag
=
convert_SI_to_HEP
(
get_charge
(
beamCode
)
*
Bmag
*
gyroradius
);
double
theta
=
0.
;
auto
const
omega_inv
=
convert_HEP_to_SI
<
MassType
::
dimension_type
>
(
get_mass
(
beamCode
))
/
((
-
1
)
*
get_charge
(
beamCode
)
*
Bmag
);
double
phi
=
0.
;
MomentumVector
const
plab
{
rootCS
,
pLabMag
,
0
_MeV
,
0
_MeV
};
auto
const
Elab
=
sqrt
(
plab
.
getSquaredNorm
()
+
static_pow
<
2
>
(
get_mass
(
beamCode
)));
Point
injectionPos
(
rootCS
,
0
_m
,
100
_m
,
0
_m
);
TimeType
const
period
=
2
*
M_PI
*
omega_inv
;
{
auto
elab2plab
=
[](
HEPEnergyType
Elab
,
HEPMassType
m
)
{
std
::
cout
<<
"|p| = "
<<
plab
.
getNorm
()
<<
"; E = "
<<
Elab
<<
std
::
endl
;
return
sqrt
(
Elab
*
Elab
-
m
*
m
);
std
::
cout
<<
"period: "
<<
period
<<
std
::
endl
;
};
HEPMomentumType
P0
=
elab2plab
(
E0
,
mass
);
Point
injectionPos
(
rootCS
,
0
_m
,
0
_m
,
0
_m
);
auto
momentumComponents
=
[](
double
theta
,
double
phi
,
HEPMomentumType
ptot
)
{
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
Elab
,
plab
,
injectionPos
,
0
_ns
));
return
std
::
make_tuple
(
ptot
*
cos
(
theta
),
ptot
*
sin
(
theta
),
ptot
*
sin
(
theta
));
};
auto
const
[
px
,
py
,
pz
]
=
momentumComponents
(
theta
/
180.
*
M_PI
,
phi
/
180.
*
M_PI
,
P0
);
auto
plab
=
MomentumVector
(
rootCS
,
{
px
,
py
,
pz
});
cout
<<
"input particle: "
<<
beamCode
<<
endl
;
cout
<<
"input momentum: "
<<
plab
.
getComponents
()
/
1
_GeV
<<
endl
;
stack
.
addParticle
(
std
::
make_tuple
(
beamCode
,
E0
,
plab
,
injectionPos
,
0
_ns
));
}
// setup relevant processes
// setup relevant processes
setup
::
Tracking
tracking
;
setup
::
Tracking
tracking
;
// StackInspector<setup::Stack> stackInspect(1, true, E0);
// put radio process here
// put radio process here
RadioProcess
<
decltype
(
detector
),
CoREAS
<
decltype
(
detector
),
RadioProcess
<
decltype
(
detector
),
CoREAS
<
decltype
(
detector
),
decltype
(
StraightPropagator
(
env
))
>
,
decltype
(
StraightPropagator
(
env
))
>
decltype
(
StraightPropagator
(
env
))
>
,
decltype
(
StraightPropagator
(
env
))
>
coreas
(
detector
,
env
);
coreas
(
detector
,
env
);
TimeCut
cut
(
1e-9
_s
);
TimeCut
cut
(
period
);
TrackWriter
trackWriter
(
"tracks.dat"
);
TrackWriter
trackWriter
(
"tracks.dat"
);
...
@@ -190,4 +182,4 @@ int main() {
...
@@ -190,4 +182,4 @@ int main() {
// get radio output
// get radio output
coreas
.
writeOutput
();
coreas
.
writeOutput
();
}
}
\ No newline at end of file
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