Changeset 4545 for trunk/MagicSoft/Mars/mtemp
- Timestamp:
- 08/09/04 15:48:03 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp
- Files:
-
- 7 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/MStarLocalPos.cc
r4433 r4545 16 16 ! 17 17 ! 18 ! Author(s): Javier López , 4/2004 <mailto:jlopez@ifae.es> 19 ! Author(s): Robert Wagner, 7/2004 <mailto:rwagner@mppmu.mpg.de> 18 ! Author(s): Javier López , 4/2004 <mailto:jlopez@ifae.es> 19 ! Robert Wagner, 7/2004 <mailto:rwagner@mppmu.mpg.de> 20 ! Wolfgang Wittek, 8/2004 <mailto:wittek@mppmu.mpg.de> 20 21 ! 21 22 ! Copyright: MAGIC Software Development, 2000-2004 … … 53 54 54 55 //Info from calculation 55 56 56 fMagCalc = 0.; 57 57 fMaxCalc = 0.; … … 61 61 fSigmaMajorAxisCalc = 0.; 62 62 63 //Info from fit 64 63 //Info from uncorrelated Gauss fit 65 64 fMagFit = 0.; 66 65 fMaxFit = 0.; … … 69 68 fSigmaMinorAxisFit = 0.; 70 69 fSigmaMajorAxisFit = 0.; 70 71 71 fChiSquare = 0.; 72 72 fNdof = 1; 73 74 //Info from correlated Gauss fit 75 fMagCGFit = 0.; 76 fMaxCGFit = 0.; 77 fMeanXCGFit = 0.; 78 fMeanYCGFit = 0.; 79 fSigmaXCGFit = 0.; 80 fSigmaYCGFit = 0.; 81 fCorrXYCGFit = 0.; 82 fXXErrCGFit = 0.; 83 fXYErrCGFit = 0.; 84 fYYErrCGFit = 0.; 85 86 fChiSquareCGFit = 0.; 87 fNdofCGFit = 1; 73 88 74 89 } … … 81 96 } 82 97 83 void MStarLocalPos::SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis) 98 void MStarLocalPos::SetCalcValues(Float_t mag, Float_t max, 99 Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis) 84 100 { 85 101 fMagCalc = mag; … … 91 107 } 92 108 93 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) 109 void MStarLocalPos::SetFitValues(Float_t mag, Float_t max, 110 Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, 111 Float_t chiSquare, Int_t ndof) 94 112 { 95 113 fMagFit = mag; … … 103 121 } 104 122 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) 123 void MStarLocalPos::SetFitValues(Float_t mag, Float_t max, 124 Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, 125 Float_t chiSquare, Int_t ndof, 126 Float_t xx, Float_t xy, Float_t yy) 106 127 { 107 128 SetFitValues(mag, max, x, y, sigmaMinorAxis, sigmaMajorAxis, chiSquare, ndof); … … 109 130 fYYErr = yy; 110 131 fXYErr = xy; 132 } 133 134 void MStarLocalPos::SetCGFitValues( 135 Float_t mag, Float_t max, Float_t x, Float_t y, 136 Float_t sigmaX, Float_t sigmaY, Float_t correlation, 137 Float_t xx, Float_t xy, Float_t yy, 138 Float_t chiSquare, Int_t ndof) 139 { 140 fMagCGFit = mag; 141 fMaxCGFit = max; 142 fMeanXCGFit = x; 143 fMeanYCGFit = y; 144 fSigmaXCGFit = sigmaX; 145 fSigmaYCGFit = sigmaY; 146 fCorrXYCGFit = correlation; 147 fXXErrCGFit = xx; 148 fXYErrCGFit = xy; 149 fYYErrCGFit = yy; 150 151 fChiSquareCGFit = chiSquare; 152 fNdofCGFit = ndof; 111 153 } 112 154 … … 119 161 { 120 162 //Print a cross in the expected position 121 122 163 TMarker mexp(fXExp, fYExp, 29); 123 164 mexp.SetMarkerSize(3); … … 129 170 TEllipse ecalc(fMeanXCalc, fMeanYCalc, fSigmaMinorAxisCalc, fSigmaMajorAxisCalc, 0, 360, 0); 130 171 ecalc.SetLineWidth(3); 131 ecalc.SetLineColor(k Red);172 ecalc.SetLineColor(kBlue); 132 173 ecalc.Paint(); 133 174 } 134 175 135 if (fSigmaMinorAxisFit>0. ||fSigmaMajorAxisFit>0.)176 if (fSigmaMinorAxisFit>0. && fSigmaMajorAxisFit>0.) 136 177 { 137 178 TEllipse efit(fMeanXFit, fMeanYFit, fSigmaMinorAxisFit, fSigmaMajorAxisFit, 0, 360, 0); … … 140 181 efit.Paint(); 141 182 } 183 184 if (fSigmaXCGFit>0. && fSigmaYCGFit>0.) 185 { 186 //Print a cross in the fitted position 187 //TMarker mCGFit(fMeanXCGFit, fMeanYCGFit, 3); 188 //mCGFit.SetMarkerSize(3); 189 //mCGFit.SetMarkerColor(1); 190 //mCGFit.Paint(); 191 192 Double_t cxx = fSigmaXCGFit*fSigmaXCGFit; 193 Double_t cyy = fSigmaYCGFit*fSigmaYCGFit; 194 Double_t d = cyy - cxx; 195 Double_t cxy = fCorrXYCGFit * fSigmaXCGFit * fSigmaYCGFit; 196 Double_t tandel; 197 if (cxy != 0.0) 198 tandel = ( d + sqrt(d*d + 4.0*cxy*cxy) ) / (2.0*cxy); 199 else 200 tandel = 0.0; 201 202 Double_t sindel = tandel / sqrt(1.0 + tandel*tandel); 203 Double_t delta = TMath::ASin(sindel); 204 205 Double_t major = (cxx + 2.0*tandel*cxy + tandel*tandel*cyy) 206 / (1.0 + tandel*tandel); 207 208 Double_t minor = (tandel*tandel*cxx - 2.0*tandel*cxy + cyy) 209 / (1.0 + tandel*tandel); 210 211 TEllipse efit(fMeanXCGFit, fMeanYCGFit, sqrt(major), sqrt(minor), 212 0, 360, delta*kRad2Deg); 213 efit.SetLineWidth(3); 214 efit.SetLineColor(kMagenta); 215 efit.Paint(); 216 } 142 217 } 143 218 … … 159 234 *fLog << inf << " Calcultated \t " << setw(4) << fMagCalc << endl; 160 235 *fLog << inf << " Fitted \t " << setw(4) << fMagFit << endl; 236 *fLog << inf << " CGFitted \t " << setw(4) << fMagCGFit << endl; 161 237 } 162 238 … … 164 240 { 165 241 *fLog << inf << "Star Maximum:" << endl; 166 *fLog << inf << " Calcultated \t " << setw(4) << fMaxCalc << " uA" << endl; 242 *fLog << inf << " Calcultated \t " << setw(4) << fMaxCalc << " uA" 243 << endl; 167 244 *fLog << inf << " Fitted \t " << setw(4) << fMaxFit << " uA" << endl; 245 *fLog << inf << " CGFitted \t " << setw(4) << fMaxCGFit << " uA" << endl; 168 246 } 169 247 … … 171 249 { 172 250 *fLog << inf << "Star position:" << endl; 173 *fLog << inf << " Expected \t X " << setw(4) << fXExp << " mm \tY " << setw(4) << fYExp << " mm" << endl; 174 *fLog << inf << " Calcultated \t X " << setw(4) << fMeanXCalc << " mm \tY " << setw(4) << fMeanYCalc << " mm" << endl; 175 *fLog << inf << " Fitted \t X " << setw(4) << fMeanXFit << " mm \tY " << setw(4) << fMeanYFit << " mm" << endl; 251 *fLog << inf << " Expected \t X " << setw(4) << fXExp 252 << " mm \tY " << setw(4) << fYExp << " mm" << endl; 253 *fLog << inf << " Calcultated \t X " << setw(4) << fMeanXCalc 254 << " mm \tY " << setw(4) << fMeanYCalc << " mm" << endl; 255 *fLog << inf << " Fitted \t X " << setw(4) << fMeanXFit 256 << " mm \tY " << setw(4) << fMeanYFit << " mm" << endl; 257 *fLog << inf << " CGFitted \t X " << setw(4) << fMeanXCGFit 258 << " mm \tY " << setw(4) << fMeanYCGFit << " mm" << endl; 176 259 } 177 260 … … 179 262 { 180 263 *fLog << inf << "Star size:" << endl; 181 *fLog << inf << " Calcultated \t X " << setw(4) << fSigmaMinorAxisCalc << " mm \tY " << setw(4) << fSigmaMajorAxisCalc << " mm" << endl; 182 *fLog << inf << " Fitted \t X " << setw(4) << fSigmaMinorAxisFit << " mm \tY " << setw(4) << fSigmaMajorAxisFit << " mm" << endl; 264 *fLog << inf << " Calcultated \t X " << setw(4) << fSigmaMinorAxisCalc 265 << " mm \tY " << setw(4) << fSigmaMajorAxisCalc << " mm" << endl; 266 *fLog << inf << " Fitted \t X " << setw(4) << fSigmaMinorAxisFit 267 << " mm \tY " << setw(4) << fSigmaMajorAxisFit << " mm" << endl; 268 *fLog << inf << " CGFitted \t X " << setw(4) << fSigmaXCGFit 269 << " mm \tY " << setw(4) << fSigmaYCGFit << " mm \t correlation" 270 << setw(4) << fCorrXYCGFit << endl; 183 271 } 184 272 … … 186 274 { 187 275 *fLog << inf << "Star Fit Quality:" << endl; 188 *fLog << inf << " ChiSquare/Ndof \t " << setw(3) << fChiSquare << "/" << fNdof << endl; 276 *fLog << inf << " ChiSquare/Ndof \t " << setw(3) << fChiSquare 277 << "/" << fNdof << endl; 278 279 *fLog << inf << "Star CGFit Quality:" << endl; 280 *fLog << inf << " ChiSquareCGFit/NdofCGFit \t " << setw(3) 281 << fChiSquareCGFit << "/" << fNdofCGFit << endl; 189 282 } 190 283 191 284 if (o.Contains("err", TString::kIgnoreCase) || opt == NULL) 192 285 { 193 *fLog << inf << "Minuit Error Matrix:" << endl; 194 *fLog << inf << " xx,xy,yy \t " << setw(3) << fXXErr << ", " << fXYErr << ", " << fYYErr << endl; 195 } 196 197 198 } 286 *fLog << inf << "CGFit Error Matrix of (fMeanXCGFit,fMeanYCGFit) :" 287 << endl; 288 *fLog << inf << " xx,xy,yy \t " << setw(3) << fXXErrCGFit << ", " 289 << fXYErrCGFit << ", " << fYYErrCGFit << endl; 290 } 291 292 293 } 294 //-------------------------------------------------------------------------- 295 296 297 298 299 300 301 302 303 -
trunk/MagicSoft/Mars/mtemp/MStarLocalPos.h
r4433 r4545 11 11 12 12 //Expected position on camera 13 14 13 Float_t fMagExp; 15 14 Float_t fXExp; //[mm] … … 17 16 18 17 //Info from calculation 19 20 18 Float_t fMagCalc; 21 19 Float_t fMaxCalc; //[uA] … … 25 23 Float_t fSigmaMajorAxisCalc; //[mm] 26 24 27 //Info from fit 28 25 //Info from uncorrelated Gauss fit 29 26 Float_t fMagFit; 30 27 Float_t fMaxFit; //[uA] … … 33 30 Float_t fSigmaMinorAxisFit; //[mm] 34 31 Float_t fSigmaMajorAxisFit; //[mm] 35 Float_t fChiSquare; 36 Float_t fXXErr; //minuit error matrix elements 32 Float_t fXXErr; 37 33 Float_t fXYErr; 38 34 Float_t fYYErr; 35 36 Float_t fChiSquare; 39 37 Int_t fNdof; 38 39 //Info from correlated Gauss fit 40 Float_t fMagCGFit; 41 Float_t fMaxCGFit; //[uA] 42 Float_t fMeanXCGFit; //[mm] 43 Float_t fMeanYCGFit; //[mm] 44 Float_t fSigmaXCGFit; //[mm] 45 Float_t fSigmaYCGFit; //[mm] 46 Float_t fCorrXYCGFit; // correlation coefficient 47 Float_t fXXErrCGFit; // error matrix of (fMeanXCGFit,fMeanYCGFit) 48 Float_t fXYErrCGFit; 49 Float_t fYYErrCGFit; 50 51 Float_t fChiSquareCGFit; 52 Int_t fNdofCGFit; 53 40 54 41 55 public: … … 70 84 Float_t GetSigmaMajorAxis() {return fSigmaMajorAxisFit!=0?fSigmaMajorAxisFit:fSigmaMajorAxisCalc;} 71 85 72 Float_t GetXXErr() {return fXXErr;} 73 Float_t GetXYErr() {return fXYErr;} 74 Float_t GetYYErr() {return fYYErr;} 86 // getters for the correlated Gauss fit 87 Float_t GetMagCGFit() {return fMagCGFit;} 88 Float_t GetMaxCGFit() {return fMaxCGFit;} 89 Float_t GetMeanXCGFit() {return fMeanXCGFit;} 90 Float_t GetMeanYCGFit() {return fMeanYCGFit;} 91 Float_t GetSigmaXCGFit() {return fSigmaXCGFit;} 92 Float_t GetSigmaYCGFit() {return fSigmaYCGFit;} 93 Float_t GetCorrXYCGFit() {return fCorrXYCGFit;} 94 Float_t GetXXErrCGFit() {return fXXErrCGFit;} 95 Float_t GetXYErrCGFit() {return fXYErrCGFit;} 96 Float_t GetYYErrCGFit() {return fYYErrCGFit;} 97 Float_t GetChiSquareCGFit() {return fChiSquareCGFit;} 98 UInt_t GetNdofCGFit() {return fNdofCGFit;} 99 Float_t GetChiSquareNdofCGFit() {return fChiSquareCGFit/fNdofCGFit;} 100 75 101 76 102 void Reset(); 77 103 78 104 void SetExpValues(Float_t mag, Float_t x, Float_t y); 79 void SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis); 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); 105 106 void SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, 107 Float_t sigmaMinorAxis, Float_t sigmaMajorAxis); 108 109 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, 110 Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, 111 Float_t chi, Int_t ndof); 112 113 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, 114 Float_t sigmaX, Float_t sigmaY, 115 Float_t chi, Int_t ndof, 116 Float_t xx, Float_t xy, Float_t yy); 117 118 void SetCGFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, 119 Float_t sigmaX, Float_t sigmaY, Float_t correlation, 120 Float_t xx, Float_t xy, Float_t yy, 121 Float_t chi, Int_t ndof); 82 122 83 123 void Paint(Option_t *opt=NULL); … … 88 128 89 129 #endif 130 131 -
trunk/MagicSoft/Mars/mtemp/Makefile
r4002 r4545 40 40 MStarLocalPos.cc \ 41 41 MStarLocalCam.cc \ 42 MFindStars.cc 42 MFindStars.cc \ 43 MTelAxisFromStars.cc \ 44 MHTelAxisFromStars.cc \ 45 MSkyCamTrans.cc \ 46 MSourceDirections.cc 43 47 44 48 ############################################################ -
trunk/MagicSoft/Mars/mtemp/TempLinkDef.h
r4002 r4545 8 8 #pragma link C++ class MStarLocalCam+; 9 9 #pragma link C++ class MFindStars+; 10 #pragma link C++ class MTelAxisFromStars+; 11 #pragma link C++ class MHTelAxisFromStars+; 12 #pragma link C++ class MSkyCamTrans+; 13 #pragma link C++ class MSourceDirections+; 10 14 11 15 #endif
Note:
See TracChangeset
for help on using the changeset viewer.