source: trunk/MagicSoft/Simulation/Detector/ReflectorII/init.h@ 19594

Last change on this file since 19594 was 1908, checked in by moralejo, 22 years ago
*** empty log message ***
File size: 5.4 KB
Line 
1#ifndef __RFL_INIT__
2#define __RFL_INIT__
3
4/* Constant definitions */
5#define LINE_MAX_LENGTH 128 /* parsing buffer sz. */
6#define NR_OF_CPHOTONS 65535 /* CPhotons sz. */
7#define PH_IN_DATABLOCK 39 /* Photons in datablk */
8#define SHOW_ME 500 /* How many evts among two logs */
9#define FALSE 0
10#define TRUE 1
11
12/* Macros */
13#define ARRAY_SZ(A) (sizeof(A)/sizeof(A[0]))
14
15/* Tags inside reflector file */
16#define SIZE_OF_FLAGS 13
17
18#define FLAG_START_OF_RUN "\nSTART---RUN\n"
19#define FLAG_START_OF_EVENT "\nSTART-EVENT\n"
20#define FLAG_END_OF_EVENT "\nEND---EVENT\n"
21#define FLAG_END_OF_RUN "\nEND-----RUN\n"
22#define FLAG_END_OF_FILE "\nEND----FILE\n"
23#define FLAG_END_OF_STDIN "\nEND---STDIN\n"
24
25/* Prototypes */
26void init(char *filename);
27
28/* External declarations */
29extern FILE *filelist; /* filelist ptr */
30extern FILE *rflfile; /* reflector (out)file */
31extern FILE *cerfile; /* current cerfile */
32extern char cername[]; /* current cername */
33extern long first_Event; /* first proc. event */
34extern long last_Event; /* last proc. event */
35extern long max_Events; /* max proc. events */
36extern float low_Ecut; /* lower Ecut (GeV) */
37extern float high_Ecut; /* upper Ecut (GeV) */
38
39extern int is_Fixed_Target; /* fixed target? */
40extern float fixed_Theta; /* zenith angle (rad) */
41extern float fixed_Phi; /* azi (0N->90E) (rad) */
42
43extern float Telescope_x, Telescope_y; /* Telescope coordinates (cm) */
44
45extern int wobble_position;
46
47extern int is_Random_Pointing; /* random pointing? */
48extern float Random_Pointing_MaxDist; /* in metres */
49extern int nRepeat_Random; /* nr of times a sh. is reused */
50extern long Seeds[2]; /* random seeds */
51
52extern float ct_Focal_mean; /* focal dist. (mean) (cm) */
53extern float ct_PSpread_mean; /* pt. spread fn. (mean) (cm) */
54extern float ct_PSpread_std; /* pt. spread fn. (std) (cm) */
55extern float ct_BlackSpot_rad; /* black spot radius (cm) */
56extern float ct_RMirror; /* rad. of single mirror (cm) */
57extern int ct_NMirrors; /* number of mirrors */
58extern float ct_CameraWidth; /* camera width (cm) */
59extern int ct_NPixels; /* number of pixels */
60extern float ct_PixelWidth; /* pixel width (cm) */
61extern float ct_max_radius; /* Approximate mirror dish radius,
62 * used for fast rejection of photons
63 * not hitting the dish (in ph2cph.c).
64 */
65
66typedef struct
67{ int i; /* mirror id */
68 float f, /* focal length (cm) */
69 sx, sy, /* curvilinear coords. (cm) */
70 x, y, z, /* rectangular coords. (cm) */
71 theta, phi, /* angles of mirror axis */
72 xn, yn, zn; /* versor of mirror axis */
73} mirror;
74
75extern mirror *ct_data; /* ptr to mirror data */
76extern int nReflectivity; /* nr of refl. table elements */
77extern float *Reflectivity[]; /* ptr to refl. table */
78extern float *AxisDeviation[]; /* ptr to axisdev. table */
79
80/* Photon structures */
81typedef struct
82{ float w, /* photon wavelength (nm) */
83 x, y, /* (ground) impact point (cm) */
84 u, v, /* direction cosines */
85 t, /* arrival time (ns) */
86 h; /* production height (cm) */
87} photon;
88
89typedef struct
90{ float w, /* cphoton wavelength (nm) */
91 x, y, /* (chamber) imp. point (cm) */
92 u, v, /* direction cosines */
93 t, /* arrival time (ns) */
94 h, /* production height (cm) */
95 phi; /* (chamber) inc. angle (rad) */
96} cphoton;
97extern cphoton *CPhotons;
98
99/* Strings */
100#define RFL__START_MSG /* program, version */ \
101 "\n ################################################\n" \
102 " %s %s\n\n Simulation of the reflector\n" \
103 " - J.C. Gonzalez - May 1998\n" \
104 " Single file version\n" \
105 " - D. Bastieri & C. Bigongiari - Jan 2000\n" \
106 " Version 0.6\n" \
107 " - A. Moralejo - January 2003\n" \
108 " ################################################\n\n"
109#define SIGN_ERROR_FTL /* program, version */ \
110 "Signature of parameters file is not correct.\n" \
111 " *** Should be: **%s %s**.\n"
112#define SKIP_TOKEN_MSG /* skipped token */ \
113 " *** Skipping unknown token [%s].\n"
114#define GEOM_NSPEC_FTL /* no parms */ \
115 "No geometry file given.\n" \
116 " *** Please specify its name after the \"ct_file\" directive.\n"
117#define CPHS_ALLOC_FTL /* cphotons */ \
118 "Cannot allocate enough memory space for %d cphotons.\n"
119#define CPHS_ALLOC_LOG /* cphotons */ \
120 "Allocated memory for %d cphotons.\n"
121#define CERF_NFND__MSG /* cername */ \
122 " *** Cerfile \"%s\" not found.\n"
123#define CERF_OPEN__LOG /* cername */ \
124 "Opened cerfile \"%s\".\n"
125#define CERF_ERROR_LOG /* cername */ \
126 "Error while reading cerfile \"%s\": skipping it.\n"
127#define EVTN_WRONG_ERR /* first, last, cername */ \
128 " *** Event boundaries [%ld, %ld] wrong for \"%s\".\n" \
129 " *** Reading all events.\n"
130#define TEMP_ERROR_FTL /* no parms */ \
131 "Cannot open a temporary file: unable to handle overflow."
132#define INFO_EVENT_LOG /* run, evt, energy */ \
133 "Run %.0f, event %.0f: energy = %f.\n"
134#define MEM__FREE__MSG /* no parms */ \
135 "Freeing up allocated memory.\n"
136#define VECT_FREE__LOG /* vector name */ \
137 " ... freeing up [%s]\n"
138#define RFLF_CLOSE_LOG /* no parms */ \
139 "Closing reflector file.\n"
140#define RFL__EXIT__MSG /* program, version */ \
141 "%s %s: done.\n\n"
142
143#endif
Note: See TracBrowser for help on using the repository browser.