Ignore:
Timestamp:
04/16/09 10:46:32 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcorsika/MCorsikaEvtHeader.cc

    r9374 r9422  
    6161// --------------------------------------------------------------------------
    6262//
    63 //  Return Hypot(x, y)
     63// Return Impact (distance of ground incident point from telescope axis)
     64//
     65// Distance d between a point q and a line u (via p):
     66//   d = | ( vec(q) - vec(p) ) x vec(u) |  /  | vec(u) |
     67//
     68// If p = 0
     69//
     70//   ==>   d = | vec(q) x vec(u) |  /  | vec(u) |
     71//          w :=  q = (x/y/0)
     72//          v :=  u = (Alt/Az)
     73//
     74// For Alt/Az = Theta/Phi:
     75//
     76//  x = r sin(theta) cos(phi)
     77//  y = r sin(theta) sin(phi)
     78//  z = r cos(theta)
     79//
     80//                   (   -q3*u2    )   ( -cos(theta)*y                                     )
     81// vec(q) x vec(u) = (    q3*u1    ) = (  cos(theta)*x                                     )
     82//                   ( q1*u2-q2*u1 )   ( sin(theta) cos(phi) * y - sin(theta) sin(phi) * x )
     83//
     84//   ==> d = sqrt( cos(theta)^2 (x^2  + y^2 ) +
     85//                 sin(theta)^2 ( cos(phi) y + sin(phi) x)^2 )
    6486//
    6587Double_t MCorsikaEvtHeader::GetImpact() const
    6688{
    67     return TMath::Hypot(fX, fY);
     89    const Double_t c = TMath::Cos(fZd);
     90    const Double_t s = TMath::Sin(fZd);
     91
     92    const Double_t p = TMath::Cos(fAz)*fX - TMath::Sin(fAz)*fY;
     93
     94    return TMath::Sqrt(c*c*(fX*fX + fY*fY) + s*s* p*p);
    6895}
    6996
Note: See TracChangeset for help on using the changeset viewer.