Changeset 9259 for trunk/MagicSoft


Ignore:
Timestamp:
01/25/09 13:41:19 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mgeom
Files:
8 edited

Legend:

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

    r9219 r9259  
    244244        const UInt_t  s = pix.GetAidx();
    245245
    246         const Float_t d = pix.GetD();
     246        const Float_t d = pix.GetT();
    247247        const Float_t r = pix.GetDist();
    248248
     
    340340// --------------------------------------------------------------------------
    341341//
     342// The maximum possible distance from the origin.
     343//
     344Float_t MGeomCam::GetMaxRadius() const
     345{
     346    return fMaxRadius[0];
     347}
     348
     349// --------------------------------------------------------------------------
     350//
     351// The minimum possible distance from the origin.
     352//
     353Float_t MGeomCam::GetMinRadius() const
     354{
     355    return fMinRadius[0];
     356}
     357
     358// --------------------------------------------------------------------------
     359//
    342360// Have to call the radii of the subcameras starting to count from 1
    343361//
    344362Float_t MGeomCam::GetMaxRadius(const Int_t i) const
    345363{
    346     return i<-1 || i>=(Int_t)GetNumAreas() ? -1 : fMaxRadius[i+1];
     364    return i<0 || i>=(Int_t)GetNumAreas() ? -1 : fMaxRadius[i+1];
    347365}
    348366
     
    353371Float_t MGeomCam::GetMinRadius(const Int_t i) const
    354372{
    355     return i<-1 || i>=(Int_t)GetNumAreas() ? -1 : fMinRadius[i+1];
     373    return i<0 || i>=(Int_t)GetNumAreas() ? -1 : fMinRadius[i+1];
    356374}
    357375
     
    379397    // The const_cast is necessary to support older root version
    380398    return i<fNumPixels ? const_cast<TArrayF&>(fPixRatioSqrt)[i] : 0;
     399}
     400
     401// --------------------------------------------------------------------------
     402//
     403// Check if the position given in the focal plane (so z can be ignored)
     404// is a position which might hit the detector. It is meant to be a rough
     405// and fast estimate not a precise calculation. All positions dicarded
     406// must not hit the detector. All positions accepted might still miss
     407// the detector.
     408//
     409Bool_t MGeomCam::HitDetector(const MQuaternion &v, Double_t offset) const
     410{
     411    const Double_t max = fMaxRadius[0]/10+offset; // cm --> mm
     412    return v.R2()<max*max;
    381413}
    382414
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.h

    r9234 r9259  
    7878    UInt_t  GetNumPixels()  const { return fNumPixels; }
    7979
    80     Float_t GetMaxRadius(const Int_t i=-1) const;
    81     Float_t GetMinRadius(const Int_t i=-1) const;
     80    Float_t GetMaxRadius() const;
     81    Float_t GetMinRadius() const;
     82    Float_t GetMaxRadius(const Int_t i) const;
     83    Float_t GetMinRadius(const Int_t i) const;
    8284
    8385    Float_t GetDist(UShort_t i, UShort_t j=0) const;
     
    113115
    114116    virtual Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const { return kFALSE; }
    115     virtual Bool_t HitDetector(const MQuaternion &p) const { return kFALSE; }
     117    virtual Bool_t HitDetector(const MQuaternion &p, Double_t offset=0) const;
    116118
    117119    void Print(Option_t *opt=NULL) const;
  • trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.cc

    r9234 r9259  
    133133// --------------------------------------------------------------------------
    134134//
    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 //
    143 Bool_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 //
    151135// Calculate in the direction 0-5 (kind of sector) in the ring-th ring
    152136// the x and y coordinate of the i-th pixel. The unitx are unity,
  • trunk/MagicSoft/Mars/mgeom/MGeomCamDwarf.h

    r9234 r9259  
    2929
    3030    Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const;
    31     Bool_t HitDetector(const MQuaternion &p) const;
    3231
    3332    ClassDef(MGeomCamDwarf, 1) // Geometry class for the Dwarf camera
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc

    r9234 r9259  
    6767
    6868    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 //
    79 Bool_t MGeomCamMagic::HitDetector(const MQuaternion &v) const
    80 {
    81     return v.R()<60.2;
    8269}
    8370
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.h

    r9234 r9259  
    1616
    1717    Bool_t HitFrame(MQuaternion p, const MQuaternion &u) const;
    18     Bool_t HitDetector(const MQuaternion &p) const;
    1918
    2019    ClassDef(MGeomCamMagic, 1)          // Geometry class for the Magic camera
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.cc

    r9235 r9259  
    6666using namespace std;
    6767
    68 const Float_t MGeomPix::gsTan30 = tan(30/kRad2Deg);
    69 const Float_t MGeomPix::gsTan60 = tan(60/kRad2Deg);
     68const Float_t MGeomPix::gsTan30 = TMath::Tan(30/kRad2Deg); // sqrt(3)/3
     69const Float_t MGeomPix::gsTan60 = TMath::Tan(60/kRad2Deg); // sqrt(3)
    7070
    7171// --------------------------------------------------------------------------
     
    7373// Initializes one pixel
    7474//
    75 MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s, UInt_t a)
     75MGeomPix::MGeomPix(Float_t x, Float_t y, Float_t r, UInt_t s, UInt_t a) : fUserBits(0)
    7676{
    7777    //  default constructor
  • trunk/MagicSoft/Mars/mgeom/MGeomPix.h

    r9235 r9259  
    99class TVector2;
    1010class TOrdCollection;
     11
    1112
    1213class MGeomPix : public MParContainer
     
    7576    Float_t GetX() const  { return fX; }
    7677    Float_t GetY() const  { return fY; }
    77     Float_t GetD() const  { return fD; }
     78    Float_t GetD() const  { return fD; }         // Distance between two parellel sides
    7879    Float_t GetL() const  { return fD*gsTan30; } // Length of one of the parallel sides
     80    Float_t GetT() const  { return fD/gsTan60; } // Distance between two opposite edges (traverse)
    7981    UInt_t  GetSector() const { return fSector; }
    8082
     
    101103    //Double_t CalcOverlapArea(const MGeomPix &cam) const;
    102104
     105    //TObject *GetGraphics() { return new MHexagon(*this); }
     106
    103107    ClassDef(MGeomPix, 4) // Geometry class describing the geometry of one pixel
    104108};
Note: See TracChangeset for help on using the changeset viewer.