Changeset 4977
- Timestamp:
- 09/13/04 13:36:36 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4974 r4977 30 30 31 31 32 32 33 2004/09/13: Markus Gaug 33 34 … … 41 42 42 43 44 45 43 46 2004/09/13: Thomas Bretz 44 47 … … 69 72 - fixed number of bins 70 73 - remove first edge when finalizing 74 - added plots for lambda and NDF 71 75 72 76 * mjobs/MJStar.cc: … … 112 116 - removed some obsolete (empty) destructors 113 117 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 114 126 115 127 -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.cc
r4521 r4977 154 154 #endif 155 155 156 ClassImp(MVector3);157 156 ClassImp(MAstroCatalog); 158 157 159 158 using namespace std; 160 161 void MVector3::WriteBinary(ostream &out) const162 {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 }184 159 185 160 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mastro/MAstroCatalog.h
r4817 r4977 2 2 #define MARS_MAstroCatalog 3 3 4 #ifndef ROOT_TVector35 #include <TVector3.h>4 #ifndef MARS_MVector3 5 #include "MVector3.h" 6 6 #endif 7 7 #ifndef ROOT_TList … … 16 16 class TArrayI; 17 17 class TGToolTip; 18 19 class MVector3 : public TVector320 {21 private:22 enum VectorType_t23 {24 kIsInvalid,25 kIsRaDec,26 kIsZdAz,27 kIsAltAz,28 kIsArbitrary29 };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-name63 };64 18 65 19 class MAstroCatalog : public TObject -
trunk/MagicSoft/Mars/mastro/Makefile
r4687 r4977 22 22 # mgeom (MAstroCamera): MGeomCam, MGeomMirror 23 23 24 SRCFILES = MAstro.cc \ 24 SRCFILES = MVector3.cc \ 25 MAstro.cc \ 25 26 MAstroSky2Local.cc \ 26 27 MAstroCatalog.cc \
Note:
See TracChangeset
for help on using the changeset viewer.