Changeset 3113 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
02/12/04 11:40:54 (21 years ago)
Author:
jlopez
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/macros/pointspreadfunction.C

    r3110 r3113  
    3737//     (It's possible not to use the calibration file and then the gain     //
    3838//      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.                                                             //
    3942//                                                                          //
    4043//--------------------------------------------------------------------------//
    4144
    4245const Int_t numPixels = 577;
    43 Int_t nPixelsFitted; // 396[inners] 36[3rings] 60[4rings] 90[5rings]
     46Int_t nPixelsFitted;
    4447Bool_t isPixelsFitted[numPixels];
    4548Float_t z[numPixels],x[numPixels],y[numPixels],errorz[numPixels];
     
    4750
    4851//______________________________________________________________________________
     52//
     53// Function use for Minuit to do the fit
     54//
    4955void fcn(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
    5056{
     
    7379
    7480//______________________________________________________________________________
     81//
     82// The 2D gaussian fucntion use to fit the spot of the star
     83//
    7584Double_t func(float x,float y,Double_t *par)
    7685{
     
    102111}
    103112
     113
    104114void pointspreadfunction(TString fname, TString clname = "NULL", Int_t userNumLines = 1000)
    105115{
    106 
    107 // First run over continuos light files to have a DC calibration
    108116
    109117
     
    131139    if (clname != "NULL")
    132140    {
     141
     142        //
     143        // First run over continuos light files to have a DC calibration
     144        //
     145
    133146        MParList plist0;
    134147       
     
    179192            currrms[swpix] /= meanofcurrmean;   
    180193           
    181 //      cout << "swpixel " << swpix << " dc fCalib " << currmean[swpix] << " +- " << currrms[swpix] << endl;
    182194        }
    183195       
    184196       
    185         //    curr.Print();
    186197/*     MHCamera display0(geomcam);
    187198       display0.SetPrettyPalette();
    188199       display0.Draw();
    189200       
     201        //    curr.Print();
    190202       display0.SetCamContent(currbis);
    191203       cout << "PSF>> DC mean values drawn" << endl;
     
    198210    else
    199211    {
     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.
    200214        for (Int_t swpix=0; swpix<numPixels; swpix++)
    201215        {
    202216            currmean[swpix] = 1.;
    203             currrms[swpix] = 0.2;
     217            currrms[swpix] = 0.2; 
    204218        }
    205219       
    206220    }
    207221
    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//     
    210225    const Int_t maxNumLines = 10000;
    211226       
     
    241256    MHCamera display(geomcam);
    242257    display.SetPrettyPalette();
    243 //    display.SetInvDeepBlueSeaPalette()
    244258    display.Draw();
    245259    gPad->SetLogy();
     
    252266    Double_t xmean,xsigma,ymean,ysigma;
    253267    Double_t xmeanerror,xsigmaerror,ymeanerror,ysigmaerror;
    254 
    255 //    TVector xellipsecenter;
    256 //    TVector yellipsecenter;
    257268
    258269    TEllipse ellipse;
     
    274285
    275286    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    //
    276293
    277294    tlist.Process();
     
    362379        break;
    363380*/
     381
     382    // Minuit initialization
     383
    364384    TMinuit *gMinuit = new TMinuit(7);  //initialize TMinuit with a maximum of 5 params
    365385    gMinuit->SetFCN(fcn);
     
    402422    gMinuit->mnparm(3, "ymean", vstart[3], step[3], lowlimit[3], uplimit[3],ierflg);
    403423    gMinuit->mnparm(4, "ysigma", vstart[4], step[4], lowlimit[4], uplimit[4],ierflg);
    404 
    405     numLines++;
    406424
    407425    while (tlist.Process() && numLines < maxNumLines)
     
    479497        }
    480498*/
    481             numLines++;
    482499            // Remove the comments if you want to go through the file
    483500            //event-by-event:
     
    492509                    break;
    493510            }
     511            numLines++;
    494512        }
    495513    }
     
    498516    evtloop.PostProcess();
    499517
    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;
    503523
    504524    gROOT->Reset();
Note: See TracChangeset for help on using the changeset viewer.