Ignore:
Timestamp:
04/29/03 23:47:38 (22 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Simulation/Detector/ReflectorII
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/ReflectorII/Changelog

    r1960 r2046  
    11** Add changes at the beginning! **
     2
     329/04/2003 A. Moralejo
     4
     5ph2cph.c:
     6Changed determination of which mirror element is hit. Before there was a
     7problem when going to very large distances from the mirror center, sometimes
     8a wrong mirror was chosen, which was actually further away from the impact
     9point than the mirror size, and therefore the photon was discarded later as
     10"not hitting any mirror". Now we measure the distance on the paraboloid. The
     11new code is:
     12
     13  /*  calculate the mirror to be used */
     14
     15  distmirr = 1000000.0f;
     16       
     17  for (i=0; i<ct_NMirrors && distmirr>=ct_RMirror; ++i) {
     18    distmirr2 = (float) sqrt(SQR(ct_data[i].sx - sx) +
     19                             SQR(ct_data[i].sy - sy));
     20
     21    if (distmirr2 < distmirr) {
     22      i_mirror = i;
     23      distmirr  = distmirr2;
     24    }
     25  }
     26
     27geometry.c:
     28Small change in calculation of ct_nax_radius (introduced fabs, but nothing
     29changes)
    230
    33116/04/2003 A. Moralejo
  • trunk/MagicSoft/Simulation/Detector/ReflectorII/geometry.c

    r1908 r2046  
    4949        if (12 != fscanf(geofile, "%d %f %f %f %f %f %f %f %f %f %f %f",
    5050                         &ct_data[i].i,     &ct_data[i].f,
    51                          &ct_data[i].sx,            &ct_data[i].sy,
    52                          &ct_data[i].x,     &ct_data[i].y,      &ct_data[i].z,
    53                          &ct_data[i].theta,  &ct_data[i].phi,
    54                          &ct_data[i].xn,            &ct_data[i].yn,     &ct_data[i].zn))
     51                         &ct_data[i].sx,    &ct_data[i].sy,
     52                         &ct_data[i].x,     &ct_data[i].y,   &ct_data[i].z,
     53                         &ct_data[i].theta, &ct_data[i].phi,
     54                         &ct_data[i].xn,    &ct_data[i].yn,     &ct_data[i].zn))
    5555          break;
    5656
    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);
     57        ct_max_radius =
     58          (fabs(ct_data[i].sx) > ct_max_radius? fabs(ct_data[i].sx) :
     59           ct_max_radius);
     60        ct_max_radius =
     61          (fabs(ct_data[i].sy) > ct_max_radius? fabs(ct_data[i].sy) :
     62           ct_max_radius);
    6163      }
    6264
  • trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c

    r1908 r2046  
    142142
    143143  /*  get director cosines x,y on ground */ 
    144 
    145144  /*
    146145  r[0] = 0.0;     
    147146  r[1] = 0.0;   
    148   r[2] = 1.0;   
     147  r[2] = -1.0;   
    149148  */
    150149  /* CBC */
     
    194193  applyMxV( OmegaCT, x, xCT );
    195194  applyMxV( OmegaCT, r, rCT );       
     195
    196196
    197197  /* CBC */
     
    293293  xcut[0] = xCT[0] + rCT[0]/rCT[2]*(xcut[2]-xCT[2]);
    294294  xcut[1] = xCT[1] + rCT[1]/rCT[2]*(xcut[2]-xCT[2]);
    295      
    296295
    297296  /* CBC */
     
    317316  }
    318317
     318
    319319  /*  calculate the mirror to be used */
    320320
     
    322322       
    323323  for (i=0; i<ct_NMirrors && distmirr>=ct_RMirror; ++i) {
    324     distmirr2 = (float) sqrt(SQR(ct_data[i].x - xcut[0]) +
    325                      SQR(ct_data[i].y - xcut[1]) +
    326                      SQR(ct_data[i].z - xcut[2]));
     324    distmirr2 = (float) sqrt(SQR(ct_data[i].sx - sx) +
     325                             SQR(ct_data[i].sy - sy));
     326
    327327    if (distmirr2 < distmirr) {
    328328      i_mirror = i;
     
    332332
    333333  /*
    334    the mirror to use is i_mirror (calculated several lines above)
     334   the mirror to use is i_mirror (calculated above)
    335335   check whether the photon is outside the nearest (this) mirror
    336336  */
Note: See TracChangeset for help on using the changeset viewer.