Changeset 9371 for trunk/MagicSoft


Ignore:
Timestamp:
03/02/09 09:05:19 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9370 r9371  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2009/03/02 Thomas Bretz
     21
     22   * mgeom/MGeomCam.[h,cc], msimreflector/MMirror.h,
     23     msimreflector/MMirrorDisk.[h,cc], msimreflector/MMirrorHex.[h,cc],
     24     msimreflector/MMirrorSquare.[h,cc], msimreflector/MReflector.[h,cc]:
     25     - added GetA member function
     26
     27
     28
    2029 2009/03/01 Thomas Bretz
    2130
  • trunk/MagicSoft/Mars/msimreflector/MMirror.cc

    r9332 r9371  
    5757//
    5858//    The action should coincide with what is painted in Paint()
     59//
     60// ------------------------------------------------------------------------
     61//
     62// Double_t GetA() const
     63//
     64//     Return the reflective area of the mirror
     65//
     66// ------------------------------------------------------------------------
     67//
     68// Double_t GetMaxR() const
     69//
     70//     Return the maximum distance of a reflective point from the
     71//     mirror center
    5972//
    6073// ------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/msimreflector/MMirror.h

    r9332 r9371  
    6262
    6363    virtual Double_t GetMaxR() const=0;// { return TMath::Max(fMaxRX, fMaxRY); }
     64    virtual Double_t GetA() const=0;// { return TMath::Max(fMaxRX, fMaxRY); }
    6465
    6566    TVector3 SimPSF(const TVector3 &n, Double_t F, Double_t psf) const;
  • trunk/MagicSoft/Mars/msimreflector/MMirrorDisk.cc

    r9332 r9371  
    3434#include <stdlib.h> // atof (Ubuntu 8.10)
    3535
     36#include <TMath.h>
    3637#include <TObjArray.h>
    3738
     
    4647
    4748using namespace std;
     49
     50// --------------------------------------------------------------------------
     51//
     52// Return the aread of the disk: Pi*r^2
     53//
     54Double_t MMirrorDisk::GetA() const
     55{
     56    return TMath::Pi()*fR*fR;
     57}
    4858
    4959// ------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/msimreflector/MMirrorDisk.h

    r9312 r9371  
    1616    // MMirror
    1717    Double_t GetMaxR() const { return fR; }
     18    Double_t GetA() const;
    1819
    1920    Bool_t CanHit(const MQuaternion &p) const;
  • trunk/MagicSoft/Mars/msimreflector/MMirrorHex.cc

    r9332 r9371  
    5252const Double_t MMirrorHex::fgCos60 = TMath::Cos(60*TMath::DegToRad());
    5353const Double_t MMirrorHex::fgSin60 = TMath::Sin(60*TMath::DegToRad());
     54
     55// --------------------------------------------------------------------------
     56//
     57// Return the aread of the hexagon: d^2*sin(60)
     58//
     59Double_t MMirrorHex::GetA() const
     60{
     61    return fD*fD*fgSin60*4;
     62}
    5463
    5564// ------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/msimreflector/MMirrorHex.h

    r9312 r9371  
    2323    // MMirror
    2424    Double_t GetMaxR() const { return fMaxR; }
     25    Double_t GetA() const;
    2526
    2627    Bool_t CanHit(const MQuaternion &p) const;
  • trunk/MagicSoft/Mars/msimreflector/MMirrorSquare.cc

    r9332 r9371  
    4949using namespace std;
    5050
     51// --------------------------------------------------------------------------
     52//
     53// Return the max radius, i.e. the distance of the edges to zje center
     54//
    5155Double_t MMirrorSquare::GetMaxR() const
    5256{
    5357    return TMath::Sqrt(2.)*fSideLength;
     58}
     59
     60// --------------------------------------------------------------------------
     61//
     62// Return the aread of the square: l^2
     63//
     64Double_t MMirrorSquare::GetA() const
     65{
     66    return fSideLength*fSideLength*4;
    5467}
    5568
  • trunk/MagicSoft/Mars/msimreflector/MMirrorSquare.h

    r9312 r9371  
    1616    // MMirror
    1717    Double_t GetMaxR() const;
     18    Double_t GetA() const;
    1819
    1920    Bool_t HasHit(const MQuaternion &p) const;
  • trunk/MagicSoft/Mars/msimreflector/MReflector.cc

    r9332 r9371  
    9595// --------------------------------------------------------------------------
    9696//
     97// Return the total Area of all mirrors. Note, that it is recalculated
     98// with any call.
     99//
     100Double_t MReflector::GetA() const
     101{
     102    Double_t A = 0;
     103
     104    TIter Next(&fMirrors);
     105    MMirror *m = 0;
     106    while ((m=static_cast<MMirror*>(Next())))
     107        A += m->GetA();
     108
     109    return A;
     110}
     111
     112// --------------------------------------------------------------------------
     113//
    97114// Get the pointer to the first mirror. This is a very dangerous way of
    98115// access, but the fastest possible. because it is the most often called
  • trunk/MagicSoft/Mars/msimreflector/MReflector.h

    r9332 r9371  
    4545
    4646    Double_t GetMaxR() const { return fMaxR; }
     47    Double_t GetA() const;
    4748
    4849    virtual Bool_t CanHit(const MQuaternion &p) const;
Note: See TracChangeset for help on using the changeset viewer.