Changeset 4709 for trunk/MagicSoft/Mars
- Timestamp:
- 08/23/04 14:01:25 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mstarcam/MStarPos.cc
r4667 r4709 50 50 //Expected position on camera 51 51 fMagExp = 0.; 52 fXExp = 0.; 53 fYExp = 0.; 52 fXExp = 0.; 53 fYExp = 0.; 54 55 //Ideal position on camera 56 fMagIdeal = 0.; 57 fXIdeal = 0.; 58 fYIdeal = 0.; 54 59 55 60 //Info from calculation 56 fMagCalc = 0.; 57 fMaxCalc = 0.; 58 fMeanXCalc = 0.; 59 fMeanYCalc = 0.; 60 fSigmaMinorAxisCalc = 0.; 61 fSigmaMajorAxisCalc = 0.; 62 63 //Info from uncorrelated Gauss fit 64 fMagFit = 0.; 65 fMaxFit = 0.; 66 fMeanXFit = 0.; 67 fMeanYFit = 0.; 68 fSigmaMinorAxisFit = 0.; 69 fSigmaMajorAxisFit = 0.; 70 71 fChiSquare = 0.; 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; 61 fMagCalc = 0.; 62 fMaxCalc = 0.; 63 fMeanXCalc = 0.; 64 fMeanYCalc = 0.; 65 fSigmaXCalc = 0.; 66 fSigmaYCalc = 0.; 67 fCorrXYCalc = 0.; 68 fXXErrCalc = 0.; 69 fXYErrCalc = 0.; 70 fYYErrCalc = 0.; 71 72 //Info from Gauss fit 73 fMagFit = 0.; 74 fMaxFit = 0.; 75 fMeanXFit = 0.; 76 fMeanYFit = 0.; 77 fSigmaXFit = 0.; 78 fSigmaYFit = 0.; 79 fCorrXYFit = 0.; 80 fXXErrFit = 0.; 81 fXYErrFit = 0.; 82 fYYErrFit = 0.; 83 84 fChiSquareFit = 0.; 85 fNdofFit = 1; 88 86 89 87 } … … 103 101 } 104 102 105 void MStarPos::SetCalcValues(Float_t mag, Float_t max, 106 Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis) 107 { 108 fMagCalc = mag; 109 fMaxCalc = max; 110 fMeanXCalc = x; 111 fMeanYCalc = y; 112 fSigmaMinorAxisCalc = sigmaMinorAxis; 113 fSigmaMajorAxisCalc = sigmaMajorAxis; 114 } 115 116 void MStarPos::SetFitValues(Float_t mag, Float_t max, 117 Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, 118 Float_t chiSquare, Int_t ndof) 119 { 120 fMagFit = mag; 121 fMaxFit = max; 122 fMeanXFit = x; 123 fMeanYFit = y; 124 fSigmaMinorAxisFit = sigmaMinorAxis; 125 fSigmaMajorAxisFit = sigmaMajorAxis; 126 fChiSquare = chiSquare; 127 fNdof = ndof; 128 } 129 130 void MStarPos::SetFitValues(Float_t mag, Float_t max, 131 Float_t x, Float_t y, Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, 132 Float_t chiSquare, Int_t ndof, 133 Float_t xx, Float_t xy, Float_t yy) 134 { 135 SetFitValues(mag, max, x, y, sigmaMinorAxis, sigmaMajorAxis, chiSquare, ndof); 136 fXXErr = xx; 137 fYYErr = yy; 138 fXYErr = xy; 139 } 140 141 void MStarPos::SetCGFitValues( 103 void MStarPos::SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, 104 Float_t sigmaX, Float_t sigmaY, Float_t correlation, 105 Float_t xx, Float_t xy, Float_t yy) 106 { 107 fMagCalc = mag; 108 fMaxCalc = max; 109 fMeanXCalc = x; 110 fMeanYCalc = y; 111 fSigmaXCalc = sigmaX; 112 fSigmaYCalc = sigmaY; 113 fCorrXYCalc = correlation; 114 fXXErrCalc = xx; 115 fXYErrCalc = xy; 116 fYYErrCalc = yy; 117 } 118 119 120 void MStarPos::SetFitValues( 142 121 Float_t mag, Float_t max, Float_t x, Float_t y, 143 122 Float_t sigmaX, Float_t sigmaY, Float_t correlation, … … 145 124 Float_t chiSquare, Int_t ndof) 146 125 { 147 fMag CGFit = mag;148 fMax CGFit = max;149 fMeanX CGFit = x;150 fMeanY CGFit = y;151 fSigmaX CGFit = sigmaX;152 fSigmaY CGFit = sigmaY;153 fCorrXY CGFit = correlation;154 fXXErr CGFit = xx;155 fXYErr CGFit = xy;156 fYYErr CGFit = yy;157 158 fChiSquare CGFit = chiSquare;159 fNdof CGFit = ndof;126 fMagFit = mag; 127 fMaxFit = max; 128 fMeanXFit = x; 129 fMeanYFit = y; 130 fSigmaXFit = sigmaX; 131 fSigmaYFit = sigmaY; 132 fCorrXYFit = correlation; 133 fXXErrFit = xx; 134 fXYErrFit = xy; 135 fYYErrFit = yy; 136 137 fChiSquareFit = chiSquare; 138 fNdofFit = ndof; 160 139 } 161 140 … … 173 152 mexp.Paint(); 174 153 175 if (fSigmaMinorAxisCalc>0. && fSigmaMajorAxisCalc>0.) 176 { 177 TEllipse ecalc(fMeanXCalc, fMeanYCalc, fSigmaMinorAxisCalc, fSigmaMajorAxisCalc, 0, 360, 0); 154 if (fSigmaXCalc>0. && fSigmaYCalc>0.) 155 { 156 TEllipse ecalc(fMeanXCalc, fMeanYCalc, fSigmaXCalc, fSigmaYCalc, 157 0, 360, 0); 178 158 ecalc.SetLineWidth(3); 179 ecalc.SetLineColor(kBlue); 159 //ecalc.SetLineColor(kBlue); 160 ecalc.SetLineColor(kMagenta); 180 161 ecalc.Paint(); 181 162 } 182 163 183 if (fSigmaMinorAxisFit>0. && fSigmaMajorAxisFit>0.) 184 { 185 TEllipse efit(fMeanXFit, fMeanYFit, fSigmaMinorAxisFit, fSigmaMajorAxisFit, 0, 360, 0); 186 efit.SetLineWidth(3); 187 efit.SetLineColor(kBlack); 188 efit.Paint(); 189 } 190 191 if (fSigmaXCGFit>0. && fSigmaYCGFit>0.) 164 if (fSigmaXFit>0. && fSigmaYFit>0.) 192 165 { 193 166 //Print a cross in the fitted position 194 //TMarker m CGFit(fMeanXCGFit, fMeanYCGFit, 3);195 //m CGFit.SetMarkerSize(3);196 //m CGFit.SetMarkerColor(1);197 //m CGFit.Paint();198 199 Double_t cxx = fSigmaX CGFit*fSigmaXCGFit;200 Double_t cyy = fSigmaY CGFit*fSigmaYCGFit;167 //TMarker mFit(fMeanXFit, fMeanYFit, 3); 168 //mFit.SetMarkerSize(3); 169 //mFit.SetMarkerColor(1); 170 //mFit.Paint(); 171 172 Double_t cxx = fSigmaXFit*fSigmaXFit; 173 Double_t cyy = fSigmaYFit*fSigmaYFit; 201 174 Double_t d = cyy - cxx; 202 Double_t cxy = fCorrXY CGFit * fSigmaXCGFit * fSigmaYCGFit;175 Double_t cxy = fCorrXYFit * fSigmaXFit * fSigmaYFit; 203 176 Double_t tandel; 204 177 if (cxy != 0.0) … … 216 189 / (1.0 + tandel*tandel); 217 190 218 TEllipse efit(fMeanX CGFit, fMeanYCGFit, sqrt(major), sqrt(minor),191 TEllipse efit(fMeanXFit, fMeanYFit, sqrt(major), sqrt(minor), 219 192 0, 360, delta*kRad2Deg); 220 193 efit.SetLineWidth(3); 221 efit.SetLineColor(kMagenta); 194 //efit.SetLineColor(kMagenta); 195 //efit.SetLineColor(kBlack); 222 196 efit.Paint(); 223 197 } … … 237 211 238 212 *fLog << inf << "Star magnitude:" << endl; 213 *fLog << inf << " Ideal \t" << setw(4) << fMagIdeal << endl; 239 214 *fLog << inf << " Expected \t" << setw(4) << fMagExp << endl; 240 215 *fLog << inf << " Calcultated \t " << setw(4) << fMagCalc << endl; 241 216 *fLog << inf << " Fitted \t " << setw(4) << fMagFit << endl; 242 *fLog << inf << " CGFitted \t " << setw(4) << fMagCGFit << endl;243 217 } 244 218 … … 249 223 << endl; 250 224 *fLog << inf << " Fitted \t " << setw(4) << fMaxFit << " uA" << endl; 251 *fLog << inf << " CGFitted \t " << setw(4) << fMaxCGFit << " uA" << endl;252 225 } 253 226 … … 255 228 { 256 229 *fLog << inf << "Star position:" << endl; 230 *fLog << inf << " Ideal \t X " << setw(4) << fXIdeal 231 << " mm \tY " << setw(4) << fYIdeal << " mm" << endl; 257 232 *fLog << inf << " Expected \t X " << setw(4) << fXExp 258 233 << " mm \tY " << setw(4) << fYExp << " mm" << endl; … … 261 236 *fLog << inf << " Fitted \t X " << setw(4) << fMeanXFit 262 237 << " mm \tY " << setw(4) << fMeanYFit << " mm" << endl; 263 *fLog << inf << " CGFitted \t X " << setw(4) << fMeanXCGFit264 << " mm \tY " << setw(4) << fMeanYCGFit << " mm" << endl;265 238 } 266 239 … … 268 241 { 269 242 *fLog << inf << "Star size:" << endl; 270 *fLog << inf << " Calcultated \t X " << setw(4) << fSigmaMinorAxisCalc 271 << " mm \tY " << setw(4) << fSigmaMajorAxisCalc << " mm" << endl; 272 *fLog << inf << " Fitted \t X " << setw(4) << fSigmaMinorAxisFit 273 << " mm \tY " << setw(4) << fSigmaMajorAxisFit << " mm" << endl; 274 *fLog << inf << " CGFitted \t X " << setw(4) << fSigmaXCGFit 275 << " mm \tY " << setw(4) << fSigmaYCGFit << " mm \t correlation" 276 << setw(4) << fCorrXYCGFit << endl; 243 *fLog << inf << " Calcultated \t X " << setw(4) << fSigmaXCalc 244 << " mm \tY " << setw(4) << fSigmaYCalc << " mm \t correlation " 245 << setw(4) << fCorrXYCalc << endl; 246 *fLog << inf << " Fitted \t X " << setw(4) << fSigmaXFit 247 << " mm \tY " << setw(4) << fSigmaYFit << " mm \t correlation " 248 << setw(4) << fCorrXYFit << endl; 277 249 } 278 250 … … 280 252 { 281 253 *fLog << inf << "Star Fit Quality:" << endl; 282 *fLog << inf << " ChiSquare/Ndof \t " << setw(3) << fChiSquare 283 << "/" << fNdof << endl; 284 285 *fLog << inf << "Star CGFit Quality:" << endl; 286 *fLog << inf << " ChiSquareCGFit/NdofCGFit \t " << setw(3) 287 << fChiSquareCGFit << "/" << fNdofCGFit << endl; 254 *fLog << inf << " ChiSquareFit/NdofFit \t " << setw(3) 255 << fChiSquareFit << "/" << fNdofFit << endl; 288 256 } 289 257 290 258 if (o.Contains("err", TString::kIgnoreCase) || opt == NULL) 291 259 { 292 *fLog << inf << " CGFit Error Matrix of (fMeanXCGFit,fMeanYCGFit) :"260 *fLog << inf << "Error Matrix of (fMeanX,fMeanY) :" 293 261 << endl; 294 *fLog << inf << " xx,xy,yy \t " << setw(3) << fXXErrCGFit << ", " 295 << fXYErrCGFit << ", " << fYYErrCGFit << endl; 262 *fLog << inf << " xxCalc,xyCalc,yyCalc \t " << setw(3) << fXXErrCalc 263 << ", " << fXYErrCalc << ", " << fYYErrCalc << endl; 264 *fLog << inf << " xxFit,xyFit,yyFit \t " << setw(3) << fXXErrFit << ", " 265 << fXYErrFit << ", " << fYYErrFit << endl; 296 266 } 297 267 -
trunk/MagicSoft/Mars/mstarcam/MStarPos.h
r4667 r4709 25 25 Float_t fMeanXCalc; //[mm] 26 26 Float_t fMeanYCalc; //[mm] 27 Float_t fSigmaMinorAxisCalc; //[mm] 28 Float_t fSigmaMajorAxisCalc; //[mm] 27 Float_t fSigmaXCalc; //[mm] 28 Float_t fSigmaYCalc; //[mm] 29 Float_t fCorrXYCalc; // correlation coefficient 30 Float_t fXXErrCalc; // error matrix of (fMeanXCalc,fMeanYCalc) 31 Float_t fXYErrCalc; 32 Float_t fYYErrCalc; 29 33 30 //Info from uncorrelatedGauss fit34 //Info from Gauss fit 31 35 Float_t fMagFit; 32 36 Float_t fMaxFit; //[uA] 33 37 Float_t fMeanXFit; //[mm] 34 38 Float_t fMeanYFit; //[mm] 35 Float_t fSigmaMinorAxisFit; //[mm] 36 Float_t fSigmaMajorAxisFit; //[mm] 37 Float_t fXXErr; 38 Float_t fXYErr; 39 Float_t fYYErr; 39 Float_t fSigmaXFit; //[mm] 40 Float_t fSigmaYFit; //[mm] 41 Float_t fCorrXYFit; // correlation coefficient 42 Float_t fXXErrFit; // error matrix of (fMeanXFit,fMeanYFit) 43 Float_t fXYErrFit; 44 Float_t fYYErrFit; 40 45 41 Float_t fChiSquare; 42 Int_t fNdof; 43 44 //Info from correlated Gauss fit 45 Float_t fMagCGFit; 46 Float_t fMaxCGFit; //[uA] 47 Float_t fMeanXCGFit; //[mm] 48 Float_t fMeanYCGFit; //[mm] 49 Float_t fSigmaXCGFit; //[mm] 50 Float_t fSigmaYCGFit; //[mm] 51 Float_t fCorrXYCGFit; // correlation coefficient 52 Float_t fXXErrCGFit; // error matrix of (fMeanXCGFit,fMeanYCGFit) 53 Float_t fXYErrCGFit; 54 Float_t fYYErrCGFit; 55 56 Float_t fChiSquareCGFit; 57 Int_t fNdofCGFit; 46 Float_t fChiSquareFit; 47 Int_t fNdofFit; 58 48 59 49 … … 75 65 Float_t GetMeanXCalc() {return fMeanXCalc;} 76 66 Float_t GetMeanYCalc() {return fMeanYCalc;} 77 Float_t GetSigmaMinorAxisCalc() {return fSigmaMinorAxisCalc;} 78 Float_t GetSigmaMajorAxisCalc() {return fSigmaMajorAxisCalc;} 67 Float_t GetSigmaXCalc() {return fSigmaXCalc;} 68 Float_t GetSigmaYCalc() {return fSigmaYCalc;} 69 Float_t GetCorrXYCalc() {return fCorrXYCalc;} 70 Float_t GetXXErrCalc() {return fXXErrCalc;} 71 Float_t GetXYErrCalc() {return fXYErrCalc;} 72 Float_t GetYYErrCalc() {return fYYErrCalc;} 79 73 80 Float_t GetMagFit() {return fMagFit;} 81 Float_t GetMaxFit() {return fMaxFit;} 82 Float_t GetMeanXFit() {return fMeanXFit;} 83 Float_t GetMeanYFit() {return fMeanYFit;} 84 Float_t GetSigmaMinorAxisFit() {return fSigmaMinorAxisFit;} 85 Float_t GetSigmaMajorAxisFit() {return fSigmaMajorAxisFit;} 86 Float_t GetChiSquare() {return fChiSquare;} 87 UInt_t GetNdof() {return fNdof;} 88 Float_t GetChiSquareNdof() {return fChiSquare/fNdof;} 74 75 // getters for the Gauss fit 76 Float_t GetMagFit() {return fMagFit;} 77 Float_t GetMaxFit() {return fMaxFit;} 78 Float_t GetMeanXFit() {return fMeanXFit;} 79 Float_t GetMeanYFit() {return fMeanYFit;} 80 Float_t GetSigmaXFit() {return fSigmaXFit;} 81 Float_t GetSigmaYFit() {return fSigmaYFit;} 82 Float_t GetCorrXYFit() {return fCorrXYFit;} 83 Float_t GetXXErrFit() {return fXXErrFit;} 84 Float_t GetXYErrFit() {return fXYErrFit;} 85 Float_t GetYYErrFit() {return fYYErrFit;} 86 Float_t GetChiSquareFit() {return fChiSquareFit;} 87 UInt_t GetNdofFit() {return fNdofFit;} 88 Float_t GetChiSquareNdofFit() {return fChiSquareFit/fNdofFit;} 89 89 90 // ----- 90 91 Float_t GetMeanX() {return fMeanXFit!=0?fMeanXFit:fMeanXCalc;} 91 Float_t GetMeanY() {return fMeanXFit!=0?fMeanYFit:fMeanYCalc;} 92 Float_t GetSigmaMinorAxis() {return fSigmaMinorAxisFit!=0?fSigmaMinorAxisFit:fSigmaMinorAxisCalc;} 93 Float_t GetSigmaMajorAxis() {return fSigmaMajorAxisFit!=0?fSigmaMajorAxisFit:fSigmaMajorAxisCalc;} 94 95 // getters for the correlated Gauss fit 96 Float_t GetMagCGFit() {return fMagCGFit;} 97 Float_t GetMaxCGFit() {return fMaxCGFit;} 98 Float_t GetMeanXCGFit() {return fMeanXCGFit;} 99 Float_t GetMeanYCGFit() {return fMeanYCGFit;} 100 Float_t GetSigmaXCGFit() {return fSigmaXCGFit;} 101 Float_t GetSigmaYCGFit() {return fSigmaYCGFit;} 102 Float_t GetCorrXYCGFit() {return fCorrXYCGFit;} 103 Float_t GetXXErrCGFit() {return fXXErrCGFit;} 104 Float_t GetXYErrCGFit() {return fXYErrCGFit;} 105 Float_t GetYYErrCGFit() {return fYYErrCGFit;} 106 Float_t GetChiSquareCGFit() {return fChiSquareCGFit;} 107 UInt_t GetNdofCGFit() {return fNdofCGFit;} 108 Float_t GetChiSquareNdofCGFit() {return fChiSquareCGFit/fNdofCGFit;} 92 Float_t GetMeanY() {return fMeanYFit!=0?fMeanYFit:fMeanYCalc;} 93 94 Float_t GetSigmaX() {return fSigmaXFit!=0?fSigmaXFit:fSigmaXCalc;} 95 Float_t GetSigmaY() {return fSigmaYFit!=0?fSigmaYFit:fSigmaYCalc;} 109 96 110 97 … … 115 102 void SetIdealValues(Float_t mag, Float_t x, Float_t y); 116 103 117 void SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, 118 Float_t sigmaMinorAxis, Float_t sigmaMajorAxis); 104 void SetCalcValues(Float_t mag, Float_t max, Float_t x, Float_t y, 105 Float_t sigmaX, Float_t sigmaY, Float_t correlation, 106 Float_t xx, Float_t xy, Float_t yy); 119 107 120 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, 121 Float_t sigmaMinorAxis, Float_t sigmaMajorAxis, 122 Float_t chi, Int_t ndof); 123 124 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, 125 Float_t sigmaX, Float_t sigmaY, 126 Float_t chi, Int_t ndof, 127 Float_t xx, Float_t xy, Float_t yy); 128 129 void SetCGFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, 130 Float_t sigmaX, Float_t sigmaY, Float_t correlation, 131 Float_t xx, Float_t xy, Float_t yy, 132 Float_t chi, Int_t ndof); 108 void SetFitValues(Float_t mag, Float_t max, Float_t x, Float_t y, 109 Float_t sigmaX, Float_t sigmaY, Float_t correlation, 110 Float_t xx, Float_t xy, Float_t yy, 111 Float_t chi, Int_t ndof); 133 112 134 113 void Paint(Option_t *opt=NULL); -
trunk/MagicSoft/Mars/mtemp/MSourceDirections.cc
r4706 r4709 124 124 125 125 Int_t rc = fAstro.AddObject(ra,dec,1,name); 126 126 // if (rc) { 127 // MStarPos *starpos = new MStarPos; 128 // starpos->SetName(name); 129 // fStars->GetList()->Add(starpos); 130 // } 127 131 return rc; 128 132 }
Note:
See TracChangeset
for help on using the changeset viewer.