Changeset 8337
- Timestamp:
- 02/28/07 13:34:10 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8336 r8337 19 19 -*-*- END OF LINE -*-*- 20 20 21 2007/02/28 Thomas Bretz 22 23 * macros/tutorials/mirrordelay.C: 24 - fixed the formula for the spherical mirror 25 - fixed the calculation of the time-delay 26 27 * mastro/MObservatory.[h,cc]: 28 - added constructors and functions to set the observatory location 29 manually 30 31 * mbase/MTime.[h,cc]: 32 - added constructor to construct MTime by date 33 - added AsDouble for new root streamers (allowing to view MTime in 34 a TBrowser) 35 - added GetRootDatime to return TDatime object 36 37 * mcalib/MCalibrateData.cc: 38 - added more meaningful output in case a conversion factor exceeds a limit 39 40 41 21 42 2007/02/26 Daniela Dorner 22 43 -
trunk/MagicSoft/Mars/macros/tutorials/mirrordelay.C
r8322 r8337 25 25 void mirrordelay() 26 26 { 27 TF1 fpar("Parab", " [0]*x*x");28 TF1 fsph("Sphere", "-sqrt( [0]*[0] - x*x)+[0]");27 TF1 fpar("Parab", "x*x/(4*[0])"); 28 TF1 fsph("Sphere", "-sqrt(4*[0]*[0] - x*x) + 2*[0]"); 29 29 30 30 Double_t F = 4.92; // Fokallaenge = 1/4a 31 31 Double_t D = 4.5; // Mirror Diameter 32 32 Double_t x = 1.85; // incident point for photon 33 33 34 34 fsph.SetRange(-D*0.55, D*0.55); 35 35 fpar.SetRange(-D*0.55, D*0.55); 36 36 37 fpar.SetParameter(0, 1./(4*F));37 fpar.SetParameter(0, F); 38 38 fsph.SetParameter(0, F); 39 39 … … 79 79 TLegend leg(0.40, 0.6, 0.60, 0.85);//, "NDC"); 80 80 81 TF1 fdel("Diff", "(Sphere-Parab+TMath::Hypot(x-0, Parab-[0])-[0])/3e8*1e9");82 fdel.SetRange(-D*0.55, D*0.55);83 fdel.SetLineWidth(2);84 85 81 for (int i=-2; i<3; i++) 86 82 { 83 // Make sure to set the parameters BEFORE reusing the function! 84 fsph.SetParameter(0, F+i*0.10*F); 85 fpar.SetParameter(0, F+i*0.10*F); 87 86 87 TF1 fdel1("Diff1", "Sphere-Parab"); 88 TF1 fdel2("Diff2", "TMath::Hypot(x-0, Parab-[0])-TMath::Hypot(x-0, Sphere-[0])"); 89 fdel2.SetParameter(0, F+i*0.10*F); 90 91 TF1 fdel("Diff", "(Diff1+Diff2)/3e8*1e9"); 92 fdel.SetRange(-D*0.55, D*0.55); 93 fdel.SetLineWidth(2); 88 94 fdel.SetParameter(0, F+i*0.10*F); 95 89 96 fdel.SetLineColor(kBlack+(abs(i)==2?3:abs(i))); 90 97 if (i<0) … … 98 105 99 106 f->GetXaxis()->SetTitle("x [m]"); 100 f->GetYaxis()->SetTitle("Delay \\Delta t [ns]");107 f->GetYaxis()->SetTitle("Delay \\Delta t [ns]"); 101 108 f->GetXaxis()->CenterTitle(); 102 109 -
trunk/MagicSoft/Mars/mastro/MObservatory.cc
r8324 r8337 53 53 } 54 54 55 // -------------------------------------------------------------------------- 56 // 57 // Default constructor sets name and title of instace. 58 // Default location is kMagic1 59 // 55 60 MObservatory::MObservatory(const char *name, const char *title) 56 61 { … … 60 65 } 61 66 67 // -------------------------------------------------------------------------- 68 // 69 // For example "MObservator(MObservatory::kMagic1)" 70 // 62 71 MObservatory::MObservatory(LocationName_t key, const char *name, const char *title) 63 72 { … … 65 74 66 75 SetLocation(key); 76 } 77 78 // -------------------------------------------------------------------------- 79 // 80 // Calls SetLocation 81 // 82 MObservatory::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 // 93 MObservatory::MObservatory(Double_t lon, Double_t lat, Double_t h, const char *name) 94 { 95 Init(); 96 97 SetLocation(lon, lat, h, name); 67 98 } 68 99 … … 106 137 } 107 138 139 // -------------------------------------------------------------------------- 140 // 141 // Longitude/Latitude [rad] 142 // Height [m] 143 // 144 void 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 108 157 void MObservatory::Print(Option_t *) const 109 158 { -
trunk/MagicSoft/Mars/mastro/MObservatory.h
r8066 r8337 32 32 Double_t fHeight; //! [m] height of observatory 33 33 34 void Init(const char *name , const char *title);34 void Init(const char *name=NULL, const char *title=NULL); 35 35 36 36 public: 37 37 MObservatory(const char *name=NULL, const char *title=NULL); 38 38 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>"); 39 41 40 42 void Copy(TObject &obj) const … … 50 52 51 53 void SetLocation(LocationName_t name); 54 void SetLocation(Double_t lon, Double_t lat, Double_t h=0, const char *name=NULL); 52 55 53 56 void Print(Option_t *o=0) const; -
trunk/MagicSoft/Mars/mbase/MTime.cc
r7550 r8337 108 108 // -------------------------------------------------------------------------- 109 109 // 110 // Constructor. Calls Set(y, m, d, h, min, s, ms, ns). 111 // To check validity test for (*this)==MTime() 112 // 113 MTime::MTime(UShort_t y, Byte_t m, Byte_t d, Byte_t h, Byte_t min, Byte_t s, UShort_t ms, UInt_t ns) 114 { 115 Set(y, m, d, h, min, s, ms, ns); 116 } 117 118 // -------------------------------------------------------------------------- 119 // 110 120 // Return date as year(y), month(m), day(d) 111 121 // … … 218 228 { 219 229 return (ULong_t)((GetMjd()-49718)*kDay); 230 } 231 232 // -------------------------------------------------------------------------- 233 // 234 // Return a time which is expressed in seconds since 01/01/1970 0:00h 235 // This is compatible with root's definition used in the constructor of 236 // TDatime. 237 // 238 TDatime MTime::GetRootDatime() const 239 { 240 return TDatime((UInt_t)((GetMjd()-40587)*kDay/1000)); 220 241 } 221 242 -
trunk/MagicSoft/Mars/mbase/MTime.h
r8066 r8337 64 64 } 65 65 MTime(Double_t mjd); 66 MTime(UShort_t y, Byte_t m, Byte_t d, Byte_t h=13, Byte_t min=0, Byte_t s=0, UShort_t ms=0, UInt_t ns=0); 66 67 MTime(const MTime& t) : MParContainer(), fMjd(t.fMjd), fTime(t.fTime), fNanoSec(t.fNanoSec) 67 68 { 68 69 Init(NULL, NULL); 69 70 } 71 72 //static Int_t Hour() { return 3600; } 73 //static Int_t Day() { return 3600;*24 } 70 74 71 75 void operator=(const MTime &t) … … 108 112 void GetDateOfSunrise(UShort_t &y, Byte_t &m, Byte_t &d) const; 109 113 TTime GetRootTime() const; 114 TDatime GetRootDatime() const; 110 115 Double_t GetAxisTime() const; 111 116 Double_t GetMoonPhase() const; … … 143 148 operator double() const; //[s] 144 149 double operator()() const; //[s] 150 151 Double_t AsDouble() const { return GetMjd(); } 152 //const char *AsString() const { return GetString(); } 153 //const char *AsSQLString() const { return GetSqldateTime(); } 145 154 146 155 // Calculation functions -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r8277 r8337 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.6 3 2007-01-29 13:03:43tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.64 2007-02-28 13:29:52 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 723 723 calibConv = -1.; 724 724 calibFFactor = -1.; 725 *fLog << warn << GetDescriptor() 726 << ": WARNING - Conversion factor of Pixel " << pixidx << " out of range... set to 0. " << endl; 725 *fLog << warn << GetDescriptor() << ": WARNING - "; 726 *fLog << "Conversion factor " << calibConv << " of Pixel " << pixidx << " out of range ]"; 727 *fLog << fCalibConvMinLimit << "," << fCalibConvMaxLimit << "[... set to 0. " << endl; 727 728 } 728 729 cpix.SetCalibConst(calibConv); … … 733 734 if (skip>fGeomCam->GetNumPixels()*0.9) 734 735 { 735 *fLog << warn << GetDescriptor()736 << ": WARNING -GetConversionFactor has skipped more than 90% of the pixels... abort." << endl;736 *fLog << err << GetDescriptor() << ": ERROR - "; 737 *fLog << "GetConversionFactor has skipped more than 90% of the pixels... abort." << endl; 737 738 return kFALSE; 738 739 }
Note:
See TracChangeset
for help on using the changeset viewer.