CORSIKA add-on package IACT/ATMO:
Version 1.63 (November 2020)
|
Definitions and structures for CORSIKA Cherenkov light interface. More...
Go to the source code of this file.
Data Structures | |
struct | bunch |
Photons collected in bunches of identical direction, position, time, and wavelength. More... | |
struct | compact_bunch |
The compact_bunch struct is equivalent to the bunch struct except that we try to use less memory. More... | |
struct | linked_string |
The linked_string is mainly used to keep CORSIKA input. More... | |
struct | photo_electron |
A photo-electron produced by a photon hitting a pixel. More... | |
struct | shower_extra_parameters |
Extra shower parameters of unspecified nature. More... | |
Typedefs | |
typedef short | INT16 |
typedef int | INT32 |
typedef float | real |
typedef struct shower_extra_parameters | ShowerExtraParam |
typedef unsigned short | UINT16 |
typedef unsigned int | UINT32 |
Functions | |
int | begin_read_tel_array (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int *array) |
Begin reading data for one array of telescopes/detectors. More... | |
int | begin_write_tel_array (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int array) |
Begin writing data for one array of telescopes/detectors. More... | |
int | clear_shower_extra_parameters (ShowerExtraParam *ep) |
Similar to init_shower_extra_parameters() but without any attempts to re-allocate or resize buffers. More... | |
int | end_read_tel_array (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih) |
End reading data for one array of telescopes/detectors. More... | |
int | end_write_tel_array (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih) |
End writing data for one array of telescopes/detectors. More... | |
int | get_corsika_atm_params (double *hlay, double *aatm, double *batm, double *catm, double *datm) |
ShowerExtraParam * | get_shower_extra_parameters (void) |
int | init_shower_extra_parameters (ShowerExtraParam *ep, size_t ni_max, size_t nf_max) |
Initialize, resize, clear shower extra parameters. More... | |
int | print_atmprof (IO_BUFFER *iobuf) |
Print the atmospheric profile table as used in CORSIKA. More... | |
int | print_camera_layout (IO_BUFFER *iobuf) |
Print the layout (pixel positions) of a camera used for converting from photons to photo-electrons in a pixel. More... | |
int | print_photo_electrons (IO_BUFFER *iobuf) |
List the the photoelectrons registered in a Cherenkov telescope camera. More... | |
int | print_shower_extra_parameters (IO_BUFFER *iobuf) |
int | print_shower_longitudinal (IO_BUFFER *iobuf) |
Print CORSIKA shower longitudinal distributions. More... | |
int | print_tel_block (IO_BUFFER *iobuf) |
Print a CORSIKA header/trailer block of any type (see mc_tel.h) More... | |
int | print_tel_offset (IO_BUFFER *iobuf) |
Print offsets and weights of randomly scattered arrays with respect to shower core. More... | |
int | print_tel_photons (IO_BUFFER *iobuf) |
int | print_tel_pos (IO_BUFFER *iobuf) |
Print positions of telescopes/detectors within a system or array. More... | |
int | read_atmprof (IO_BUFFER *iobuf, AtmProf *atmprof) |
Read the atmospheric profile table as used in CORSIKA. More... | |
int | read_camera_layout (IO_BUFFER *iobuf, int max_pixels, int *itel, int *type, int *pixels, double *xp, double *yp) |
Read the layout (pixel positions) of a camera used for converting from photons to photo-electrons in a pixel. More... | |
int | read_input_lines (IO_BUFFER *iobuf, struct linked_string *list) |
Read a block with several character strings (normally containing the text of the CORSIKA inputs file) into a linked list. More... | |
int | read_photo_electrons (IO_BUFFER *iobuf, int max_pixel, int max_pe, int *array, int *tel, int *npe, int *pixels, int *flags, int *pe_counts, int *tstart, double *t, double *a, int *photon_counts) |
Read the photoelectrons registered in a Cherenkov telescope camera. More... | |
int | read_shower_extra_parameters (IO_BUFFER *iobuf, ShowerExtraParam *ep) |
int | read_shower_longitudinal (IO_BUFFER *iobuf, int *event, int *type, double *data, int ndim, int *np, int *nthick, double *thickstep, int max_np) |
Read CORSIKA shower longitudinal distributions. More... | |
int | read_tel_array_end (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int *array) |
End reading data for one array of telescopes/detectors. More... | |
int | read_tel_array_head (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int *array) |
Begin reading data for one array of telescopes/detectors. More... | |
int | read_tel_block (IO_BUFFER *iobuf, int type, real *data, int maxlen) |
Read a CORSIKA header/trailer block of given type (see mc_tel.h) More... | |
int | read_tel_offset (IO_BUFFER *iobuf, int max_array, int *narray, double *toff, double *xoff, double *yoff) |
Read offsets of randomly scattered arrays with respect to shower core. More... | |
int | read_tel_offset_w (IO_BUFFER *iobuf, int max_array, int *narray, double *toff, double *xoff, double *yoff, double *weight) |
Read offsets and weights of randomly scattered arrays with respect to shower core. More... | |
int | read_tel_photons (IO_BUFFER *iobuf, int max_bunches, int *array, int *tel, double *photons, struct bunch *bunches, int *nbunches) |
Read bunches of Cherenkov photons for one telescope/detector. More... | |
int | read_tel_pos (IO_BUFFER *iobuf, int max_tel, int *ntel, double *x, double *y, double *z, double *r) |
Read positions of telescopes/detectors within a system or array. More... | |
void | remember_corsika_atm_params (float *hlay, float *aatm, float *batm, float *catm) |
int | write_atmprof (IO_BUFFER *iobuf, AtmProf *atmprof) |
Write the atmospheric profile table as used in CORSIKA with ATMEXT option and set up with 'ATMOSPHERE <n> <fref>' or 'IACT ATMOFILE <name>' data cards. More... | |
int | write_camera_layout (IO_BUFFER *iobuf, int itel, int type, int pixels, double *xp, double *yp) |
Write the layout (pixel positions) of a camera used for converting from photons to photo-electrons in a pixel. More... | |
int | write_input_lines (IO_BUFFER *iobuf, struct linked_string *list) |
Write a linked list of character strings (normally containing the text of the CORSIKA inputs file) as a dedicated block. More... | |
int | write_photo_electrons (IO_BUFFER *iobuf, int array, int tel, int npe, int pixels, int flags, int *pe_counts, int *tstart, double *t, double *a, int *photon_counts) |
Write the photo-electrons registered in a Cherenkov telescope camera. More... | |
int | write_shower_extra_parameters (IO_BUFFER *iobuf, ShowerExtraParam *ep) |
int | write_shower_longitudinal (IO_BUFFER *iobuf, int event, int type, double *data, int ndim, int np, int nthick, double thickstep) |
Write CORSIKA shower longitudinal distributions. More... | |
int | write_tel_array_end (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int array) |
End writing data for one array of telescopes/detectors. More... | |
int | write_tel_array_head (IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int array) |
Begin writing data for one array of telescopes/detectors. More... | |
int | write_tel_block (IO_BUFFER *iobuf, int type, int num, real *data, int len) |
Write a CORSIKA block as given type number (see mc_tel.h). More... | |
int | write_tel_compact_photons (IO_BUFFER *iobuf, int array, int tel, double photons, struct compact_bunch *cbunches, int nbunches, int ext_bunches, char *ext_fname) |
Write all the photon bunches for one telescope to an I/O buffer. More... | |
int | write_tel_offset (IO_BUFFER *iobuf, int narray, double toff, double *xoff, double *yoff) |
Write offsets of randomly scattered arrays with respect to shower core. More... | |
int | write_tel_offset_w (IO_BUFFER *iobuf, int narray, double toff, double *xoff, double *yoff, double *weight) |
Write offsets and weights of randomly scattered arrays with respect to shower core. More... | |
int | write_tel_photons (IO_BUFFER *iobuf, int array, int tel, double photons, struct bunch *bunches, int nbunches, int ext_bunches, char *ext_fname) |
Write all the photon bunches for one telescope to an I/O buffer. More... | |
int | write_tel_pos (IO_BUFFER *iobuf, int ntel, double *x, double *y, double *z, double *r) |
Write positions of telescopes/detectors within a system or array. More... | |
This file contains definitions of data structures and of function prototypes as needed for the Cherenkov light extraction interfaced to the modified CORSIKA code.
CVS $Date: 2019/07/13 18:27:56 $
CVS $Revision: 1.20 $
int begin_read_tel_array | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih, | ||
int * | array | ||
) |
Note: this function does not finish reading from the I/O block but after reading of the photons a call to end_read_tel_array() is needed.
iobuf | – I/O buffer descriptor |
ih | – I/O item header (for item opened here) |
array | – Number of array |
int begin_write_tel_array | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih, | ||
int | array | ||
) |
Note: this function does not finish writing to the I/O block but after writing of the photons a call to end_write_tel_array() is needed.
iobuf | I/O buffer descriptor |
ih | I/O item header (for item opened here) |
array | Number of array |
int clear_shower_extra_parameters | ( | ShowerExtraParam * | ep | ) |
Just clear contents.
ep | Pointer to parameter block. A NULL value indicates that the static block is meant. |
int end_read_tel_array | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih | ||
) |
iobuf | I/O buffer descriptor |
ih | I/O item header (as opened in begin_write_tel_array() ) |
int end_write_tel_array | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih | ||
) |
iobuf | I/O buffer descriptor |
ih | I/O item header (as opened in begin_write_tel_array() ) |
int init_shower_extra_parameters | ( | ShowerExtraParam * | ep, |
size_t | ni_max, | ||
size_t | nf_max | ||
) |
ep | Pointer to parameter block. A NULL value indicates that the static block is meant. |
ni_max | The number of integer parameters to be used. |
nf_max | The number of float parameters to be used. |
int print_atmprof | ( | IO_BUFFER * | iobuf | ) |
iobuf | I/O buffer descriptor |
int print_camera_layout | ( | IO_BUFFER * | iobuf | ) |
iobuf | I/O buffer descriptor |
int print_photo_electrons | ( | IO_BUFFER * | iobuf | ) |
iobuf | I/O buffer descriptor |
int print_shower_longitudinal | ( | IO_BUFFER * | iobuf | ) |
iobuf | I/O buffer descriptor |
int print_tel_block | ( | IO_BUFFER * | iobuf | ) |
iobuf | I/O buffer descriptor |
int print_tel_offset | ( | IO_BUFFER * | iobuf | ) |
iobuf | I/O buffer descriptor |
int print_tel_pos | ( | IO_BUFFER * | iobuf | ) |
iobuf | I/O buffer descriptor |
iobuf | I/O buffer descriptor |
atmprof | Address of struct with relevant parts of atmospheric profile table |
int read_camera_layout | ( | IO_BUFFER * | iobuf, |
int | max_pixels, | ||
int * | itel, | ||
int * | type, | ||
int * | pixels, | ||
double * | xp, | ||
double * | yp | ||
) |
iobuf | I/O buffer descriptor |
max_pixels | The maximum number of pixels that can be stored in xp, yp. |
itel | telescope number |
type | camera type (hex/square) |
pixels | number of pixels |
xp | X positions of pixels |
yp | Y position of pixels |
int read_input_lines | ( | IO_BUFFER * | iobuf, |
struct linked_string * | list | ||
) |
iobuf | I/O buffer descriptor |
list | starting point of linked list (on first call this should be a link to an empty list, i.e. the first element has text=NULL and next=NULL; on additional calls the new lines will be appended.) |
int read_photo_electrons | ( | IO_BUFFER * | iobuf, |
int | max_pixels, | ||
int | max_pe, | ||
int * | array, | ||
int * | tel, | ||
int * | npe, | ||
int * | pixels, | ||
int * | flags, | ||
int * | pe_counts, | ||
int * | tstart, | ||
double * | t, | ||
double * | a, | ||
int * | photon_counts | ||
) |
iobuf | I/O buffer descriptor |
max_pixels | Maximum number of pixels which can be treated |
max_pe | Maximum number of photo-electrons |
array | Array number |
tel | Telescope number |
npe | The total number of photo-electrons read. |
pixels | Number of pixels read. |
flags | Bit 0: amplitudes available, bit 1: includes NSB p.e. |
pe_counts | Numbers of photo-electrons in each pixel |
tstart | Offsets in 't' at which data for each pixel starts |
t | Time of arrival of photons at the camera. |
a | Amplitudes of p.e. signals [mean p.e.] (optional, may be NULL). |
photon_counts | Optional number of photons arriving at a pixel. |
int read_shower_longitudinal | ( | IO_BUFFER * | iobuf, |
int * | event, | ||
int * | type, | ||
double * | data, | ||
int | ndim, | ||
int * | np, | ||
int * | nthick, | ||
double * | thickstep, | ||
int | max_np | ||
) |
See tellng_() in iact.c for more detailed parameter description.
iobuf | I/O buffer descriptor |
event | return event number |
type | return 1 = particle numbers, 2 = energy, 3 = energy deposits |
data | return set of (usually 9) distributions |
ndim | maximum number of entries per distribution |
np | return number of distributions (usually 9) |
nthick | return number of entries actually filled per distribution (is 1 if called without LONGI being enabled). |
thickstep | return step size in g/cm**2 |
max_np | maximum number of distributions for which we have space. |
int read_tel_array_end | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih, | ||
int * | array | ||
) |
iobuf | I/O buffer descriptor |
ih | I/O item header (as opened in begin_write_tel_array() ) |
int read_tel_array_head | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih, | ||
int * | array | ||
) |
Note: this function does not finish reading from the I/O block but after reading of the photons a call to end_read_tel_array() is needed.
iobuf | – I/O buffer descriptor |
ih | – I/O item header (for item opened here) |
array | – Number of array |
int read_tel_block | ( | IO_BUFFER * | iobuf, |
int | type, | ||
real * | data, | ||
int | maxlen | ||
) |
iobuf | I/O buffer descriptor |
type | block type (see mc_tel.h) |
data | area for data to be read |
maxlen | maximum number of elements to be read |
int read_tel_offset | ( | IO_BUFFER * | iobuf, |
int | max_array, | ||
int * | narray, | ||
double * | toff, | ||
double * | xoff, | ||
double * | yoff | ||
) |
iobuf | I/O buffer descriptor |
max_array | Maximum number of arrays that can be treated |
narray | Number of arrays of telescopes/detectors |
toff | Time offset (ns, from first interaction to ground) |
xoff | X offsets of arrays |
yoff | Y offsets of arrays |
int read_tel_offset_w | ( | IO_BUFFER * | iobuf, |
int | max_array, | ||
int * | narray, | ||
double * | toff, | ||
double * | xoff, | ||
double * | yoff, | ||
double * | weight | ||
) |
iobuf | I/O buffer descriptor |
max_array | Maximum number of arrays that can be treated |
narray | Number of arrays of telescopes/detectors |
toff | Time offset (ns, from first interaction to ground) |
xoff | X offsets of arrays |
yoff | Y offsets of arrays |
weight | Area weight for uniform or importance sampled core offset. For old version data (uniformly sampled), 0.0 is returned. |
int read_tel_photons | ( | IO_BUFFER * | iobuf, |
int | max_bunches, | ||
int * | array, | ||
int * | tel, | ||
double * | photons, | ||
struct bunch * | bunches, | ||
int * | nbunches | ||
) |
The data format may be either the more or less compact one.
iobuf | I/O buffer descriptor |
max_bunches | maximum number of bunches that can be treated |
array | array number |
tel | telescope number |
photons | sum of photons (and fractions) in this device |
bunches | list of photon bunches |
nbunches | number of elements in bunch list |
int read_tel_pos | ( | IO_BUFFER * | iobuf, |
int | max_tel, | ||
int * | ntel, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
double * | r | ||
) |
iobuf | I/O buffer descriptor |
max_tel | maximum number of telescopes allowed |
ntel | number of telescopes/detectors |
x | X positions |
y | Y positions |
z | Z positions |
r | radius of spheres including the whole devices |
iobuf | I/O buffer descriptor |
atmprof | Address of struct with relevant parts of atmospheric profile table |
int write_camera_layout | ( | IO_BUFFER * | iobuf, |
int | itel, | ||
int | type, | ||
int | pixels, | ||
double * | xp, | ||
double * | yp | ||
) |
iobuf | I/O buffer descriptor |
itel | telescope number |
type | camera type (hex/square) |
pixels | number of pixels |
xp | X positions of pixels |
yp | Y position of pixels |
int write_input_lines | ( | IO_BUFFER * | iobuf, |
struct linked_string * | list | ||
) |
iobuf | I/O buffer descriptor |
list | starting point of linked list |
int write_photo_electrons | ( | IO_BUFFER * | iobuf, |
int | array, | ||
int | tel, | ||
int | npe, | ||
int | flags, | ||
int | pixels, | ||
int * | pe_counts, | ||
int * | tstart, | ||
double * | t, | ||
double * | a, | ||
int * | photon_counts | ||
) |
iobuf | I/O buffer descriptor |
array | array number |
tel | telescope number |
npe | Total number of photo-electrons in the camera. |
pixels | No. of pixels to be written |
flags | Bit 0: save also amplitudes if available, Bit 1: p.e. list includes NSB p.e., bit 2: data also including no. of photons hitting each pixel. bit 3: photons (if any) are in wavelength range 300-550 nm. |
pe_counts | Numbers of photo-electrons in each pixel |
tstart | Offsets in 't' at which data for each pixel starts |
t | Time of arrival of photons at the camera. |
a | Amplitudes of p.e. signals [mean p.e.] (optional, may be NULL). |
photon_counts | Optional number of photons arriving at a pixel (with flags bit 2 set) |
int write_shower_longitudinal | ( | IO_BUFFER * | iobuf, |
int | event, | ||
int | type, | ||
double * | data, | ||
int | ndim, | ||
int | np, | ||
int | nthick, | ||
double | thickstep | ||
) |
See tellng_() in iact.c for more detailed parameter description.
iobuf | I/O buffer descriptor |
event | event number |
type | 1 = particle numbers, 2 = energy, 3 = energy deposits |
data | set of (usually 9) distributions |
ndim | maximum number of entries per distribution |
np | number of distributions (usually 9) |
nthick | number of entries actually filled per distribution (is 1 if called without LONGI being enabled). |
thickstep | step size in g/cm**2 |
int write_tel_array_end | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih, | ||
int | array | ||
) |
iobuf | I/O buffer descriptor |
ih | I/O item header (as opened in begin_write_tel_array() ) |
int write_tel_array_head | ( | IO_BUFFER * | iobuf, |
IO_ITEM_HEADER * | ih, | ||
int | array | ||
) |
Note: this function does not finish writing to the I/O block but after writing of the photons a call to end_write_tel_array() is needed.
iobuf | I/O buffer descriptor |
ih | I/O item header (for item opened here) |
array | Number of array |
int write_tel_block | ( | IO_BUFFER * | iobuf, |
int | type, | ||
int | num, | ||
real * | data, | ||
int | len | ||
) |
iobuf | I/O buffer descriptor |
type | block type (see mc_tel.h) |
num | Run or event number depending on type |
data | Data as passed from CORSIKA |
len | Number of elements to be written |
int write_tel_compact_photons | ( | IO_BUFFER * | iobuf, |
int | array, | ||
int | tel, | ||
double | photons, | ||
struct compact_bunch * | cbunches, | ||
int | nbunches, | ||
int | ext_bunches, | ||
char * | ext_fname | ||
) |
Usually, calls to this function for each telescope in an array should be enclosed within calls to begin_write_tel_array() and end_write_tel_array(). This routine writes the more compact format (16 bytes per bunch). The more compact format should usually be used to save memory and disk space.
iobuf | I/O buffer descriptor |
array | array number |
tel | telescope number |
photons | sum of photons (and fractions) in this device |
cbunches | list of photon bunches |
nbunches | number of elements in bunch list |
ext_bunches | number of elements in external file |
ext_fname | name of external (temporary) file |
int write_tel_offset | ( | IO_BUFFER * | iobuf, |
int | narray, | ||
double | toff, | ||
double * | xoff, | ||
double * | yoff | ||
) |
iobuf | I/O buffer descriptor |
narray | Number of arrays of telescopes/detectors |
toff | Time offset (ns, from first interaction to ground) |
xoff | X offsets of arrays |
yoff | Y offsets of arrays |
int write_tel_offset_w | ( | IO_BUFFER * | iobuf, |
int | narray, | ||
double | toff, | ||
double * | xoff, | ||
double * | yoff, | ||
double * | weight | ||
) |
With respect to the backwards-compatible non-weights version write_tel_offset(), this version adds a weight to each offset position which should be normalized in such a way that with uniform sampling it should be the area over which showers are thrown divided by the number of array in each shower. With importance sampling the same relation should hold on average. So in either case, the average sum of weights for the different offsets in one shower equals just the area over which cores are randomized. This leaves the possibility to change the number of offsets from shower to shower.
iobuf | I/O buffer descriptor |
narray | Number of arrays of telescopes/detectors |
toff | Time offset (ns, from first interaction to ground) |
xoff | X offsets of arrays |
yoff | Y offsets of arrays |
weight | Area weight for uniform or importance sampled core offset. |
int write_tel_photons | ( | IO_BUFFER * | iobuf, |
int | array, | ||
int | tel, | ||
double | photons, | ||
struct bunch * | bunches, | ||
int | nbunches, | ||
int | ext_bunches, | ||
char * | ext_fname | ||
) |
Usually, calls to this function for each telescope in an array should be enclosed within calls to begin_write_tel_array() and end_write_tel_array(). This routine writes the less compact format (32 bytes per bunch).
iobuf | I/O buffer descriptor |
array | array number |
tel | telescope number |
photons | sum of photons (and fractions) in this device |
bunches | list of photon bunches |
nbunches | number of elements in bunch list |
ext_bunches | number of elements in external file |
ext_fname | name of external (temporary) file |
int write_tel_pos | ( | IO_BUFFER * | iobuf, |
int | ntel, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
double * | r | ||
) |
iobuf | I/O buffer descriptor |
ntel | number of telescopes/detectors |
x | X positions |
y | Y positions |
z | Z positions |
r | radius of spheres including the whole devices |