source: trunk/MagicSoft/Mars/mfileio/structures.h@ 3308

Last change on this file since 3308 was 1664, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 37.4 KB
Line 
1/******************************************************************/
2/* GGG AAA M M M M AAA SSS */
3/* G G A A MM MM MM MM A A S S */
4/* G A A M M M M M M A A SS */
5/* G GG AAAAA M M M M AAAAA SS */
6/* G G A A M M M M A A S S */
7/* GGG A A M M M M A A SSS */
8/* Gamma Astronomer's Munich Madrid Analysis Suite */
9/* An Atmospheric Cherenkov Telescope Data Analysis Software */
10/* MPI f"ur Physik, M"unchen & Universidad Complutense, Madrid */
11/******************************************************************/
12
13/******************************************************************/
14/* This File belongs to the programs */
15/* */
16/* P R E P R O C E S S O R and I M A G E R */
17/* */
18/* Purpose: provide the structure definitions common to both */
19/* programs, especially the output structures of the */
20/* preprocessor */
21/* */
22/******************************************************************/
23
24/******************************************************************/
25/* @(#) File name structures.h
26 @(#) latest SID 0.5
27 @(#) Date of latest delta 26/6/00
28 Author: D. Petry
29 changed by M. Kestel */
30/******************************************************************/
31
32#ifndef _structures_h_
33#define _structures_h_ "__structures_h__"
34
35#define STRUCT_VERSION 0.6
36
37#define iHEADERTITLELENGTH 60
38/* length of the string written at the beginning of the */
39/* output for each runfile */
40#define cTITLE_TEMPLATE "PREPROC V%f/S%f CT %d RUN %d %d PROCMJD %d\n"
41
42#define cEND_EVENTS_TEMPLATE "EVENTS AFTER FILTER = %d\n"
43
44#define iMAXNUMPIX 127
45/* maximum value for the number of camera pixels (excl. muon shield) */
46#define iMAXNUMMUONPIX 5
47/* maximum value for the number of pixels in the muon shield */
48#define iMAXNUMCOINTDCS 5
49/* maximum value for the number of coincidence tdcs */
50
51
52#define iBADMACTIME_BIT 1
53/* snot_ok_flags is ORed with this number to set the bit which
54 * indicates that the mactime measurement didn't work */
55#define iBADRUBTIME_BIT 2
56/* snot_ok_flags is ORed with this number to set the bit which
57 * indicates that the Rubidium time measurement didn't work */
58#define iBADPOINTING_BIT 4
59/* snot_ok_flags is ORed with this number to set the bit which
60 * indicates that the shaft encoder values were inconsistent with
61 * time OR source coordinates */
62#define iMUON_BIT 8
63 /* snot_ok_flags is ORed with this number to set the bit which
64 * indicates that the event didn't pass the muon filter
65 * (for test puposes) */
66
67#define i2OUTFAIL_BIT 16
68/* snot_ok_flags is ORed with this number to set the bit which
69 * indicates that the event didn't pass the "two out of all"
70 * software trigger */
71#define iSUMFAIL_BIT 32
72/* snot_ok_flags is ORed with this number to set the bit which
73 * indicates that the event didn't pass the "sum of all
74 * photoelectrons" filter */
75
76#define iPARTICLETYPE_FACTOR 1024
77/* for MC data: the particle type multiplied with this number
78 * is ORed with snot_ok_flags */
79
80enum onoroff {NEITHER_ON_NOR_OFF, OFF_SOURCE, ON_SOURCE};
81enum trackmodes {NORMAL, REVERSE, DUNNO};
82enum axes {RA, DEC, ALT, AZ};
83enum eERRORTOLERANCE {CAUTIOUS=0, GOODPHYSICS, TANK};
84enum eMCTRIGGERFLAG {ALL=0, FLAG, NOFLAG};
85
86struct outputpars {
87 /* preprocessing parameters that are passed to imager.
88 * Note: Not all parameters from the parameter file are passed to
89 * imager, only those that are repeated in this struct outputpars
90 * here !! That's why these two structs must be the same for both
91 * preproc and imager. */
92
93 int itelescope;
94 /* number of the CT which took the data (from parameters file */
95 /* crosschecked with run file name) */
96 float flongitude_deg;
97 /* longitude (counted positive towards West) of CT position */
98 float flatitude_deg;
99 /* latitude (counted positive towards North) of CT position */
100 int irunnum;
101 /* run number (from parameters file cross checked with run */
102 /* file name) */
103 enum onoroff eruntype;
104#ifdef LINUX
105 int dummy;
106#endif
107 /* indicates if the */
108 /* run is on- or off source (from runfile cross checked with */
109 /* file name) */
110 double dsourcera_hours;
111 /* right ascension of observed source in hours */
112 double dsourcedec_deg;
113 /* declination of observed source in degrees */
114 int inumpixels;
115 /* number of pixels in the camera (from parameters file cross */
116 /* checked with run file, calibration file and pedestal file) */
117 int inummuonpixels;
118 /* number of pixels in the muon shield (from parameters file */
119 /* cross checked with run file, calibration file and pedestal */
120 /* file) */
121 int inumcointdcs;
122 /* number of coincidence tdcs recorded in the runfile (from */
123 /* parameters file cross checked */
124 /* with run file) */
125 float fpixdiameter_deg;
126 /* smallest pixel diameter (degrees) (from parameters file) */
127 enum axes ese1_is;
128 /* name of the axis to which shaft encoder 1 is attached */
129 /* (implies the type of mount) */
130 int isezeropos[2];
131 /* zero position of shaftencoders 1 and 2 (from parameters file) */
132 int iaz_rev_track_corr;
133 /* correction for the azimuth shaft encoder (ALT/AZ mount */
134 /* only) in reverse tracking mode */
135 int ialt_rev_track_corr;
136 /* correction for the altitude shaft encoder (ALT/AZ mount */
137 /* only) in reverse tracking mode */
138 float fbendingcorr;
139 /* bending correction factor (ALT/AZ mount only) */
140 float fextinction;
141 /* atmospheric extinction (typically taken from the Carlsberg */
142 /* Meridian Circle data) */
143 Boolean bdontusepix[iMAXNUMPIX];
144 /* bdontusepix is set true if the pixel should due to whatever
145 * reason not be used in image analysis, otherwise it is true;
146 *
147 * bdontusepix is set by the user inside preproc.par and is
148 * untouched by preproc (version >= 0.4). */
149 Boolean bexcludepix[iMAXNUMPIX];
150 /* bexcludepix[] is set TRUE (== exclude from pedestal, Laser
151 * calibration and the further analysis) when the Mean value
152 * of a pixel inside a pedestal Run is larger than 50 or ( || )
153 * if the pedestal RMS value of this pixel is larger than 5.0
154 * This is reflected in the (new for versions >= 0.4)
155 * variable "pixonoff" in the ntuple written by preproc:
156 * preproc.nt.hbook
157 *
158 * When the pixel is excluded by the user it will get a -2 otherwise
159 * pixonoff = 0.
160 * Additive to this a -1 is added when preproc excludes the pixel
161 * for a given Run. So the actual value tells you whether you caught
162 * it already by hand or not.
163 *
164 * A plot of pixonoff may also be handy to tell you the status of your
165 * ADC equipment. */
166 float fphotoel_per_adccnt[iMAXNUMPIX];
167 /* conversion factors for the pixel signals */
168 int irubminusutc_usecs;
169 /* difference between rubidium clock and UTC in microseconds */
170 int isum_thresh_phot;
171 /* threshold for the total sum of photoelectrons filter */
172 /* from the parameters file */
173 int i2out_thresh_phot;
174 /* threshold for the two-pixels-out-of-all software */
175 /* trigger from parameters file */
176 int imuoncut_thresh_adccnt[iMAXNUMMUONPIX];
177 /* thresholds for the muon cut */
178 Boolean bmuon_suppression;
179 /* "Dolby" noise reduction flag */
180 float ftolerated_pointerror_deg;
181 /* maximum tolerated pointing error in the position
182 * check in iprocessdata */
183 float fxpointcorr_deg;
184 /* pointing correction (to be added along the camera
185 * x axis) e.g. from point run */
186 float fypointcorr_deg;
187 /* pointing correction (to be added along the camera
188 * y axis) e.g. from point run */
189 float fcamera_align_angle_deg;
190 /* the angle between the camera y-axis and the meridian
191 * when a culminating object is observed (defined
192 * counter-clockwise looking at the sky) */
193 int iratecalc_numevents_odd;
194 /* number of events used in the rate calculation (must be odd) */
195 int inumpedfile;
196 /* number of the pedestal file used */
197 int inumpedrun;
198 /* number of the pedestal run used in the file (starting at 0) */
199 int inumcalfile;
200 /* number of the calibration file used */
201 int inumlaserrun;
202 /* number of the laserrun used in the file (starting at 0) */
203 int inumtellogfile;
204 /* number of the TelLog file to be used */
205 int inumtellogrun;
206 /* number of the tellog entry (Runnumber) used from the log file */
207 int imcparticle; /* CORSIKA-coded Monte Carlo particle type.
208 * This is given once per run. */
209
210 /* preprocessing results: */
211
212 int istart_mjdate_day;
213 /* MJD of run start (first event) */
214 int iend_mjdate_day;
215 /* MJD of run end (last event) */
216 int irunduration_secs;
217 /* difference between start and end time (secs) */
218 int iproc_mjdate;
219 /* MJD of data processing (i.e. creation of this file) */
220 enum trackmodes etrackmode;
221 /* tracking mode (for ALT/AZ CTs) */
222 int iproc_evts;
223#ifdef LINUX
224 int dummy2;
225#endif
226 /* number of events processed */
227 double dactual_sourcera_hours;
228 /* for off runs: the false source (that should have been) observed */
229 float frms_pedsig_phot[iMAXNUMPIX];
230 /* standard deviation of the calibrated signals from the pedestal run */
231 float fpedrms_mean; /* Used to communicate the mean over all pixels
232 * pedestal RMS into the Runs NTuple, as it might
233 * be used for e.g. quality cuts. */
234 float fcurrent_mean; /* The average current over the active pixels
235 * for this run. This is done separately for
236 * ON and OF runs. */
237
238 enum eERRORTOLERANCE eerrortolerance;
239 /* 0 == "cautious", exits on any reason (but tells in
240 * the .err file,
241 * 1 == "goodphysics", exits when physics could be affected
242 * by the error,
243 * 2 == "tank", never exits except on coredumps and when
244 * all files have been processed. Do not use such files for
245 * physics analysis!
246 *
247 * NOTE: the capital letter words are the enums, the small letter
248 * words must be used inside the parameter file. */
249 enum eMCTRIGGERFLAG emctriggerflag;
250 /* all: all events which survive the filter are written to the
251 * events NTuple.
252 * flag: When Dorota's triggerflag is set to 1 for a particular
253 * event, it shall be written to the output. All others shall
254 * just be disregarded. (Default)
255 * noflag: Opposite of 'flag': only events with triggerflag = 0 shall
256 * be treated further. */
257 Boolean bmontecarlo;
258 /* if TRUE we have a monte carlo dataset before us, if FALSE
259 * (default value) it is just normal data. */
260};
261
262struct filterresults {
263 int imax_alt_arcs;
264 /* maximum altitude reached during the run */
265 int iaz_at_max_alt_arcs;
266 /* azimuth at the time the max. alt. was reached */
267 int itimeaverage_alt_arcs;
268 /* altitude averaged over the runtime */
269 int icoord_inconsist_evts;
270 /* number of events with time-coordinate */
271 /* inconsistency in this run */
272 int ifilter_passed_evts;
273 /* number of events which passed the filter */
274 int imuon_fail_evts;
275 /* number of events rejected as muons (other filters passed) */
276 int i2out_fail_evts;
277 /* number of events which failed in the two out of all */
278 /* pixels software trigger */
279 int imuon_and_2out_fail_evts;
280 /* number of events failing in both muon and */
281 /* 2out filter */
282 int isum_fail_evts;
283 /* number of events which failed the sum-of-all-calibrated */
284 /* ADC counts filter */
285 int isum_and_muon_fail_evts;
286 /* number of events which failed in both the sum and */
287 /* the muon filter */
288 int isum_and_2out_fail_evts;
289 /* number of events which failed in both the sum and */
290 /* the 2out filter */
291 int iall_filters_fail_evts;
292 /* number of events which failed in all filters */
293 float favg_event_rate_hz;
294 /* average rate before filtering */
295 float fstddev_event_rate_hz;
296 /* standard deviation of the rate before filtering */
297
298};
299
300struct eventrecord {
301 int isecs_since_midday;
302 /* seconds passed since midday before sunset (JD of run start) */
303 int isecfrac_200ns;
304 /* fractional part of isecs_since_midday */
305 short snot_ok_flags;
306 /* the bits in these two bytes are flags for additional */
307 /* information on the event: Everything OK =: all Bits = 0 */
308 int ialt_arcs;
309 /* altitude (arcseconds) */
310 int iaz_arcs;
311 /* azimuth (arcseconds) */
312 int ipreproc_alt_arcs;
313 /* "should be" alt according to preproc (arcseconds) */
314 int ipreproc_az_arcs;
315 /* "should be" az according to preproc (arcseconds) */
316 int ifieldrot_arcs;
317 /* for ALT-AZ mount telescopes: rotation angle of the field of
318 * view; this angle is defined mathematically positive looking
319 * towards the sky as the angle between the hour circle through
320 * the object being tracked and the line through pixel 1 and 2 */
321 unsigned short srate_millihz;
322 /* event rate in milli Hertz before filtering calculated by
323 * iratecalc_numevents_odd/(time[i+iratecalc_numevents_odd/2] -
324 * time[i-iratecalc_numevents_odd/2])
325 * For the first and the last iratecalc_numevents_odd/2
326 * events the rate is assumed to be constant */
327 float fhourangle; /* This is the angle between the observation of this
328 * event and the culmination point. It is going to
329 * be written into the events NTuple. */
330 float fmcenergy_tev; /* Simulated Energy.... dropping through to
331 * the Events NTuple. */
332 float fmcsize_phel; /* Simulated SIZE.... dropping through to
333 * the Events NTuple. */
334 int imcimpact_m;
335 /* MC data contain the impact parameter, which is given here in
336 * meters. */
337 int imcparticle;
338 /* MC data know which particle they are.... all in CORSIKA standard. */
339 int imctriggerflag;
340 /* MC data from Dorota get a triggerflag: 1 means triggered, 0 not. */
341 short spixsig_10thphot[iMAXNUMPIX];
342 /* number of photoelectrons measured in each pixel only the
343 * actual number of pixels (outputpars.inumpixels) is written out */
344};
345
346struct camera { /* camera parameters for imaging */
347 int inumpixels;
348 int inumrings;
349 double dpixdiameter_deg;
350 double dxc[iMAXNUMPIX];
351/* Pixel coordinates in camera coordinate system (x points from
352 * pixel 1 to 2). */
353 double dyc[iMAXNUMPIX];
354 /* The numbering of the pixels in these arrays starts at 0! */
355 double dxpointcorr_deg;
356 /* correction of the pixel coordinates; to be added to dxc[]
357 * to get correct value */
358 double dypointcorr_deg;
359 /* correction of the pixel coordinates; to be added to dxc[]
360 * to get correct value */
361};
362
363
364/* two structures for better file handling */
365struct inputfile {
366 char cname[iMAXFILENAMELENGTH];
367 /* filename (including path) */
368 FILE *pointer;
369 /* filepointer */
370 char ccannotopentext[161];
371 /* Error text printed when file cannot be opened */
372 int icannotopencode;
373 /* Error code for the exit statement when file could not be opened */
374 int iearlyeofcode;
375 /* Error code for the exit statement for unexpected EOF */
376 int ierroratclosecode;
377 /* Error code for the exit statement for error while trying to close */
378};
379
380struct outputfile {
381 char cname[iMAXFILENAMELENGTH]; /* filename (including path) */
382 FILE *pointer; /* filepointer */
383 char ccannotopentext[161];
384 /* Error text printed when file cannot be opened */
385 int icannotopencode;
386 /* Error code for the exit statement when file could not be opened */
387 int icannotwritecode;
388 /* Error code for the exit statement for failed fprintf */
389 int ierroratclosecode;
390 /* Error code for the exit statement for error while trying to close */
391};
392
393struct P2ALLHISTOS {
394
395 HISTO *p2adchist;
396 HISTO *p2pedonhist;
397 HISTO *p2pedofhist;
398 HISTO *p2pedonmeanhist;
399 HISTO *p2pedofmeanhist;
400 HISTO *p2pedonjitthist;
401 HISTO *p2pedofjitthist;
402 HISTO *p2calonhist;
403 HISTO *p2calofhist;
404 HISTO *p2calonmeanhist;
405 HISTO *p2calofmeanhist;
406 HISTO *p2calonjitthist;
407 HISTO *p2calofjitthist;
408 HISTO *p2phehist;
409 HISTO *p2zenonhist;
410 HISTO *p2zenofhist;
411 HISTO *p2corrpedhist;
412 HISTO *p2pedfwhmhist;
413};
414
415struct CALNT_DAT {
416 /* the structure for an entry in the calibration ntuple */
417 float CTrunnum;
418 float runtype;
419 float ALT_deg; /* the ALT taken from the first event of the run */
420 float extinct; /* extinction */
421 float RtiSecBF; /* runtime in seconds before filter */
422 float pixnum; /* number of the pixel for which the following
423 * data is given */
424 float pixonoff; /* Quantity telling whether this pixel was switched
425 * off by the user (-= 2.) or by preproc (-= 1.).
426 * If ON, its value = 0. */
427 float ped_adcc; /* the standard deviation of the pedestal as
428 * calculated by TIJARAFE */
429 float pedrmsac; /* the standard deviation of the pedestal in
430 * ADC counts as calculated by TIJARAFE */
431 float pedrmsPE; /* the calibrated ped RMS in photoelectrons
432 * which is also given to the imager */
433 float las_adcc; /* the mean signal for this pixel from the
434 * laser run */
435 float lasrmsac; /* RMS of the laser events after cleaning from cosmics */
436 float conv_fac; /* conversion factor = <Q>/Var(Q) * F^2 */
437 float F; /* The F from the line before */
438 float rel_gain; /* the relative gain of the pixel */
439 float numtrig; /* number of events in which the pixel was
440 * above trigger threshold */
441 float num3sig; /* number of events in which the pixel was
442 * 3 sigma above its pedestal */
443 float HV1; /* Adjustment of HV1 for this run, if available. */
444 float HV2; /* Adjustment of HV2 for this run, if available. */
445 float ThrCurr;
446 float AvgCurr; /* the sum of all currents during this run (with the
447 * particular runtype in question) from the TelLog
448 * file. The currents are averaged over the 2-minute
449 * intervals but summed over all pixels with currents
450 * higher than the threshold current value. This sum
451 * is then stored in the runs ntuple.
452 * Same for the scaler values --> */
453 float AvgScal;
454};
455
456struct inputpars {
457 Boolean bkeywordgiven[iNUMKEYWORDS+1]; /* if a valid keyword
458 * is given in the
459 * parameters file
460 * the corresponding
461 * element in this
462 * array is set to true */
463 int itelescope; /* number of the CT which took the data */
464 float flongitude_deg; /* longitude (counted positive
465 * towards West) of CT position */
466 float flatitude_deg; /* latitude (counted positive
467 * towards North) of CT position */
468 int ifirstrunnum; /* first run number to which these
469 * parameters apply*/
470 int ilastrunnum; /* last run number to which these
471 * parameters apply, */
472 /* i.e. this run will be processed
473 * with these parameters */
474 int inumpixels; /* number of pixels in the camera */
475 int inummuonpixels; /* number of pixels in the muon shield */
476 int inumcointdcs; /* number of coincidence tdcs recorded
477 * in the runfile */
478 float fpixdiameter_deg; /* smallest pixel diameter (degrees) */
479 enum axes ese1_is; /* name of the axis to which shaft
480 * encoder 1 is attached
481 * (implies the type of mount) (the
482 * type axes is declared in structures.h) */
483 float fdegrees_per_step[2]; /* angular resolution of shaft
484 * encoders 1 and 2 */
485 int isezeropos[2]; /* zero position of shaftencoders 1 and
486 * 2 from parameters file */
487 int iaz_rev_track_corr; /* correction for the azimuth shaft
488 * encoder (ALT/AZ mount only) in
489 * reverse tracking mode */
490 int ialt_rev_track_corr; /* correction for the altitude
491 * shaft encoder (ALT/AZ mount only)
492 * in reverse tracking mode */
493 float fbendingcorr; /* bending correction factor
494 * (ALT/AZ mount only) */
495 Boolean bdontusepix[iMAXNUMPIX]; /* bdontusepix is set true
496 * if the pixel should due
497 * to whatever reason not be
498 * used in image analysis,
499 * otherwise it is false;
500 * this is a copy of the
501 * input from the parameters file */
502 Boolean bdontusepix_in_trig[iMAXNUMPIX]; /* is set true if the
503 * pixel should due
504 * to whatever reason not
505 * be used in the two out
506 * of all trigger, otherwise
507 * it is false; this is a
508 * copy of the input from
509 * the parameters file */
510 float fphotoel_per_adccnt[iMAXNUMPIX]; /* conversion factors for
511 * the pixel signals */
512 float fextinction; /* atmospheric extinction (typically
513 * taken from the Carlsberg Meridian
514 * Circle data) */
515 int irubminusutc_usecs; /* difference between rubidium clock
516 * and UTC in microseconds */
517 int isum_thresh_phot; /* threshold for the total sum of
518 * photoelectrons filter from the
519 * parameters file */
520 int i2out_thresh_phot; /* threshold for the
521 * two-pixels-out-of-all software
522 * trigger from parameters file */
523 int imuoncut_thresh_adccnt[iMAXNUMMUONPIX]; /* thresholds for
524 * the muon cut */
525 Boolean bmuon_suppression; /* if true, the events which do
526 * not pass the muon cut are not
527 * written to the output */
528 float ftolerated_pointerror_deg; /* maximum tolerated pointing
529 * error in the position check
530 * in iprocessdata */
531 float fxpointcorr_deg; /* pointing correction (to be added
532 * along the camera x axis) e.g.
533 * from point run */
534 float fypointcorr_deg; /* pointing correction (to be added
535 * along the camera y axis) e.g.
536 * from point run */
537 float fcamera_align_angle_deg; /* the angle between the camera
538 * y-axis and the meridian when
539 * a culminating object is
540 * observed (defined
541 * counter-clockwise looking at
542 * the sky) */
543 int iratecalc_numevents_odd; /* number of events used in the
544 * rate calculation (must be odd) */
545 enum pedsearchdirs {MATCH=0, BEFORE, AFTER, PINGPONG,
546 PEAKFWHM, NONE} epedsearchdir ;
547 /* MATCH = only same number as run file (if ipedendofsearch is 0) or
548 exactly ipedendofsearch;
549 BEFORE = search backwards until pedendofsearch;
550 AFTER = search forward until pedendofsearch,
551 PINGPONG = Try to fibnd the matching partner, try run#-1, run#+1,
552 run#-2, run#+2 etc. up to the third argument, the partnerfindrange
553 NONE = use none of both. This is only useful for Monte Carlo
554 Analysis, for everything else it is highly unrecommended.*/
555 int ipedendofsearch; /* pedestal file number until which to
556 * search (see epedsearchdir) */
557 int ipedsearchdepth; /* depth, until which preproc should
558 * try to find TelPed* partnerfiles */
559 enum pedsearchdirs ecalsearchdir;
560 /* MATCH = only same number as run file (if ipedendofsearch is 0) or
561 exactly ipedendofsearch;
562 BEFORE = search backwards until pedendofsearch;
563 AFTER = search forward until pedendofsearch,
564 PINGPONG = Try to fibnd the matching partner, try run#-1, run#+1,
565 run#-2, run#+2 etc. up to the third argument, the partnerfindrange
566 NONE = use none of both. This is only useful for Monte Carlo
567 Analysis, for everything else it is highly unrecommended.*/
568 int icalendofsearch; /* calibration file number until which
569 * to search (see ecalsearchdir)*/
570 int icalsearchdepth; /* depth, until which preproc should
571 * try to find TelCal* partnerfiles */
572 double dsourcera_hours; /* right ascension of observed source
573 * in hours */
574 double dsourcedec_deg; /* declination of observed source in
575 * degrees */
576 float fpadlevel_phot_pix[iMAXNUMPIX]; /* if > 0., software
577 * padding to this
578 * level is applied
579 * for the given pixel */
580 float fseed1; /* seed for random generators */
581 float fseed2;
582
583 int iswap_partner_of_pix[iMAXNUMPIX]; /* if >= 0, pixel i is
584 * swapped with
585 * iswap_partner_of_pix[i]
586 * in ireadrunfile, -pedfile,
587 * -calfile (internal
588 * numbering starting at 0)*/
589
590 Boolean bnewhistograms; /* set to true if new histograms shall be booked */
591 Boolean bhisto_on; /* set to true if histogramming is on */
592
593 enum eERRORTOLERANCE eerrortolerance;
594 /* 0 == "cautious", exits on any reason (but tells in
595 * the .err file,
596 * 1 == "normal", exits when physics could be affected
597 * by the error,
598 * 2 == "tank", never exits except on coredumps and when
599 * all files have been processed. Do not use such files for
600 * physics analysis!
601 *
602 * NOTE: the capital letter words are the enums, the small letter
603 * words are to be used inside the parameter file. */
604 Boolean bmontecarlo;
605 /* if TRUE we have a monte carlo dataset before us, if FALSE
606 * (default value) it is just normal data. */
607 enum eMCTRIGGERFLAG emctriggerflag;
608 /* all: all events which survive the filter are written to the
609 * events NTuple.
610 * flag: When Dorota's triggerflag is set to 1 for a particular
611 * event, it shall be written to the output. All others shall
612 * just be disregarded. (Default)
613 * noflag: Opposite of 'flag': only events with triggerflag = 0 shall
614 * be treated further. */
615 char mcfile[FILENAME_MAX];
616 float fmean_nsb_pe_pix[iMAXNUMPIX];
617 Boolean bfitmypedrms;
618 /* If TRUE, the pedestal MEAN and SIGMA=sqrt(MEAN) is fitted
619 * from pickup corrected pedestal data and not calculated from
620 * the pickup corrected ADC values, as it was done up to
621 * ~November 2000. */
622};
623
624struct calibrationdata { /* Calibration (Laser Run) Data to be read
625 * from the Te?Cal files */
626 int iid; /* no useful information, is long in the Macintosh format */
627 int itelescope; /* number of the CT which took the data */
628 int irunnum; /* run number from the file name */
629 enum onoroff eruntype; /* indicates if the run is on- or off
630 * (taken from filename) */
631 int inumruns; /* number of laser runs recorded in this file, is
632 * long in the Macintosh format */
633 char cname[iMAXFILENAMELENGTH]; /* copy of the filename used when
634 * the data was read */
635 double dmean_adc[iMAXNUMLASERRUNS][iMAXNUMPIX];
636 /* means of pixel signals over all shots calculated by TIJARAFE /
637 * Roberto: in processdata.c this number is recalculated. */
638 double dmean_lasoutput[iMAXNUMLASERRUNS][iMAXNUMLASEREVENTS];
639 /* This new (April 26 2000) quantity monitors the laser mean
640 * output recorded in events, which are not considered cosmics. */
641 double dmean_alladc[iMAXNUMPIX];
642 /* means of pixel signals over all triggers calculated by
643 * preproc. */
644 double dmean_laserjitter[iMAXNUMPIX];
645 /* Here we calc. the deviation from the actual lasergain in a
646 * single laser shot to the laser mean as averaged over the camera */
647 double drms_adc[iMAXNUMPEDRUNS][iMAXNUMPIX];
648 /* the standard deviations of the pixel signals */
649 int inumpixels; /* number of pixels in the camera, short in
650 * Macintosh format */
651 int inumevents[iMAXNUMLASERRUNS]; /* number laser shots,
652 * short in Macintosh format */
653 int ipixsig_adc[iMAXNUMLASERRUNS][iMAXNUMLASEREVENTS][iMAXNUMPIX];
654 /* the signals obtained from each pixel for each laser shot and
655 * each laser run, unsigned short in the Macintosh format */
656};
657
658struct pedestaldata { /* Pedestal Run Data to be read from the
659 * Te?Ped files */
660 int iid; /* no useful information, is long in the Macintosh
661 * format */
662 int itelescope; /* number of the CT which took the data */
663 int irunnum; /* run number from the file name */
664 enum onoroff eruntype; /* indicates if the run is on- or of
665 * (taken from filename) */
666 int inumruns; /* number of pedestal events recorded in this file,
667 * is long in the Macintosh format */
668 char cname[iMAXFILENAMELENGTH]; /* copy of the filename used
669 * when the data was read */
670 double dmean_adc[iMAXNUMPEDRUNS][iMAXNUMPIX];
671 /* means of pixel signals over all triggers calculated by
672 * TIJARAFE using a sigma cut of 2 */
673 double dmean_alladc[iMAXNUMPIX];
674 /* means of pixel signals over all triggers calculated by
675 * preproc. */
676 double dmean_allPE[iMAXNUMPIX];
677 /* means of pixel signals over all triggers calculated by
678 * preproc. */
679 double dmean_pedlevel[iMAXNUMPEDRUNS][iMAXNUMPEDEVENTS];
680 /* This new (preproc_0.4) quantity monitors the pedestal mean
681 * output recorded in events, which are not considered cosmics.
682 * The calc.ing is done inside processdata.c */
683 double dmean_pedlevelPE[iMAXNUMPEDRUNS][iMAXNUMPEDEVENTS];
684 /* This new (preproc_0.4) quantity monitors the pedestal mean
685 * output recorded in events, which are not considered cosmics.
686 * The calc.ing is done inside processdata.c */
687 double dmean_pedoffset[iMAXNUMPIX];
688 /* Mean Offset from the ADC spectrum of a pixel to the mean of the
689 * pedestal events. */
690 double dmean_pedoffsetPE[iMAXNUMPIX];
691 /* Mean Offset from the ADC spectrum of a pixel to the mean of the
692 * pedestal events. */
693 double drms_adc[iMAXNUMPEDRUNS][iMAXNUMPIX];
694 /* the standard deviations of the pixel signals used in the
695 * sigma cut mentioned above */
696 double drms_alladc[iMAXNUMPIX];
697 /* The RMS value of the as-is ADC spectrum for all events inside a
698 * Pedestal file. */
699 double drms_allPE[iMAXNUMPIX];
700 /* The RMS value of the as-is ADC spectrum for all events inside a
701 * Pedestal file. */
702 double drms_nopickup[iMAXNUMPIX];
703 /* the standard deviations of the pixel signals' deviation from
704 * the events' mean (in ADC counts, of course...) ---
705 * This is the same as the RMS of the pickup corrected pedestals! */
706 double drms_nopickupPE[iMAXNUMPIX];
707 /* the standard deviations of the pixel signals' deviation from
708 * the events' mean (in ADC counts, of course...) ---
709 * This is the same as the RMS of the pickup corrected pedestals! */
710 int inumpixels; /* number of pixels in the camera, short in
711 * Macintosh format */
712 int inumevents[iMAXNUMPEDRUNS]; /* number of random triggers,
713 * short in Macintosh format */
714 int ipixsig_adc[iMAXNUMPEDRUNS][iMAXNUMPEDEVENTS][iMAXNUMPIX];
715 /* the signals obtained from each pixel for each random trigger
716 * and each pedestal event, short in the Macintosh format */
717};
718
719struct runfiledata { /* Data read from Te?Run files */
720 int iformatid; /* Format ID of the data, long in Macintosh format */
721 int iversid; /* Version ID of the data, long in Macintosh format */
722 int irevid; /* Revision ID..., long in Macintosh format */
723 int itelescope; /* number of the CT which took the data */
724 int irunnum; /* run number from the file name */
725 int irunnumx; /* number read from the file, long in Macintosh format */
726 int inumevents; /* number of events recorded in this run, long in
727 * Macintosh format */
728 char cname[iMAXFILENAMELENGTH]; /* copy of the filename used when
729 * the data was read */
730 int ieventheaderlength; /* number of bytes in the event header,
731 * long in Macintosh format */
732 int ieventheaderoffset; /* unknown meaning, long in Macintosh
733 * format */
734 int isignalslength; /* number of bytes used by the pixel signals,
735 * long in Macintosh format */
736 int isignalsoffset; /* unknown meaning, long in Macintosh format */
737 int itdccountslength; /* number of bytes used by the TDC signals,
738 * long in Macintosh format */
739 int itdccountsoffset; /* unknown meaning, long in Macintosh format */
740 int iobservtime_mins; /* (planned) observational time (minutes),
741 * short in Macintosh format */
742 enum onoroff eruntype; /* indicates if the run is on- or off-source;
743 * in the Macintosh format, this is a short
744 * where 1 means off and 2 means on */
745 int ileapsecs; /* Leap seconds, introduced into UTC in order to
746 * keep track of some very small differences
747 * accumulated through the years. */
748 int ihv1;
749 int ihv2; /* these two numbers represent the HV adjustment made
750 * by the shiftpersonnel. The last three items are
751 * only read for Roberto files, but not for Tijarafe
752 * files, as e.g. the HVs are not written out correctly. */
753 char cdummy[40]; /* unknown meaning */
754 int imactime_secs[iMAXNUMRUNEVENTS];
755 /* Macintosh time (time_t mydatum) in seconds since 1970, this is
756 * put together from two Macintosh shorts and converted to the time
757 * format required by SYSTEM */
758 unsigned int uigpstime_secs[iMAXNUMRUNEVENTS];
759 /* GPS time (time_t mydatum) in seconds since 1970, this is
760 * put together from two Macintosh shorts and converted to the time
761 * format required by SYSTEM
762 * This time is new from Roberto and is coming from the PC-GPS card.
763 * There is another flag available in the runheader, which gives an
764 * overall flag for the run, whether or not the GPS time had been
765 * working. It is, however, not a good idea to use this flag, as
766 * the workability of this card can also be dedued from the GPS time
767 * itself. This allows to check for failures on a event-by-event
768 * basis, which seems more reasonable than using the global flag. */
769 unsigned int uigpstime_usecs[iMAXNUMRUNEVENTS];
770 /* GPS microseconds -- available from the card, that's why it is
771 * put to the data, here it is.
772 * This is put together from two Macintosh shorts and converted
773 * to the time format required by SYSTEM */
774 unsigned int uirubsecs_secs[iMAXNUMRUNEVENTS];
775 /* the seconds of the Rubidium clock time this is put together
776 * from two Macintosh shorts and converted to the time format
777 * required by SYSTEM */
778 unsigned int uirubsecfrac_200ns[iMAXNUMRUNEVENTS];
779 /* the fractional part of the Rubidium clock time second, this is
780 * put together from two Macintosh shorts, unit is 200 ns */
781 int isepos[2][iMAXNUMRUNEVENTS];
782 /* positions of shaft encoders 1 and 2, short in Macintosh format */
783 float fhourangle; /* This is the angle between the observation of this
784 * event and the culmination point. It is going to
785 * be written into the events NTuple. */
786 int ieventnumber[iMAXNUMRUNEVENTS];
787/* number of the event, short in Macintosh format */
788 int inumpixels; /* number of pixels in the camera, short in
789 * Macintosh format */
790 int inummuonpixels; /* number of pixels in the muon shield;
791 * the sum of inumpixels and inummuonpixels is
792 * part of the event record but should be the
793 * same for all events, so it is not put into
794 * an array */
795 int inumcointdcs; /* number of coincidence TDCs for which counts
796 * were recorded, short in Macintosh format
797 * this value is part of the event record but
798 * should be the same for all events, so it is
799 * not put into an array */
800 int ipixsig_adc[iMAXNUMRUNEVENTS][iMAXNUMPIX];
801 /* signals from the camera photo multipliers (ADC counts) */
802 int imuonpixsig_adc[iMAXNUMRUNEVENTS][iMAXNUMMUONPIX];
803 /* signals from the muon shield photo multipliers (ADC counts) */
804 int itdcsig_cnts[iMAXNUMRUNEVENTS][iMAXNUMCOINTDCS];
805 /* counts from the coincidence TDCs if itdccountslength > 0 */
806};
807
808struct TELLOGDATA {
809 int irunnum; /* The runnumber which we are interested in.
810 * Only data for this runnumber are written into
811 * this structure and then copied to the calnt NTuple.
812 *
813 * This runnumber is generally the closest match
814 * inside the TelLog file. */
815 float pixel_timeaveraged_current[127];
816 float pixel_timeaveraged_scaler[127];
817};
818
819/************************************************
820 * structures in output file *
821 * (Konopelko files format) *
822 * (from structures.h file 4.4) *
823 ************************************************/
824struct mcbankheader { /* Once in every file */
825 int iparticle_type;
826 /* Primary particle type: 0 = gamma; +-1= e+-;
827 * +-2 = mu+-; +-3 = p+-, n; +-4 = pi+- */
828 int inum_cts;
829 /* Number of simulated telescopes */
830 int inum_nfl_shifts;
831 /* Number of NFL shifts for hadrons (per event) */
832 int itrigger_thresh_phot;
833 /* Only images with two pixels above this threshold are
834 * in the MC data file */
835 int imin_signal;
836 /* "Tail cut" = smallest signal saved */
837 int inum_sim_showers;
838 /* Total number of showers simulated for this file */
839 float fatmothick_gcm2;
840 /* Atmosphere above the telescope [g/cm2] */
841 float fcos_zenangle;
842 /* Cosine of the zenith angle */
843 float fnfl_shift_radius_deg;
844 /* Maximum angular radius within which a shifted
845 * hadron shower is sampled [degrees] */
846 float fenergybin_bound_tev[iNUMENERGYBINS+1];
847 /* Boundaries for the 14 energy bins [TeV]
848 * (newline after the first 8 numbers) */
849 float fzenithanglebin_bound[iNUMZENANGLEBINS+1];
850 /* Boundaries for the 11 zenith angle bins [degrees] */
851 int inum_show_in_bin[iNUMENERGYBINS];
852 /* Number of simulated (or saved) showers
853 * per energy bin (newline after the first 8 numbers) */
854 float fmaxdist_impact_m[iNUMIMPACTBINS];
855 /* Maximum distance of the impact point to the
856 * central telescope [m] for each energy bin
857 * (newline after the first 8 numbers) */
858 int inumpixels_for_ct[iMAXNUMCTS];
859 /* Number of pixels in the camera of each simulated CT */
860 float fpixwidth_deg_ct[iMAXNUMCTS];
861 /* Pixel width [degrees] for each CT */
862 float fmirrsize_m2_ct[iMAXNUMCTS];
863 /* Mirror area [m^2] for each CT */
864 float fmean_nsb_phot_ct[iMAXNUMCTS];
865 /* Mean signal caused by the NSB in each pixel for each CT
866 * [photoelectrons]. This is the simulation of the NSB,
867 * not the electronic noise */
868 float fphes_per_photon_ct[iMAXNUMCTS];
869 /* Conversion factor photoelectron per photon */
870 float frelative_x_ct[iMAXNUMCTS];
871 /* x position relative to the central CT for each CT */
872 float frelative_y_ct[iMAXNUMCTS];
873 /* y position relative to the central CT for each CT */
874};
875#endif
876
877
878
879
880
881
882
Note: See TracBrowser for help on using the repository browser.