36 #ifndef _MC_TEL_LOADED 38 #define _MC_TEL_LOADED 2 40 #ifndef _EVENTIO_BASIC_LOADED 59 typedef unsigned short UINT16;
62 typedef unsigned long UINT32;
65 typedef unsigned int UINT32;
163 #define IO_TYPE_MC_BASE 1200 164 #define IO_TYPE_MC_RUNH (IO_TYPE_MC_BASE+0) 165 #define IO_TYPE_MC_TELPOS (IO_TYPE_MC_BASE+1) 166 #define IO_TYPE_MC_EVTH (IO_TYPE_MC_BASE+2) 167 #define IO_TYPE_MC_TELOFF (IO_TYPE_MC_BASE+3) 168 #define IO_TYPE_MC_TELARRAY (IO_TYPE_MC_BASE+4) 169 #define IO_TYPE_MC_PHOTONS (IO_TYPE_MC_BASE+5) 170 #define IO_TYPE_MC_LAYOUT (IO_TYPE_MC_BASE+6) 171 #define IO_TYPE_MC_TRIGTIME (IO_TYPE_MC_BASE+7) 172 #define IO_TYPE_MC_PE (IO_TYPE_MC_BASE+8) 173 #define IO_TYPE_MC_EVTE (IO_TYPE_MC_BASE+9) 174 #define IO_TYPE_MC_RUNE (IO_TYPE_MC_BASE+10) 175 #define IO_TYPE_MC_LONGI (IO_TYPE_MC_BASE+11) 176 #define IO_TYPE_MC_INPUTCFG (IO_TYPE_MC_BASE+12) 177 #define IO_TYPE_MC_TELARRAY_HEAD (IO_TYPE_MC_BASE+13) 178 #define IO_TYPE_MC_TELARRAY_END (IO_TYPE_MC_BASE+14) 179 #define IO_TYPE_MC_EXTRA_PARAM (IO_TYPE_MC_BASE+15) 180 #define IO_TYPE_MC_ATMPROF (IO_TYPE_MC_BASE+16) 186 real *data,
int len);
197 double *y,
double *z,
double *r);
199 double *x,
double *y,
double *z,
double *r);
203 double *xoff,
double *yoff);
205 double *xoff,
double *yoff,
double *
weight);
207 double *toff,
double *xoff,
double *yoff);
209 double *toff,
double *xoff,
double *yoff,
double *
weight);
223 double photons,
struct bunch *bunches,
int nbunches,
224 int ext_bunches,
char *ext_fname);
226 double photons,
struct compact_bunch *cbunches,
int nbunches,
227 int ext_bunches,
char *ext_fname);
229 int *tel,
double *photons,
struct bunch *bunches,
int *nbunches);
230 int print_tel_photons (
IO_BUFFER *iobuf);
233 double *data,
int ndim,
int np,
int nthick,
double thickstep);
235 int *type,
double *data,
int ndim,
int *np,
int *nthick,
236 double *thickstep,
int max_np);
240 int pixels,
double *xp,
double *yp);
242 int *type,
int *pixels,
double *xp,
double *yp);
246 int npe,
int pixels,
int flags,
int *pe_counts,
int *tstart,
247 double *t,
double *a,
int *photon_counts);
249 int max_pe,
int *array,
int *tel,
int *npe,
int *pixels,
int *flags,
250 int *pe_counts,
int *tstart,
double *t,
double *a,
int *photon_counts);
255 int print_shower_extra_parameters (
IO_BUFFER *iobuf);
260 void remember_corsika_atm_params(
float *hlay,
float *aatm,
float *batm,
float *catm);
261 int get_corsika_atm_params(
double *hlay,
double *aatm,
double *batm,
double *catm,
double *datm);
Photons collected in bunches of identical direction, position, time, and wavelength.
Definition: mc_tel.h:75
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.
Definition: io_simtel.c:620
float zem
Height of emission point above sea level (cm)
Definition: mc_tel.h:81
int print_tel_block(IO_BUFFER *iobuf)
Print a CORSIKA header/trailer block of any type (see mc_tel.h)
Definition: io_simtel.c:149
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)...
Definition: io_simtel.c:393
Atmospheric profile as stored in atmprof*.dat files - the actually used columns only.
Definition: mc_atmprof.h:49
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.
Definition: io_simtel.c:659
int clear_shower_extra_parameters(ShowerExtraParam *ep)
Similar to init_shower_extra_parameters() but without any attempts to re-allocate or resize buffers.
Definition: io_simtel.c:2422
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.
Definition: io_simtel.c:680
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)
Definition: io_simtel.c:89
int init_shower_extra_parameters(ShowerExtraParam *ep, size_t ni_max, size_t nf_max)
Initialize, resize, clear shower extra parameters.
Definition: io_simtel.c:2354
int write_tel_array_end(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int array)
End writing data for one array of telescopes/detectors.
Definition: io_simtel.c:917
int print_shower_longitudinal(IO_BUFFER *iobuf)
Print CORSIKA shower longitudinal distributions.
Definition: io_simtel.c:1607
int begin_read_tel_array(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int *array)
Begin reading data for one array of telescopes/detectors.
Definition: io_simtel.c:850
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.
Definition: io_simtel.c:1131
int pixel
The pixel that was hit.
Definition: mc_tel.h:120
static int ntel
Number of telescopes set up.
Definition: iact.c:334
A photo-electron produced by a photon hitting a pixel.
Definition: mc_tel.h:118
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 ...
Definition: io_simtel.c:1724
int end_read_tel_array(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih)
End reading data for one array of telescopes/detectors.
Definition: io_simtel.c:874
float cy
Direction cosines of photon direction.
Definition: mc_tel.h:79
int print_tel_pos(IO_BUFFER *iobuf)
Print positions of telescopes/detectors within a system or array.
Definition: io_simtel.c:547
int print_atmprof(IO_BUFFER *iobuf)
Print the atmospheric profile table as used in CORSIKA.
Definition: io_simtel.c:2665
float y
Arrival position relative to telescope (cm)
Definition: mc_tel.h:78
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).
Definition: io_simtel.c:56
int end_write_tel_array(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih)
End writing data for one array of telescopes/detectors.
Definition: io_simtel.c:828
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.
Definition: io_simtel.c:491
int print_photo_electrons(IO_BUFFER *iobuf)
List the the photoelectrons registered in a Cherenkov telescope camera.
Definition: io_simtel.c:2079
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...
Definition: io_simtel.c:1688
The compact_bunch struct is equivalent to the bunch struct except that we try to use less memory.
Definition: mc_tel.h:106
Basic header file for eventio data format.
int read_atmprof(IO_BUFFER *iobuf, AtmProf *atmprof)
Read the atmospheric profile table as used in CORSIKA.
Definition: io_simtel.c:2544
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.
Definition: io_simtel.c:591
short ctime
ctime*10 (0.1ns) after subtracting offset
Definition: mc_tel.h:111
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.
Definition: io_simtel.c:1231
short y
x,y*10 (mm)
Definition: mc_tel.h:109
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.
Definition: io_simtel.c:1005
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.
Definition: io_simtel.c:1503
int print_tel_offset(IO_BUFFER *iobuf)
Print offsets and weights of randomly scattered arrays with respect to shower core.
Definition: io_simtel.c:743
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.
Definition: io_simtel.c:454
A data structure shared between io_simtel.c and atmo.c - which is used by both sim_telarray and the C...
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.
Definition: io_simtel.c:1546
int lambda
The wavelength of the photon.
Definition: mc_tel.h:121
int print_camera_layout(IO_BUFFER *iobuf)
Print the layout (pixel positions) of a camera used for converting from photons to photo-electrons in...
Definition: io_simtel.c:1763
int begin_write_tel_array(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int array)
Begin writing data for one array of telescopes/detectors.
Definition: io_simtel.c:808
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...
Definition: io_simtel.c:340
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...
Definition: io_simtel.c:2478
float photons
Number of photons in bunch.
Definition: mc_tel.h:77
int read_tel_array_head(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int *array)
Begin reading data for one array of telescopes/detectors.
Definition: io_simtel.c:943
double atime
The time [ns] when the photon hit the pixel.
Definition: mc_tel.h:122
int read_tel_array_end(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int *array)
End reading data for one array of telescopes/detectors.
Definition: io_simtel.c:969
The linked_string is mainly used to keep CORSIKA input.
Definition: mc_tel.h:128
float ctime
Arrival time (ns)
Definition: mc_tel.h:80
short log_zem
log10(zem)*1000
Definition: mc_tel.h:112
The IO_BUFFER structure contains all data needed the manage the stuff.
Definition: io_basic.h:86
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.
Definition: io_simtel.c:1936
int write_tel_array_head(IO_BUFFER *iobuf, IO_ITEM_HEADER *ih, int array)
Begin writing data for one array of telescopes/detectors.
Definition: io_simtel.c:896
short cy
cx,cy*30000
Definition: mc_tel.h:110
float lambda
Wavelength in nanometers or 0.
Definition: mc_tel.h:82
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.
Definition: io_simtel.c:1830
short lambda
(nm) or 0
Definition: mc_tel.h:113
short photons
ph*100
Definition: mc_tel.h:108