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

Last change on this file since 397 was 390, checked in by blanch, 25 years ago
New input card option has been introduced: trigger_loop lt ut lm um lg ug It forces the camera program to study several condition trigger implementations. Integers after key word fix limits of loop over thershold, multiplicity and topology.
File size: 32.7 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.4 $
22//= $Author: blanch $
23//= $Date: 2000-05-11 14:22:33 $
24//=
25//=//////////////////////////////////////////////////////////////////////
26
27// @T \newpage
28
29//!@section Source code of |creadparam.cxx|.
30
31/*!@"
32
33 This section describes briefly the source code for the file
34 |creadparam.cxx|. This file is very closely related to the file
35 |readparams.cxx| from the |reflector| program. Actually, this later
36 file was the ancestror of the file you are looking at.
37
38 All the defines it uses are located in the file |creadparam.h|. In
39 the first one we can see the definitions of the commands available
40 for the parameters file. We describe these commands in a later
41 section.
42
43 @"*/
44
45//!@subsection Includes and Global variables definition.
46
47/*!@"
48
49 All the defines are located in the file {\tt creadparam.h}.
50
51 @"*/
52
53//!@{
54
55#include "creadparam.h"
56
57//!@}
58
59//!@subsection Definition of global variables.
60
61/*!@"
62
63 Here we define the global variables where the values from the
64 parameters file are stored.
65
66 @"*/
67
68//!@{
69
70static char Input_filename[PATH_MAX_LENGTH]; //@< input filename
71static char Starfield_filename[PATH_MAX_LENGTH]; //@< starfield input filename
72static char Data_filename[PATH_MAX_LENGTH]; //@< data filename
73static char DIAG_filename[PATH_MAX_LENGTH]; //@< data filename
74static char ROOT_filename[PATH_MAX_LENGTH]; //@< data filename
75static char CT_filename[PATH_MAX_LENGTH]; //@< name of the CT def. file
76static int simulateNSB = TRUE; //@< Will we simulate NSB?
77static int anaPixels = -1; //@< number of pixels for the analysis
78static float meanNSB; //@< NSB mean value (per pixel)
79static float qThreshold; //@< Threshold value
80static float qTailCut; //@< Tail Cut value
81static int nIslandsCut; //@< Islands Cut value
82static int countIslands = TRUE; //@< Will we count the islands?
83static long int Seeds[2];
84static int *Skip;
85static int nSkip=0;
86static int Data_From_STDIN = FALSE;
87static int Read_Phe = FALSE;
88static int Read_Phe_All = FALSE;
89static int Write_All_Images = FALSE;
90static int Write_McEvt = TRUE;
91static int Write_McTrig = FALSE;
92static int Write_RawEvt = FALSE;
93static int Write_All_Data = FALSE;
94static int Select_Energy = TRUE;
95static float Select_Energy_le = 0.0; //@< GeV
96static float Select_Energy_ue = 100000.0; //@< GeV
97static float Trigger_Radius;
98static int Set_Trigger_Radius=FALSE;
99static float fCorrection;
100static int Apply_Correction=FALSE;
101static int Trigger_Scan = FALSE;
102static int FADC_Scan = FALSE;
103static int Trigger_Loop = FALSE;
104static int Trigger_loop_lthres = 0;
105static int Trigger_loop_uthres = 10;
106static int Trigger_loop_lmult = 2;
107static int Trigger_loop_umult = 10;
108static int Trigger_loop_ltop = 0;
109static int Trigger_loop_utop = 2;
110//!@}
111
112//!@subsection The function |readparam()|.
113
114//!-----------------------------------------------------------
115// @name creadparam
116//
117// @desc read parameters from the stdin / parameters file
118//
119// @var *filename Name of the parameters file (NULL->STDIN)
120//
121// @date Mon Sep 14 13:27:56 MET DST 1998
122//------------------------------------------------------------
123// @function
124
125//!@{
126void
127readparam(char * filename)
128{
129 char sign[] = GLUE_postp( PROGRAM, VERSION ); //@< initialize sign
130 char line[LINE_MAX_LENGTH]; //@< line to get from the stdin
131 char token[ITEM_MAX_LENGTH]; //@< a single token
132 int i, j; //@< dummy counters
133 ifstream ifile;
134
135 // use cin or ifile (reading from STDIN or from parameters file?
136 if ( filename != NULL )
137 ifile.open( filename );
138
139 // get signature
140 if ( filename != NULL )
141 ifile.getline(line, LINE_MAX_LENGTH);
142 else
143 cin.getline(line, LINE_MAX_LENGTH);
144 line[strlen(SIGNATURE)] = '\0';
145 strcpy(line, sign);
146 if (strcmp(sign, SIGNATURE) != 0) {
147 cerr << "ERROR: Signature of parameters file is not correct\n";
148 cerr << '"' << sign << '"' << '\n';
149 cerr << "should be: " << SIGNATURE << '\n';
150 exit(1);
151 }
152
153 // loop till the "end" directive is reached
154 int is_end = FALSE;
155 while (! is_end) {
156
157 // get line from file or stdin
158 if ( filename != NULL )
159 ifile.getline(line, LINE_MAX_LENGTH);
160 else
161 cin.getline(line, LINE_MAX_LENGTH);
162
163 // skip comments (start with '#')
164 if (line[0] == '#')
165 continue;
166
167 // show user comments (start with '>')
168 if (line[0] == '>') {
169 cout << line << endl << flush;
170 continue;
171 }
172
173 // look for each item at the beginning of the line
174 for (i=0; i<=end_file; i++)
175 if (strstr(line, ITEM_NAMES[i]) == line)
176 break;
177
178 // if it is not a valid line, just ignore it
179 if (i == end_file+1) {
180 cerr << "Skipping unknown token in [" << line << "]\n";
181 continue;
182 }
183
184 // case block for each directive
185 switch ( i ) {
186
187 case input_file: //@< name of the input file
188
189 // get the name of the input_file from the line
190 sscanf(line, "%s %s", token, Input_filename);
191
192 break;
193
194 case starfield_file: //@< name of the output file
195
196 // get the name of the output_file from the line
197 sscanf(line, "%s %s", token, Starfield_filename);
198
199 break;
200
201 case data_file: //@< name of the data file
202
203 // get the name of the data_file from the line
204 sscanf(line, "%s %s", token, Data_filename);
205
206 break;
207
208 case diag_file: //@< name of the DIAG file
209
210 // get the name of the data_file from the line
211 sscanf(line, "%s %s", token, DIAG_filename);
212 cout << '[' << DIAG_filename << ']' << endl << flush;
213
214 break;
215
216 case root_file: //@< name of the ROOT file
217
218 // get the name of the data_file from the line
219 sscanf(line, "%s %s", token, ROOT_filename);
220 cout << '[' << ROOT_filename << ']' << endl << flush;
221
222 break;
223
224 case ct_file: //@< name of the telescope file
225
226 // get the name of the ct_file from the line
227 sscanf(line, "%s %s", token, CT_filename);
228
229 break;
230
231 case nsb_on: //@< simulate NSB?
232
233 // we will simulate NSB
234 simulateNSB = TRUE;
235
236 break;
237
238 case nsb_off: //@< simulate NSB?
239
240 // we will NOT simulate NSB
241 simulateNSB = FALSE;
242
243 break;
244
245 case nsb_mean: //@< value of <NSB> per pixel
246
247 // get value of <NSB> (in photons)
248 sscanf(line, "%s %f", token, &meanNSB);
249 simulateNSB = TRUE;
250
251 break;
252
253 case ana_pixels: //@< number of pixels for analysis
254
255 // number of pixels for analysis
256 sscanf(line, "%s %d", token, &anaPixels);
257
258 break;
259
260 case threshold: //@< value of threshold for trigger (q0)
261
262 // get value of threshold (in ph.e.)
263 sscanf(line, "%s %f", token, &qThreshold);
264
265 break;
266
267 case tail_cut: //@< value of tail_cut (t0)
268
269 // get value of tail_cut (in ph.e.)
270 sscanf(line, "%s %f", token, &qTailCut);
271
272 break;
273
274 case islands_on: //@< DO count islands
275
276 // DO count islands
277 countIslands = TRUE;
278
279 break;
280
281 case islands_off: //@< do NOT count islands
282
283 // do NOT count islands
284 countIslands = FALSE;
285
286 break;
287
288 case islands_cut: //@< value of islands_cut (i0)
289
290 // get value of islands_cut (in ph.e.)
291 sscanf(line, "%s %d", token, &nIslandsCut);
292 countIslands = TRUE;
293
294 break;
295
296 case seeds: //@< values of seeds for random numbers
297
298 // get seeds
299 sscanf(line, "%s %ld %ld", token, &Seeds[0], &Seeds[1]);
300
301 break;
302
303 case skip: //@< skip pathological showers
304
305 // get showers to skip
306 cin >> nSkip;
307 Skip = new int[nSkip];
308 for (j=0; j<nSkip; ++j) {
309 cin >> Skip[j];
310 cout << Skip[j] << endl << flush;
311 }
312
313 break;
314
315 case data_from_stdin: //@< to read data from stdin
316
317 // change boolean value
318 Data_From_STDIN = TRUE;
319
320 break;
321
322 case read_phe: //@< to read PHE files
323
324 // change boolean value
325 Read_Phe = TRUE;
326
327 break;
328
329 case read_phe_all: //@< to read PHE files from write_all_images
330
331 // change boolean value
332 Read_Phe_All = TRUE;
333
334 break;
335
336 case write_all_images: //@< to write ALL the images
337
338 // change boolean value
339 Write_All_Images = TRUE;
340
341 break;
342
343 case nowrite_McEvt: //@< do not write the McEvt info
344
345 // change boolean value
346 Write_McEvt = FALSE;
347
348 break;
349
350 case write_McTrig: //@< to write the McTrig info
351
352 // change boolean value
353 Write_McTrig = TRUE;
354
355 break;
356
357 case write_RawEvt: //@< to write the RawEvt data
358
359 // change boolean value
360 Write_RawEvt = TRUE;
361
362 break;
363
364 case write_all_data: //@< to write single pixel data
365
366 // change boolean value
367 Write_All_Data = TRUE;
368
369 break;
370
371 case select_energy: //@< value of islands_cut (i0)
372
373 // get energy range
374 sscanf(line, "%s %f %f", token, &Select_Energy_le, &Select_Energy_ue);
375 Select_Energy = TRUE;
376
377 break;
378
379 case trigger_radius: //@< set radius of trigger area
380
381 // get trigger radius
382 sscanf(line, "%s %f", token, &Trigger_Radius);
383 Set_Trigger_Radius = TRUE;
384
385 break;
386
387 case correction: //@< apply a kind of correction to pixel values
388
389 // get trigger radius
390 sscanf(line, "%s %f", token, &fCorrection);
391 Apply_Correction = TRUE;
392
393 break;
394
395 case fadc_scan:
396
397 // change boolean value
398 FADC_Scan = TRUE;
399
400 break;
401
402 case trigger_scan:
403
404 // change boolean value
405 Trigger_Scan = TRUE;
406
407 break;
408
409 case trigger_loop:
410
411 // Get loop's limits
412 sscanf(line, "%s %d %d %d %d %d %d", token, &Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop );
413
414 // change boolean value
415 Trigger_Loop = TRUE;
416
417 break;
418
419 case end_file: //@< end of the parameters file
420
421 // show a short message
422 is_end = TRUE;
423
424 break;
425
426 } // switch ( i )
427
428 } // while (! is_end)
429
430 // after the loop is finished, return to the main function
431 return;
432}
433//!@}
434
435
436//!-----------------------------------------------------------
437// @name get_input_filename
438//
439// @desc get name of the input file
440//
441// @return Name of the Input file
442//
443// @date Mon Sep 14 13:27:56 MET DST 1998
444//------------------------------------------------------------
445// @function
446
447//!@{
448char *
449get_input_filename(void)
450{
451 return (Input_filename);
452}
453//!@}
454
455
456//!-----------------------------------------------------------
457// @name get_starfield_filename
458//
459// @desc get name of the starfield input file
460//
461// @return Name of the starfield file
462//
463// @date Tue Feb 15 16:02:18 CET 2000
464//------------------------------------------------------------
465// @function
466
467//!@{
468char *
469get_starfield_filename(void)
470{
471 return (Starfield_filename);
472}
473//!@}
474
475
476//!-----------------------------------------------------------
477// @name get_data_filename
478//
479// @desc get name of the data file
480//
481// @return Name of the Data file
482//
483// @date Mon Sep 14 13:27:56 MET DST 1998
484//------------------------------------------------------------
485// @function
486
487//!@{
488char *
489get_data_filename(void)
490{
491 return (Data_filename);
492}
493//!@}
494
495
496//!-----------------------------------------------------------
497// @name get_diag_filename
498//
499// @desc get name of the diagnostic output file
500//
501// @return Name of the DIAG file
502//
503// @date Mon Sep 14 13:27:56 MET DST 1998
504//------------------------------------------------------------
505// @function
506
507//!@{
508char *
509get_diag_filename(void)
510{
511 return (DIAG_filename);
512}
513//!@}
514
515
516//!-----------------------------------------------------------
517// @name get_root_filename
518//
519// @desc get name of the ROOT file
520//
521// @return Name of the ROOT file
522//
523// @date Mon Sep 14 13:27:56 MET DST 1998
524//------------------------------------------------------------
525// @function
526
527//!@{
528char *
529get_root_filename(void)
530{
531 return (ROOT_filename);
532}
533//!@}
534
535
536
537//!-----------------------------------------------------------
538// @name get_ct_filename
539//
540// @desc get name of CT definition file
541//
542// @return Name of the CT definition file
543//
544// @date Mon Sep 14 13:27:56 MET DST 1998
545//------------------------------------------------------------
546// @function
547
548//!@{
549char *
550get_ct_filename(void)
551{
552 return (CT_filename);
553}
554//!@}
555
556
557//!-----------------------------------------------------------
558// @name get_nsb
559//
560// @desc are we going to simulate NSB ?
561//
562// @var *n Mean value for the NSB (ph.e./pixel)
563// @return TRUE: we'll simulate NSB; FALSE: we won't
564//
565// @date Mon Sep 14 13:27:56 MET DST 1998
566//------------------------------------------------------------
567// @function
568
569//!@{
570int
571get_nsb(float *n)
572{
573 *n = meanNSB;
574 return ( simulateNSB );
575}
576//!@}
577
578
579//!-----------------------------------------------------------
580// @name get_threshold
581//
582// @desc get threshold value
583//
584// @return Value of the threshold q$_0$
585//
586// @date Mon Sep 14 13:27:56 MET DST 1998
587//------------------------------------------------------------
588// @function
589
590//!@{
591float
592get_threshold(void)
593{
594 return( qThreshold );
595}
596//!@}
597
598
599//!-----------------------------------------------------------
600// @name get_tail_cut
601//
602// @desc get tail cut value
603//
604// @return Value for the Tail-cut
605//
606// @date Mon Sep 14 13:27:56 MET DST 1998
607//------------------------------------------------------------
608// @function
609
610//!@{
611float
612get_tail_cut(void)
613{
614 return( qTailCut );
615}
616//!@}
617
618
619//!-----------------------------------------------------------
620// @name get_islands_cut
621//
622// @desc are we going to count the islands ?
623//
624// @var *n Cut on islands number
625// @return TRUE: we'll count the islands; FALSE: we won't
626//
627// @date Mon Sep 14 13:27:56 MET DST 1998
628//------------------------------------------------------------
629// @function
630
631//!@{
632int
633get_islands_cut(int *n)
634{
635 *n = nIslandsCut;
636 return ( countIslands );
637}
638//!@}
639
640
641//!-----------------------------------------------------------
642// @name get_ana_pixels
643//
644// @desc number of pixels for the analysis
645//
646// @return Number of pixels to use in the image parameters
647//
648// @date Mon Sep 14 13:27:56 MET DST 1998
649//------------------------------------------------------------
650// @function
651
652//!@{
653int
654get_ana_pixels(void)
655{
656 return ( anaPixels );
657}
658//!@}
659
660
661//!-----------------------------------------------------------
662// @name get_seeds
663//
664// @desc are we going to count the islands ?
665//
666// @var *n Number of the seed
667// @return N-th random-number Seed
668//
669// @date Mon Sep 14 13:27:56 MET DST 1998
670//------------------------------------------------------------
671// @function
672
673//!@{
674long int
675get_seeds(int n)
676{
677 return ( Seeds[n] );
678}
679//!@}
680
681
682//!-----------------------------------------------------------
683// @name get_skip_showers
684//
685// @desc get list of showers to skip
686//
687// @var *s1 Pointer to a vector of number of showers
688//
689// @date Mon Sep 14 13:27:56 MET DST 1998
690//------------------------------------------------------------
691// @function
692
693//!@{
694void
695get_skip_showers( int *s )
696{
697 int i;
698 for (i=0; i<nSkip; ++i)
699 s[i] = Skip[i];
700}
701//!@}
702
703
704//!-----------------------------------------------------------
705// @name get_nskip_showers
706//
707// @desc get number of showers to skip
708//
709// @return Number of showers to be skipped
710//
711// @date Mon Sep 14 13:27:56 MET DST 1998
712//------------------------------------------------------------
713// @function
714
715//!@{
716int
717get_nskip_showers( void )
718{
719 return( nSkip );
720}
721//!@}
722
723
724//!-----------------------------------------------------------
725// @name get_data_from_stdin
726//
727// @desc get whether we will read the data from the STDIN
728//
729// @return TRUE: we'll read data from STDIN; FALSE: we won't
730//
731// @date Wed Nov 25 13:21:00 MET 1998
732//------------------------------------------------------------
733// @function
734
735//!@{
736int
737get_data_from_stdin(void)
738{
739 return ( Data_From_STDIN );
740}
741//!@}
742
743
744//!-----------------------------------------------------------
745// @name get_read_phe
746//
747// @desc get whether we will read PHE files
748//
749// @return TRUE: we'll read PHE files; FALSE: we won't
750//
751// @date Wed Nov 25 13:21:00 MET 1998
752//------------------------------------------------------------
753// @function
754
755//!@{
756int
757get_read_phe(void)
758{
759 return ( Read_Phe );
760}
761//!@}
762
763
764//!-----------------------------------------------------------
765// @name get_read_phe_all
766//
767// @desc get whether we will read PHE files, with write_all_images
768//
769// @return TRUE: we'll do it; FALSE: we won't
770//
771// @date Wed Nov 25 13:21:00 MET 1998
772//------------------------------------------------------------
773// @function
774
775//!@{
776int
777get_read_phe_all(void)
778{
779 return ( Read_Phe_All );
780}
781//!@}
782
783
784//!-----------------------------------------------------------
785// @name write_all_images
786//
787// @desc write all images to .phe, even those without trigger
788//
789// @return TRUE: we'll write everything; FALSE: we won't
790//
791// @date Wed Nov 25 13:21:00 MET 1998
792//------------------------------------------------------------
793// @function
794
795//!@{
796int
797get_write_all_images(void)
798{
799 return ( Write_All_Images );
800}
801//!@}
802
803
804//!-----------------------------------------------------------
805// @name write_all_data
806//
807// @desc write single pixel data to file .dat
808//
809// @return TRUE: we'll write everything; FALSE: we won't
810//
811// @date Wed Nov 25 13:21:00 MET 1998
812//------------------------------------------------------------
813// @function
814
815//!@{
816int
817get_write_all_data(void)
818{
819 return ( Write_All_Data );
820}
821//!@}
822
823//!-----------------------------------------------------------
824// @name write_McEvt
825//
826// @desc write the McEvt class for each event to the .root file
827//
828// @return TRUE: we'll write it; FALSE: we won't
829//
830//------------------------------------------------------------
831// @function
832
833//!@{
834int
835get_write_McEvt(void)
836{
837 return ( Write_McEvt );
838}
839//!@}
840
841//!-----------------------------------------------------------
842// @name write_McTrig
843//
844// @desc write the McTrig class for each event to the .root file
845//
846// @return TRUE: we'll write it; FALSE: we won't
847//
848//------------------------------------------------------------
849// @function
850
851//!@{
852int
853get_write_McTrig(void)
854{
855 return ( Write_McTrig );
856}
857//!@}
858
859//!-----------------------------------------------------------
860// @name write_RawEvt
861//
862// @desc write the RawEvt class for each event to the .root file
863//
864// @return TRUE: we'll write it; FALSE: we won't
865//
866//------------------------------------------------------------
867// @function
868
869//!@{
870int
871get_write_RawEvt(void)
872{
873 return ( Write_RawEvt );
874}
875//!@}
876
877//!-----------------------------------------------------------
878// @name get_select_energy
879//
880// @desc return energy range allowed for showers from .phe file
881//
882// @var *le Lower limit in the allowed energy range
883// @var *ue Lower limit in the allowed energy range
884// @return TRUE: we make selection on the energy; FALSE: we don't
885//
886// @date Wed Nov 25 13:21:00 MET 1998
887//------------------------------------------------------------
888// @function
889
890//!@{
891int
892get_select_energy(float *le, float *ue)
893{
894 *le = Select_Energy_le;
895 *ue = Select_Energy_ue;
896 return ( Select_Energy );
897}
898//!@}
899
900
901//!-----------------------------------------------------------
902// @name get_trigger_radius
903//
904// @desc return the radius of the trigger area in the camera (if set)
905//
906// @var *radius Radius of the trigger area in the camera
907// @return TRUE: we choose a given radius for the trigger area
908//
909// @date Fri May 7 11:07:43 MET DST 1999
910//------------------------------------------------------------
911// @function
912
913//!@{
914int get_trigger_radius(float *radius)
915{
916 *radius = Trigger_Radius;
917 return ( Set_Trigger_Radius );
918}
919//!@}
920
921
922//!-----------------------------------------------------------
923// @name get_trigger_radius
924//
925// @desc return the radius of the trigger area in the camera (if set)
926//
927// @var *radius Radius of the trigger area in the camera
928// @return TRUE: we choose a given radius for the trigger area
929//
930// @date Fri May 7 11:07:43 MET DST 1999
931//------------------------------------------------------------
932// @function
933
934//!@{
935int get_correction(float *corr)
936{
937 *corr = fCorrection;
938 return ( Apply_Correction );
939}
940//!@}
941
942//!-----------------------------------------------------------
943// @name FADC_Scan
944//
945// @desc show the FADC signal for each event in the screen
946//
947// @return TRUE: we'll show it; FALSE: we won't
948//
949//------------------------------------------------------------
950// @function
951
952//!@{
953int
954get_FADC_Scan(void)
955{
956 return ( FADC_Scan );
957}
958//!@}
959
960//!-----------------------------------------------------------
961// @name Trigger_Scan
962//
963// @desc show the Trigger signal for each event in the screen
964//
965// @return TRUE: we'll show it; FALSE: we won't
966//
967//------------------------------------------------------------
968// @function
969
970//!@{
971int
972get_Trigger_Scan(void)
973{
974 return ( Trigger_Scan );
975}
976//!@}
977
978//!-----------------------------------------------------------
979// @name Trigger_Loop
980//
981// @desc make a loop over Trigger conditions
982//
983// @return TRUE: we'll make it; FALSE: we won't
984//
985//------------------------------------------------------------
986// @function
987
988//!@{
989int
990get_Trigger_Loop(int *lt, int *ut, int *lm, int *um, int *lg, int *ug)
991{
992 *lt=Trigger_loop_lthres;
993 *ut=Trigger_loop_uthres;
994 *lm=Trigger_loop_lmult;
995 *um=Trigger_loop_umult;
996 *lg=Trigger_loop_ltop;
997 *ug=Trigger_loop_utop;
998 return ( Trigger_Loop );
999}
1000//!@}
1001
1002
1003//=------------------------------------------------------------
1004//!@subsection Log of this file.
1005
1006//!@{
1007//
1008// $Log: not supported by cvs2svn $
1009// Revision 1.3 2000/03/24 18:14:05 blanch
1010// Parameters that tell as if we are going to see the diskriminator and/or FADC signal have been included.
1011//
1012// Revision 1.2 2000/02/18 17:45:43 petry
1013// This version belongs to camera.cxx 1.5.
1014// It has been put in the repository in order to be
1015// able to share the further development with others.
1016//
1017// If you need something working, wait or take an earlier one.
1018// See file README
1019//
1020// Revision 1.1.1.1 1999/11/05 11:59:34 harald
1021// This the starting point for CVS controlled further developments of the
1022// camera program. The program was originally written by Jose Carlos.
1023// But here you can find a "rootified" version to the program. This means
1024// that there is no hbook stuff in it now. Also the output of the
1025// program changed to the MagicRawDataFormat.
1026//
1027// The "rootification" was done by Dirk Petry and Harald Kornmayer.
1028//
1029// In the following you can see the README file of that version:
1030//
1031// ==================================================
1032//
1033// Fri Oct 22 1999 D.P.
1034//
1035// The MAGIC Monte Carlo System
1036//
1037// Camera Simulation Programme
1038// ---------------------------
1039//
1040// 1) Description
1041//
1042// This version is the result of the fusion of H.K.'s
1043// root_camera which is described below (section 2)
1044// and another version by D.P. which had a few additional
1045// useful features.
1046//
1047// The version compiles under Linux with ROOT 2.22 installed
1048// (variable ROOTSYS has to be set).
1049//
1050// Compile as before simply using "make" in the root_camera
1051// directory.
1052//
1053// All features of H.K.'s root_camera were retained.
1054//
1055// Additional features of this version are:
1056//
1057// a) HBOOK is no longer used and all references are removed.
1058//
1059// b) Instead of HBOOK, the user is given now the possibility of
1060// having Diagnostic data in ROOT format as a complement
1061// to the ROOT Raw data.
1062//
1063// This data is written to the file which is determined by
1064// the new input parameter "diag_file" in the camera parameter
1065// file.
1066//
1067// All source code file belonging to this part have filenames
1068// starting with "MDiag".
1069//
1070// The user can read the output file using the following commands
1071// in an interactive ROOT session:
1072//
1073// root [0] .L MDiag.so
1074// root [1] new TFile("diag.root");
1075// root [2] new TTreeViewer("T");
1076//
1077// This brings up a viewer from which all variables of the
1078// TTree can be accessed and histogrammed. This example
1079// assumes that you have named the file "diag.root", that
1080// you are using ROOT version 2.22 or later and that you have
1081// the shared object library "MDiag.so" which is produced
1082// by the Makefile along with the executable "camera".
1083//
1084// ! The contents of the so-called diag file is not yet fixed.
1085// ! At the moment it is what J.C.G. used to put into the HBOOK
1086// ! ntuple. In future versions the moments calculation can be
1087// ! removed and the parameter list be modified correspondingly.
1088//
1089// c) Now concatenated reflector files can be read. This is useful
1090// if you have run the reflector with different parameters but
1091// you want to continue the analysis with all reflector data
1092// going into ONE ROOT outputfile.
1093//
1094// The previous camera version contained a bug which made reading
1095// of two or more concatenated reflector files impossible.
1096//
1097// d) The reflector output format was changed. It is now version
1098// 0.4 .
1099// The change solely consists in a shortening of the flag
1100// definition in the file
1101//
1102// include-MC/MCCphoton.hxx
1103//
1104// ! IF YOU WANT TO READ REFLECTOR FORMAT 0.3, you can easily
1105// ! do so by recompiling camera with the previous version of
1106// ! include-MC/MCCphoton.hxx.
1107//
1108// The change was necessary for saving space and better
1109// debugging. From now on, this format can be frozen.
1110//
1111// ! For producing reflector output in the new format, you
1112// ! of course have to recompile your reflector with the
1113// ! new include-MC/MCCphoton.hxx .
1114//
1115// e) A first version of the pixelization with the larger
1116// outer pixels is implemented. THIS IS NOT YET FULLY
1117// TESTED, but first rough tests show that it works
1118// at least to a good approximation.
1119//
1120// The present version implements the camera outline
1121// with 18 "gap-pixels" and 595 pixels in total as
1122// shown in
1123//
1124// http://sarastro.ifae.es/internal/home/hardware/camera/numbering.ps
1125//
1126// This change involved
1127//
1128// (i) The file pixels.dat is no longer needed. Instead
1129// the coordinates are generated by the program itself
1130// (takes maybe 1 second). In the file
1131//
1132// pixel-coords.txt
1133//
1134// in the same directory as this README, you find a list
1135// of the coordinates generated by this new routine. It
1136// has the format
1137//
1138// number i j x y size-factor
1139//
1140// where i and j are J.C.G.'s so called biaxis hexagonal
1141// coordinates (for internal use) and x and y are the
1142// coordinates of the pixel centers in the standard camera
1143// coordinate system in units of centimeters. The value
1144// of "size-factor" determines the linear size of the pixel
1145// relative to the central pixels.
1146//
1147// (ii) The magic.def file has two additional parameters
1148// which give the number of central pixels and the
1149// number of gap pixels
1150//
1151// (iii) In camera.h and camera.cxx several changes were
1152// necessary, among them the introduction of several
1153// new functions
1154//
1155// The newly suggested outline with asymmetric Winston cones
1156// will be implemented in a later version.
1157//
1158// f) phe files can no longer be read since this contradicts
1159// our philosophy that the analysis should be done with other
1160// programs like e.g. EVITA and not with "camera" itself.
1161// This possibility was removed.
1162//
1163// g) ROOT is no longer invoked with an interactive interface.
1164// In this way, camera can better be run as a batch program and
1165// it uses less memory.
1166//
1167// h) small changes concerning the variable "t_chan" were necessary in
1168// order to avoid segmentation faults: The variable is used as an
1169// index and it went sometimes outside the limits when camera
1170// was reading proton data. This is because the reflector files
1171// don't contain the photons in a chronological order and also
1172// the timespread can be considerably longer that the foreseen
1173// digitisation timespan. Please see the source code of camera.cxx
1174// round about line 1090.
1175//
1176// j) several unused variables were removed, a few warning messages
1177// occur when you compile camera.cxx but these can be ignored at
1178// the moment.
1179//
1180// In general the program is of course not finished. It still needs
1181// debugging, proper trigger simulation, simulation of the asymmetric
1182// version of the outer pixels, proper NSB simulation, adaption of
1183// the diag "ntuple" contents to our need and others small improvements.
1184//
1185// In the directory rfl-files there is now a file in reflector format 0.4
1186// containing a single event produced by the starfiled adder. It has
1187// a duration of 30 ns and represents the region around the Crab Nebula.
1188// Using the enclosed input parameter file, camera should process this
1189// file without problems.
1190//
1191// 2) The README for the previous version of root_camera
1192//
1193// README for a preliminary version of the
1194// root_camera program.
1195//
1196// root_camera is based on the program "camera"of Jose Carlos
1197// Gonzalez. It was changed in the way that only the pixelisation
1198// and the distibution of the phe to the FADCs works in a
1199// first version.
1200//
1201// Using the #undef command most possibilities of the orignal
1202// program are switched of.
1203//
1204// The new parts are signed by
1205//
1206// - ROOT or __ROOT__
1207// nearly all important codelines for ROOT output are enclosed
1208// in structures like
1209// #ifdef __ROOT__
1210//
1211// code
1212//
1213// #endif __ROOT__
1214//
1215// In same case the new lines are signed by a comment with the word
1216// ROOT in it.
1217//
1218// For timing of the pulse some variable names are changed.
1219// (t0, t1, t --> t_ini, t_fin, t_1st, t_chan,...)
1220// Look also for this changes.
1221//
1222// For the new root-file is also a change in readparm-files
1223//
1224//
1225// - __DETAIL_TRIGGER__
1226//
1227// This is for the implementation of the current work on trigger
1228// studies. Because the class MTrigger is not well documented it
1229// isn´t a part of this tar file. Only a dummy File exists.
1230//
1231//
1232//
1233// With all files in the archive, the root_camera program should run.
1234//
1235// A reflector file is in the directory rfl-files
1236//
1237// ==================================================
1238//
1239// From now on, use CVS for development!!!!
1240//
1241//
1242//
1243// Revision 1.2 1999/10/22 15:01:28 petry
1244// version sent to H.K. and N.M. on Fri Oct 22 1999
1245//
1246// Revision 1.1.1.1 1999/10/21 16:35:11 petry
1247// first synthesised version
1248//
1249// Revision 1.6 1999/03/15 14:59:08 gonzalez
1250// camera-1_1
1251//
1252// Revision 1.5 1999/03/02 09:56:12 gonzalez
1253// *** empty log message ***
1254//
1255// Revision 1.4 1999/01/14 17:32:41 gonzalez
1256// Added to camera the STDIN input option (data_from_input)
1257//
1258//!@}
1259
1260//=EOF
Note: See TracBrowser for help on using the repository browser.