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

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