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

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