source: trunk/MagicSoft/Simulation/Detector/Camera/creadparam.cxx@ 5290

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