Changeset 4433 for trunk/MagicSoft
- Timestamp:
- 07/30/04 12:19:16 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4430 r4433 19 19 20 20 -*-*- END OF LINE -*-*- 21 22 2004/07/30: Robert Wagner 23 24 * mastro/MAstroCamera.[h,cc] 25 - Added method FillStarList() which fills a TList with objects 26 of type MStarLocalPos for all stars found from the catalog 27 matching specified criteria (FOV, magnitude limit, position) 28 29 * mtemp/MStarLocalPos.[h,cc] 30 - Added handling of the minuit error matrix elements to 31 MStarLocalPos::MSetFitValues 32 - Added member variables to hold error matrix elements 33 - Added getters for error matrix elements 34 - Expected star position is painted by Paint, too. 35 - Error matrix elements are printed by Print, too. 36 21 37 22 38 2004/07/28: Javi Lopez -
trunk/MagicSoft/Mars/mastro/MAstroCamera.cc
r4058 r4433 11 11 ! * provided that the above copyright notice appear in all copies and 12 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 13 ! * in supporting documentation. It is provided "as is" without expressed 14 14 ! * or implied warranty. 15 15 ! * … … 45 45 // Algorithm: 46 46 // ---------- 47 // The cal uclation of the position of the reflection in the camera is47 // The calculation of the position of the reflection in the camera is 48 48 // done by: 49 49 // - Rotation of the star-field such that the camera is looking into … … 92 92 // HOW TO GET RID OF IT? Move MHCamera to mgeom? 93 93 94 //#include "MStarLocalPos.h"94 #include "MStarLocalPos.h" 95 95 96 96 ClassImp(MAstroCamera); … … 133 133 if (arr.GetClass()!=MGeomMirror::Class()) 134 134 { 135 136 135 cout << "ERROR - TClonesArray doesn't contain objects of type MGeomMirror... ignored." << endl; 136 return; 137 137 } 138 138 … … 148 148 149 149 } 150 150 151 151 152 // -------------------------------------------------------------------------- … … 301 302 if (!fTime || !fObservatory || !fMirrors) 302 303 { 303 304 cout << "Missing data..." << endl; 304 305 return; 305 306 } … … 405 406 mean *= 1./num; 406 407 DrawStar(mean(0), mean(1), *radec, hasmean?kBlack:-1, Form("x=%.1fmm y=%.1fmm", mean(0), mean(1)), resize); 407 408 408 if (hasnull) 409 409 { … … 418 418 } 419 419 420 // -------------------------------------------------------------------------- 421 // 422 // Options: 423 // 424 // '*' Draw the mean of the reflections on all mirrors 425 // '.' Draw a dot for the reflection on each individual mirror 426 // 'h' To create a TH2D of the star-light which is displayed 427 // 'c' Use the underlaying MHCamera as histogram 428 // '0' Draw the reflection on a virtual perfect mirror 429 // 430 // If the Pad contains an object MHCamera of type MHCamera it is used. 431 // Otherwise a new object is created. 432 // 433 /*void MAstroCamera::FillStarList(TList *list) 434 { 435 list->SetOwner(); 436 list->Delete(); 437 438 if (!fTime || !fObservatory || !fMirrors || !list) 439 { 440 cout << "Missing data..." << endl; 441 return; 442 } 443 444 const MAstroSky2Local s2l(*fTime, *fObservatory); 445 const TRotation trans(AlignCoordinates(rot*fRaDec)); 446 447 // Return the correct rotation matrix 448 const TRotation rot = trans*s2l; 449 420 421 // -------------------------------------------------------------------------- 422 // 423 // Fills a TList with all stars found under current presets 424 // (Coordinates, Time, FOV). The list is emptied before the filling is done. 425 // Currently, the mean spot when averaging over all mirrors is used. 426 // 427 void MAstroCamera::FillStarList(TList* list) 428 { 429 if (!fTime || !fObservatory || !fMirrors) { 430 cout << "Missing data..." << endl; 431 return; 432 } 433 434 if (!list) { 435 cout << "Missing storage list for stars found..." << endl; 436 return; 437 } 438 439 list->Delete(); // dump old list... (otherwise the same stars would pile up) 440 441 const TRotation rot(GetGrid(kTRUE)); 450 442 MVector3 *radec; 451 443 TIter Next(&fList); 452 444 453 while ((radec=(MVector3*)Next())) 454 { 455 const Double_t mag = radec->Magnitude(); 456 457 TVector3 mean; 458 TVector3 star(*radec); 459 star *= rot; 460 const TVector3 spot = fMirror0->GetReflection(star, fGeom->GetCameraDist())*1000; 461 462 MStarLocalPos *starpos = new MStarLocalPos; 463 starpos->SetExpValues(mag,mean(0),mean(1)); 464 list->Add(starpos); 465 } 466 // For MAGIC the distance of the mean of the light distribution 467 // to the Mirror0 reflection of the star (Abberation) can be 468 // expressed as: dr = (0.0713 +/- 0.0002) * r = r/14.03 469 // with r = hypot(mean(0), mean(1)) 470 } 471 */ 445 while ((radec=(MVector3*)Next())) { 446 const Double_t mag = radec->Magnitude(); 447 if (mag>GetLimMag()) 448 continue; 449 TVector3 star(*radec); 450 // Rotate Star into telescope system 451 star *= rot; 452 TVector3 mean; 453 Int_t num = 0; 454 MGeomMirror *mirror = 0; 455 TIter NextM(fMirrors); 456 while ((mirror=(MGeomMirror*)NextM())) { 457 const TVector3 spot = mirror->GetReflection(star, fGeom->GetCameraDist())*1000; 458 mean += spot; 459 num++; 460 } 461 mean *= 1./num; 462 MStarLocalPos *starpos = new MStarLocalPos; 463 starpos->SetExpValues(mag,mean(0),mean(1)); 464 465 TString name = radec->GetName(); 466 if (name.Length()==0) { 467 starpos->SetName("unknown"); 468 } else { 469 starpos->SetName(radec->GetName()); 470 } 471 list->Add(starpos); 472 } 473 } 472 474 473 475 // ------------------------------------------------------------------------ -
trunk/MagicSoft/Mars/mastro/MAstroCamera.h
r4214 r4433 35 35 void SetGeom(const MGeomCam &cam); 36 36 37 void FillStarList(TList *list); 38 37 39 void GetDiffZdAz(Double_t x, Double_t y, Double_t &dzd, Double_t &daz); 38 40 -
trunk/MagicSoft/Mars/mtemp/MStarLocalPos.cc
r4294 r4433 11 11 ! * provided that the above copyright notice appear in all copies and 12 12 ! * that both that copyright notice and this permission notice appear 13 ! * in supporting documentation. It is provided "as is" without express 13 ! * in supporting documentation. It is provided "as is" without expressed 14 14 ! * or implied warranty. 15 15 ! * … … 17 17 ! 18 18 ! Author(s): Javier López , 4/2004 <mailto:jlopez@ifae.es> 19 ! Author(s): Robert Wagner, 7/2004 <mailto:rwagner@mppmu.mpg.de> 19 20 ! 20 21 ! Copyright: MAGIC Software Development, 2000-2004 … … 25 26 26 27 #include <TEllipse.h> 28 #include <TMarker.h> 27 29 28 30 #include "MLog.h" … … 101 103 } 102 104 105 void MStarLocalPos::SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, Float_t chiSquare, Int_t ndof, Float_t xx, Float_t xy, Float_t yy) 106 { 107 SetFitValues(mag, max, x, y, sigmaMinorAxis, sigmaMajorAxis, chiSquare, ndof); 108 fXXErr = xx; 109 fYYErr = yy; 110 fXYErr = xy; 111 } 112 113 103 114 // -------------------------------------------------------------------------- 104 115 // … … 108 119 { 109 120 //Print a cross in the expected position 121 122 TMarker mexp(fXExp, fYExp, 29); 123 mexp.SetMarkerSize(3); 124 mexp.SetMarkerColor(94); 125 mexp.Paint(); 110 126 111 127 if (fSigmaMinorAxisCalc>0. && fSigmaMajorAxisCalc>0.) 112 128 { 113 129 TEllipse ecalc(fMeanXCalc, fMeanYCalc, fSigmaMinorAxisCalc, fSigmaMajorAxisCalc, 0, 360, 0); 114 ecalc.SetLineWidth( 2);130 ecalc.SetLineWidth(3); 115 131 ecalc.SetLineColor(kRed); 116 132 ecalc.Paint(); … … 120 136 { 121 137 TEllipse efit(fMeanXFit, fMeanYFit, fSigmaMinorAxisFit, fSigmaMajorAxisFit, 0, 360, 0); 122 efit.SetLineWidth( 2);138 efit.SetLineWidth(3); 123 139 efit.SetLineColor(kBlack); 124 140 efit.Paint(); … … 129 145 { 130 146 TString o = opt; 147 148 if (o.Contains("name", TString::kIgnoreCase) || opt == NULL) 149 { 150 *fLog << inf << "Star Name: \"" << this->GetName() << "\"" << endl; 151 } 152 131 153 132 154 if (o.Contains("mag", TString::kIgnoreCase) || opt == NULL) 133 155 { 156 134 157 *fLog << inf << "Star maginitude:" << endl; 135 158 *fLog << inf << " Expected \t" << setw(4) << fMagExp << endl; … … 165 188 *fLog << inf << " ChiSquare/Ndof \t " << setw(3) << fChiSquare << "/" << fNdof << endl; 166 189 } 190 191 if (o.Contains("err", TString::kIgnoreCase) || opt == NULL) 192 { 193 *fLog << inf << "Minuit Error Matrix:" << endl; 194 *fLog << inf << " xx,xy,yy \t " << setw(3) << fXXErr << ", " << fXYErr << ", " << fYYErr << endl; 195 } 196 197 167 198 } -
trunk/MagicSoft/Mars/mtemp/MStarLocalPos.h
r4294 r4433 34 34 Float_t fSigmaMajorAxisFit; //[mm] 35 35 Float_t fChiSquare; 36 Float_t fXXErr; //minuit error matrix elements 37 Float_t fXYErr; 38 Float_t fYYErr; 36 39 Int_t fNdof; 37 40 … … 66 69 Float_t GetSigmaMinorAxis() {return fSigmaMinorAxisFit!=0?fSigmaMinorAxisFit:fSigmaMinorAxisCalc;} 67 70 Float_t GetSigmaMajorAxis() {return fSigmaMajorAxisFit!=0?fSigmaMajorAxisFit:fSigmaMajorAxisCalc;} 71 72 Float_t GetXXErr() {return fXXErr;} 73 Float_t GetXYErr() {return fXYErr;} 74 Float_t GetYYErr() {return fYYErr;} 68 75 69 76 void Reset(); … … 72 79 void SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis); 73 80 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, Float_t chi, Int_t ndof); 81 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, Float_t chi, Int_t ndof, Float_t xx, Float_t xy, Float_t yy); 74 82 75 83 void Paint(Option_t *opt=NULL);
Note:
See TracChangeset
for help on using the changeset viewer.