Ignore:
Timestamp:
02/28/07 13:34:10 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mastro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mastro/MObservatory.cc

    r8324 r8337  
    5353}
    5454
     55// --------------------------------------------------------------------------
     56//
     57// Default constructor sets name and title of instace.
     58// Default location is kMagic1
     59//
    5560MObservatory::MObservatory(const char *name, const char *title)
    5661{
     
    6065}
    6166
     67// --------------------------------------------------------------------------
     68//
     69// For example "MObservator(MObservatory::kMagic1)"
     70//
    6271MObservatory::MObservatory(LocationName_t key, const char *name, const char *title)
    6372{
     
    6574
    6675    SetLocation(key);
     76}
     77
     78// --------------------------------------------------------------------------
     79//
     80// Calls SetLocation
     81//
     82MObservatory::MObservatory(Double_t lon, Double_t lat, const char *name)
     83{
     84    Init();
     85
     86    SetLocation(lon, lat, 0, name);
     87}
     88
     89// --------------------------------------------------------------------------
     90//
     91// Calls SetLocation
     92//
     93MObservatory::MObservatory(Double_t lon, Double_t lat, Double_t h, const char *name)
     94{
     95    Init();
     96
     97    SetLocation(lon, lat, h, name);
    6798}
    6899
     
    106137}
    107138
     139// --------------------------------------------------------------------------
     140//
     141// Longitude/Latitude [rad]
     142// Height             [m]
     143//
     144void MObservatory::SetLocation(Double_t lon, Double_t lat, Double_t h, const char *name)
     145{
     146    fLongitude = lon;
     147    fLatitude  = lat;
     148    fHeight    = h;
     149
     150    fSinLatitude = TMath::Sin(fLatitude);
     151    fCosLatitude = TMath::Cos(fLatitude);
     152
     153    if (name)
     154        fObservatoryName = name;
     155}
     156
    108157void MObservatory::Print(Option_t *) const
    109158{
  • trunk/MagicSoft/Mars/mastro/MObservatory.h

    r8066 r8337  
    3232    Double_t fHeight;                //! [m] height of observatory
    3333
    34     void Init(const char *name, const char *title);
     34    void Init(const char *name=NULL, const char *title=NULL);
    3535
    3636public:
    3737    MObservatory(const char *name=NULL, const char *title=NULL);
    3838    MObservatory(LocationName_t key, const char *name=NULL, const char *title=NULL);
     39    MObservatory(Double_t lon, Double_t lat, const char *name="<n/a>");
     40    MObservatory(Double_t lon, Double_t lat, Double_t h, const char *name="<n/a>");
    3941
    4042    void Copy(TObject &obj) const
     
    5052
    5153    void SetLocation(LocationName_t name);
     54    void SetLocation(Double_t lon, Double_t lat, Double_t h=0, const char *name=NULL);
    5255
    5356    void Print(Option_t *o=0) const;
Note: See TracChangeset for help on using the changeset viewer.