Changeset 4977


Ignore:
Timestamp:
09/13/04 13:36:36 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4974 r4977  
    3030
    3131
     32
    3233 2004/09/13: Markus Gaug
    3334 
     
    4142             
    4243
     44
     45
    4346 2004/09/13: Thomas Bretz
    4447
     
    6972     - fixed number of bins
    7073     - remove first edge when finalizing
     74     - added plots for lambda and NDF
    7175
    7276   * mjobs/MJStar.cc:
     
    112116     - removed some obsolete (empty) destructors
    113117
     118   * mastro/MVector3.[h,cc]:
     119     - added from MAstroCatalog
     120
     121   * mastro/MAstroCatalog.[h,cc]:
     122     - removed MVector3
     123
     124   * mastro/Makefile:
     125     - added MVector3
    114126
    115127
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc

    r4521 r4977  
    154154#endif
    155155
    156 ClassImp(MVector3);
    157156ClassImp(MAstroCatalog);
    158157
    159158using namespace std;
    160 
    161 void MVector3::WriteBinary(ostream &out) const
    162 {
    163     const Double_t t = Theta();
    164     const Double_t p = Phi();
    165     const Float_t  m = Mag();
    166     out.write((char*)&t, 8);
    167     out.write((char*)&p, 8);
    168     out.write((char*)&m, 4);
    169     out << fName << endl;
    170 }
    171 
    172 void MVector3::ReadBinary(istream &in)
    173 {
    174     Double_t t, p;
    175     Float_t  m;
    176 
    177     in.read((char*)&t, 8);
    178     in.read((char*)&p, 8);
    179     in.read((char*)&m, 4);
    180     fName.ReadLine(in);
    181 
    182     SetMagThetaPhi(m, t, p);
    183 }
    184159
    185160// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mastro/MAstroCatalog.h

    r4817 r4977  
    22#define MARS_MAstroCatalog
    33
    4 #ifndef ROOT_TVector3
    5 #include <TVector3.h>
     4#ifndef MARS_MVector3
     5#include "MVector3.h"
    66#endif
    77#ifndef ROOT_TList
     
    1616class TArrayI;
    1717class TGToolTip;
    18 
    19 class MVector3 : public TVector3
    20 {
    21 private:
    22     enum VectorType_t
    23     {
    24         kIsInvalid,
    25         kIsRaDec,
    26         kIsZdAz,
    27         kIsAltAz,
    28         kIsArbitrary
    29     };
    30 
    31     VectorType_t fType;
    32 
    33     TString fName;
    34 
    35 public:
    36     MVector3() { fType=kIsInvalid; }
    37     MVector3(const TVector3 &v3) : TVector3(v3) { fType=kIsArbitrary; }
    38     Double_t Magnitude() const { return -2.5*TMath::Log10(Mag()); }
    39 
    40     void SetRaDec(Double_t ra, Double_t dec, Double_t mag=0)
    41     {
    42         fType = kIsRaDec;
    43         SetMagThetaPhi(pow(10, -mag/2.5), TMath::Pi()/2-dec, ra);
    44     }
    45     void SetName(const TString &str) { fName = str.Strip(TString::kBoth); }
    46     void SetZdAz(Double_t zd, Double_t az, Double_t mag=0)
    47     {
    48         fType = kIsZdAz;
    49         SetMagThetaPhi(pow(10, -mag/2.5), zd, az);
    50     }
    51     void SetAltAz(Double_t alt, Double_t az, Double_t mag=0)
    52     {
    53         fType = kIsAltAz;
    54         SetMagThetaPhi(pow(10, -mag/2.5), TMath::Pi()/2-alt, az);
    55     }
    56 
    57     const char *GetName() const { return fName; }
    58 
    59     void WriteBinary(ostream &out) const;
    60     void ReadBinary(istream &in);
    61 
    62     ClassDef(MVector3, 1) // A specialized TVector3 storing a star-name
    63 };
    6418
    6519class MAstroCatalog : public TObject
  • trunk/MagicSoft/Mars/mastro/Makefile

    r4687 r4977  
    2222# mgeom (MAstroCamera): MGeomCam, MGeomMirror
    2323
    24 SRCFILES = MAstro.cc \
     24SRCFILES = MVector3.cc \
     25           MAstro.cc \
    2526           MAstroSky2Local.cc \
    2627           MAstroCatalog.cc \
Note: See TracChangeset for help on using the changeset viewer.