Changeset 2051


Ignore:
Timestamp:
04/30/03 18:22:48 (21 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Simulation/Detector/ReflectorII
Files:
2 edited

Legend:

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

    r2047 r2051  
    11** Add changes at the beginning! **
     2
     330/04/2003 A. Moralejo
     4
     5ph2cph.c: Found out that the fix from yesterday, although it "patched" the
     6loss of photons, did not remove the real cause for it. Actually in the
     7determination of the intersection of the photon with the paraboloid there
     8was an overflow which resulted in nonsense coordinates beyond 10 m from
     9the mirror dish center. It has been fixed fixed by changing the following
     10cut:
     11
     12  if ( fabs(a) < 1.e-3 ) {
     13    xcut[2] = -c / b
     14  }
     15
     16which was formerly < 1.e-6.
     17
     18I also noticed that the problem from yesterday was not so serious: it only
     19removed a significant amount of the photons nearly paralel to the telescope
     20axis, but globally, over a cer file there is no big difference.
    221
    32229/04/2003 A. Moralejo
  • trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c

    r2046 r2051  
    7878  float phi;                  /* angle between photon and camera plane */
    7979
    80   float a, b, c, t;           /* intermediate variables */
     80  float a, b, c, t, t1, t2;   /* intermediate variables */
    8181
    8282  float d;                    /* minimum distance trajectory-mirror center */
     
    9595
    9696  float sx, sy;
    97   float t1, t2;
    9897  float dummy = 0.;
    9998
     
    193192  applyMxV( OmegaCT, x, xCT );
    194193  applyMxV( OmegaCT, r, rCT );       
    195 
    196194
    197195  /* CBC */
     
    240238 
    241239  /*  the z coordinate is calculated */
    242  
     240
    243241  a = - SQR(rCT[0]) - SQR(rCT[1]);
    244242
     
    257255    - SQR(rCT[0])*SQR(xCT[2]) - SQR(rCT[1])*SQR(xCT[2]);
    258256
    259 
    260   if ( fabs(a) < 1.e-6 ) {
    261 
    262     /*  only one value */
    263 
    264     xcut[2] = -c / b;
     257  /* Alternative calculation (AM), same result:
     258   *
     259   * a = SQR(rCT[0])+SQR(rCT[1]);
     260   * b = 2*xCT[0]*rCT[0]+2*xCT[1]*rCT[1]-4*ct_Focal_mean*rCT[2];
     261   * c = -4*ct_Focal_mean*xCT[2]+SQR(xCT[0])+SQR(xCT[1]);
     262   */
     263
     264  if ( fabs(a) < 1.e-3 ) {   /* Changed old cut value 1e-6 AM, 04/2003 */
     265    xcut[2] = -c / b;         // Only one solution
     266
     267      /*
     268       * Alternative calculation:
     269       *  if (a < 1.e-3 )
     270       *  {
     271       *     xcut[2] = xCT[2] - c/b*rCT[2];
     272       */
    265273
    266274  } else {
     
    281289
    282290    /*  z must be the minimum of t1 and t2 */
    283          
     291
    284292    xcut[2] = (t1 < t2) ? t1 : t2;
    285293
     294    /*
     295     * Alternative calculation:
     296     *
     297     * xcut[2] = (t1 < t2) ? xCT[2]+t1*rCT[2] : xCT[2]+t2*rCT[2]; 
     298     */
    286299  }
    287300   
     
    315328    return 2;
    316329  }
    317 
    318330
    319331  /*  calculate the mirror to be used */
Note: See TracChangeset for help on using the changeset viewer.