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
f71fbdbf
Commit
f71fbdbf
authored
2 years ago
by
Nikos Karastathis
Browse files
Options
Downloads
Patches
Plain Diff
add extreme scenarios for testing radio
parent
ef147853
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
tests/modules/testRadio.cpp
+121
-1
121 additions, 1 deletion
tests/modules/testRadio.cpp
with
121 additions
and
1 deletion
tests/modules/testRadio.cpp
+
121
−
1
View file @
f71fbdbf
...
...
@@ -259,6 +259,126 @@ TEST_CASE("Radio", "[processes]") {
}
// END: SECTION("ZHS process")
SECTION
(
"Radio extreme cases"
)
{
// Environment
using
EnvironmentInterface
=
IRefractiveIndexModel
<
IMediumPropertyModel
<
IMagneticFieldModel
<
IMediumModel
>>>
;
using
EnvType
=
Environment
<
EnvironmentInterface
>
;
EnvType
envRadio
;
CoordinateSystemPtr
const
&
rootCSRadio
=
envRadio
.
getCoordinateSystem
();
Point
const
center
{
rootCSRadio
,
0
_m
,
0
_m
,
0
_m
};
create_5layer_atmosphere
<
EnvironmentInterface
,
MyExtraEnv
>
(
envRadio
,
AtmosphereId
::
LinsleyUSStd
,
center
,
1.415
,
Medium
::
AirDry1Atm
,
MagneticFieldVector
{
rootCSRadio
,
0
_T
,
50
_uT
,
0
_T
});
// now create antennas and detectors
// the antennas location
const
auto
point1
{
Point
(
envRadio
.
getCoordinateSystem
(),
0
_m
,
0
_m
,
0
_m
)};
// track points
Point
const
point_1
(
rootCSRadio
,
{
1
_m
,
1
_m
,
0
_m
});
Point
const
point_2
(
rootCSRadio
,
{
2
_km
,
1
_km
,
0
_m
});
Point
const
point_4
(
rootCSRadio
,
{
0
_m
,
1
_m
,
0
_m
});
// create times for the antenna
const
TimeType
start
{
0
_s
};
const
TimeType
duration
{
100
_ns
};
const
InverseTimeType
sample
{
1e+12
_Hz
};
const
TimeType
duration_dummy
{
2
_s
};
const
InverseTimeType
sample_dummy
{
1
_Hz
};
// check that I can create an antenna at (1, 2, 3)
TimeDomainAntenna
ant1
(
"antenna_name"
,
point1
,
rootCSRadio
,
start
,
duration
,
sample
,
start
);
TimeDomainAntenna
ant2
(
"dummy"
,
point1
,
rootCSRadio
,
start
,
duration_dummy
,
sample_dummy
,
start
);
// construct a radio detector instance to store our antennas
AntennaCollection
<
TimeDomainAntenna
>
detector
;
AntennaCollection
<
TimeDomainAntenna
>
detector_dummy
;
// add the antennas to the detector
detector
.
addAntenna
(
ant1
);
detector_dummy
.
addAntenna
(
ant2
);
// create a new stack for each trial
setup
::
Stack
<
EnvType
>
stack
;
// create a particle
const
Code
particle
{
Code
::
Electron
};
const
Code
particle2
{
Code
::
Proton
};
const
auto
pmass
{
get_mass
(
particle
)};
const
auto
pmass2
{
get_mass
(
particle2
)};
// construct an energy
const
HEPEnergyType
E0
{
1
_TeV
};
// compute the necessary momentumn
const
HEPMomentumType
P0
{
sqrt
(
E0
*
E0
-
pmass
*
pmass
)};
// and create the momentum vector
const
auto
plab
{
MomentumVector
(
rootCSRadio
,
{
P0
,
0
_GeV
,
0
_GeV
})};
// add the particle to the stack
auto
const
particle_stack
{
stack
.
addParticle
(
std
::
make_tuple
(
particle
,
calculate_kinetic_energy
(
plab
.
getNorm
(),
get_mass
(
particle
)),
plab
.
normalized
(),
point_1
,
0
_ns
))};
// particle stack with proton
auto
const
particle_stack_proton
{
stack
.
addParticle
(
std
::
make_tuple
(
particle2
,
calculate_kinetic_energy
(
plab
.
getNorm
(),
get_mass
(
particle2
)),
plab
.
normalized
(),
point_1
,
0
_ns
))};
// feed radio with a zero length trajectory to trigger the startTime = endTime check.
TimeType
t0
{(
point_1
-
point_1
).
getNorm
()
/
(
0.999
*
constants
::
c
)};
VelocityVector
v
{(
point_1
-
point_1
)
/
t0
};
Line
l
{
point_1
,
v
};
StraightTrajectory
track0
{
l
,
t0
};
Step
step0
(
particle_stack
,
track0
);
// feed radio with a proton track to check that it skips that track.
TimeType
tp
{(
point_2
-
point_1
).
getNorm
()
/
(
0.999
*
constants
::
c
)};
VelocityVector
vp
{(
point_2
-
point_1
)
/
tp
};
Line
lp
{
point_1
,
vp
};
StraightTrajectory
track_p
{
lp
,
tp
};
Step
step_proton
(
particle_stack_proton
,
track_p
);
// feed radio with a track that triggers zhs like approx in coreas and fraunhofer limit check for zhs
TimeType
th
{(
point_4
-
point1
).
getNorm
()
/
constants
::
c
};
VelocityVector
vh
{(
point_4
-
point1
)
/
th
};
Line
lh
{
point1
,
vh
};
StraightTrajectory
track_h
{
lh
,
th
};
Step
step_h
(
particle_stack
,
track_h
);
// create radio process instances
RadioProcess
<
decltype
(
detector
),
CoREAS
<
decltype
(
detector
),
decltype
(
SimplePropagator
(
envRadio
))
>
,
decltype
(
SimplePropagator
(
envRadio
))
>
coreas
(
detector
,
envRadio
);
RadioProcess
<
decltype
(
detector
),
ZHS
<
decltype
(
detector
),
decltype
(
SimplePropagator
(
envRadio
))
>
,
decltype
(
SimplePropagator
(
envRadio
))
>
zhs
(
detector
,
envRadio
);
coreas
.
doContinuous
(
step0
,
true
);
zhs
.
doContinuous
(
step0
,
true
);
coreas
.
doContinuous
(
step_proton
,
true
);
zhs
.
doContinuous
(
step_proton
,
true
);
coreas
.
doContinuous
(
step_h
,
true
);
zhs
.
doContinuous
(
step_h
,
true
);
// create radio processes with "dummy" antenna to trigger extreme time-binning
RadioProcess
<
decltype
(
detector_dummy
),
CoREAS
<
decltype
(
detector_dummy
),
decltype
(
SimplePropagator
(
envRadio
))
>
,
decltype
(
SimplePropagator
(
envRadio
))
>
coreas_dummy
(
detector_dummy
,
envRadio
);
RadioProcess
<
decltype
(
detector_dummy
),
ZHS
<
decltype
(
detector_dummy
),
decltype
(
SimplePropagator
(
envRadio
))
>
,
decltype
(
SimplePropagator
(
envRadio
))
>
zhs_dummy
(
detector_dummy
,
envRadio
);
coreas_dummy
.
doContinuous
(
step_h
,
true
);
zhs_dummy
.
doContinuous
(
step_h
,
true
);
}
// END: SECTION("Radio extreme cases")
}
// END: TEST_CASE("Radio", "[processes]")
TEST_CASE
(
"Antennas"
)
{
...
...
@@ -673,7 +793,7 @@ TEST_CASE("Propagators") {
Approx
(
0
).
margin
(
absMargin
));
CHECK
(
path
.
average_refractive_index_
==
Approx
(
0.210275935
));
CHECK
(
path
.
refractive_index_source_
==
Approx
(
2
));
//
CHECK(path.refractive_index_destination_ == Approx(0.0000000041));
// CHECK(path.refractive_index_destination_ == Approx(0.0000000041));
CHECK
(
path
.
emit_
.
getComponents
()
==
vvv1
.
getComponents
());
CHECK
(
path
.
receive_
.
getComponents
()
==
vvv2
.
getComponents
());
CHECK
(
path
.
R_distance_
==
10
_m
);
...
...
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