Changeset 4545 for trunk/MagicSoft/Mars/mtemp/MStarLocalPos.cc
- Timestamp:
- 08/09/04 15:48:03 (20 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.