source: branches/start/MagicSoft/Simulation/Detector/Reflector/readparam.h@ 13452

Last change on this file since 13452 was 292, checked in by harald, 25 years ago
This is the startpoint for the futher development of the Reflector program of Jose Carlos. For all developments use this CVS-controlled directory.
File size: 5.7 KB
Line 
1//=//////////////////////////////////////////////////////////////////////
2//=
3//= readparam
4//=
5//= @file readparam.h
6//= @desc Header 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: readparam.h,v $
21//= $Revision: 1.1.1.1 $
22//= $Author: harald $
23//= $Date: 1999-10-29 07:00:33 $
24//=
25//=//////////////////////////////////////////////////////////////////////
26
27// @T \newpage
28
29//!@section Source code of |readparam.h|.
30
31/*!@"
32
33 In this section you can find the source code for the file
34 |readparam.h|. This file is mainly needed by |readparam.cxx|. Here
35 is located the definition of the commands you can use in the
36 parameters file. In this file, the first line must be |reflector|
37 |version|, where |version| is the appropiate version program which
38 can read the commands written in that parameters file. You cannot
39 mix parameters files and executables with different versions. The
40 current version is |reflector 0.3|. Each line starting with a \#
41 will be treated as a comment.
42
43 The commands now available for the parameters file will be explained
44 in the documentation.
45
46 A parameters file looks like this:
47
48 |reflector 0.2|
49
50 |verbose_level 2|
51
52 |fixed_target 0. 0.|
53
54 |max_events 1000|
55
56 |data_paths 1|
57
58 |/hd80/MC/CT1/data/low-za/p/run9|
59
60 |output_file reflector.rfl|
61
62 |ct_file ct1.def|
63
64 |atm_model ATM_CORSIKA|
65
66 |end_file|
67
68 @"*/
69
70//!@{
71#ifndef _readparam_
72#define _readparam_
73
74#ifndef _this_
75#define _this_ readparam
76#endif
77//!@}
78
79//!@subsection Include files.
80
81//!@{
82
83#include <iostream.h>
84#include <fstream.h>
85#include <stdlib.h>
86#include <stdio.h>
87#include <string.h>
88#include <math.h>
89#include <float.h>
90#include <unistd.h>
91
92#include "jcmacros.h"
93#include "jcdebug.h"
94
95#include "reflector-v.h"
96
97#include "atm.h"
98
99//!@}
100
101//!@subsection Macro-definitions, and constants.
102
103//!@{
104
105// now we define the list ITEM_LIST of possible items in
106// the parameters file. note that they are functions of
107// T(x). we will change T(x) to be the real item or the
108// string of this item when needed
109
110#define ITEM_LIST /* LIST OF ITEMS IN THE PARAMETERS FILE */ \
111T(data_paths), /* begin of the list of source data paths */ \
112T(output_file), /* output file */ \
113T(ct_file), /* file with the characteristics of the CT */ \
114T(atm_model), /* changes the atmospheric model to be used */ \
115T(verbose_level), /* defines verbose level of the output */ \
116T(fixed_target), /* defines the position towards the CT is pointing */ \
117T(max_events), /* maximum number of event to read */ \
118T(range_events), /* analyze from event A to B */ \
119T(energy_cuts), /* lowest/highest energy allowed */ \
120T(parallel_beam), /* defines a parallel beam of light */ \
121T(pm_parallel_beam),/* defines a parallel beam of light, out of a pixmap */ \
122T(seeds), /* seeds for random number generation */ \
123T(block), /* size of the block of files, when 'blocking' */ \
124T(random_pointing), /* random CT pointing from each shower (hadrons) */ \
125T(data_from_stdin), /* read data from STDIN */ \
126T(data_to_stdout), /* read data from STDIN */ \
127T(end_file) /* end of the parameters file */
128
129#define T(x) x // define T() as the name as it is
130
131enum ITEM_TYPE {
132 ITEM_LIST
133};
134
135#undef T
136
137#define T(x) #x // define T() as the string of x
138
139const char *const ITEM_NAMES[] = {
140 ITEM_LIST
141};
142
143#undef T
144
145#define LINE_MAX_LENGTH 400
146#define ITEM_MAX_LENGTH 40
147#define PATH_MAX_LENGTH 120
148
149// Verbose Levels
150enum VerboseLevel {
151 VERBOSE_QUIET,
152 VERBOSE_MINIMAL,
153 VERBOSE_NORMAL,
154 VERBOSE_MAXIMAL
155};
156
157#define VERBOSE_DEFAULT VERBOSE_QUIET
158
159// directory for intermediate storage of data from STDIN
160
161#define TMP_STDIN_DIR "/hd90/gonzalez/tmp"
162
163//!@}
164
165//!@subsection Prototypes of functions.
166
167//!@{
168
169//++
170// prototypes
171//--
172
173void readparam(char * filename);
174int get_num_of_paths(void);
175char *get_path_name(int i);
176char *get_output_filename(void);
177char *get_ct_filename(void);
178int get_verbose(void);
179int get_fixed_target(float *theta, float *phi);
180int get_max_events(void);
181void get_range_events(int *a, int *b);
182void get_energy_cuts(float *low, float *high);
183void get_parallel_beam(float *pb_theta, float *pb_phi,
184 float *pb_x, float *pb_y,
185 float *pb_lengthx, float *pb_lengthy,
186 float *pb_nx, float *pb_ny, float *pb_height);
187int is_parallel_beam(void);
188char * get_parallel_beam_pm(float *pb_scale, float *pb_height);
189int is_parallel_beam_pm(void);
190long int get_seeds(int n);
191int get_block(void);
192int get_data_from_stdin(void);
193int get_data_to_stdout(void);
194int get_random_pointing(float *maxdist);
195
196//!@}
197
198//!@{
199
200#endif // ! _readparam_
201
202//!@}
203
204//=------------------------------------------------------------
205//!@subsection Log of this file.
206
207//!@{
208
209/*
210 * $Log: not supported by cvs2svn $
211 * Revision 1.13 1999/10/05 11:06:37 gonzalez
212 * Sep. 1999
213 *
214 * Revision 1.12 1999/03/24 16:33:02 gonzalez
215 * REFLECTOR 1.1: Release
216 *
217 * Revision 1.11 1999/01/21 16:03:41 gonzalez
218 * Only small modifications
219 *
220 * Revision 1.10 1999/01/19 18:07:18 gonzalez
221 * Bugs in STDIN-STDOUT version corrected.
222 *
223 * Revision 1.9 1999/01/14 17:35:40 gonzalez
224 * Both reading from STDIN (data_from_stdin) and
225 * writing to STDOUT (data_to_STDOUT) working.
226 *
227 */
228
229//!@}
230//=EOF
Note: See TracBrowser for help on using the repository browser.