Ignore:
Timestamp:
03/03/04 10:14:48 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgeom
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.cc

    r3383 r3387  
    6666    : fNumPixels(0), fCamDist(0), fConvMm2Deg(0)
    6767{
     68    fName  = "MGeomCam";
     69    fTitle = "Storage container for a camera geometry";
    6870}
    6971
     
    7779{
    7880    fName  = name  ? name  : "MGeomCam";
    79     fTitle = title ? title : "Storage container for  a camera geometry";
     81    fTitle = title ? title : "Storage container for a camera geometry";
    8082
    8183    //
  • trunk/MagicSoft/Mars/mgeom/MGeomMirror.cc

    r2521 r3387  
    128128    fReflectivity = ref;
    129129}
     130
     131TVector3 MGeomMirror::GetReflection(const TVector3 &star, Double_t dist)
     132{
     133    if (fReflector==TRotation())
     134    {
     135        fReflector = TRotation(); // unit matrix
     136        fReflector.Rotate(TMath::Pi(), GetMirrorNorm());
     137    }
     138
     139    // Reflect star on the mirror (done by a rotation
     140    // around the normal vector of the mirror center
     141    TVector3 light(star);
     142    light *= fReflector;
     143
     144    if (dist<0)
     145        return light;
     146
     147    // calculate distance to the camera
     148    const TVector3 &pos = GetMirrorCenter();
     149    const Double_t d = (dist - pos.Z()) / light.Z();
     150
     151    return light*d + pos;
     152}
  • trunk/MagicSoft/Mars/mgeom/MGeomMirror.h

    r2568 r3387  
    1010#endif
    1111
    12 #ifndef ROOT_TVector3
    13 #include <TVector3.h>
     12#ifndef ROOT_TRotation
     13#include <TRotation.h>
    1414#endif
    1515
     
    1717{
    1818private:
    19     Int_t   fMirrorId;    // the Mirror Id
     19    Int_t   fMirrorId;     // the Mirror Id
    2020
    21     Float_t fFocalDist;   // [cm] focal distance of that mirror
    22     Float_t fSX;          // [cm] curvilinear coordinate of mirror's center in X
    23     Float_t fSY;          // [cm] curvilinear coordinate of mirror's center in Y
    24     Float_t fX;           // [cm] x coordinate of the center of the mirror
    25     Float_t fY;           // [cm] y coordinate of the center of the mirror
    26     Float_t fZ;           // [cm] z coordinate of the center of the mirror
    27     Float_t fThetaN;      // polar theta angle of the direction where the mirror points to
    28     Float_t fPhiN;        // polar phi angle of the direction where the mirror points to
    29     Float_t fXN;          // xn coordinate of the normal vector in the center
    30     Float_t fYN;          // yn coordinate of the normal vector in the center
    31     Float_t fZN;          // zn coordinate of the normal vector in the center
    32                           // Note: fXN^2*fYN^2*fZN^2 = 1
    33     Float_t fDeviationX;  // [cm] deviation in x of the spot of a single mirror on the camera plane
    34     Float_t fDeviationY;  // [cm] deviation in y of the spot of a single mirror on the camera plane
     21    Float_t fFocalDist;    // [cm] focal distance of that mirror
     22    Float_t fSX;           // [cm] curvilinear coordinate of mirror's center in X
     23    Float_t fSY;           // [cm] curvilinear coordinate of mirror's center in Y
     24    Float_t fX;            // [cm] x coordinate of the center of the mirror
     25    Float_t fY;            // [cm] y coordinate of the center of the mirror
     26    Float_t fZ;            // [cm] z coordinate of the center of the mirror
     27    Float_t fThetaN;       // polar theta angle of the direction where the mirror points to
     28    Float_t fPhiN;         // polar phi angle of the direction where the mirror points to
     29    Float_t fXN;           // xn coordinate of the normal vector in the center
     30    Float_t fYN;           // yn coordinate of the normal vector in the center
     31    Float_t fZN;           // zn coordinate of the normal vector in the center
     32                           // Note: fXN^2*fYN^2*fZN^2 = 1
     33    Float_t fDeviationX;   // [cm] deviation in x of the spot of a single mirror on the camera plane
     34    Float_t fDeviationY;   // [cm] deviation in y of the spot of a single mirror on the camera plane
    3535
    36     TArrayF fWavelength;  // List of wavelength
    37     TArrayF fReflectivity;// Mirror reflectivity
     36    TArrayF fWavelength;   // List of wavelength
     37    TArrayF fReflectivity; // Mirror reflectivity
     38
     39    TRotation fReflector;  //! Store this for acceleration
    3840
    3941public:
     
    5557    TVector3 GetMirrorNorm() const   { return TVector3(fXN, fYN, fZN); }
    5658
     59    TVector3 GetReflection(const TVector3 &star, Double_t dist=-1);
     60
    5761    ClassDef(MGeomMirror, 2)  // geometry class describing one mirror
    5862};
Note: See TracChangeset for help on using the changeset viewer.