Changeset 3113 for trunk/MagicSoft/Mars/macros
- Timestamp:
- 02/12/04 11:40:54 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/pointspreadfunction.C
r3110 r3113 37 37 // (It's possible not to use the calibration file and then the gain // 38 38 // of the pmts are supouse to be the same for all of them. // 39 // 3- The third argument is just the number of dc measurements you want // 40 // analize. If you put 0 it just stops after each fit and show you // 41 // results. // 39 42 // // 40 43 //--------------------------------------------------------------------------// 41 44 42 45 const Int_t numPixels = 577; 43 Int_t nPixelsFitted; // 396[inners] 36[3rings] 60[4rings] 90[5rings]46 Int_t nPixelsFitted; 44 47 Bool_t isPixelsFitted[numPixels]; 45 48 Float_t z[numPixels],x[numPixels],y[numPixels],errorz[numPixels]; … … 47 50 48 51 //______________________________________________________________________________ 52 // 53 // Function use for Minuit to do the fit 54 // 49 55 void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag) 50 56 { … … 73 79 74 80 //______________________________________________________________________________ 81 // 82 // The 2D gaussian fucntion use to fit the spot of the star 83 // 75 84 Double_t func(float x,float y,Double_t *par) 76 85 { … … 102 111 } 103 112 113 104 114 void pointspreadfunction(TString fname, TString clname = "NULL", Int_t userNumLines = 1000) 105 115 { 106 107 // First run over continuos light files to have a DC calibration108 116 109 117 … … 131 139 if (clname != "NULL") 132 140 { 141 142 // 143 // First run over continuos light files to have a DC calibration 144 // 145 133 146 MParList plist0; 134 147 … … 179 192 currrms[swpix] /= meanofcurrmean; 180 193 181 // cout << "swpixel " << swpix << " dc fCalib " << currmean[swpix] << " +- " << currrms[swpix] << endl;182 194 } 183 195 184 196 185 // curr.Print();186 197 /* MHCamera display0(geomcam); 187 198 display0.SetPrettyPalette(); 188 199 display0.Draw(); 189 200 201 // curr.Print(); 190 202 display0.SetCamContent(currbis); 191 203 cout << "PSF>> DC mean values drawn" << endl; … … 198 210 else 199 211 { 212 // If you don't use the continuous light this is the currrms[] array 213 // is the error associated to the currents TMinuit will use. 200 214 for (Int_t swpix=0; swpix<numPixels; swpix++) 201 215 { 202 216 currmean[swpix] = 1.; 203 currrms[swpix] = 0.2; 217 currrms[swpix] = 0.2; 204 218 } 205 219 206 220 } 207 221 208 // Now we can run over the dc data to extract the psf rms. 209 222 // 223 // Now we can run over the dc data to extract the psf. 224 // 210 225 const Int_t maxNumLines = 10000; 211 226 … … 241 256 MHCamera display(geomcam); 242 257 display.SetPrettyPalette(); 243 // display.SetInvDeepBlueSeaPalette()244 258 display.Draw(); 245 259 gPad->SetLogy(); … … 252 266 Double_t xmean,xsigma,ymean,ysigma; 253 267 Double_t xmeanerror,xsigmaerror,ymeanerror,ysigmaerror; 254 255 // TVector xellipsecenter;256 // TVector yellipsecenter;257 268 258 269 TEllipse ellipse; … … 274 285 275 286 TCanvas *psfcanvas = new TCanvas("psfcanvas","Point Spread Funtion 2D",200,20,900,700); 287 288 289 // 290 // Using the first dc meausrement we search the star and we define the area to be fitted 291 // around 3 rings of neightbords around the peak of the star. 292 // 276 293 277 294 tlist.Process(); … … 362 379 break; 363 380 */ 381 382 // Minuit initialization 383 364 384 TMinuit *gMinuit = new TMinuit(7); //initialize TMinuit with a maximum of 5 params 365 385 gMinuit->SetFCN(fcn); … … 402 422 gMinuit->mnparm(3, "ymean", vstart[3], step[3], lowlimit[3], uplimit[3],ierflg); 403 423 gMinuit->mnparm(4, "ysigma", vstart[4], step[4], lowlimit[4], uplimit[4],ierflg); 404 405 numLines++;406 424 407 425 while (tlist.Process() && numLines < maxNumLines) … … 479 497 } 480 498 */ 481 numLines++;482 499 // Remove the comments if you want to go through the file 483 500 //event-by-event: … … 492 509 break; 493 510 } 511 numLines++; 494 512 } 495 513 } … … 498 516 evtloop.PostProcess(); 499 517 500 //Draw the ditributions of the sigmas the point spread function 501 502 cout<<"Number of lines "<<numLines<<endl; 518 // 519 // Draw the ditributions of the sigmas the point spread function 520 // 521 522 cout<<"PSF>> Number of lines "<<numLines<<endl; 503 523 504 524 gROOT->Reset();
Note:
See TracChangeset
for help on using the changeset viewer.