source: trunk/MagicSoft/Simulation/Detector/Camera/creadparam.h@ 1722

Last change on this file since 1722 was 1704, checked in by blanch, 22 years ago
Option to set a dc value to rise the discriminator threshold has been added.
File size: 11.0 KB
Line 
1//=//////////////////////////////////////////////////////////////////////
2//=
3//= creadparam
4//=
5//= @file creadparam.h
6//= @desc Header file
7//= @author J C Gonzalez
8//= @email gonzalez@mppmu.mpg.de
9//= @date Thu May 7 16:24:22 1998
10//=
11//=----------------------------------------------------------------------
12//=
13//= Created: Thu May 7 16:24:22 1998
14//= Author: Jose Carlos Gonzalez
15//= Purpose: Program for reflector simulation
16//= Notes: See files README for details
17//=
18//=----------------------------------------------------------------------
19//=
20//= $RCSfile: creadparam.h,v $
21//= $Revision: 1.16 $
22//= $Author: blanch $
23//= $Date: 2003-01-14 13:37:32 $
24//=
25//=//////////////////////////////////////////////////////////////////////
26
27// @T \newpage
28
29//!@section Source code of |creadparam.h|.
30
31/*!@"
32
33 In this section you can find the source code for the file
34 |creadparam.h|. This file is mainly needed by
35 |creadparam.cxx|. Here is located the definition of the commands you
36 can use in the parameters file. In this file, the first line must be
37 |camera 'version'|, where |'version'| is the appropiate version of
38 the output format (NOT the version of the camera program) which can
39 read the commands written in that parameters file. You cannot mix
40 parameters files and executables with different versions. The
41 current version is |camera 0.2|.
42
43 The commands now available for the parameters file are:
44
45 @itemize
46
47 @- |input_file| filename :
48 Sets the name of the input file (|.rfl|).
49 @- |starfield_file| filename :
50 Sets the name of the starfield input file (|.rfl|).
51 @- |ct_file| filename :
52 Sets the name of the CT definition file (|.def|).
53 @- |data_file| filename :
54 Sets the name of the output data file (|.dat|).
55 @- |elec_noise_off| :
56 De-activates ElecNoise for FADC and Trigger channels. By default it is on.
57 @- |fadc_noise_off| :
58 Sets the ElecNoise for FADC.
59 @- |trig_noise_off| :
60 Sets the ElecNoise for trigger system.
61 @- |nsb_on| :
62 Activates the NSB simulation. This is the default.
63 @- |nsb_off| :
64 De-activates the NSB simulation.
65 @- |nsb_mean| number :
66 Sets the mean value for the NSB.
67 Default value: 6 for CT1, 6 for MAGIC.
68 This implies always |nsb_on|.
69 @- |threshold| number :
70 Sets the Threshold value q0. Default value: 10.
71 @- |tail_cut| number :
72 Sets the Tail-Cut value.
73 Default value: 7.
74 @- |islands_cut| number :
75 Sets the Islands-Cut value i0.
76 Default value: 10.
77 @- |end_file|
78 Last command in the parameters file.
79
80 @enditemize
81
82 @ignoreHTML
83 A parameters file (a small one) looks like this:
84
85 |camera 0.2|
86
87 |input_file gm100-500.rfl|
88
89 |output_file gm100-500.phe|
90
91 |output_file gm100-500.dat|
92
93 |ct_file magic.def|
94
95 |threshold 10.0|
96
97 |tail_cut 7.0|
98
99 |nsb_mean 5.0|
100
101 |end_file|
102 @endignoreHTML
103
104@"*/
105
106//!@{
107
108#ifndef _creadparam_
109#define _creadparam_
110
111#ifndef _this_
112#define _this_ creadparam
113#endif
114
115//!@}
116
117//!@subsection Include files.
118
119//!@{
120
121#include <iostream.h>
122#include <fstream.h>
123#include <stdlib.h>
124#include <stdio.h>
125#include <string.h>
126#include <math.h>
127#include <float.h>
128
129#include "jcmacros.h"
130#include "jcdebug.h"
131
132#include "camera-v.h"
133
134#include "MTriggerDefine.h"
135#include "MFadcDefine.h"
136#include "Mdefine.h"
137
138//!@}
139
140//!@subsection Macro-definitions, and constants.
141
142//!@{
143
144// now we define the list PM_ITEM_LIST of possible items in
145// the parameters file. note that they are functions of
146// T(x). we will change T(x) to be the real item or the
147// string of this item when needed
148
149#define PM_ITEM_LIST /* LIST OF ITEMS IN THE PARAMETERS FILE */ \
150T(input_file), /* input file */ \
151T(starfield_file), /* starfield file */ \
152T(starfield_center),/* center of thestarfield FOV */ \
153T(data_file), /* data file */ \
154T(root_file), /* ROOT file */ \
155T(ct_file), /* file with the characteristics of the CT */ \
156T(ana_pixels), /* size of the camera for parameters calculation */ \
157T(elec_noise_off), /* de-activates ElecNoise for FADC and Trigger channels */\
158T(fadc_noise), /* ElecNoise for FADC */\
159T(trig_noise), /* ElecNoise for trigger */\
160T(sfr_on), /* starfield rotation */ \
161T(nsb_on), /* activates NSB simulation */ \
162T(nsb_off), /* de-activates NSB simulation */ \
163T(nsb_mean), /* mean value of NSB contribution per pixel */ \
164T(nsb_directory), /* database for the NSB */ \
165T(pixel_thres), /* value of q0 for trigger for a given pixel */ \
166T(secure_disc), /* Ac value to rise discrimnator threshold */ \
167T(tail_cut), /* value of tail cut (t0) */ \
168T(islands_on), /* DO count islands */ \
169T(islands_off), /* do NOT count islands */ \
170T(islands_cut), /* value of islands cut (i0) */ \
171T(seeds), /* seeds for random number generation */ \
172T(data_from_stdin), /* to read data from STDIN */ \
173T(skip), /* skip pathological showers */ \
174T(read_phe_all), /* id., but was processed with write_all_events */ \
175T(read_phe), /* read an already camera processed file */ \
176T(write_all_events),/* write to file .phe ALL images (even w.o. trigger)*/ \
177T(nowrite_McEvt), /* nowrite to file .root McEvt infos */ \
178T(write_McTrig), /* write to file .root McTrig infos */ \
179T(write_McFadc), /* write to file .root McFadc infos */ \
180T(nowrite_RawEvt), /* write to file .root RawData infos */ \
181T(write_all_data), /* write to file .dat ALL image data */ \
182T(select_energy), /* energy range to read: only for .phe files */ \
183T(trigger_radius), /* trigger radius for the camera */ \
184T(correction), /* factor for correction in the pixel values */ \
185T(trigger_scan), /* show signal in the diskriminator */ \
186T(fadc_scan), /* show fadc signal */ \
187T(trigger_loop), /* make loop over trigger conditions */ \
188T(trigger_prop), /* values of trigger properties */ \
189T(fadc_prop), /* values of fadc properties */ \
190T(trigger_single), /* trigger conditions */ \
191T(Trigger_Loop_Output_Only_Specialists), /* special steercard */ \
192T(telescope_axis), /* Direction of the axis telescope */ \
193T(source_offset), /* Displacement of the source from the center */ \
194T(corsika_vers), /* Version of Corsika */ \
195T(end_file) /* end of the parameters file */
196
197#define T(x) x // define T() as the name as it is
198
199enum ITEM_TYPE {
200 PM_ITEM_LIST
201};
202
203#undef T
204
205#define T(x) #x // define T() as the string of x
206
207const char *const ITEM_NAMES[] = {
208 PM_ITEM_LIST
209};
210
211#undef T
212
213#define LINE_MAX_LENGTH 400
214#define ITEM_MAX_LENGTH 40
215#define PATH_MAX_LENGTH 120
216
217// mean values of NSB contribution per pixel
218
219static const float Mean_NSB_MAGIC = 5.0; //@< for MAGIC
220static const float Mean_NSB_CT1 = 5.0; //@< for CT1
221
222//!@}
223
224//!@subsection Prototypes of functions.
225
226//!@{
227
228//++
229// prototypes
230//--
231
232void readparam(char * filename);
233char *get_input_filename(void);
234char *get_starfield_filename(void);
235void get_starfield_center(int *rh,int *rm,int *rs,int *dd,int *dm,int *ds);
236int get_starfield_rotate(void);
237char *get_data_filename(void);
238char *get_root_filename(void);
239char *get_loop_filename(void);
240char *get_ct_filename(void);
241char *get_nsb_directory(void);
242int add_elec_noise(float *fadc, float *trig);
243int get_nsb(float *n, int *m);
244float get_tail_cut(void);
245int get_islands_cut(int *n);
246long int get_seeds(int n);
247int get_ana_pixels(void);
248void get_skip_showers( int *s );
249int get_nskip_showers( void );
250int get_data_from_stdin(void);
251int get_read_phe(void);
252int get_read_phe_all(void);
253int get_write_all_events(void);
254//
255int get_write_McEvt(void);
256int get_write_McTrig(void);
257int get_write_McFadc(void);
258int get_write_RawEvt(void);
259//
260int get_write_all_data(void);
261int get_select_energy(float *le, float *ue);
262int get_trigger_radius(float *radius);
263int get_correction(float *corr);
264int get_FADC_Scan(void);
265int get_Trigger_Scan(void);
266void get_Trigger_properties(float *gl, float *ot, float *ra, float *rf);
267void get_FADC_properties(float *ra, float *rf);
268int get_Trigger_Loop(float *lt, float *ut, float *st, int *lm, int *um, int *lg, int *ug);
269void get_Trigger_Single(float *t, int *m, int *g);
270void get_threshold(float *t);
271void get_secure_threhold(float *ac, float *disc);
272int get_indi_thres_pixel(void);
273void get_teles_axis(float *th, float *p);
274void get_source_off(float *th, float *p);
275int get_corsika_ver(void);
276//!@}
277
278//!@{
279
280#endif // ! _creadparam_
281
282//!@}
283
284//=------------------------------------------------------------
285//!@subsection Log of this file.
286
287//!@{
288
289/*
290 * $Log: not supported by cvs2svn $
291 * Revision 1.15 2002/07/16 16:20:59 blanch
292 * Modifications done for the camera.cxx version, where a first implementation
293 * of the Star Field Rotation has been introduced.
294 *
295 * Revision 1.14 2002/03/15 15:17:57 blanch
296 * Header file for creadparam.cxx v 1.16
297 *
298 * Revision 1.13 2002/03/04 17:20:50 blanch
299 * Header file for creadparam.cxx 1.15
300 *
301 * Revision 1.12 2002/02/28 15:08:01 blanch
302 * Header file for creadparam.cxx 1.14.
303 *
304 * Revision 1.11 2002/01/18 17:45:37 blanch
305 * Header file for creadparam.cxx 1.13.
306 *
307 * Revision 1.10 2001/11/13 17:06:01 blanch
308 * Header file for creadparam.cxx version 1.12
309 *
310 * Revision 1.9 2001/07/19 09:29:02 blanch
311 * Header file for creadparam.cxx vrsion 1.10
312 *
313 * Revision 1.8 2001/03/05 10:44:44 blanch
314 * Header file of creadparam.cxx version 1.9
315 *
316 * Revision 1.7 2001/02/23 10:56:10 magicsol
317 * Header file for creadparam.cxx version 1.8
318 *
319 * Revision 1.6 2001/01/15 12:38:00 magicsol
320 * *** empty log message ***
321 *
322 * Revision 1.5 2000/07/04 14:13:34 MagicSol
323 * *** empty log message ***
324 *
325 * Revision 1.4 2000/05/11 14:23:28 blanch
326 * Thi version owns to the version 1.4 of creadparam.cxx.
327 *
328 * Revision 1.3 2000/03/24 18:15:46 blanch
329 * *** empty log message ***
330 *
331 * Revision 1.2 2000/02/18 17:50:07 petry
332 * This version belongs to camera.cxx 1.5.
333 * It version has been put in the repository in order to be
334 * able to share the further development with others.
335 *
336 * If you need something working, wait or take an earlier one.
337 * See file README
338 *
339 * Revision 1.1.1.1 1999/11/05 11:59:34 harald
340 * This the starting point for CVS controlled further developments of the
341 * camera program. The program was originally written by Jose Carlos.
342 * But here you can find a "rootified" version to the program. This means
343 * that there is no hbook stuff in it now. Also the output of the
344 * program changed to the MagicRawDataFormat.
345 *
346 * The "rootification" was done by Dirk Petry and Harald Kornmayer.
347 *
348 * Revision 1.2 1999/10/22 15:01:29 petry
349 * version sent to H.K. and N.M. on Fri Oct 22 1999
350 *
351 * Revision 1.1.1.1 1999/10/21 16:35:11 petry
352 * first synthesised version
353 *
354 * Revision 1.7 1999/03/15 14:59:09 gonzalez
355 * camera-1_1
356 *
357 * Revision 1.6 1999/03/02 09:56:13 gonzalez
358 * *** empty log message ***
359 *
360 * Revision 1.5 1999/01/14 17:32:43 gonzalez
361 * Added to camera the STDIN input option (data_from_input)
362 *
363 */
364
365//!@}
366//=EOF
Note: See TracBrowser for help on using the repository browser.