Changeset 1908 for trunk/MagicSoft/Simulation/Detector/ReflectorII
- Timestamp:
- 04/04/03 21:15:24 (22 years ago)
- Location:
- trunk/MagicSoft/Simulation/Detector/ReflectorII
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/ReflectorII/Changelog
r1725 r1908 1 1 ** Add changes at the beginning! ** 2 3 4/04/2003 A. Moralejo 4 5 init.h, geometry.c, ph2cph.c: 6 introduced variable ct_max_radius, the maximum distance in x or y from the 7 center to the edge of the telescope, measured on the parabolic dish. This 8 is used in a fast check of whether the photon hits the disk in ph2cph.c 9 10 ph2cph.c: 11 in function Lin2Curv(float x), changed the calculation of the curvilinear 12 coordinates (which before was only valid for ~17 m focus paraboloids). 2 13 3 14 22/01/2003 A. Moralejo -
trunk/MagicSoft/Simulation/Detector/ReflectorII/geometry.c
r1614 r1908 18 18 int ct_NPixels; /* number of pixels */ 19 19 float ct_PixelWidth; /* pixel width (cm) */ 20 float ct_max_radius; /* Maximum value of curvilinear 21 * coordinates of the center of 22 * the mirrors. 23 */ 20 24 21 25 mirror *ct_data=NULL; /* ptr to mirror data */ … … 32 36 static void ReadMirrorTable(FILE *geofile) 33 37 { int i; /* Mirror index */ 38 39 ct_max_radius = 0.; 34 40 35 41 if ((ct_data=(mirror *)malloc(sizeof(mirror)*ct_NMirrors)) == NULL) … … 49 55 break; 50 56 57 ct_max_radius = (ct_data[i].sx > ct_max_radius? ct_data[i].sx : 58 ct_max_radius); 59 ct_max_radius = (ct_data[i].sy > ct_max_radius? ct_data[i].sy : 60 ct_max_radius); 51 61 } 62 52 63 if (i < ct_NMirrors) 53 64 FatalError(MIRR_FEW___FTL, i); … … 198 209 fclose(geofile); 199 210 211 ct_max_radius += ct_RMirror; 212 200 213 if (strlen(reflectivity_filename) == 0) 201 214 strcpy(reflectivity_filename, REFLECTIVITY_FILE); -
trunk/MagicSoft/Simulation/Detector/ReflectorII/init.h
r1722 r1908 59 59 extern int ct_NPixels; /* number of pixels */ 60 60 extern float ct_PixelWidth; /* pixel width (cm) */ 61 61 extern float ct_max_radius; /* Approximate mirror dish radius, 62 * used for fast rejection of photons 63 * not hitting the dish (in ph2cph.c). 64 */ 62 65 63 66 typedef struct -
trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c
r1624 r1908 92 92 93 93 float distmirr, distmirr2; /* distances used in MAGIC reflection routine */ 94 95 94 96 float sx, sy; 95 97 float t1, t2; … … 307 309 308 310 /* is it outside the dish? */ 309 310 if ((fabs(sx) > 850.0) || (fabs(sy) > 850.0)) { 311 if ((fabs(sx) > ct_max_radius) || (fabs(sy) > ct_max_radius)) { 311 312 /* 312 313 cout << "CONDITION 1 !" << endl << flush; … … 848 849 Lin2Curv(float x) 849 850 { 851 /* 850 852 x /= 100.f; 851 853 return ((x + 0.000144175317185f * x * x * x)*100.f); 854 */ 855 856 double k = 0.25/ct_Focal_mean; 857 return ((2*k*x*sqrt(1+4*k*k*x*x)+asinh(2*k*x))/4/k); 852 858 } 853 859
Note:
See TracChangeset
for help on using the changeset viewer.