Changeset 2906


Ignore:
Timestamp:
01/24/04 01:56:57 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2905 r2906  
    3434     - do not fill &val when return kFALSE
    3535
     36   * macros/calibration.C
     37     - include functions to exclude the blind pixel,
     38       calculation of times and quality checks
     39
    3640
    3741 2004/01/23: Abelardo Moralejo
  • trunk/MagicSoft/Mars/macros/calibration.C

    r2877 r2906  
    2323\* ======================================================================== */
    2424
    25 // const TString pedfile = "/mnt/Data/rootdata/DarkPatch4/2003_11_27/20031126_03030_P_DarkPatch4_E.root";
    26 // const TString calfile = "/mnt/Data/rootdata/DarkPatch4/2004_01_17/20040116_*_C_DarkPatch2_E.root";
    27 
    2825const TString pedfile = "/mnt/Data/rootdata/Miscellaneous/2003_12_19/20031218_03522_P_Park_E.root";
    2926const TString calfile = "/mnt/Data/rootdata/Miscellaneous/2003_12_19/20031218_03527_C_Park_E.root";
     
    6865    tlist.AddToList(&fill);
    6966
    70     MStatusDisplay *d1 = new MStatusDisplay;
    71 
    72     //Set update time to 3s
    73     d1->SetUpdateTime(3000);
    74  
    7567    //
    7668    // Create and setup the eventloop
     
    7870    MEvtLoop evtloop;
    7971    evtloop.SetParList(&plist);
    80     evtloop.SetDisplay(d1);     
    8172
    8273    //
     
    118109    read2.DisableAutoScheme();
    119110
    120     MExtractSignal       sigsig;
     111    MExtractSignal       sigcalc;
     112    MArrivalTimeCalc     timecalc;
    121113    MCalibrationCalc     calcalc;
     114
     115    //
     116    // As long, as we don't have digital modules,
     117    // we have to set the color of the pulser LED by hand
     118    //
     119    calcalc.SetPulserColor(MCalibrationCalc::kECT1);
    122120
    123121    //
     
    125123    // (This is a preliminary feature)
    126124    //
    127     //    calcalc.ExcludePixelsFromAsciiFile("badpixels.dat");
     125    // calcalc.ExcludePixelsFromAsciiFile("badpixels_all.dat");
    128126   
    129127    //
    130     // As long, as we don't have digital modules,
    131     // we have to set the color of the pulser LED by hand
    132     //
    133     calcalc.SetPulserColor(MCalibrationCalc::kECT1);
     128    // In case, you want to skip the blind pixel method:
     129    // (NOT RECOMMENDED!!!)
     130    //
     131    // calcalc.SkipBlindPixelFit();
     132
     133    //
     134    // In case, you want to skip the cosmics rejection
     135    // (NOT RECOMMENDED!!!)
     136    //
     137    // calcalc.SkipCosmicsRejection();
     138
     139    //
     140    // In case, you want to skip the quality checks
     141    // (NOT RECOMMENDED!!!)
     142    //
     143    // calcalc.SkipQualityChecks();
    134144
    135145    //
     
    141151
    142152    tlist2.AddToList(&read2);
    143     tlist2.AddToList(&sigsig);
     153    tlist2.AddToList(&sigcalc);
     154    //
     155    // In case, you want to skip the somewhat lengthy calculation
     156    // of the arrival times using a spline, uncomment the next line
     157    //
     158    // tlist2.AddToList(&timecalc);
    144159    tlist2.AddToList(&calcalc);
    145160
     
    159174
    160175    //
     176    // print the most important results of all pixels
     177    //
     178    calcam.Print();
     179
     180    //
    161181    // just one example how to get the plots of individual pixels
    162182    //
    163     MCalibrationCam *cam = plist2.FindObject("MCalibrationCam");
    164     cam.Print();
     183    calcam[17].DrawClone();
    165184
    166185    MHCamEvent camevt;
     
    183202    MHCamera disp16  (geomcam, "MCalibrationPix;RSigma/Charge", "Reduced Sigma per Charge");
    184203
    185     disp1.SetCamContent(*cam, 0);
    186     disp1.SetCamError(*cam,1);
    187 
    188     disp3.SetCamContent(*cam, 2);
    189     disp3.SetCamError(*cam,3);
    190 
    191     disp5.SetCamContent(*cam, 4);
    192 
    193     disp6.SetCamContent(*cam, 5);
    194     disp6.SetCamError(*cam, 6);
    195     disp7.SetCamContent(*cam, 6);
    196     disp8.SetCamContent(*cam, 7);
    197 
    198     disp9.SetCamContent(*cam, 8);
    199     disp9.SetCamError(*cam, 9);
    200 
    201     disp10.SetCamContent(*cam, 9);
    202     disp11.SetCamContent(*cam, 10);
    203 
    204     disp12.SetCamContent(*cam, 11);
    205     disp12.SetCamError(*cam, 12);
    206 
    207     disp13.SetCamContent(*cam, 13);
    208     disp13.SetCamError(*cam, 14);
    209 
    210     disp14.SetCamContent(*cam, 15);
    211     disp15.SetCamContent(*cam, 16);
    212     disp16.SetCamContent(*cam, 17);
     204    disp1.SetCamContent(calcam, 0);
     205    disp1.SetCamError(calcam,1);
     206
     207    disp3.SetCamContent(calcam, 2);
     208    disp3.SetCamError(calcam,3);
     209
     210    disp5.SetCamContent(calcam, 4);
     211
     212    disp6.SetCamContent(calcam, 5);
     213    disp6.SetCamError(calcam, 6);
     214    disp7.SetCamContent(calcam, 6);
     215    disp8.SetCamContent(calcam, 7);
     216
     217    disp9.SetCamContent(calcam, 8);
     218    disp9.SetCamError(calcam, 9);
     219
     220    disp10.SetCamContent(calcam, 9);
     221    disp11.SetCamContent(calcam, 10);
     222
     223    disp12.SetCamContent(calcam, 11);
     224    disp12.SetCamError(calcam, 12);
     225
     226    disp13.SetCamContent(calcam, 13);
     227    disp13.SetCamError(calcam, 14);
     228
     229    disp14.SetCamContent(calcam, 15);
     230    disp15.SetCamContent(calcam, 16);
     231    disp16.SetCamContent(calcam, 17);
    213232
    214233
     
    239258    c1.Divide(2,3);
    240259
    241     CamDraw(c1,disp1,cam,1,2,1);
    242     CamDraw(c1,disp3,cam,2,2,2);
     260    CamDraw(c1,disp1,&calcam,1,2,1);
     261    CamDraw(c1,disp3,&calcam,2,2,2);
    243262
    244263    // Fit Probability
     
    246265    c2.Divide(1,3);
    247266
    248     CamDraw(c2,disp5,cam,1,1,3);
     267    CamDraw(c2,disp5,&calcam,1,1,3);
    249268
    250269    // Times
     
    252271    c3.Divide(3,3);
    253272
    254     CamDraw(c3,disp6,cam,1,3,1);
    255     CamDraw(c3,disp7,cam,2,3,0);
    256     CamDraw(c3,disp8,cam,3,3,0);
     273    CamDraw(c3,disp6,&calcam,1,3,1);
     274    CamDraw(c3,disp7,&calcam,2,3,0);
     275    CamDraw(c3,disp8,&calcam,3,3,0);
    257276
    258277    // Pedestals
     
    260279    c4.Divide(2,3);
    261280
    262     CamDraw(c4,disp9,cam,1,2,0);
    263     CamDraw(c4,disp10,cam,2,2,1);
     281    CamDraw(c4,disp9,&calcam,1,2,0);
     282    CamDraw(c4,disp10,&calcam,2,2,1);
    264283
    265284    // Reduced Sigmas
     
    267286    c5.Divide(2,3);
    268287
    269     CamDraw(c5,disp11,cam,1,2,2);
    270     CamDraw(c5,disp16,cam,2,2,2);
     288    CamDraw(c5,disp11,&calcam,1,2,2);
     289    CamDraw(c5,disp16,&calcam,2,2,2);
    271290
    272291    // F-Factor Method
     
    274293    c6.Divide(2,3);
    275294
    276     CamDraw(c6,disp12,cam,1,2,1);
    277     CamDraw(c6,disp13,cam,2,2,1);
     295    CamDraw(c6,disp12,&calcam,1,2,1);
     296    CamDraw(c6,disp13,&calcam,2,2,2);
    278297
    279298    // Blind Pixel Method
     
    281300    c7.Divide(2, 3);
    282301
    283     CamDraw(c7,disp14,cam,1,2,9);
    284     CamDraw(c7,disp15,cam,2,2,1);
     302    CamDraw(c7,disp14,&calcam,1,2,9);
     303    CamDraw(c7,disp15,&calcam,2,2,2);
    285304
    286305}
     
    301320  c.cd(i+2*j);
    302321  gPad->SetBorderMode(0);
    303   Float_t he = gStyle->GetStatH();
    304   Float_t wi = gStyle->GetStatH();
    305   gStyle->SetStatH(0.4);
    306   gStyle->SetStatW(0.25);
    307    
    308322  TH1D *obj2 = (TH1D*)obj1->Projection();
    309323  obj2->Draw();
     
    317331  const Double_t width = max-min;
    318332 
     333  if (rms == 0. || width == 0. )
     334    return;
     335
    319336  switch (fit)
    320337    {
    321338    case 0:
    322339      TF1 *sgaus = new TF1("sgaus","gaus(0)",min,max);
     340      sgaus->SetBit(kCanDelete);
    323341      sgaus->SetParNames("Area","#mu","#sigma");
    324342      sgaus->SetParameters(integ/rms,mean,rms);
     
    332350    case 1:
    333351      TF1 *dgaus = new TF1("dgaus","gaus(0)+gaus(3)",min,max);
     352      dgaus->SetBit(kCanDelete);
    334353      dgaus->SetParNames("A1","#mu1","#sigma1","A2","#mu2","#sigma2");
    335354      dgaus->SetParameters(integ/width,max-width/6.,width/4.,
     
    347366    case 2:
    348367      TF1 *tgaus = new TF1("tgaus","gaus(0)+gaus(3)+gaus(6)",min,max);
     368      tgaus->SetBit(kCanDelete);
    349369      tgaus->SetParNames("A1","#mu1","#sigma1","A2","#mu2","#sigma2","A3","#mu3","#sigma3");
    350370      tgaus->SetParameters(integ/width,max-width/6.,width/4.,
     
    375395    }
    376396 
    377   gStyle->SetStatH(he);     
    378   gStyle->SetStatW(wi);
    379 
    380397}
Note: See TracChangeset for help on using the changeset viewer.