Ignore:
Timestamp:
01/21/09 14:26:15 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgeom
Files:
5 edited

Legend:

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

    r8921 r9234  
    1313#ifndef ROOT_TArrayS
    1414#include <TArrayS.h>
     15#endif
     16#ifndef MARS_MQuaternion
     17#include "MQuaternion.h"
    1518#endif
    1619
     
    109112    Int_t GetNeighbor(UInt_t idx, Int_t dir) const;
    110113
     114    virtual Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const { return kFALSE; }
     115    virtual Bool_t HitDetector(const MQuaternion &p) const { return kFALSE; }
     116
    111117    void Print(Option_t *opt=NULL) const;
    112118
  • trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.cc

    r8910 r9234  
    112112// --------------------------------------------------------------------------
    113113//
     114// Check if the photon which is flying along the trajectory u has passed
     115// (or will pass) the frame of the camera (and consequently get
     116// absorbed). The position p and direction u must be in the
     117// telescope coordinate frame, which is z parallel to the focal plane,
     118// x to the right and y upwards, looking from the mirror towards the camera.
     119//
     120// The units are cm.
     121//
     122Bool_t MGeomCamDwarf::HitFrame(MQuaternion p, const MQuaternion &u) const
     123{
     124    // z is defined from the mirror (0) to the camera (z>0).
     125    // Thus we just propagate to the focal plane (z=fDist)
     126    //p -= 1700./u.Z()*u;
     127    p.PropagateZ(u, GetCameraDist()*100); // m->cm
     128
     129    // Add 10% to the max radius and convert from mm to cm
     130    return p.R()<GetMaxRadius()*0.11;//TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65;
     131}
     132
     133// --------------------------------------------------------------------------
     134//
     135// Check if the position given in the focal plane (so z can be ignored)
     136// is a position which might hit the detector. It is meant to be a rough
     137// and fast estimate not a precise calculation. All positions dicarded
     138// must not hit the detector. All positions accepted might still miss
     139// the detector.
     140//
     141// The units are cm.
     142//
     143Bool_t MGeomCamDwarf::HitDetector(const MQuaternion &v) const
     144{
     145    // Add 10% to the max radius and convert from mm to cm
     146    return v.R()<GetMaxRadius()*0.11;//60.2;
     147}
     148
     149// --------------------------------------------------------------------------
     150//
    114151// Calculate in the direction 0-5 (kind of sector) in the ring-th ring
    115152// the x and y coordinate of the i-th pixel. The unitx are unity,
  • trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.h

    r9219 r9234  
    2828    TObject *Clone(const char *newname) const;
    2929
    30     ClassDef(MGeomCamDwarf, 1)          // Geometry class for the Dwarf camera
     30    Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const;
     31    Bool_t HitDetector(const MQuaternion &p) const;
     32
     33    ClassDef(MGeomCamDwarf, 1) // Geometry class for the Dwarf camera
    3134};
    3235
    3336#endif
    34 
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc

    r3392 r9234  
    4949    CreateNN();
    5050    InitGeometry();
     51}
     52
     53// --------------------------------------------------------------------------
     54//
     55// Check if the photon which is flying along the trajectory u has passed
     56// (or will pass) the frame of the camera (and consequently get
     57// absorbed). The position p and direction u must be in the
     58// telescope coordinate frame, which is z parallel to the focal plane,
     59// x to the right and y upwards, looking from the mirror towards the camera.
     60//
     61Bool_t MGeomCamMagic::HitFrame(MQuaternion p, const MQuaternion &u) const
     62{
     63    // z is defined from the mirror (0) to the camera (z>0).
     64    // Thus we just propagate to the focal plane (z=fDist)
     65    //p -= 1700./u.Z()*u;
     66    p.PropagateZ(u, GetCameraDist()*100);
     67
     68    return TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65;
     69}
     70
     71// --------------------------------------------------------------------------
     72//
     73// Check if the position given in the focal plane (so z can be ignored)
     74// is a position which might hit the detector. It is meant to be a rough
     75// and fast estimate not a precise calculation. All positions dicarded
     76// must not hit the detector. All positions accepted might still miss
     77// the detector.
     78//
     79Bool_t MGeomCamMagic::HitDetector(const MQuaternion &v) const
     80{
     81    return v.R()<60.2;
    5182}
    5283
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h

    r1458 r9234  
    1515    MGeomCamMagic(const char *name=NULL);
    1616
     17    Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const;
     18    Bool_t HitDetector(const MQuaternion &p) const;
     19
    1720    ClassDef(MGeomCamMagic, 1)          // Geometry class for the Magic camera
    1821};
Note: See TracChangeset for help on using the changeset viewer.