1 | //=//////////////////////////////////////////////////////////////////////
|
---|
2 | //=
|
---|
3 | //= creadparam
|
---|
4 | //=
|
---|
5 | //= @file creadparam.cxx
|
---|
6 | //= @desc Reading of parameters 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.cxx,v $
|
---|
21 | //= $Revision: 1.35 $
|
---|
22 | //= $Author: MAGIC $
|
---|
23 | //= $Date: 2004-12-15 01:56:39 $
|
---|
24 | //=
|
---|
25 | //=//////////////////////////////////////////////////////////////////////
|
---|
26 |
|
---|
27 |
|
---|
28 | #include "creadparam.h"
|
---|
29 | #include "camera.h" // Needed for MAX_NUMBER_OF_CTS
|
---|
30 |
|
---|
31 | // Here we define the global variables where the values from the
|
---|
32 | // parameters file are stored.
|
---|
33 |
|
---|
34 | static char **Input_filename; //@< input filename
|
---|
35 | static char Starfield_filename[PATH_MAX_LENGTH]; //@< starfield input filename
|
---|
36 | static int Starfield_center[6]={0,0,0,0,0,0}; //@< center of the starfield FOV
|
---|
37 | //@< RA(H,M,S) & DEC (D,M,S)
|
---|
38 | static char Data_filename[PATH_MAX_LENGTH]; //@< data filename
|
---|
39 | static char ROOT_filename[PATH_MAX_LENGTH]; //@< data filename
|
---|
40 | static char Loop_filename[PATH_MAX_LENGTH]; //@< special data filename
|
---|
41 | static char CT_geom_string[256]; //@< Contains geometry ids of CTs
|
---|
42 | static int CT_number = 1; //@< Number of CT
|
---|
43 | static char **QE_filename; //@< name of the qe file
|
---|
44 | static char NSB_directory[PATH_MAX_LENGTH]; //@< database for NSB
|
---|
45 | static char NSB_outer_directory[PATH_MAX_LENGTH]; //@< database for NSB
|
---|
46 | static int Starfield_rotate = FALSE; //@< switch on starfield rotation
|
---|
47 | static int ElecNoise = TRUE; //@< Will we add ElecNoise?
|
---|
48 | static float FADC_pedestal = 10.0; //@< Value for FADC Pedestal
|
---|
49 | static float FADC_Noise_inner = 2.0; //@< Value for FADC ElecNoise
|
---|
50 | static float FADC_Noise_outer = 2.0; //@< Value for FADC ElecNoise
|
---|
51 | static float Digital_Noise = 0.0; //@< Value for FADC digital Noise
|
---|
52 | static float Trig_Noise = 0.3; //@< Factor for Trigger ElecNoise
|
---|
53 | static int simulateNSB = TRUE; //@< Will we simulate NSB?
|
---|
54 | static float meanNSB; //@< NSB mean value (per pixel)
|
---|
55 | static int nphe2NSB=0; //@< Number of phe from shower to do NSB simulation
|
---|
56 | static float **qThreshold; //@< Threshold values
|
---|
57 | static int Individual_Thres = FALSE;
|
---|
58 | static float RiseDisc = -1.0;
|
---|
59 | static float SecureDisc = 7.0;
|
---|
60 | static long int Seeds[2]={69184,10406};
|
---|
61 | static int *Skip;
|
---|
62 | static int nSkip=0;
|
---|
63 | static int Data_From_STDIN = FALSE;
|
---|
64 | static int Write_All_Images = FALSE;
|
---|
65 | static int Write_McEvt = TRUE;
|
---|
66 | static int Write_McTrig = FALSE;
|
---|
67 | static int Write_McFadc = FALSE;
|
---|
68 | static int Write_RawEvt = TRUE;
|
---|
69 | static int Select_Energy = TRUE;
|
---|
70 | static float Select_Energy_le = 0.0; //@< GeV
|
---|
71 | static float Select_Energy_ue = 100000.0; //@< GeV
|
---|
72 | static int Trigger_Scan = FALSE;
|
---|
73 | static int FADC_Scan = FALSE;
|
---|
74 | static int Trigger_Loop = FALSE;
|
---|
75 | static float Trigger_gate_length = 3.0;
|
---|
76 | static float Trigger_over_time = 0.25;
|
---|
77 | static float Trigger_response_ampl = 1.0;
|
---|
78 | static float Trigger_response_fwhm = 2.0;
|
---|
79 | static float Trigger_threshold[MAX_NUMBER_OF_CTS];
|
---|
80 | static int Trigger_multiplicity[MAX_NUMBER_OF_CTS];
|
---|
81 | static int Trigger_topology[MAX_NUMBER_OF_CTS];
|
---|
82 | static float Trigger_loop_lthres = 3.0;
|
---|
83 | static float Trigger_loop_uthres = 10.0;
|
---|
84 | static float Trigger_loop_sthres = 1.0;
|
---|
85 | static int Trigger_loop_lmult = 2;
|
---|
86 | static int Trigger_loop_umult = 10;
|
---|
87 | static int Trigger_loop_ltop = 0;
|
---|
88 | static int Trigger_loop_utop = 2;
|
---|
89 | static int FADC_shape = 0;
|
---|
90 | static float FADC_response_ampl = MFADC_RESPONSE_INTEGRAL;
|
---|
91 | static float FADC_response_fwhm = MFADC_RESPONSE_FWHM;
|
---|
92 | static int FADC_shape_out = 0;
|
---|
93 | static float FADC_resp_ampl_out = MFADC_RESPONSE_INTEGRAL;
|
---|
94 | static float FADC_resp_fwhm_out = MFADC_RESPONSE_FWHM;
|
---|
95 | static float FADC_slices_per_ns = FADC_SLICES_PER_NSEC;
|
---|
96 | static int FADC_slices_written = FADC_SLICES;
|
---|
97 | static float High_to_Low = 10.0; //@< Low gain channel respct to High
|
---|
98 |
|
---|
99 | static float sigma_x_spot = 0.; // Sigma in x and y (cm) for additional
|
---|
100 | static float sigma_y_spot = 0.; // gaussian spread of the mirror spot.
|
---|
101 |
|
---|
102 | static float misp_x = 0.; // Mispointing in x
|
---|
103 | static float misp_y = 0.; // Mispointing in y
|
---|
104 |
|
---|
105 | static float trig_delay = 25.; // Delay in ns between beginning of FADC
|
---|
106 | // time window and the trigger instant.
|
---|
107 |
|
---|
108 | static float pmt_jitter = 0.25; // Time jitter in ns (sigma of gaussian)
|
---|
109 | // of the PMT (per phe)
|
---|
110 |
|
---|
111 | static float CTcoor[MAX_NUMBER_OF_CTS][3];
|
---|
112 |
|
---|
113 | static float m_fraction[MAX_NUMBER_OF_CTS];
|
---|
114 |
|
---|
115 | static int CalibrationRun = 0; // > 0 if a calibration run has been chosen
|
---|
116 | static float lambda = 0.; // Mean wavelength for photons of calibration pulses.
|
---|
117 | static float sigma_lambda = 0.; // Sigma of wavelength distribution for calibration.
|
---|
118 | static float phot_per_pix = 0.; // Average number of photons per inner pixel for calibration.
|
---|
119 | static float fwhm_time = 0.; // Time spread (FWHM of gaussian) of calibration photons.
|
---|
120 | static int nevents = 0; // Number of events in calibration run.
|
---|
121 | static int selected_pixel = -1; // Selected pixel: if >= 0 ==> only this pixel is filled!
|
---|
122 |
|
---|
123 | static int gain_fluctuations = 1; // Is 0 if PMT gain fluctuations are disabled for signal
|
---|
124 | static int noise_gain_fluctuations = 1; // Is 0 if PMT gain fluctuations are disabled for NSB noise
|
---|
125 |
|
---|
126 | // Coordinates of CT locations, in centimeters, in the Corsika system.
|
---|
127 |
|
---|
128 | void
|
---|
129 | readparam(char * filename)
|
---|
130 | {
|
---|
131 | char sign[] = GLUE_postp( PROGRAM, VERSION ); //@< initialize sign
|
---|
132 | char line[LINE_MAX_LENGTH]; //@< line to get from the stdin
|
---|
133 | char token[ITEM_MAX_LENGTH]; //@< a single token
|
---|
134 | int i, j, k; //@< dummy counters
|
---|
135 | float aux, aux1, aux2; //@< auxiliar variable
|
---|
136 | int aux3, aux4; //@< auxiliar variable
|
---|
137 | ifstream ifile;
|
---|
138 | char filename_tmp[PATH_MAX_LENGTH];
|
---|
139 |
|
---|
140 |
|
---|
141 | memset((char*)CT_geom_string, 0, sizeof(CT_geom_string));
|
---|
142 |
|
---|
143 | Input_filename = new char *[MAX_NUMBER_OF_CTS];
|
---|
144 | QE_filename = new char *[MAX_NUMBER_OF_CTS];
|
---|
145 | qThreshold = new float *[MAX_NUMBER_OF_CTS];
|
---|
146 |
|
---|
147 | for (int i = 0; i < MAX_NUMBER_OF_CTS; i++)
|
---|
148 | {
|
---|
149 | Input_filename[i] = new char[PATH_MAX_LENGTH];
|
---|
150 | QE_filename[i] = new char[PATH_MAX_LENGTH];
|
---|
151 | qThreshold[i] = new float[CAMERA_PIXELS];
|
---|
152 | CTcoor[i][0] = 0.; CTcoor[i][1] = 0.; CTcoor[i][2] = 0.;
|
---|
153 | m_fraction[i] = 1.;
|
---|
154 | }
|
---|
155 |
|
---|
156 | // use cin or ifile (reading from STDIN or from parameters file?
|
---|
157 | if ( filename != NULL )
|
---|
158 | ifile.open( filename );
|
---|
159 |
|
---|
160 | // get signature
|
---|
161 | if ( filename != NULL )
|
---|
162 | ifile.getline(line, LINE_MAX_LENGTH);
|
---|
163 | else
|
---|
164 | cin.getline(line, LINE_MAX_LENGTH);
|
---|
165 | line[strlen(SIGNATURE)] = '\0';
|
---|
166 | strcpy(sign, line);
|
---|
167 | cout<< '"' << sign << '"' << '\n';
|
---|
168 | if (strcmp(sign, SIGNATURE) != 0) {
|
---|
169 | cerr << "ERROR: Signature of parameters file is not correct\n";
|
---|
170 | cerr << '"' << sign << '"' << '\n';
|
---|
171 | cerr << "should be: " << SIGNATURE << '\n';
|
---|
172 | exit(1);
|
---|
173 | }
|
---|
174 |
|
---|
175 | // loop till the "end" directive is reached
|
---|
176 | int is_end = FALSE;
|
---|
177 | while (! is_end) {
|
---|
178 |
|
---|
179 | // get line from file or stdin
|
---|
180 | if ( filename != NULL )
|
---|
181 | ifile.getline(line, LINE_MAX_LENGTH);
|
---|
182 | else
|
---|
183 | cin.getline(line, LINE_MAX_LENGTH);
|
---|
184 |
|
---|
185 | // skip comments (start with '#')
|
---|
186 | if (line[0] == '#')
|
---|
187 | continue;
|
---|
188 |
|
---|
189 | // show user comments (start with '>')
|
---|
190 | if (line[0] == '>') {
|
---|
191 | cout << line << endl << flush;
|
---|
192 | continue;
|
---|
193 | }
|
---|
194 |
|
---|
195 | // look for each item at the beginning of the line
|
---|
196 | for (i=0; i<=end_file; i++)
|
---|
197 | if (strstr(line, ITEM_NAMES[i]) == line)
|
---|
198 | break;
|
---|
199 |
|
---|
200 | // if it is not a valid line, just ignore it
|
---|
201 | if (i == end_file+1) {
|
---|
202 | cerr << "ERROR: Unknown token in [" << line << "]\n";
|
---|
203 | exit(-1);
|
---|
204 | }
|
---|
205 |
|
---|
206 | // case block for each directive
|
---|
207 | switch ( i ) {
|
---|
208 |
|
---|
209 | case input_file: //@< name of the input file
|
---|
210 |
|
---|
211 | // get the name of the input_file from the line
|
---|
212 | sscanf(line, "%s %i %s", token,&k, filename_tmp);
|
---|
213 | if(k>99 || k<0){
|
---|
214 | printf("ERROR : The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
|
---|
215 | exit(1);
|
---|
216 | }
|
---|
217 | strcpy(&Input_filename[k][0],&filename_tmp[0]);
|
---|
218 | break;
|
---|
219 |
|
---|
220 | case starfield_file: //@< name of the output file
|
---|
221 |
|
---|
222 | // get the name of the output_file from the line
|
---|
223 | sscanf(line, "%s %s", token, Starfield_filename);
|
---|
224 |
|
---|
225 | break;
|
---|
226 |
|
---|
227 | case starfield_center: //@< name of the output file
|
---|
228 |
|
---|
229 | // get the name of the output_file from the line
|
---|
230 | sscanf(line, "%s %i %i %i %i %i %i", token, &Starfield_center[0], &Starfield_center[1], &Starfield_center[2], &Starfield_center[3], &Starfield_center[4], &Starfield_center[5]);
|
---|
231 |
|
---|
232 | break;
|
---|
233 |
|
---|
234 | case data_file: //@< name of the data file
|
---|
235 |
|
---|
236 | // get the name of the data_file from the line
|
---|
237 | sscanf(line, "%s %s", token, Data_filename);
|
---|
238 |
|
---|
239 | break;
|
---|
240 |
|
---|
241 | case root_file: //@< name of the ROOT file
|
---|
242 |
|
---|
243 | // get the name of the data_file from the line
|
---|
244 | sscanf(line, "%s %s", token, ROOT_filename);
|
---|
245 | cout << '[' << ROOT_filename << ']' << endl << flush;
|
---|
246 |
|
---|
247 | break;
|
---|
248 |
|
---|
249 | case ct_num: //@< number of telescopes
|
---|
250 |
|
---|
251 | // get the name of the ct_file from the line
|
---|
252 | sscanf(line, "%s %i", token, &CT_number);
|
---|
253 |
|
---|
254 | break;
|
---|
255 |
|
---|
256 | case ct_geom: //@< name of the telescope file
|
---|
257 |
|
---|
258 | // get the name of the ct_file from the line
|
---|
259 | sscanf(line, "%s %s", token, CT_geom_string);
|
---|
260 | if ( strlen(CT_geom_string) > MAX_NUMBER_OF_CTS )
|
---|
261 | {
|
---|
262 | printf("\nError: ct_geom option read from input card wrong:\n");
|
---|
263 | printf("Number of digits (%d) is larger than maximum number\n",strlen(CT_geom_string) );
|
---|
264 | printf("of allowed telescopes (%d). Exiting.\n\n", MAX_NUMBER_OF_CTS);
|
---|
265 | exit(1);
|
---|
266 | }
|
---|
267 |
|
---|
268 | break;
|
---|
269 |
|
---|
270 | case qe_file: //@< name of the telescope file
|
---|
271 |
|
---|
272 | // get the name of the ct_file from the line
|
---|
273 | sscanf(line, "%s %i %s", token, &k, filename_tmp);
|
---|
274 | strcpy(&QE_filename[k][0],&filename_tmp[0]);
|
---|
275 |
|
---|
276 | break;
|
---|
277 |
|
---|
278 | case elec_noise_off: //@< add ElecNoise?
|
---|
279 |
|
---|
280 | // we will not add electronic noise for FADC and Trigger channels.
|
---|
281 | ElecNoise = FALSE;
|
---|
282 | FADC_Noise_inner = 0.0;
|
---|
283 | FADC_Noise_outer = 0.0;
|
---|
284 | Trig_Noise =0.0;
|
---|
285 |
|
---|
286 | break;
|
---|
287 |
|
---|
288 | case fadc_pedestal: //@< FADC pedestal
|
---|
289 |
|
---|
290 | // value for FADC Pedestal
|
---|
291 | sscanf(line, "%s %f", token, &FADC_pedestal);
|
---|
292 |
|
---|
293 | //
|
---|
294 | // A. Moralejo:
|
---|
295 | // Require integer mean pedestal. Although it seems a silly
|
---|
296 | // restriction, this saves lots of trouble (due to rounding
|
---|
297 | // happening in the FADC), particularly when running the
|
---|
298 | // simulation with no noise (NSB or electronic):
|
---|
299 | //
|
---|
300 |
|
---|
301 | if (fmod((double)FADC_pedestal, (double)1.) > 1.e-4)
|
---|
302 | {
|
---|
303 | printf("ERROR : requested average FADC pedestal (%f) is not integer. Please use an integer value.\n", FADC_pedestal);
|
---|
304 | exit(1);
|
---|
305 | }
|
---|
306 |
|
---|
307 | break;
|
---|
308 |
|
---|
309 | case high_to_low: //@< High to Low gain ratio
|
---|
310 |
|
---|
311 | // Value for the Low Gain channel respect to the High gain
|
---|
312 | sscanf(line, "%s %f", token, &High_to_Low);
|
---|
313 |
|
---|
314 | break;
|
---|
315 |
|
---|
316 | case fadc_noise: //@< FADC ElecNoise
|
---|
317 |
|
---|
318 | // value for FADC Elec Noise
|
---|
319 | sscanf(line, "%s %f %f %f", token,
|
---|
320 | &FADC_Noise_inner, &FADC_Noise_outer,
|
---|
321 | &Digital_Noise);
|
---|
322 |
|
---|
323 | ElecNoise = TRUE;
|
---|
324 |
|
---|
325 | break;
|
---|
326 |
|
---|
327 | case trig_noise: //@< add ElecNoise?
|
---|
328 |
|
---|
329 | // factor for Trigger Elec Noise
|
---|
330 | sscanf(line, "%s %f", token, &Trig_Noise);
|
---|
331 | ElecNoise = TRUE;
|
---|
332 |
|
---|
333 | break;
|
---|
334 |
|
---|
335 | case sfr_on: //@< simulate starfield rotation?
|
---|
336 |
|
---|
337 | // we will simulate Starfield rotation
|
---|
338 | Starfield_rotate = TRUE;
|
---|
339 |
|
---|
340 | break;
|
---|
341 |
|
---|
342 |
|
---|
343 | case nsb_on: //@< simulate NSB?
|
---|
344 |
|
---|
345 | // we will simulate NSB
|
---|
346 | simulateNSB = TRUE;
|
---|
347 |
|
---|
348 | break;
|
---|
349 |
|
---|
350 | case nsb_off: //@< simulate NSB?
|
---|
351 |
|
---|
352 | // we will NOT simulate NSB
|
---|
353 | simulateNSB = FALSE;
|
---|
354 |
|
---|
355 | break;
|
---|
356 |
|
---|
357 | case nsb_mean: //@< value of <NSB> per pixel
|
---|
358 |
|
---|
359 | // get value of <NSB> (in photons)
|
---|
360 | sscanf(line, "%s %f %d", token, &meanNSB, &nphe2NSB);
|
---|
361 |
|
---|
362 | break;
|
---|
363 |
|
---|
364 | case nsb_directory: //@< name of the output file
|
---|
365 |
|
---|
366 | // get the name of the NSB diretory for inner pixels
|
---|
367 | sscanf(line, "%s %s", token, NSB_directory);
|
---|
368 |
|
---|
369 | break;
|
---|
370 |
|
---|
371 | case nsb_dir_outer: //@< name of the output file
|
---|
372 |
|
---|
373 | // get the name of the NSB diretory for outer pixels
|
---|
374 | sscanf(line, "%s %s", token, NSB_outer_directory);
|
---|
375 |
|
---|
376 | break;
|
---|
377 |
|
---|
378 | case pixel_thres: //@< value of threshold for trigger (q0)
|
---|
379 |
|
---|
380 | // get value of threshold (in ph.e.)
|
---|
381 | sscanf(line, "%s %i %f", token,&k, &aux);
|
---|
382 | if(k>99 || k<0){
|
---|
383 | printf("ERROR : The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
|
---|
384 | exit(1);
|
---|
385 | }
|
---|
386 | qThreshold[0][k]=aux;
|
---|
387 | Individual_Thres = TRUE;
|
---|
388 |
|
---|
389 | break;
|
---|
390 |
|
---|
391 | case secure_disc: //@< value of secure threshold
|
---|
392 |
|
---|
393 | // get value of secure threshold (in ph.e.)
|
---|
394 | sscanf(line, "%s %f %f", token,&aux, &aux2);
|
---|
395 | RiseDisc=aux;
|
---|
396 | SecureDisc=aux2;
|
---|
397 |
|
---|
398 | break;
|
---|
399 |
|
---|
400 | case seeds: //@< values of seeds for random numbers
|
---|
401 |
|
---|
402 | // get seeds
|
---|
403 | sscanf(line, "%s %ld %ld", token, &Seeds[0], &Seeds[1]);
|
---|
404 |
|
---|
405 | break;
|
---|
406 |
|
---|
407 | case skip: //@< skip pathological showers
|
---|
408 |
|
---|
409 | // get showers to skip
|
---|
410 | cin >> nSkip;
|
---|
411 | Skip = new int[nSkip];
|
---|
412 | for (j=0; j<nSkip; ++j) {
|
---|
413 | cin >> Skip[j];
|
---|
414 | cout << Skip[j] << endl << flush;
|
---|
415 | }
|
---|
416 |
|
---|
417 | break;
|
---|
418 |
|
---|
419 | case data_from_stdin: //@< to read data from stdin
|
---|
420 |
|
---|
421 | // change boolean value
|
---|
422 | Data_From_STDIN = TRUE;
|
---|
423 |
|
---|
424 | break;
|
---|
425 |
|
---|
426 | case write_all_events: //@< to write ALL the images
|
---|
427 |
|
---|
428 | // change boolean value
|
---|
429 | Write_All_Images = TRUE;
|
---|
430 |
|
---|
431 | break;
|
---|
432 |
|
---|
433 | case nowrite_McEvt: //@< do not write the McEvt info
|
---|
434 |
|
---|
435 | // change boolean value
|
---|
436 | Write_McEvt = FALSE;
|
---|
437 |
|
---|
438 | break;
|
---|
439 |
|
---|
440 | case write_McTrig: //@< to write the McTrig info
|
---|
441 |
|
---|
442 | // change boolean value
|
---|
443 | Write_McTrig = TRUE;
|
---|
444 |
|
---|
445 | break;
|
---|
446 |
|
---|
447 | case write_McFadc: //@< to write the McFadc info
|
---|
448 |
|
---|
449 | // change boolean value
|
---|
450 | Write_McFadc = TRUE;
|
---|
451 |
|
---|
452 | break;
|
---|
453 |
|
---|
454 | case nowrite_RawEvt: //@< to write the McFadc info
|
---|
455 |
|
---|
456 | // change boolean value
|
---|
457 | Write_RawEvt = FALSE;
|
---|
458 |
|
---|
459 | break;
|
---|
460 |
|
---|
461 | case select_energy: //@< value of islands_cut (i0)
|
---|
462 |
|
---|
463 | // get energy range
|
---|
464 | sscanf(line, "%s %f %f", token, &Select_Energy_le, &Select_Energy_ue);
|
---|
465 | Select_Energy = TRUE;
|
---|
466 |
|
---|
467 | break;
|
---|
468 |
|
---|
469 | case fadc_scan:
|
---|
470 |
|
---|
471 | // change boolean value
|
---|
472 | FADC_Scan = TRUE;
|
---|
473 |
|
---|
474 | break;
|
---|
475 |
|
---|
476 | case fadc_prop:
|
---|
477 |
|
---|
478 | // Get parameters for the fadc response for one phe
|
---|
479 | sscanf(line, "%s %i %f %f", token, &FADC_shape, &FADC_response_ampl,&FADC_response_fwhm);
|
---|
480 |
|
---|
481 | break;
|
---|
482 |
|
---|
483 | case fadc_outer:
|
---|
484 |
|
---|
485 | // Get parameters for the fadc response for one phe
|
---|
486 | sscanf(line, "%s %i %f %f", token, &FADC_shape_out, &FADC_resp_ampl_out,&FADC_resp_fwhm_out);
|
---|
487 |
|
---|
488 | break;
|
---|
489 |
|
---|
490 | case fadc_GHz:
|
---|
491 |
|
---|
492 | // Get FADC sampling frequency in GHz (default 0.3)
|
---|
493 | sscanf(line, "%s %f %i", token, &FADC_slices_per_ns, &FADC_slices_written);
|
---|
494 |
|
---|
495 | break;
|
---|
496 |
|
---|
497 | case trigger_scan:
|
---|
498 |
|
---|
499 | // change boolean value
|
---|
500 | Trigger_Scan = TRUE;
|
---|
501 |
|
---|
502 | break;
|
---|
503 | case trigger_prop:
|
---|
504 |
|
---|
505 | // Get parameters for the diskriminator and the electronic
|
---|
506 | // response for one phe
|
---|
507 | sscanf(line, "%s %f %f %f %f", token, &Trigger_gate_length,&Trigger_over_time, &Trigger_response_ampl,&Trigger_response_fwhm);
|
---|
508 |
|
---|
509 | break;
|
---|
510 |
|
---|
511 | case trigger_loop:
|
---|
512 |
|
---|
513 | // Get loop's limits
|
---|
514 | sscanf(line, "%s %f %f %f %d %d %d %d", token, &Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_sthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop );
|
---|
515 |
|
---|
516 | // Set qThreshold to a global value
|
---|
517 | for(k=0;k<CAMERA_PIXELS;k++){
|
---|
518 | qThreshold[0][k]=Trigger_loop_lthres;
|
---|
519 | }
|
---|
520 |
|
---|
521 | // change boolean value
|
---|
522 | Trigger_Loop = TRUE;
|
---|
523 | Write_RawEvt = FALSE;
|
---|
524 | Individual_Thres = FALSE;
|
---|
525 |
|
---|
526 | break;
|
---|
527 |
|
---|
528 | case trigger_single:
|
---|
529 |
|
---|
530 | // Get trigger conditions
|
---|
531 | sscanf(line, "%s %d %f %d %d", token, &j, &aux, &aux3, &aux4);
|
---|
532 | if(j>99 || j<0){
|
---|
533 | printf("ERROR : The input_file command in input card is faulty. \n\t Most likely the control index for CT is missing.\n");
|
---|
534 | exit(1);
|
---|
535 | }
|
---|
536 | Trigger_threshold[j]=aux;
|
---|
537 | Trigger_multiplicity[j]=aux3;
|
---|
538 | Trigger_topology[j]=aux4;
|
---|
539 |
|
---|
540 | // Set qThreshold to a global value
|
---|
541 | for(k=0;k<CAMERA_PIXELS;k++){
|
---|
542 | qThreshold[j][k]=Trigger_threshold[j];
|
---|
543 | }
|
---|
544 |
|
---|
545 | // change boolean value
|
---|
546 | Trigger_Loop = FALSE;
|
---|
547 | Write_RawEvt = TRUE;
|
---|
548 | Individual_Thres = FALSE;
|
---|
549 |
|
---|
550 | break;
|
---|
551 |
|
---|
552 | case Trigger_Loop_Output_Only_Specialists:
|
---|
553 |
|
---|
554 | // get the name of the data_file from the line
|
---|
555 | sscanf(line, "%s %s", token, Loop_filename);
|
---|
556 | cout << '[' << Loop_filename << ']' << endl << flush;
|
---|
557 |
|
---|
558 | // change boolean value
|
---|
559 | Write_RawEvt = TRUE;
|
---|
560 |
|
---|
561 | break;
|
---|
562 |
|
---|
563 | case trigger_delay:
|
---|
564 |
|
---|
565 | sscanf(line, "%s %f", token, &trig_delay);
|
---|
566 | break;
|
---|
567 |
|
---|
568 | case pmt_jitter_ns:
|
---|
569 |
|
---|
570 | sscanf(line, "%s %f", token, &pmt_jitter);
|
---|
571 | break;
|
---|
572 |
|
---|
573 |
|
---|
574 | case sigma_xy_cm_spot:
|
---|
575 |
|
---|
576 | sscanf(line, "%s %f", token, &sigma_x_spot);
|
---|
577 | sigma_y_spot=sigma_x_spot;
|
---|
578 | break;
|
---|
579 |
|
---|
580 | case sigma_x_cm_spot:
|
---|
581 |
|
---|
582 | sscanf(line, "%s %f", token, &sigma_x_spot);
|
---|
583 | break;
|
---|
584 |
|
---|
585 | case sigma_y_cm_spot:
|
---|
586 |
|
---|
587 | sscanf(line, "%s %f", token, &sigma_y_spot);
|
---|
588 | break;
|
---|
589 |
|
---|
590 | case misspoint_deg:
|
---|
591 |
|
---|
592 | sscanf(line, "%s %f %f", token, &misp_x, &misp_y);
|
---|
593 | break;
|
---|
594 |
|
---|
595 | case telescope_location_cm:
|
---|
596 |
|
---|
597 | if ( 5 != sscanf(line, "%s %d %f %f %f", token, &j, &aux, &aux1, &aux2) )
|
---|
598 | {
|
---|
599 | printf("\nError: wrong number of arguments for command telescope_location_cm.\n");
|
---|
600 | printf("Usage: telescope_location_cm ct_id x y z\n");
|
---|
601 | printf("Coordinates must be written in centimeters.");
|
---|
602 | printf("Exiting.\n\n");
|
---|
603 | exit(1);
|
---|
604 | }
|
---|
605 |
|
---|
606 | if (j >= MAX_NUMBER_OF_CTS)
|
---|
607 | {
|
---|
608 | printf("\nError: coordinates were supplied for a telescope index (%d)\n", j);
|
---|
609 | printf("larger than allowed. Valid telescope ids range from 0 to %d. Exiting.\n\n", MAX_NUMBER_OF_CTS-1);
|
---|
610 | exit(1);
|
---|
611 | }
|
---|
612 | CTcoor[j][0] = aux;
|
---|
613 | CTcoor[j][1] = aux1;
|
---|
614 | CTcoor[j][2] = aux2;
|
---|
615 |
|
---|
616 | break;
|
---|
617 |
|
---|
618 | case mirror_fraction:
|
---|
619 |
|
---|
620 | sscanf(line, "%s %d %f", token, &j, &aux);
|
---|
621 | m_fraction[j] = aux;
|
---|
622 |
|
---|
623 | break;
|
---|
624 |
|
---|
625 | case calibration_run:
|
---|
626 |
|
---|
627 | sscanf(line, "%s %f %f %f %f %i %i", token, &lambda, &sigma_lambda, &phot_per_pix,
|
---|
628 | &fwhm_time, &nevents, &selected_pixel);
|
---|
629 |
|
---|
630 | CalibrationRun = 1;
|
---|
631 |
|
---|
632 | break;
|
---|
633 |
|
---|
634 | case gain_fluctuations_off:
|
---|
635 |
|
---|
636 | gain_fluctuations = 0;
|
---|
637 |
|
---|
638 | break;
|
---|
639 |
|
---|
640 | case noise_gain_fluctuations_off:
|
---|
641 |
|
---|
642 | noise_gain_fluctuations = 0;
|
---|
643 |
|
---|
644 | break;
|
---|
645 |
|
---|
646 | case end_file: //@< end of the parameters file
|
---|
647 |
|
---|
648 | // show a short message
|
---|
649 | is_end = TRUE;
|
---|
650 |
|
---|
651 | break;
|
---|
652 |
|
---|
653 |
|
---|
654 | } // switch ( i )
|
---|
655 |
|
---|
656 | } // while (! is_end)
|
---|
657 |
|
---|
658 | // after the loop is finished, return to the main function
|
---|
659 | return;
|
---|
660 | }
|
---|
661 | //!@}
|
---|
662 |
|
---|
663 |
|
---|
664 | //!-----------------------------------------------------------
|
---|
665 | // @name get_input_filename
|
---|
666 | //
|
---|
667 | // @desc get name of the input file
|
---|
668 | //
|
---|
669 | // @return Name of the Input file
|
---|
670 | //
|
---|
671 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
672 | //------------------------------------------------------------
|
---|
673 | // @function
|
---|
674 |
|
---|
675 | //!@{
|
---|
676 | char *
|
---|
677 | get_input_filename(int i)
|
---|
678 | {
|
---|
679 | return (Input_filename[i]);
|
---|
680 | }
|
---|
681 | //!@}
|
---|
682 |
|
---|
683 |
|
---|
684 | //!-----------------------------------------------------------
|
---|
685 | // @name get_starfield_filename
|
---|
686 | //
|
---|
687 | // @desc get name of the starfield input file
|
---|
688 | //
|
---|
689 | // @return Name of the starfield file
|
---|
690 | //
|
---|
691 | // @date Tue Feb 15 16:02:18 CET 2000
|
---|
692 | //------------------------------------------------------------
|
---|
693 | // @function
|
---|
694 |
|
---|
695 | //!@{
|
---|
696 | char *
|
---|
697 | get_starfield_filename(void)
|
---|
698 | {
|
---|
699 | return (Starfield_filename);
|
---|
700 | }
|
---|
701 | //!@}
|
---|
702 |
|
---|
703 |
|
---|
704 | //!-----------------------------------------------------------
|
---|
705 | // @name get_starfield_center
|
---|
706 | //
|
---|
707 | // @desc get center of the starfield FOV
|
---|
708 | //
|
---|
709 | // @return Central co-ordinates in RA and DEC for the centre of FOV
|
---|
710 | //
|
---|
711 | // @date Tue Feb 15 16:02:18 CET 2000
|
---|
712 | //------------------------------------------------------------
|
---|
713 | // @function
|
---|
714 |
|
---|
715 | //!@{
|
---|
716 | void get_starfield_center(int *rh,int *rm,int *rs,int *dd,int *dm,int *ds)
|
---|
717 | {
|
---|
718 | *rh=Starfield_center[0];
|
---|
719 | *rm=Starfield_center[1];
|
---|
720 | *rs=Starfield_center[2];
|
---|
721 | *dd=Starfield_center[3];
|
---|
722 | *dm=Starfield_center[4];
|
---|
723 | *ds=Starfield_center[5];
|
---|
724 | }
|
---|
725 | //!-----------------------------------------------------------
|
---|
726 | // @name get_starfield_rotate
|
---|
727 | //
|
---|
728 | // @Starfield_rotate
|
---|
729 | //
|
---|
730 | // @return
|
---|
731 | //
|
---|
732 | //------------------------------------------------------------
|
---|
733 | // @function
|
---|
734 |
|
---|
735 | //!@{
|
---|
736 | int
|
---|
737 | get_starfield_rotate(void)
|
---|
738 | {
|
---|
739 | return(Starfield_rotate);
|
---|
740 | }
|
---|
741 |
|
---|
742 |
|
---|
743 | //!@}
|
---|
744 | //!-----------------------------------------------------------
|
---|
745 | // @name get_data_filename
|
---|
746 | //
|
---|
747 | // @desc get name of the data file
|
---|
748 | //
|
---|
749 | // @return Name of the Data file
|
---|
750 | //
|
---|
751 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
752 | //------------------------------------------------------------
|
---|
753 | // @function
|
---|
754 |
|
---|
755 | //!@{
|
---|
756 | char *
|
---|
757 | get_data_filename(void)
|
---|
758 | {
|
---|
759 | return (Data_filename);
|
---|
760 | }
|
---|
761 | //!@}
|
---|
762 |
|
---|
763 |
|
---|
764 | //!-----------------------------------------------------------
|
---|
765 | // @name get_root_filename
|
---|
766 | //
|
---|
767 | // @desc get name of the ROOT file
|
---|
768 | //
|
---|
769 | // @return Name of the ROOT file
|
---|
770 | //
|
---|
771 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
772 | //------------------------------------------------------------
|
---|
773 | // @function
|
---|
774 |
|
---|
775 | //!@{
|
---|
776 | char *
|
---|
777 | get_root_filename(void)
|
---|
778 | {
|
---|
779 | return (ROOT_filename);
|
---|
780 | }
|
---|
781 | //!@}
|
---|
782 | //!-----------------------------------------------------------
|
---|
783 | // @name get_loop_filename
|
---|
784 | //
|
---|
785 | // @desc get name of the special ROOT file
|
---|
786 | //
|
---|
787 | // @return Name of the special ROOT file
|
---|
788 | //
|
---|
789 | // @date Fri Jun 23 17:34:19 CEST 2000
|
---|
790 | //------------------------------------------------------------
|
---|
791 | // @function
|
---|
792 |
|
---|
793 | //!@{
|
---|
794 |
|
---|
795 | char *
|
---|
796 | get_loop_filename(void)
|
---|
797 | {
|
---|
798 | return (Loop_filename);
|
---|
799 | }
|
---|
800 | //!@}
|
---|
801 |
|
---|
802 | //!-----------------------------------------------------------
|
---|
803 | // @name get_ct_number
|
---|
804 | //
|
---|
805 | // @desc get number of CT
|
---|
806 | //
|
---|
807 | // @return number of CT
|
---|
808 | //
|
---|
809 | // @date Tue Jul 29 01:48:26 CEST 2003
|
---|
810 | //------------------------------------------------------------
|
---|
811 | // @function
|
---|
812 |
|
---|
813 | //!@{
|
---|
814 | int
|
---|
815 | get_ct_number(void)
|
---|
816 | {
|
---|
817 | return (CT_number);
|
---|
818 | }
|
---|
819 | //!@}
|
---|
820 |
|
---|
821 | //!-----------------------------------------------------------
|
---|
822 | // @name get_ct_geometry
|
---|
823 | //
|
---|
824 | // @desc get geometry of CT
|
---|
825 | //
|
---|
826 | // @return geometry of CT
|
---|
827 | //
|
---|
828 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
829 | //------------------------------------------------------------
|
---|
830 | // @function
|
---|
831 |
|
---|
832 | //!@{
|
---|
833 | int
|
---|
834 | get_ct_geometry(int ict)
|
---|
835 | {
|
---|
836 | char dummy[2];
|
---|
837 | strncpy(dummy, &(CT_geom_string[ict]), 1);
|
---|
838 | dummy[1] = '\0';
|
---|
839 |
|
---|
840 | return ((int)atoi(dummy));
|
---|
841 | }
|
---|
842 | //!@}
|
---|
843 |
|
---|
844 | //!-----------------------------------------------------------
|
---|
845 | // @name get_qe_filename
|
---|
846 | //
|
---|
847 | // @desc get name of QE definition file
|
---|
848 | //
|
---|
849 | // @return Name of the QE definition file
|
---|
850 | //
|
---|
851 | // @date Thu Jul 10 14:10:13 CEST 2003
|
---|
852 | //------------------------------------------------------------
|
---|
853 | // @function
|
---|
854 |
|
---|
855 | //!@{
|
---|
856 | char *
|
---|
857 | get_qe_filename(int ict)
|
---|
858 | {
|
---|
859 | return (QE_filename[ict]);
|
---|
860 | }
|
---|
861 | //!@}
|
---|
862 |
|
---|
863 | //!-----------------------------------------------------------
|
---|
864 | // @name get_nsb_directory
|
---|
865 | //
|
---|
866 | // @desc get name of the directory where the database for NSB is
|
---|
867 | //
|
---|
868 | // @return Name of the NSB directory
|
---|
869 | //
|
---|
870 | // @date Tue Jan 30 12:07:56 MET 2001
|
---|
871 | //------------------------------------------------------------
|
---|
872 | // @function
|
---|
873 |
|
---|
874 | //!@{
|
---|
875 | char *
|
---|
876 | get_nsb_directory(void)
|
---|
877 | {
|
---|
878 | return (NSB_directory);
|
---|
879 | }
|
---|
880 | //!@}
|
---|
881 |
|
---|
882 |
|
---|
883 |
|
---|
884 | //!-----------------------------------------------------------
|
---|
885 | // @name get_nsb_directory_outer
|
---|
886 | //
|
---|
887 | // @desc get name of the directory where the database for NSB is
|
---|
888 | //
|
---|
889 | // @return Name of the NSB directory for outer pixels
|
---|
890 | //
|
---|
891 | // @date Thu Jul 10 14:10:13 CEST 2003
|
---|
892 | //------------------------------------------------------------
|
---|
893 | // @function
|
---|
894 |
|
---|
895 | //!@{
|
---|
896 | char *
|
---|
897 | get_nsb_directory_outer(void)
|
---|
898 | {
|
---|
899 | return (NSB_outer_directory);
|
---|
900 | }
|
---|
901 | //!@}
|
---|
902 |
|
---|
903 |
|
---|
904 |
|
---|
905 | //!-----------------------------------------------------------
|
---|
906 | // @name add_elec_noise
|
---|
907 | //
|
---|
908 | // @desc are we going to add the ElecNoise?
|
---|
909 | //
|
---|
910 | // @date Mon Jan 14 19:27:56 MET DST 2002
|
---|
911 | //------------------------------------------------------------
|
---|
912 | // @function
|
---|
913 |
|
---|
914 | //!@{
|
---|
915 | int
|
---|
916 | add_elec_noise(float *fadcinner, float*fadcouter, float *digi, float *trig)
|
---|
917 | {
|
---|
918 | *fadcinner = FADC_Noise_inner;
|
---|
919 | *fadcouter = FADC_Noise_outer;
|
---|
920 |
|
---|
921 | *digi = Digital_Noise;
|
---|
922 | *trig = Trig_Noise;
|
---|
923 |
|
---|
924 | return ( ElecNoise);
|
---|
925 | }
|
---|
926 | //!@}
|
---|
927 |
|
---|
928 | //!-----------------------------------------------------------
|
---|
929 | // @name get_nsb
|
---|
930 | //
|
---|
931 | // @desc are we going to simulate NSB ?
|
---|
932 | //
|
---|
933 | // @var *n Mean value for the NSB (ph.e./pixel)
|
---|
934 | // @return TRUE: we'll simulate NSB; FALSE: we won't
|
---|
935 | //
|
---|
936 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
937 | //------------------------------------------------------------
|
---|
938 | // @function
|
---|
939 |
|
---|
940 | //!@{
|
---|
941 | int
|
---|
942 | get_nsb(float *n, int *m)
|
---|
943 | {
|
---|
944 | *n = meanNSB;
|
---|
945 | *m = nphe2NSB;
|
---|
946 | return ( simulateNSB );
|
---|
947 | }
|
---|
948 | //!@}
|
---|
949 |
|
---|
950 |
|
---|
951 | //!-----------------------------------------------------------
|
---|
952 | // @name get_threshold
|
---|
953 | //
|
---|
954 | // @desc get threshold value
|
---|
955 | //
|
---|
956 | // @return Value of the threshold q$_0$
|
---|
957 | //
|
---|
958 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
959 | //------------------------------------------------------------
|
---|
960 | // @function
|
---|
961 |
|
---|
962 | //!@{
|
---|
963 | void
|
---|
964 | get_threshold(float *t)
|
---|
965 | {
|
---|
966 | for(int i=0;i<CAMERA_PIXELS;i++)
|
---|
967 | t[i]=qThreshold[0][i];
|
---|
968 | }
|
---|
969 | //!@}
|
---|
970 |
|
---|
971 | //!-----------------------------------------------------------
|
---|
972 | // @name get_secure_threhold
|
---|
973 | //
|
---|
974 | // @desc get values for secure threshold.
|
---|
975 | //
|
---|
976 | // @return AC (ac)value above which discriminator threshold rised to disc
|
---|
977 | //
|
---|
978 | // @date Wed Jul 18 16:29:43 CEST 2001
|
---|
979 | //------------------------------------------------------------
|
---|
980 | // @function
|
---|
981 |
|
---|
982 | //!@{
|
---|
983 | void
|
---|
984 | get_secure_threhold(float *ac, float *disc)
|
---|
985 | {
|
---|
986 | *ac=RiseDisc;
|
---|
987 | *disc=SecureDisc;
|
---|
988 | }
|
---|
989 | //!@}
|
---|
990 |
|
---|
991 | //!-----------------------------------------------------------
|
---|
992 | // @name get_indi_thres_pixel
|
---|
993 | //
|
---|
994 | // @desc get boolean information about global (FALSE) or
|
---|
995 | // @desc individual (TRUE) pixel trigger threshold
|
---|
996 | //
|
---|
997 | // @return Value for the Individual_Thres
|
---|
998 | //
|
---|
999 | // @date Wed Jul 18 16:29:43 CEST 2001
|
---|
1000 | //------------------------------------------------------------
|
---|
1001 | // @function
|
---|
1002 |
|
---|
1003 | //!@{
|
---|
1004 | int get_indi_thres_pixel(void){
|
---|
1005 | return Individual_Thres;
|
---|
1006 | }
|
---|
1007 | //!@}
|
---|
1008 |
|
---|
1009 |
|
---|
1010 | //!-----------------------------------------------------------
|
---|
1011 | // @name get_seeds
|
---|
1012 | //
|
---|
1013 | // @desc are we going to count the islands ?
|
---|
1014 | //
|
---|
1015 | // @var *n Number of the seed
|
---|
1016 | // @return N-th random-number Seed
|
---|
1017 | //
|
---|
1018 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
1019 | //------------------------------------------------------------
|
---|
1020 | // @function
|
---|
1021 |
|
---|
1022 | //!@{
|
---|
1023 | long int
|
---|
1024 | get_seeds(int n)
|
---|
1025 | {
|
---|
1026 | return ( Seeds[n] );
|
---|
1027 | }
|
---|
1028 | //!@}
|
---|
1029 |
|
---|
1030 |
|
---|
1031 | //!-----------------------------------------------------------
|
---|
1032 | // @name get_skip_showers
|
---|
1033 | //
|
---|
1034 | // @desc get list of showers to skip
|
---|
1035 | //
|
---|
1036 | // @var *s1 Pointer to a vector of number of showers
|
---|
1037 | //
|
---|
1038 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
1039 | //------------------------------------------------------------
|
---|
1040 | // @function
|
---|
1041 |
|
---|
1042 | //!@{
|
---|
1043 | void
|
---|
1044 | get_skip_showers( int *s )
|
---|
1045 | {
|
---|
1046 | int i;
|
---|
1047 | for (i=0; i<nSkip; ++i)
|
---|
1048 | s[i] = Skip[i];
|
---|
1049 | }
|
---|
1050 | //!@}
|
---|
1051 |
|
---|
1052 |
|
---|
1053 | //!-----------------------------------------------------------
|
---|
1054 | // @name get_nskip_showers
|
---|
1055 | //
|
---|
1056 | // @desc get number of showers to skip
|
---|
1057 | //
|
---|
1058 | // @return Number of showers to be skipped
|
---|
1059 | //
|
---|
1060 | // @date Mon Sep 14 13:27:56 MET DST 1998
|
---|
1061 | //------------------------------------------------------------
|
---|
1062 | // @function
|
---|
1063 |
|
---|
1064 | //!@{
|
---|
1065 | int
|
---|
1066 | get_nskip_showers( void )
|
---|
1067 | {
|
---|
1068 | return( nSkip );
|
---|
1069 | }
|
---|
1070 | //!@}
|
---|
1071 |
|
---|
1072 |
|
---|
1073 | //!-----------------------------------------------------------
|
---|
1074 | // @name get_data_from_stdin
|
---|
1075 | //
|
---|
1076 | // @desc get whether we will read the data from the STDIN
|
---|
1077 | //
|
---|
1078 | // @return TRUE: we'll read data from STDIN; FALSE: we won't
|
---|
1079 | //
|
---|
1080 | // @date Wed Nov 25 13:21:00 MET 1998
|
---|
1081 | //------------------------------------------------------------
|
---|
1082 | // @function
|
---|
1083 |
|
---|
1084 | //!@{
|
---|
1085 | int
|
---|
1086 | get_data_from_stdin(void)
|
---|
1087 | {
|
---|
1088 | return ( Data_From_STDIN );
|
---|
1089 | }
|
---|
1090 | //!@}
|
---|
1091 |
|
---|
1092 |
|
---|
1093 | //!-----------------------------------------------------------
|
---|
1094 | // @name write_all_events
|
---|
1095 | //
|
---|
1096 | // @desc write all images to .phe, even those without trigger
|
---|
1097 | //
|
---|
1098 | // @return TRUE: we'll write everything; FALSE: we won't
|
---|
1099 | //
|
---|
1100 | // @date Wed Nov 25 13:21:00 MET 1998
|
---|
1101 | //------------------------------------------------------------
|
---|
1102 | // @function
|
---|
1103 |
|
---|
1104 | //!@{
|
---|
1105 | int
|
---|
1106 | get_write_all_events(void)
|
---|
1107 | {
|
---|
1108 | return ( Write_All_Images );
|
---|
1109 | }
|
---|
1110 | //!@}
|
---|
1111 |
|
---|
1112 | //!-----------------------------------------------------------
|
---|
1113 | // @name write_McEvt
|
---|
1114 | //
|
---|
1115 | // @desc write the McEvt class for each event to the .root file
|
---|
1116 | //
|
---|
1117 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1118 | //
|
---|
1119 | //------------------------------------------------------------
|
---|
1120 | // @function
|
---|
1121 |
|
---|
1122 | //!@{
|
---|
1123 | int
|
---|
1124 | get_write_McEvt(void)
|
---|
1125 | {
|
---|
1126 | return ( Write_McEvt );
|
---|
1127 | }
|
---|
1128 | //!@}
|
---|
1129 |
|
---|
1130 | //!-----------------------------------------------------------
|
---|
1131 | // @name write_McTrig
|
---|
1132 | //
|
---|
1133 | // @desc write the McTrig class for each event to the .root file
|
---|
1134 | //
|
---|
1135 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1136 | //
|
---|
1137 | //------------------------------------------------------------
|
---|
1138 | // @function
|
---|
1139 |
|
---|
1140 | //!@{
|
---|
1141 | int
|
---|
1142 | get_write_McTrig(void)
|
---|
1143 | {
|
---|
1144 | return ( Write_McTrig );
|
---|
1145 | }
|
---|
1146 | //!@}
|
---|
1147 |
|
---|
1148 | //!-----------------------------------------------------------
|
---|
1149 | // @name write_McFadc
|
---|
1150 | //
|
---|
1151 | // @desc write the McFadc class for each event to the .root file
|
---|
1152 | //
|
---|
1153 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1154 | //
|
---|
1155 | //------------------------------------------------------------
|
---|
1156 | // @function
|
---|
1157 |
|
---|
1158 | //!@{
|
---|
1159 | int
|
---|
1160 | get_write_McFadc(void)
|
---|
1161 | {
|
---|
1162 | return ( Write_McFadc );
|
---|
1163 | }
|
---|
1164 | //!@}
|
---|
1165 |
|
---|
1166 | //!-----------------------------------------------------------
|
---|
1167 | // @name write_RawEvt
|
---|
1168 | //
|
---|
1169 | // @desc write the RawEvt class for each event to the .root file
|
---|
1170 | //
|
---|
1171 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1172 | //
|
---|
1173 | //------------------------------------------------------------
|
---|
1174 | // @function
|
---|
1175 |
|
---|
1176 | //!@{
|
---|
1177 | int
|
---|
1178 | get_write_RawEvt(void)
|
---|
1179 | {
|
---|
1180 | return ( Write_RawEvt );
|
---|
1181 | }
|
---|
1182 | //!@}
|
---|
1183 |
|
---|
1184 | //!-----------------------------------------------------------
|
---|
1185 | // @name get_select_energy
|
---|
1186 | //
|
---|
1187 | // @desc return energy range allowed for showers from .phe file
|
---|
1188 | //
|
---|
1189 | // @var *le Lower limit in the allowed energy range
|
---|
1190 | // @var *ue Lower limit in the allowed energy range
|
---|
1191 | // @return TRUE: we make selection on the energy; FALSE: we don't
|
---|
1192 | //
|
---|
1193 | // @date Wed Nov 25 13:21:00 MET 1998
|
---|
1194 | //------------------------------------------------------------
|
---|
1195 | // @function
|
---|
1196 |
|
---|
1197 | //!@{
|
---|
1198 | int
|
---|
1199 | get_select_energy(float *le, float *ue)
|
---|
1200 | {
|
---|
1201 | *le = Select_Energy_le;
|
---|
1202 | *ue = Select_Energy_ue;
|
---|
1203 | return ( Select_Energy );
|
---|
1204 | }
|
---|
1205 | //!@}
|
---|
1206 |
|
---|
1207 | //!-----------------------------------------------------------
|
---|
1208 | // @name FADC_Scan
|
---|
1209 | //
|
---|
1210 | // @desc show the FADC signal for each event in the screen
|
---|
1211 | //
|
---|
1212 | // @return TRUE: we'll show it; FALSE: we won't
|
---|
1213 | //
|
---|
1214 | //------------------------------------------------------------
|
---|
1215 | // @function
|
---|
1216 |
|
---|
1217 | //!@{
|
---|
1218 | int
|
---|
1219 | get_FADC_Scan(void)
|
---|
1220 | {
|
---|
1221 | return ( FADC_Scan );
|
---|
1222 | }
|
---|
1223 | //!@}
|
---|
1224 |
|
---|
1225 | //!-----------------------------------------------------------
|
---|
1226 | // @name Trigger_Scan
|
---|
1227 | //
|
---|
1228 | // @desc show the Trigger signal for each event in the screen
|
---|
1229 | //
|
---|
1230 | // @return TRUE: we'll show it; FALSE: we won't
|
---|
1231 | //
|
---|
1232 | //------------------------------------------------------------
|
---|
1233 | // @function
|
---|
1234 |
|
---|
1235 | //!@{
|
---|
1236 | int
|
---|
1237 | get_Trigger_Scan(void)
|
---|
1238 | {
|
---|
1239 | return ( Trigger_Scan );
|
---|
1240 | }
|
---|
1241 | //!@}
|
---|
1242 |
|
---|
1243 | //!-----------------------------------------------------------
|
---|
1244 | // @name Fadc_Propeties
|
---|
1245 | //
|
---|
1246 | // @desc fix properties of the FADC response
|
---|
1247 | //
|
---|
1248 | //------------------------------------------------------------
|
---|
1249 | // @function
|
---|
1250 |
|
---|
1251 | //!@{
|
---|
1252 | void
|
---|
1253 | get_FADC_properties(int *shape,float *ra, float *rf,
|
---|
1254 | int *shapeo, float *rao, float *rfo,
|
---|
1255 | float *fadc_spns, int *fadc_slices)
|
---|
1256 | {
|
---|
1257 | *shape = FADC_shape;
|
---|
1258 | *ra = FADC_response_ampl;
|
---|
1259 | *rf = FADC_response_fwhm;
|
---|
1260 | *shapeo = FADC_shape_out;
|
---|
1261 | *rao = FADC_resp_ampl_out;
|
---|
1262 | *rfo = FADC_resp_fwhm_out;
|
---|
1263 | *fadc_spns = FADC_slices_per_ns;
|
---|
1264 | *fadc_slices = FADC_slices_written;
|
---|
1265 | }
|
---|
1266 | //!@}
|
---|
1267 |
|
---|
1268 | //!-----------------------------------------------------------
|
---|
1269 | // @name Trigger_Propeties
|
---|
1270 | //
|
---|
1271 | // @desc fix properties of the diskriminator and amplifier for Trigger
|
---|
1272 | //
|
---|
1273 | //------------------------------------------------------------
|
---|
1274 | // @function
|
---|
1275 |
|
---|
1276 | //!@{
|
---|
1277 | void
|
---|
1278 | get_Trigger_properties(float *gl, float *ot, float *ra, float *rf)
|
---|
1279 | {
|
---|
1280 | *gl=Trigger_gate_length;
|
---|
1281 | *ot=Trigger_over_time;
|
---|
1282 | *ra=Trigger_response_ampl;
|
---|
1283 | *rf=Trigger_response_fwhm;
|
---|
1284 |
|
---|
1285 | }
|
---|
1286 | //!@}
|
---|
1287 |
|
---|
1288 | //!-----------------------------------------------------------
|
---|
1289 | // @name Trigger_Loop
|
---|
1290 | //
|
---|
1291 | // @desc make a loop over Trigger conditions
|
---|
1292 | //
|
---|
1293 | // @return TRUE: we'll make it; FALSE: we won't
|
---|
1294 | //
|
---|
1295 | //------------------------------------------------------------
|
---|
1296 | // @function
|
---|
1297 |
|
---|
1298 | //!@{
|
---|
1299 | int
|
---|
1300 | get_Trigger_Loop(float *lt, float *ut, float *st, int *lm, int *um, int *lg, int *ug)
|
---|
1301 | {
|
---|
1302 | *lt=Trigger_loop_lthres;
|
---|
1303 | *ut=Trigger_loop_uthres;
|
---|
1304 | *st=Trigger_loop_sthres;
|
---|
1305 | *lm=Trigger_loop_lmult;
|
---|
1306 | *um=Trigger_loop_umult;
|
---|
1307 | *lg=Trigger_loop_ltop;
|
---|
1308 | *ug=Trigger_loop_utop;
|
---|
1309 | return ( Trigger_Loop );
|
---|
1310 | }
|
---|
1311 | //!@}
|
---|
1312 |
|
---|
1313 | //!-----------------------------------------------------------
|
---|
1314 | // @name Trigger_Single
|
---|
1315 | //
|
---|
1316 | // @desc fix Trigger conditions
|
---|
1317 | //
|
---|
1318 | //------------------------------------------------------------
|
---|
1319 | // @function
|
---|
1320 |
|
---|
1321 | //!@{
|
---|
1322 | void
|
---|
1323 | get_Trigger_Single(float **t, int *m, int *g)
|
---|
1324 | {
|
---|
1325 | for(int j=0;j<MAX_NUMBER_OF_CTS;j++){
|
---|
1326 | for(int i=0;i<CAMERA_PIXELS;i++)
|
---|
1327 | t[j][i]=qThreshold[j][i];
|
---|
1328 | m[j]=Trigger_multiplicity[j];
|
---|
1329 | g[j]=Trigger_topology[j];
|
---|
1330 | }
|
---|
1331 | }
|
---|
1332 | //!@}
|
---|
1333 |
|
---|
1334 | //!-----------------------------------------------------------
|
---|
1335 | // @name get_FADC_pedestal
|
---|
1336 | //
|
---|
1337 | // @desc get the value for the FADC pedestals
|
---|
1338 | //
|
---|
1339 | //------------------------------------------------------------
|
---|
1340 | // @function
|
---|
1341 |
|
---|
1342 | //!@{
|
---|
1343 |
|
---|
1344 |
|
---|
1345 | float get_FADC_pedestal(void){
|
---|
1346 |
|
---|
1347 | return FADC_pedestal;
|
---|
1348 |
|
---|
1349 | }
|
---|
1350 |
|
---|
1351 | //!@}
|
---|
1352 | //!-----------------------------------------------------------
|
---|
1353 | // @name get_High_to_Low
|
---|
1354 | //
|
---|
1355 | // @desc get the conversion factor between high and low gain
|
---|
1356 | //
|
---|
1357 | //------------------------------------------------------------
|
---|
1358 | // @function
|
---|
1359 |
|
---|
1360 | //!@{
|
---|
1361 |
|
---|
1362 |
|
---|
1363 | float get_High_to_Low(void){
|
---|
1364 |
|
---|
1365 | return High_to_Low;
|
---|
1366 |
|
---|
1367 | }
|
---|
1368 |
|
---|
1369 | int get_misspointing(float *x, float *y){
|
---|
1370 |
|
---|
1371 | *x=misp_x;
|
---|
1372 | *y=misp_y;
|
---|
1373 |
|
---|
1374 | if (misp_x == 0.0 && misp_y==0.0)
|
---|
1375 | return 0;
|
---|
1376 | else
|
---|
1377 | return 1;
|
---|
1378 |
|
---|
1379 | }
|
---|
1380 |
|
---|
1381 | float get_sigma_xy_cm_spot(float *x, float *y){
|
---|
1382 |
|
---|
1383 | *x=sigma_x_spot;
|
---|
1384 | *y=sigma_y_spot;
|
---|
1385 |
|
---|
1386 | if (sigma_x_spot > 0.0 || sigma_y_spot >0.0)
|
---|
1387 | return 1.0;
|
---|
1388 | else
|
---|
1389 | return -1.0;
|
---|
1390 |
|
---|
1391 | }
|
---|
1392 |
|
---|
1393 | float get_trig_delay(void){
|
---|
1394 |
|
---|
1395 | return trig_delay;
|
---|
1396 |
|
---|
1397 | }
|
---|
1398 |
|
---|
1399 | float get_pmt_jitter_ns(){
|
---|
1400 |
|
---|
1401 | return pmt_jitter;
|
---|
1402 |
|
---|
1403 | }
|
---|
1404 |
|
---|
1405 | float get_telescope_location_cm(int j, int icoor){
|
---|
1406 |
|
---|
1407 | return CTcoor[j][icoor];
|
---|
1408 |
|
---|
1409 | }
|
---|
1410 |
|
---|
1411 | float get_mirror_fraction(int j){
|
---|
1412 | return m_fraction[j];
|
---|
1413 | }
|
---|
1414 |
|
---|
1415 | int is_calibration_run(){
|
---|
1416 | return CalibrationRun;
|
---|
1417 | }
|
---|
1418 |
|
---|
1419 | void get_calibration_properties(float *a, float *b, float *c, float *d, int *e, int *f)
|
---|
1420 | {
|
---|
1421 | *a = lambda;
|
---|
1422 | *b = sigma_lambda;
|
---|
1423 | *c = phot_per_pix;
|
---|
1424 | *d = fwhm_time / 2.35; // Convert from FWHM to sigma of gaussian
|
---|
1425 | *e = nevents;
|
---|
1426 | *f = selected_pixel;
|
---|
1427 | }
|
---|
1428 |
|
---|
1429 | int apply_gain_fluctuations()
|
---|
1430 | {
|
---|
1431 | return gain_fluctuations;
|
---|
1432 | }
|
---|
1433 |
|
---|
1434 | int apply_noise_gain_fluctuations()
|
---|
1435 | {
|
---|
1436 | return noise_gain_fluctuations;
|
---|
1437 | }
|
---|
1438 |
|
---|
1439 |
|
---|
1440 | //=------------------------------------------------------------
|
---|
1441 | //!@subsection Log of this file.
|
---|
1442 |
|
---|
1443 | //!@{
|
---|
1444 | //
|
---|
1445 | // $Log: not supported by cvs2svn $
|
---|
1446 | // Revision 1.34 2004/11/17 11:36:07 moralejo
|
---|
1447 | // *** empty log message ***
|
---|
1448 | //
|
---|
1449 | // Revision 1.33 2004/10/26 13:58:59 moralejo
|
---|
1450 | //
|
---|
1451 | // Added option gain_fluctuations_off
|
---|
1452 | //
|
---|
1453 | // Revision 1.32 2004/10/14 16:53:49 moralejo
|
---|
1454 | //
|
---|
1455 | // Added option calibration_run
|
---|
1456 | //
|
---|
1457 | // Revision 1.31 2004/10/13 17:05:05 moralejo
|
---|
1458 | // *** empty log message ***
|
---|
1459 | //
|
---|
1460 | // Revision 1.30 2004/10/12 13:32:02 moralejo
|
---|
1461 | // *** empty log message ***
|
---|
1462 | //
|
---|
1463 | // Revision 1.29 2004/09/17 14:48:21 moralejo
|
---|
1464 | //
|
---|
1465 | // Changes to adapt headers to c++ style.
|
---|
1466 | //
|
---|
1467 | // Revision 1.28 2004/09/16 15:27:08 moralejo
|
---|
1468 | // Updated in CVS after some time (see changes below)
|
---|
1469 | //
|
---|
1470 | //
|
---|
1471 | // Revision 1.27 2004/05/12 A. Moralejo
|
---|
1472 | //
|
---|
1473 | // Changed fadc_noise command: now the two first numbers are respectively
|
---|
1474 | // the analogic electronic noise for inner (small) and outer (big) pixels
|
---|
1475 | // respectively. Last number is still the FADC digital noise which affects
|
---|
1476 | // equallly inner and outer pixels (as well as high and low gain).
|
---|
1477 | //
|
---|
1478 | // Revision 1.26 2004/01/30 09:58:39 blanch
|
---|
1479 | // [Changes done mainly by A. Moralejo]
|
---|
1480 | //
|
---|
1481 | // Two new commands of the input card have been added:
|
---|
1482 | //
|
---|
1483 | // sigma_xy_cm_spot: to enlarge the point spread function.
|
---|
1484 | // trigger_delay: to center the FADC signal
|
---|
1485 | //
|
---|
1486 | // There is also a check that the Pedestal is an integer, otherwise it
|
---|
1487 | // becames complex to get a reasonable rms for events without electronic noise.
|
---|
1488 | //
|
---|
1489 | // Revision 1.25 2003/10/26 19:45:38 blanch
|
---|
1490 | // The write_all_data input card command has been removed.
|
---|
1491 | //
|
---|
1492 | // Revision 1.24 2003/10/17 19:40:24 blanch
|
---|
1493 | // The gain ratio between the high and low FADC gain is controlled from the
|
---|
1494 | // input card.
|
---|
1495 | //
|
---|
1496 | // Revision 1.23 2003/09/23 17:38:48 blanch
|
---|
1497 | // ana_pixels command has been removed.
|
---|
1498 | //
|
---|
1499 | // Revision 1.22 2003/09/23 16:52:07 blanch
|
---|
1500 | // We do not read ct_file anymore.
|
---|
1501 | //
|
---|
1502 | // Revision 1.21 2003/09/15 10:17:09 blanch
|
---|
1503 | // Some modifications in the input card has been done for the multitelescope
|
---|
1504 | // configuration.
|
---|
1505 | //
|
---|
1506 | // Revision 1.20 2003/07/17 18:04:53 blanch
|
---|
1507 | // Some new parameters to be read have been introduced
|
---|
1508 | //
|
---|
1509 | // - FADC pedestals
|
---|
1510 | // - Response outer FADC
|
---|
1511 | // - Qe file
|
---|
1512 | //
|
---|
1513 | // The obsolete ones have been removed.
|
---|
1514 | //
|
---|
1515 | // Revision 1.19 2003/02/12 13:47:32 blanch
|
---|
1516 | // *** empty log message ***
|
---|
1517 | //
|
---|
1518 | // Revision 1.18 2003/01/14 13:37:47 blanch
|
---|
1519 | // Option to set a dc value to rise the discriminator threshold has been added.
|
---|
1520 | //
|
---|
1521 | // Revision 1.17 2002/07/16 16:20:41 blanch
|
---|
1522 | // Modifications done for the camera.cxx version, where a first implementation
|
---|
1523 | // of the Star Field Rotation has been introduced.
|
---|
1524 | //
|
---|
1525 | // Revision 1.16 2002/03/15 15:17:18 blanch
|
---|
1526 | // Several modification needed to simulate the actual trigger zone.
|
---|
1527 | //
|
---|
1528 | // Revision 1.15 2002/03/04 17:15:51 blanch
|
---|
1529 | // An item, which allows to switch off the storage of the RawEvt, has been
|
---|
1530 | // introduced. It is called nowrite_RawEvt. To avoid confusion the item
|
---|
1531 | // write_all_images has been moved to write_all_events.
|
---|
1532 | //
|
---|
1533 | // Revision 1.14 2002/02/28 15:07:23 blanch
|
---|
1534 | // Small changes have been done to introduce thes step variable for the
|
---|
1535 | // discriminator threshold in the trigger loop mode.
|
---|
1536 | //
|
---|
1537 | // Revision 1.13 2002/01/18 17:43:08 blanch
|
---|
1538 | // Three new commands have been added: fadc_noise, trig_noise and
|
---|
1539 | // elec_noise_off.
|
---|
1540 | // A small bug in the SIGNATURE check has been solved.
|
---|
1541 | //
|
---|
1542 | // Revision 1.12 2001/11/13 17:05:14 blanch
|
---|
1543 | // New input items int the input card parameter list have been included to fill
|
---|
1544 | // the MMcRunHeader.
|
---|
1545 | // There has been also some change to remove warnings in the compilation.
|
---|
1546 | //
|
---|
1547 | // Revision 1.11 2001/07/25 11:38:00 magicsol
|
---|
1548 | // Minnor changes
|
---|
1549 | //
|
---|
1550 | // Revision 1.10 2001/07/19 09:28:30 blanch
|
---|
1551 | // A new command, which allows to set individual trigger threshod for each pixel,
|
---|
1552 | // has been added.
|
---|
1553 | //
|
---|
1554 | // Revision 1.9 2001/03/05 10:43:18 blanch
|
---|
1555 | // New input commands have been added:
|
---|
1556 | //
|
---|
1557 | // - write_McFadc: to write the FADC simulation information.
|
---|
1558 | // - fadc_prop: gives the shape of the single phe response of the FADC
|
---|
1559 | //
|
---|
1560 | // And new value has been added in the mean_NSB command that tells how many phes
|
---|
1561 | // have to come from the shower to do the NSB simulation in that shower (it speeds
|
---|
1562 | // up the simulation).
|
---|
1563 | //
|
---|
1564 | // Revision 1.8 2001/02/23 10:55:43 magicsol
|
---|
1565 | // An input commmand that talls the path for the NSB database has been added.
|
---|
1566 | //
|
---|
1567 | // Revision 1.7 2001/01/15 12:37:48 magicsol
|
---|
1568 | // It has been introduced the option to read from the input card the overlaping
|
---|
1569 | // time.
|
---|
1570 | //
|
---|
1571 | // Revision 1.6 2000/09/21 11:47:33 harald
|
---|
1572 | // Oscar found some smaller errors in the calculation of the pixel shape and
|
---|
1573 | // corrected it.
|
---|
1574 | //
|
---|
1575 | // Revision 1.5 2000/07/04 14:13:02 MagicSol
|
---|
1576 | // It reads from the general input card the parameters for the
|
---|
1577 | // trigger analysi.
|
---|
1578 | //
|
---|
1579 | // Revision 1.4 2000/05/11 14:22:33 blanch
|
---|
1580 | // New input card option has been introduced:
|
---|
1581 | // trigger_loop lt ut lm um lg ug
|
---|
1582 | // It forces the camera program to study several condition trigger implementations. Integers after key word fix limits of loop over thershold, multiplicity and topology.
|
---|
1583 | //
|
---|
1584 | // Revision 1.3 2000/03/24 18:14:05 blanch
|
---|
1585 | // Parameters that tell as if we are going to see the diskriminator and/or FADC signal have been included.
|
---|
1586 | //
|
---|
1587 | // Revision 1.2 2000/02/18 17:45:43 petry
|
---|
1588 | // This version belongs to camera.cxx 1.5.
|
---|
1589 | // It has been put in the repository in order to be
|
---|
1590 | // able to share the further development with others.
|
---|
1591 | //
|
---|
1592 | // If you need something working, wait or take an earlier one.
|
---|
1593 | // See file README
|
---|
1594 | //
|
---|
1595 | // Revision 1.1.1.1 1999/11/05 11:59:34 harald
|
---|
1596 | // This the starting point for CVS controlled further developments of the
|
---|
1597 | // camera program. The program was originally written by Jose Carlos.
|
---|
1598 | // But here you can find a "rootified" version to the program. This means
|
---|
1599 | // that there is no hbook stuff in it now. Also the output of the
|
---|
1600 | // program changed to the MagicRawDataFormat.
|
---|
1601 | //
|
---|
1602 | // The "rootification" was done by Dirk Petry and Harald Kornmayer.
|
---|
1603 | //
|
---|
1604 | // In the following you can see the README file of that version:
|
---|
1605 | //
|
---|
1606 | // ==================================================
|
---|
1607 | //
|
---|
1608 | // Fri Oct 22 1999 D.P.
|
---|
1609 | //
|
---|
1610 | // The MAGIC Monte Carlo System
|
---|
1611 | //
|
---|
1612 | // Camera Simulation Programme
|
---|
1613 | // ---------------------------
|
---|
1614 | //
|
---|
1615 | // 1) Description
|
---|
1616 | //
|
---|
1617 | // This version is the result of the fusion of H.K.'s
|
---|
1618 | // root_camera which is described below (section 2)
|
---|
1619 | // and another version by D.P. which had a few additional
|
---|
1620 | // useful features.
|
---|
1621 | //
|
---|
1622 | // The version compiles under Linux with ROOT 2.22 installed
|
---|
1623 | // (variable ROOTSYS has to be set).
|
---|
1624 | //
|
---|
1625 | // Compile as before simply using "make" in the root_camera
|
---|
1626 | // directory.
|
---|
1627 | //
|
---|
1628 | // All features of H.K.'s root_camera were retained.
|
---|
1629 | //
|
---|
1630 | // Additional features of this version are:
|
---|
1631 | //
|
---|
1632 | // a) HBOOK is no longer used and all references are removed.
|
---|
1633 | //
|
---|
1634 | // b) Instead of HBOOK, the user is given now the possibility of
|
---|
1635 | // having Diagnostic data in ROOT format as a complement
|
---|
1636 | // to the ROOT Raw data.
|
---|
1637 | //
|
---|
1638 | // This data is written to the file which is determined by
|
---|
1639 | // the new input parameter "diag_file" in the camera parameter
|
---|
1640 | // file.
|
---|
1641 | //
|
---|
1642 | // All source code file belonging to this part have filenames
|
---|
1643 | // starting with "MDiag".
|
---|
1644 | //
|
---|
1645 | // The user can read the output file using the following commands
|
---|
1646 | // in an interactive ROOT session:
|
---|
1647 | //
|
---|
1648 | // root [0] .L MDiag.so
|
---|
1649 | // root [1] new TFile("diag.root");
|
---|
1650 | // root [2] new TTreeViewer("T");
|
---|
1651 | //
|
---|
1652 | // This brings up a viewer from which all variables of the
|
---|
1653 | // TTree can be accessed and histogrammed. This example
|
---|
1654 | // assumes that you have named the file "diag.root", that
|
---|
1655 | // you are using ROOT version 2.22 or later and that you have
|
---|
1656 | // the shared object library "MDiag.so" which is produced
|
---|
1657 | // by the Makefile along with the executable "camera".
|
---|
1658 | //
|
---|
1659 | // ! The contents of the so-called diag file is not yet fixed.
|
---|
1660 | // ! At the moment it is what J.C.G. used to put into the HBOOK
|
---|
1661 | // ! ntuple. In future versions the moments calculation can be
|
---|
1662 | // ! removed and the parameter list be modified correspondingly.
|
---|
1663 | //
|
---|
1664 | // c) Now concatenated reflector files can be read. This is useful
|
---|
1665 | // if you have run the reflector with different parameters but
|
---|
1666 | // you want to continue the analysis with all reflector data
|
---|
1667 | // going into ONE ROOT outputfile.
|
---|
1668 | //
|
---|
1669 | // The previous camera version contained a bug which made reading
|
---|
1670 | // of two or more concatenated reflector files impossible.
|
---|
1671 | //
|
---|
1672 | // d) The reflector output format was changed. It is now version
|
---|
1673 | // 0.4 .
|
---|
1674 | // The change solely consists in a shortening of the flag
|
---|
1675 | // definition in the file
|
---|
1676 | //
|
---|
1677 | // include-MC/MCCphoton.hxx
|
---|
1678 | //
|
---|
1679 | // ! IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily
|
---|
1680 | // ! do so by recompiling camera with the previous version of
|
---|
1681 | // ! include-MC/MCCphoton.hxx.
|
---|
1682 | //
|
---|
1683 | // The change was necessary for saving space and better
|
---|
1684 | // debugging. From now on, this format can be frozen.
|
---|
1685 | //
|
---|
1686 | // ! For producing reflector output in the new format, you
|
---|
1687 | // ! of course have to recompile your reflector with the
|
---|
1688 | // ! new include-MC/MCCphoton.hxx .
|
---|
1689 | //
|
---|
1690 | // e) A first version of the pixelization with the larger
|
---|
1691 | // outer pixels is implemented. THIS IS NOT YET FULLY
|
---|
1692 | // TESTED, but first rough tests show that it works
|
---|
1693 | // at least to a good approximation.
|
---|
1694 | //
|
---|
1695 | // The present version implements the camera outline
|
---|
1696 | // with 18 "gap-pixels" and 595 pixels in total as
|
---|
1697 | // shown in
|
---|
1698 | //
|
---|
1699 | // http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps
|
---|
1700 | //
|
---|
1701 | // This change involved
|
---|
1702 | //
|
---|
1703 | // (i) The file pixels.dat is no longer needed. Instead
|
---|
1704 | // the coordinates are generated by the program itself
|
---|
1705 | // (takes maybe 1 second). In the file
|
---|
1706 | //
|
---|
1707 | // pixel-coords.txt
|
---|
1708 | //
|
---|
1709 | // in the same directory as this README, you find a list
|
---|
1710 | // of the coordinates generated by this new routine. It
|
---|
1711 | // has the format
|
---|
1712 | //
|
---|
1713 | // number i j x y size-factor
|
---|
1714 | //
|
---|
1715 | // where i and j are J.C.G.'s so called biaxis hexagonal
|
---|
1716 | // coordinates (for internal use) and x and y are the
|
---|
1717 | // coordinates of the pixel centers in the standard camera
|
---|
1718 | // coordinate system in units of centimeters. The value
|
---|
1719 | // of "size-factor" determines the linear size of the pixel
|
---|
1720 | // relative to the central pixels.
|
---|
1721 | //
|
---|
1722 | // (ii) The magic.def file has two additional parameters
|
---|
1723 | // which give the number of central pixels and the
|
---|
1724 | // number of gap pixels
|
---|
1725 | //
|
---|
1726 | // (iii) In camera.h and camera.cxx several changes were
|
---|
1727 | // necessary, among them the introduction of several
|
---|
1728 | // new functions
|
---|
1729 | //
|
---|
1730 | // The newly suggested outline with asymmetric Winston cones
|
---|
1731 | // will be implemented in a later version.
|
---|
1732 | //
|
---|
1733 | // f) phe files can no longer be read since this contradicts
|
---|
1734 | // our philosophy that the analysis should be done with other
|
---|
1735 | // programs like e.g. EVITA and not with "camera" itself.
|
---|
1736 | // This possibility was removed.
|
---|
1737 | //
|
---|
1738 | // g) ROOT is no longer invoked with an interactive interface.
|
---|
1739 | // In this way, camera can better be run as a batch program and
|
---|
1740 | // it uses less memory.
|
---|
1741 | //
|
---|
1742 | // h) small changes concerning the variable "t_chan" were necessary in
|
---|
1743 | // order to avoid segmentation faults: The variable is used as an
|
---|
1744 | // index and it went sometimes outside the limits when camera
|
---|
1745 | // was reading proton data. This is because the reflector files
|
---|
1746 | // don't contain the photons in a chronological order and also
|
---|
1747 | // the timespread can be considerably longer that the foreseen
|
---|
1748 | // digitisation timespan. Please see the source code of camera.cxx
|
---|
1749 | // round about line 1090.
|
---|
1750 | //
|
---|
1751 | // j) several unused variables were removed, a few warning messages
|
---|
1752 | // occur when you compile camera.cxx but these can be ignored at
|
---|
1753 | // the moment.
|
---|
1754 | //
|
---|
1755 | // In general the program is of course not finished. It still needs
|
---|
1756 | // debugging, proper trigger simulation, simulation of the asymmetric
|
---|
1757 | // version of the outer pixels, proper NSB simulation, adaption of
|
---|
1758 | // the diag "ntuple" contents to our need and others small improvements.
|
---|
1759 | //
|
---|
1760 | // In the directory rfl-files there is now a file in reflector format 0.4
|
---|
1761 | // containing a single event produced by the starfiled adder. It has
|
---|
1762 | // a duration of 30 ns and represents the region around the Crab Nebula.
|
---|
1763 | // Using the enclosed input parameter file, camera should process this
|
---|
1764 | // file without problems.
|
---|
1765 | //
|
---|
1766 | // 2) The README for the previous version of root_camera
|
---|
1767 | //
|
---|
1768 | // README for a preliminary version of the
|
---|
1769 | // root_camera program.
|
---|
1770 | //
|
---|
1771 | // root_camera is based on the program "camera"of Jose Carlos
|
---|
1772 | // Gonzalez. It was changed in the way that only the pixelisation
|
---|
1773 | // and the distibution of the phe to the FADCs works in a
|
---|
1774 | // first version.
|
---|
1775 | //
|
---|
1776 | // Using the #undef command most possibilities of the orignal
|
---|
1777 | // program are switched of.
|
---|
1778 | //
|
---|
1779 | // The new parts are signed by
|
---|
1780 | //
|
---|
1781 | // - ROOT or __ROOT__
|
---|
1782 | // nearly all important codelines for ROOT output are enclosed
|
---|
1783 | // in structures like
|
---|
1784 | // #ifdef __ROOT__
|
---|
1785 | //
|
---|
1786 | // code
|
---|
1787 | //
|
---|
1788 | // #endif __ROOT__
|
---|
1789 | //
|
---|
1790 | // In same case the new lines are signed by a comment with the word
|
---|
1791 | // ROOT in it.
|
---|
1792 | //
|
---|
1793 | // For timing of the pulse some variable names are changed.
|
---|
1794 | // (t0, t1, t --> t_ini, t_fin, t_1st, t_chan,...)
|
---|
1795 | // Look also for this changes.
|
---|
1796 | //
|
---|
1797 | // For the new root-file is also a change in readparm-files
|
---|
1798 | //
|
---|
1799 | //
|
---|
1800 | // - __DETAIL_TRIGGER__
|
---|
1801 | //
|
---|
1802 | // This is for the implementation of the current work on trigger
|
---|
1803 | // studies. Because the class MTrigger is not well documented it
|
---|
1804 | // isn´t a part of this tar file. Only a dummy File exists.
|
---|
1805 | //
|
---|
1806 | //
|
---|
1807 | //
|
---|
1808 | // With all files in the archive, the root_camera program should run.
|
---|
1809 | //
|
---|
1810 | // A reflector file is in the directory rfl-files
|
---|
1811 | //
|
---|
1812 | // ==================================================
|
---|
1813 | //
|
---|
1814 | // From now on, use CVS for development!!!!
|
---|
1815 | //
|
---|
1816 | //
|
---|
1817 | //
|
---|
1818 | // Revision 1.2 1999/10/22 15:01:28 petry
|
---|
1819 | // version sent to H.K. and N.M. on Fri Oct 22 1999
|
---|
1820 | //
|
---|
1821 | // Revision 1.1.1.1 1999/10/21 16:35:11 petry
|
---|
1822 | // first synthesised version
|
---|
1823 | //
|
---|
1824 | // Revision 1.6 1999/03/15 14:59:08 gonzalez
|
---|
1825 | // camera-1_1
|
---|
1826 | //
|
---|
1827 | // Revision 1.5 1999/03/02 09:56:12 gonzalez
|
---|
1828 | // *** empty log message ***
|
---|
1829 | //
|
---|
1830 | // Revision 1.4 1999/01/14 17:32:41 gonzalez
|
---|
1831 | // Added to camera the STDIN input option (data_from_input)
|
---|
1832 | //
|
---|
1833 | //!@}
|
---|
1834 |
|
---|
1835 | //=EOF
|
---|