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.36 $
|
---|
22 | //= $Author: moralejo $
|
---|
23 | //= $Date: 2005-02-10 19:28:10 $
|
---|
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_Event_Headers = 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_event_headers: //@< to write ALL the event headers
|
---|
427 |
|
---|
428 | // change boolean value
|
---|
429 | Write_All_Event_Headers = 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_event_headers
|
---|
1095 | //
|
---|
1096 | // @desc write all event headers to output, even those without
|
---|
1097 | // trigger
|
---|
1098 | //
|
---|
1099 | // @return TRUE: we'll write everything; FALSE: we won't
|
---|
1100 | //
|
---|
1101 | // @date Wed Nov 25 13:21:00 MET 1998
|
---|
1102 | //------------------------------------------------------------
|
---|
1103 | // @function
|
---|
1104 |
|
---|
1105 | //!@{
|
---|
1106 | int
|
---|
1107 | get_write_all_event_headers(void)
|
---|
1108 | {
|
---|
1109 | return ( Write_All_Event_Headers );
|
---|
1110 | }
|
---|
1111 | //!@}
|
---|
1112 |
|
---|
1113 | //!-----------------------------------------------------------
|
---|
1114 | // @name write_McEvt
|
---|
1115 | //
|
---|
1116 | // @desc write the McEvt class for each event to the .root file
|
---|
1117 | //
|
---|
1118 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1119 | //
|
---|
1120 | //------------------------------------------------------------
|
---|
1121 | // @function
|
---|
1122 |
|
---|
1123 | //!@{
|
---|
1124 | int
|
---|
1125 | get_write_McEvt(void)
|
---|
1126 | {
|
---|
1127 | return ( Write_McEvt );
|
---|
1128 | }
|
---|
1129 | //!@}
|
---|
1130 |
|
---|
1131 | //!-----------------------------------------------------------
|
---|
1132 | // @name write_McTrig
|
---|
1133 | //
|
---|
1134 | // @desc write the McTrig class for each event to the .root file
|
---|
1135 | //
|
---|
1136 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1137 | //
|
---|
1138 | //------------------------------------------------------------
|
---|
1139 | // @function
|
---|
1140 |
|
---|
1141 | //!@{
|
---|
1142 | int
|
---|
1143 | get_write_McTrig(void)
|
---|
1144 | {
|
---|
1145 | return ( Write_McTrig );
|
---|
1146 | }
|
---|
1147 | //!@}
|
---|
1148 |
|
---|
1149 | //!-----------------------------------------------------------
|
---|
1150 | // @name write_McFadc
|
---|
1151 | //
|
---|
1152 | // @desc write the McFadc class for each event to the .root file
|
---|
1153 | //
|
---|
1154 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1155 | //
|
---|
1156 | //------------------------------------------------------------
|
---|
1157 | // @function
|
---|
1158 |
|
---|
1159 | //!@{
|
---|
1160 | int
|
---|
1161 | get_write_McFadc(void)
|
---|
1162 | {
|
---|
1163 | return ( Write_McFadc );
|
---|
1164 | }
|
---|
1165 | //!@}
|
---|
1166 |
|
---|
1167 | //!-----------------------------------------------------------
|
---|
1168 | // @name write_RawEvt
|
---|
1169 | //
|
---|
1170 | // @desc write the RawEvt class for each event to the .root file
|
---|
1171 | //
|
---|
1172 | // @return TRUE: we'll write it; FALSE: we won't
|
---|
1173 | //
|
---|
1174 | //------------------------------------------------------------
|
---|
1175 | // @function
|
---|
1176 |
|
---|
1177 | //!@{
|
---|
1178 | int
|
---|
1179 | get_write_RawEvt(void)
|
---|
1180 | {
|
---|
1181 | return ( Write_RawEvt );
|
---|
1182 | }
|
---|
1183 | //!@}
|
---|
1184 |
|
---|
1185 | //!-----------------------------------------------------------
|
---|
1186 | // @name get_select_energy
|
---|
1187 | //
|
---|
1188 | // @desc return energy range allowed for showers from .phe file
|
---|
1189 | //
|
---|
1190 | // @var *le Lower limit in the allowed energy range
|
---|
1191 | // @var *ue Lower limit in the allowed energy range
|
---|
1192 | // @return TRUE: we make selection on the energy; FALSE: we don't
|
---|
1193 | //
|
---|
1194 | // @date Wed Nov 25 13:21:00 MET 1998
|
---|
1195 | //------------------------------------------------------------
|
---|
1196 | // @function
|
---|
1197 |
|
---|
1198 | //!@{
|
---|
1199 | int
|
---|
1200 | get_select_energy(float *le, float *ue)
|
---|
1201 | {
|
---|
1202 | *le = Select_Energy_le;
|
---|
1203 | *ue = Select_Energy_ue;
|
---|
1204 | return ( Select_Energy );
|
---|
1205 | }
|
---|
1206 | //!@}
|
---|
1207 |
|
---|
1208 | //!-----------------------------------------------------------
|
---|
1209 | // @name FADC_Scan
|
---|
1210 | //
|
---|
1211 | // @desc show the FADC signal for each event in the screen
|
---|
1212 | //
|
---|
1213 | // @return TRUE: we'll show it; FALSE: we won't
|
---|
1214 | //
|
---|
1215 | //------------------------------------------------------------
|
---|
1216 | // @function
|
---|
1217 |
|
---|
1218 | //!@{
|
---|
1219 | int
|
---|
1220 | get_FADC_Scan(void)
|
---|
1221 | {
|
---|
1222 | return ( FADC_Scan );
|
---|
1223 | }
|
---|
1224 | //!@}
|
---|
1225 |
|
---|
1226 | //!-----------------------------------------------------------
|
---|
1227 | // @name Trigger_Scan
|
---|
1228 | //
|
---|
1229 | // @desc show the Trigger signal for each event in the screen
|
---|
1230 | //
|
---|
1231 | // @return TRUE: we'll show it; FALSE: we won't
|
---|
1232 | //
|
---|
1233 | //------------------------------------------------------------
|
---|
1234 | // @function
|
---|
1235 |
|
---|
1236 | //!@{
|
---|
1237 | int
|
---|
1238 | get_Trigger_Scan(void)
|
---|
1239 | {
|
---|
1240 | return ( Trigger_Scan );
|
---|
1241 | }
|
---|
1242 | //!@}
|
---|
1243 |
|
---|
1244 | //!-----------------------------------------------------------
|
---|
1245 | // @name Fadc_Propeties
|
---|
1246 | //
|
---|
1247 | // @desc fix properties of the FADC response
|
---|
1248 | //
|
---|
1249 | //------------------------------------------------------------
|
---|
1250 | // @function
|
---|
1251 |
|
---|
1252 | //!@{
|
---|
1253 | void
|
---|
1254 | get_FADC_properties(int *shape,float *ra, float *rf,
|
---|
1255 | int *shapeo, float *rao, float *rfo,
|
---|
1256 | float *fadc_spns, int *fadc_slices)
|
---|
1257 | {
|
---|
1258 | *shape = FADC_shape;
|
---|
1259 | *ra = FADC_response_ampl;
|
---|
1260 | *rf = FADC_response_fwhm;
|
---|
1261 | *shapeo = FADC_shape_out;
|
---|
1262 | *rao = FADC_resp_ampl_out;
|
---|
1263 | *rfo = FADC_resp_fwhm_out;
|
---|
1264 | *fadc_spns = FADC_slices_per_ns;
|
---|
1265 | *fadc_slices = FADC_slices_written;
|
---|
1266 | }
|
---|
1267 | //!@}
|
---|
1268 |
|
---|
1269 | //!-----------------------------------------------------------
|
---|
1270 | // @name Trigger_Propeties
|
---|
1271 | //
|
---|
1272 | // @desc fix properties of the diskriminator and amplifier for Trigger
|
---|
1273 | //
|
---|
1274 | //------------------------------------------------------------
|
---|
1275 | // @function
|
---|
1276 |
|
---|
1277 | //!@{
|
---|
1278 | void
|
---|
1279 | get_Trigger_properties(float *gl, float *ot, float *ra, float *rf)
|
---|
1280 | {
|
---|
1281 | *gl=Trigger_gate_length;
|
---|
1282 | *ot=Trigger_over_time;
|
---|
1283 | *ra=Trigger_response_ampl;
|
---|
1284 | *rf=Trigger_response_fwhm;
|
---|
1285 |
|
---|
1286 | }
|
---|
1287 | //!@}
|
---|
1288 |
|
---|
1289 | //!-----------------------------------------------------------
|
---|
1290 | // @name Trigger_Loop
|
---|
1291 | //
|
---|
1292 | // @desc make a loop over Trigger conditions
|
---|
1293 | //
|
---|
1294 | // @return TRUE: we'll make it; FALSE: we won't
|
---|
1295 | //
|
---|
1296 | //------------------------------------------------------------
|
---|
1297 | // @function
|
---|
1298 |
|
---|
1299 | //!@{
|
---|
1300 | int
|
---|
1301 | get_Trigger_Loop(float *lt, float *ut, float *st, int *lm, int *um, int *lg, int *ug)
|
---|
1302 | {
|
---|
1303 | *lt=Trigger_loop_lthres;
|
---|
1304 | *ut=Trigger_loop_uthres;
|
---|
1305 | *st=Trigger_loop_sthres;
|
---|
1306 | *lm=Trigger_loop_lmult;
|
---|
1307 | *um=Trigger_loop_umult;
|
---|
1308 | *lg=Trigger_loop_ltop;
|
---|
1309 | *ug=Trigger_loop_utop;
|
---|
1310 | return ( Trigger_Loop );
|
---|
1311 | }
|
---|
1312 | //!@}
|
---|
1313 |
|
---|
1314 | //!-----------------------------------------------------------
|
---|
1315 | // @name Trigger_Single
|
---|
1316 | //
|
---|
1317 | // @desc fix Trigger conditions
|
---|
1318 | //
|
---|
1319 | //------------------------------------------------------------
|
---|
1320 | // @function
|
---|
1321 |
|
---|
1322 | //!@{
|
---|
1323 | void
|
---|
1324 | get_Trigger_Single(float **t, int *m, int *g)
|
---|
1325 | {
|
---|
1326 | for(int j=0;j<MAX_NUMBER_OF_CTS;j++){
|
---|
1327 | for(int i=0;i<CAMERA_PIXELS;i++)
|
---|
1328 | t[j][i]=qThreshold[j][i];
|
---|
1329 | m[j]=Trigger_multiplicity[j];
|
---|
1330 | g[j]=Trigger_topology[j];
|
---|
1331 | }
|
---|
1332 | }
|
---|
1333 | //!@}
|
---|
1334 |
|
---|
1335 | //!-----------------------------------------------------------
|
---|
1336 | // @name get_FADC_pedestal
|
---|
1337 | //
|
---|
1338 | // @desc get the value for the FADC pedestals
|
---|
1339 | //
|
---|
1340 | //------------------------------------------------------------
|
---|
1341 | // @function
|
---|
1342 |
|
---|
1343 | //!@{
|
---|
1344 |
|
---|
1345 |
|
---|
1346 | float get_FADC_pedestal(void){
|
---|
1347 |
|
---|
1348 | return FADC_pedestal;
|
---|
1349 |
|
---|
1350 | }
|
---|
1351 |
|
---|
1352 | //!@}
|
---|
1353 | //!-----------------------------------------------------------
|
---|
1354 | // @name get_High_to_Low
|
---|
1355 | //
|
---|
1356 | // @desc get the conversion factor between high and low gain
|
---|
1357 | //
|
---|
1358 | //------------------------------------------------------------
|
---|
1359 | // @function
|
---|
1360 |
|
---|
1361 | //!@{
|
---|
1362 |
|
---|
1363 |
|
---|
1364 | float get_High_to_Low(void){
|
---|
1365 |
|
---|
1366 | return High_to_Low;
|
---|
1367 |
|
---|
1368 | }
|
---|
1369 |
|
---|
1370 | int get_misspointing(float *x, float *y){
|
---|
1371 |
|
---|
1372 | *x=misp_x;
|
---|
1373 | *y=misp_y;
|
---|
1374 |
|
---|
1375 | if (misp_x == 0.0 && misp_y==0.0)
|
---|
1376 | return 0;
|
---|
1377 | else
|
---|
1378 | return 1;
|
---|
1379 |
|
---|
1380 | }
|
---|
1381 |
|
---|
1382 | float get_sigma_xy_cm_spot(float *x, float *y){
|
---|
1383 |
|
---|
1384 | *x=sigma_x_spot;
|
---|
1385 | *y=sigma_y_spot;
|
---|
1386 |
|
---|
1387 | if (sigma_x_spot > 0.0 || sigma_y_spot >0.0)
|
---|
1388 | return 1.0;
|
---|
1389 | else
|
---|
1390 | return -1.0;
|
---|
1391 |
|
---|
1392 | }
|
---|
1393 |
|
---|
1394 | float get_trig_delay(void){
|
---|
1395 |
|
---|
1396 | return trig_delay;
|
---|
1397 |
|
---|
1398 | }
|
---|
1399 |
|
---|
1400 | float get_pmt_jitter_ns(){
|
---|
1401 |
|
---|
1402 | return pmt_jitter;
|
---|
1403 |
|
---|
1404 | }
|
---|
1405 |
|
---|
1406 | float get_telescope_location_cm(int j, int icoor){
|
---|
1407 |
|
---|
1408 | return CTcoor[j][icoor];
|
---|
1409 |
|
---|
1410 | }
|
---|
1411 |
|
---|
1412 | float get_mirror_fraction(int j){
|
---|
1413 | return m_fraction[j];
|
---|
1414 | }
|
---|
1415 |
|
---|
1416 | int is_calibration_run(){
|
---|
1417 | return CalibrationRun;
|
---|
1418 | }
|
---|
1419 |
|
---|
1420 | void get_calibration_properties(float *a, float *b, float *c, float *d, int *e, int *f)
|
---|
1421 | {
|
---|
1422 | *a = lambda;
|
---|
1423 | *b = sigma_lambda;
|
---|
1424 | *c = phot_per_pix;
|
---|
1425 | *d = fwhm_time / 2.35; // Convert from FWHM to sigma of gaussian
|
---|
1426 | *e = nevents;
|
---|
1427 | *f = selected_pixel;
|
---|
1428 | }
|
---|
1429 |
|
---|
1430 | int apply_gain_fluctuations()
|
---|
1431 | {
|
---|
1432 | return gain_fluctuations;
|
---|
1433 | }
|
---|
1434 |
|
---|
1435 | int apply_noise_gain_fluctuations()
|
---|
1436 | {
|
---|
1437 | return noise_gain_fluctuations;
|
---|
1438 | }
|
---|
1439 |
|
---|
1440 |
|
---|
1441 | //=------------------------------------------------------------
|
---|
1442 | //!@subsection Log of this file.
|
---|
1443 |
|
---|
1444 | //!@{
|
---|
1445 | //
|
---|
1446 | // $Log: not supported by cvs2svn $
|
---|
1447 | // Revision 1.35 2004/12/15 01:56:39 MAGIC
|
---|
1448 | //
|
---|
1449 | // Added input card option pmt_jitter_ns to simulate the time jitter of
|
---|
1450 | // PMTs. The input parameter is the sigma of a gaussian, which by
|
---|
1451 | // default is sigma=0.25 ns. This jitter is applied to each phe-
|
---|
1452 | // independently. We have not applied this to the NSB noise, since the
|
---|
1453 | // arrival time of NSB photons is random and nothing would change.
|
---|
1454 | //
|
---|
1455 | // Revision 1.34 2004/11/17 11:36:07 moralejo
|
---|
1456 | // *** empty log message ***
|
---|
1457 | //
|
---|
1458 | // Revision 1.33 2004/10/26 13:58:59 moralejo
|
---|
1459 | //
|
---|
1460 | // Added option gain_fluctuations_off
|
---|
1461 | //
|
---|
1462 | // Revision 1.32 2004/10/14 16:53:49 moralejo
|
---|
1463 | //
|
---|
1464 | // Added option calibration_run
|
---|
1465 | //
|
---|
1466 | // Revision 1.31 2004/10/13 17:05:05 moralejo
|
---|
1467 | // *** empty log message ***
|
---|
1468 | //
|
---|
1469 | // Revision 1.30 2004/10/12 13:32:02 moralejo
|
---|
1470 | // *** empty log message ***
|
---|
1471 | //
|
---|
1472 | // Revision 1.29 2004/09/17 14:48:21 moralejo
|
---|
1473 | //
|
---|
1474 | // Changes to adapt headers to c++ style.
|
---|
1475 | //
|
---|
1476 | // Revision 1.28 2004/09/16 15:27:08 moralejo
|
---|
1477 | // Updated in CVS after some time (see changes below)
|
---|
1478 | //
|
---|
1479 | //
|
---|
1480 | // Revision 1.27 2004/05/12 A. Moralejo
|
---|
1481 | //
|
---|
1482 | // Changed fadc_noise command: now the two first numbers are respectively
|
---|
1483 | // the analogic electronic noise for inner (small) and outer (big) pixels
|
---|
1484 | // respectively. Last number is still the FADC digital noise which affects
|
---|
1485 | // equallly inner and outer pixels (as well as high and low gain).
|
---|
1486 | //
|
---|
1487 | // Revision 1.26 2004/01/30 09:58:39 blanch
|
---|
1488 | // [Changes done mainly by A. Moralejo]
|
---|
1489 | //
|
---|
1490 | // Two new commands of the input card have been added:
|
---|
1491 | //
|
---|
1492 | // sigma_xy_cm_spot: to enlarge the point spread function.
|
---|
1493 | // trigger_delay: to center the FADC signal
|
---|
1494 | //
|
---|
1495 | // There is also a check that the Pedestal is an integer, otherwise it
|
---|
1496 | // becames complex to get a reasonable rms for events without electronic noise.
|
---|
1497 | //
|
---|
1498 | // Revision 1.25 2003/10/26 19:45:38 blanch
|
---|
1499 | // The write_all_data input card command has been removed.
|
---|
1500 | //
|
---|
1501 | // Revision 1.24 2003/10/17 19:40:24 blanch
|
---|
1502 | // The gain ratio between the high and low FADC gain is controlled from the
|
---|
1503 | // input card.
|
---|
1504 | //
|
---|
1505 | // Revision 1.23 2003/09/23 17:38:48 blanch
|
---|
1506 | // ana_pixels command has been removed.
|
---|
1507 | //
|
---|
1508 | // Revision 1.22 2003/09/23 16:52:07 blanch
|
---|
1509 | // We do not read ct_file anymore.
|
---|
1510 | //
|
---|
1511 | // Revision 1.21 2003/09/15 10:17:09 blanch
|
---|
1512 | // Some modifications in the input card has been done for the multitelescope
|
---|
1513 | // configuration.
|
---|
1514 | //
|
---|
1515 | // Revision 1.20 2003/07/17 18:04:53 blanch
|
---|
1516 | // Some new parameters to be read have been introduced
|
---|
1517 | //
|
---|
1518 | // - FADC pedestals
|
---|
1519 | // - Response outer FADC
|
---|
1520 | // - Qe file
|
---|
1521 | //
|
---|
1522 | // The obsolete ones have been removed.
|
---|
1523 | //
|
---|
1524 | // Revision 1.19 2003/02/12 13:47:32 blanch
|
---|
1525 | // *** empty log message ***
|
---|
1526 | //
|
---|
1527 | // Revision 1.18 2003/01/14 13:37:47 blanch
|
---|
1528 | // Option to set a dc value to rise the discriminator threshold has been added.
|
---|
1529 | //
|
---|
1530 | // Revision 1.17 2002/07/16 16:20:41 blanch
|
---|
1531 | // Modifications done for the camera.cxx version, where a first implementation
|
---|
1532 | // of the Star Field Rotation has been introduced.
|
---|
1533 | //
|
---|
1534 | // Revision 1.16 2002/03/15 15:17:18 blanch
|
---|
1535 | // Several modification needed to simulate the actual trigger zone.
|
---|
1536 | //
|
---|
1537 | // Revision 1.15 2002/03/04 17:15:51 blanch
|
---|
1538 | // An item, which allows to switch off the storage of the RawEvt, has been
|
---|
1539 | // introduced. It is called nowrite_RawEvt. To avoid confusion the item
|
---|
1540 | // write_all_images has been moved to write_all_events.
|
---|
1541 | //
|
---|
1542 | // Revision 1.14 2002/02/28 15:07:23 blanch
|
---|
1543 | // Small changes have been done to introduce thes step variable for the
|
---|
1544 | // discriminator threshold in the trigger loop mode.
|
---|
1545 | //
|
---|
1546 | // Revision 1.13 2002/01/18 17:43:08 blanch
|
---|
1547 | // Three new commands have been added: fadc_noise, trig_noise and
|
---|
1548 | // elec_noise_off.
|
---|
1549 | // A small bug in the SIGNATURE check has been solved.
|
---|
1550 | //
|
---|
1551 | // Revision 1.12 2001/11/13 17:05:14 blanch
|
---|
1552 | // New input items int the input card parameter list have been included to fill
|
---|
1553 | // the MMcRunHeader.
|
---|
1554 | // There has been also some change to remove warnings in the compilation.
|
---|
1555 | //
|
---|
1556 | // Revision 1.11 2001/07/25 11:38:00 magicsol
|
---|
1557 | // Minnor changes
|
---|
1558 | //
|
---|
1559 | // Revision 1.10 2001/07/19 09:28:30 blanch
|
---|
1560 | // A new command, which allows to set individual trigger threshod for each pixel,
|
---|
1561 | // has been added.
|
---|
1562 | //
|
---|
1563 | // Revision 1.9 2001/03/05 10:43:18 blanch
|
---|
1564 | // New input commands have been added:
|
---|
1565 | //
|
---|
1566 | // - write_McFadc: to write the FADC simulation information.
|
---|
1567 | // - fadc_prop: gives the shape of the single phe response of the FADC
|
---|
1568 | //
|
---|
1569 | // And new value has been added in the mean_NSB command that tells how many phes
|
---|
1570 | // have to come from the shower to do the NSB simulation in that shower (it speeds
|
---|
1571 | // up the simulation).
|
---|
1572 | //
|
---|
1573 | // Revision 1.8 2001/02/23 10:55:43 magicsol
|
---|
1574 | // An input commmand that talls the path for the NSB database has been added.
|
---|
1575 | //
|
---|
1576 | // Revision 1.7 2001/01/15 12:37:48 magicsol
|
---|
1577 | // It has been introduced the option to read from the input card the overlaping
|
---|
1578 | // time.
|
---|
1579 | //
|
---|
1580 | // Revision 1.6 2000/09/21 11:47:33 harald
|
---|
1581 | // Oscar found some smaller errors in the calculation of the pixel shape and
|
---|
1582 | // corrected it.
|
---|
1583 | //
|
---|
1584 | // Revision 1.5 2000/07/04 14:13:02 MagicSol
|
---|
1585 | // It reads from the general input card the parameters for the
|
---|
1586 | // trigger analysi.
|
---|
1587 | //
|
---|
1588 | // Revision 1.4 2000/05/11 14:22:33 blanch
|
---|
1589 | // New input card option has been introduced:
|
---|
1590 | // trigger_loop lt ut lm um lg ug
|
---|
1591 | // It forces the camera program to study several condition trigger implementations. Integers after key word fix limits of loop over thershold, multiplicity and topology.
|
---|
1592 | //
|
---|
1593 | // Revision 1.3 2000/03/24 18:14:05 blanch
|
---|
1594 | // Parameters that tell as if we are going to see the diskriminator and/or FADC signal have been included.
|
---|
1595 | //
|
---|
1596 | // Revision 1.2 2000/02/18 17:45:43 petry
|
---|
1597 | // This version belongs to camera.cxx 1.5.
|
---|
1598 | // It has been put in the repository in order to be
|
---|
1599 | // able to share the further development with others.
|
---|
1600 | //
|
---|
1601 | // If you need something working, wait or take an earlier one.
|
---|
1602 | // See file README
|
---|
1603 | //
|
---|
1604 | // Revision 1.1.1.1 1999/11/05 11:59:34 harald
|
---|
1605 | // This the starting point for CVS controlled further developments of the
|
---|
1606 | // camera program. The program was originally written by Jose Carlos.
|
---|
1607 | // But here you can find a "rootified" version to the program. This means
|
---|
1608 | // that there is no hbook stuff in it now. Also the output of the
|
---|
1609 | // program changed to the MagicRawDataFormat.
|
---|
1610 | //
|
---|
1611 | // The "rootification" was done by Dirk Petry and Harald Kornmayer.
|
---|
1612 | //
|
---|
1613 | // In the following you can see the README file of that version:
|
---|
1614 | //
|
---|
1615 | // ==================================================
|
---|
1616 | //
|
---|
1617 | // Fri Oct 22 1999 D.P.
|
---|
1618 | //
|
---|
1619 | // The MAGIC Monte Carlo System
|
---|
1620 | //
|
---|
1621 | // Camera Simulation Programme
|
---|
1622 | // ---------------------------
|
---|
1623 | //
|
---|
1624 | // 1) Description
|
---|
1625 | //
|
---|
1626 | // This version is the result of the fusion of H.K.'s
|
---|
1627 | // root_camera which is described below (section 2)
|
---|
1628 | // and another version by D.P. which had a few additional
|
---|
1629 | // useful features.
|
---|
1630 | //
|
---|
1631 | // The version compiles under Linux with ROOT 2.22 installed
|
---|
1632 | // (variable ROOTSYS has to be set).
|
---|
1633 | //
|
---|
1634 | // Compile as before simply using "make" in the root_camera
|
---|
1635 | // directory.
|
---|
1636 | //
|
---|
1637 | // All features of H.K.'s root_camera were retained.
|
---|
1638 | //
|
---|
1639 | // Additional features of this version are:
|
---|
1640 | //
|
---|
1641 | // a) HBOOK is no longer used and all references are removed.
|
---|
1642 | //
|
---|
1643 | // b) Instead of HBOOK, the user is given now the possibility of
|
---|
1644 | // having Diagnostic data in ROOT format as a complement
|
---|
1645 | // to the ROOT Raw data.
|
---|
1646 | //
|
---|
1647 | // This data is written to the file which is determined by
|
---|
1648 | // the new input parameter "diag_file" in the camera parameter
|
---|
1649 | // file.
|
---|
1650 | //
|
---|
1651 | // All source code file belonging to this part have filenames
|
---|
1652 | // starting with "MDiag".
|
---|
1653 | //
|
---|
1654 | // The user can read the output file using the following commands
|
---|
1655 | // in an interactive ROOT session:
|
---|
1656 | //
|
---|
1657 | // root [0] .L MDiag.so
|
---|
1658 | // root [1] new TFile("diag.root");
|
---|
1659 | // root [2] new TTreeViewer("T");
|
---|
1660 | //
|
---|
1661 | // This brings up a viewer from which all variables of the
|
---|
1662 | // TTree can be accessed and histogrammed. This example
|
---|
1663 | // assumes that you have named the file "diag.root", that
|
---|
1664 | // you are using ROOT version 2.22 or later and that you have
|
---|
1665 | // the shared object library "MDiag.so" which is produced
|
---|
1666 | // by the Makefile along with the executable "camera".
|
---|
1667 | //
|
---|
1668 | // ! The contents of the so-called diag file is not yet fixed.
|
---|
1669 | // ! At the moment it is what J.C.G. used to put into the HBOOK
|
---|
1670 | // ! ntuple. In future versions the moments calculation can be
|
---|
1671 | // ! removed and the parameter list be modified correspondingly.
|
---|
1672 | //
|
---|
1673 | // c) Now concatenated reflector files can be read. This is useful
|
---|
1674 | // if you have run the reflector with different parameters but
|
---|
1675 | // you want to continue the analysis with all reflector data
|
---|
1676 | // going into ONE ROOT outputfile.
|
---|
1677 | //
|
---|
1678 | // The previous camera version contained a bug which made reading
|
---|
1679 | // of two or more concatenated reflector files impossible.
|
---|
1680 | //
|
---|
1681 | // d) The reflector output format was changed. It is now version
|
---|
1682 | // 0.4 .
|
---|
1683 | // The change solely consists in a shortening of the flag
|
---|
1684 | // definition in the file
|
---|
1685 | //
|
---|
1686 | // include-MC/MCCphoton.hxx
|
---|
1687 | //
|
---|
1688 | // ! IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily
|
---|
1689 | // ! do so by recompiling camera with the previous version of
|
---|
1690 | // ! include-MC/MCCphoton.hxx.
|
---|
1691 | //
|
---|
1692 | // The change was necessary for saving space and better
|
---|
1693 | // debugging. From now on, this format can be frozen.
|
---|
1694 | //
|
---|
1695 | // ! For producing reflector output in the new format, you
|
---|
1696 | // ! of course have to recompile your reflector with the
|
---|
1697 | // ! new include-MC/MCCphoton.hxx .
|
---|
1698 | //
|
---|
1699 | // e) A first version of the pixelization with the larger
|
---|
1700 | // outer pixels is implemented. THIS IS NOT YET FULLY
|
---|
1701 | // TESTED, but first rough tests show that it works
|
---|
1702 | // at least to a good approximation.
|
---|
1703 | //
|
---|
1704 | // The present version implements the camera outline
|
---|
1705 | // with 18 "gap-pixels" and 595 pixels in total as
|
---|
1706 | // shown in
|
---|
1707 | //
|
---|
1708 | // http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps
|
---|
1709 | //
|
---|
1710 | // This change involved
|
---|
1711 | //
|
---|
1712 | // (i) The file pixels.dat is no longer needed. Instead
|
---|
1713 | // the coordinates are generated by the program itself
|
---|
1714 | // (takes maybe 1 second). In the file
|
---|
1715 | //
|
---|
1716 | // pixel-coords.txt
|
---|
1717 | //
|
---|
1718 | // in the same directory as this README, you find a list
|
---|
1719 | // of the coordinates generated by this new routine. It
|
---|
1720 | // has the format
|
---|
1721 | //
|
---|
1722 | // number i j x y size-factor
|
---|
1723 | //
|
---|
1724 | // where i and j are J.C.G.'s so called biaxis hexagonal
|
---|
1725 | // coordinates (for internal use) and x and y are the
|
---|
1726 | // coordinates of the pixel centers in the standard camera
|
---|
1727 | // coordinate system in units of centimeters. The value
|
---|
1728 | // of "size-factor" determines the linear size of the pixel
|
---|
1729 | // relative to the central pixels.
|
---|
1730 | //
|
---|
1731 | // (ii) The magic.def file has two additional parameters
|
---|
1732 | // which give the number of central pixels and the
|
---|
1733 | // number of gap pixels
|
---|
1734 | //
|
---|
1735 | // (iii) In camera.h and camera.cxx several changes were
|
---|
1736 | // necessary, among them the introduction of several
|
---|
1737 | // new functions
|
---|
1738 | //
|
---|
1739 | // The newly suggested outline with asymmetric Winston cones
|
---|
1740 | // will be implemented in a later version.
|
---|
1741 | //
|
---|
1742 | // f) phe files can no longer be read since this contradicts
|
---|
1743 | // our philosophy that the analysis should be done with other
|
---|
1744 | // programs like e.g. EVITA and not with "camera" itself.
|
---|
1745 | // This possibility was removed.
|
---|
1746 | //
|
---|
1747 | // g) ROOT is no longer invoked with an interactive interface.
|
---|
1748 | // In this way, camera can better be run as a batch program and
|
---|
1749 | // it uses less memory.
|
---|
1750 | //
|
---|
1751 | // h) small changes concerning the variable "t_chan" were necessary in
|
---|
1752 | // order to avoid segmentation faults: The variable is used as an
|
---|
1753 | // index and it went sometimes outside the limits when camera
|
---|
1754 | // was reading proton data. This is because the reflector files
|
---|
1755 | // don't contain the photons in a chronological order and also
|
---|
1756 | // the timespread can be considerably longer that the foreseen
|
---|
1757 | // digitisation timespan. Please see the source code of camera.cxx
|
---|
1758 | // round about line 1090.
|
---|
1759 | //
|
---|
1760 | // j) several unused variables were removed, a few warning messages
|
---|
1761 | // occur when you compile camera.cxx but these can be ignored at
|
---|
1762 | // the moment.
|
---|
1763 | //
|
---|
1764 | // In general the program is of course not finished. It still needs
|
---|
1765 | // debugging, proper trigger simulation, simulation of the asymmetric
|
---|
1766 | // version of the outer pixels, proper NSB simulation, adaption of
|
---|
1767 | // the diag "ntuple" contents to our need and others small improvements.
|
---|
1768 | //
|
---|
1769 | // In the directory rfl-files there is now a file in reflector format 0.4
|
---|
1770 | // containing a single event produced by the starfiled adder. It has
|
---|
1771 | // a duration of 30 ns and represents the region around the Crab Nebula.
|
---|
1772 | // Using the enclosed input parameter file, camera should process this
|
---|
1773 | // file without problems.
|
---|
1774 | //
|
---|
1775 | // 2) The README for the previous version of root_camera
|
---|
1776 | //
|
---|
1777 | // README for a preliminary version of the
|
---|
1778 | // root_camera program.
|
---|
1779 | //
|
---|
1780 | // root_camera is based on the program "camera"of Jose Carlos
|
---|
1781 | // Gonzalez. It was changed in the way that only the pixelisation
|
---|
1782 | // and the distibution of the phe to the FADCs works in a
|
---|
1783 | // first version.
|
---|
1784 | //
|
---|
1785 | // Using the #undef command most possibilities of the orignal
|
---|
1786 | // program are switched of.
|
---|
1787 | //
|
---|
1788 | // The new parts are signed by
|
---|
1789 | //
|
---|
1790 | // - ROOT or __ROOT__
|
---|
1791 | // nearly all important codelines for ROOT output are enclosed
|
---|
1792 | // in structures like
|
---|
1793 | // #ifdef __ROOT__
|
---|
1794 | //
|
---|
1795 | // code
|
---|
1796 | //
|
---|
1797 | // #endif __ROOT__
|
---|
1798 | //
|
---|
1799 | // In same case the new lines are signed by a comment with the word
|
---|
1800 | // ROOT in it.
|
---|
1801 | //
|
---|
1802 | // For timing of the pulse some variable names are changed.
|
---|
1803 | // (t0, t1, t --> t_ini, t_fin, t_1st, t_chan,...)
|
---|
1804 | // Look also for this changes.
|
---|
1805 | //
|
---|
1806 | // For the new root-file is also a change in readparm-files
|
---|
1807 | //
|
---|
1808 | //
|
---|
1809 | // - __DETAIL_TRIGGER__
|
---|
1810 | //
|
---|
1811 | // This is for the implementation of the current work on trigger
|
---|
1812 | // studies. Because the class MTrigger is not well documented it
|
---|
1813 | // isn´t a part of this tar file. Only a dummy File exists.
|
---|
1814 | //
|
---|
1815 | //
|
---|
1816 | //
|
---|
1817 | // With all files in the archive, the root_camera program should run.
|
---|
1818 | //
|
---|
1819 | // A reflector file is in the directory rfl-files
|
---|
1820 | //
|
---|
1821 | // ==================================================
|
---|
1822 | //
|
---|
1823 | // From now on, use CVS for development!!!!
|
---|
1824 | //
|
---|
1825 | //
|
---|
1826 | //
|
---|
1827 | // Revision 1.2 1999/10/22 15:01:28 petry
|
---|
1828 | // version sent to H.K. and N.M. on Fri Oct 22 1999
|
---|
1829 | //
|
---|
1830 | // Revision 1.1.1.1 1999/10/21 16:35:11 petry
|
---|
1831 | // first synthesised version
|
---|
1832 | //
|
---|
1833 | // Revision 1.6 1999/03/15 14:59:08 gonzalez
|
---|
1834 | // camera-1_1
|
---|
1835 | //
|
---|
1836 | // Revision 1.5 1999/03/02 09:56:12 gonzalez
|
---|
1837 | // *** empty log message ***
|
---|
1838 | //
|
---|
1839 | // Revision 1.4 1999/01/14 17:32:41 gonzalez
|
---|
1840 | // Added to camera the STDIN input option (data_from_input)
|
---|
1841 | //
|
---|
1842 | //!@}
|
---|
1843 |
|
---|
1844 | //=EOF
|
---|