Changeset 3871


Ignore:
Timestamp:
04/28/04 18:00:41 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r3870 r3871  
    2727 2004/04/28: Markus Gaug
    2828 
     29   * mjobs/MGCamDisplays.cc
     30   * mjobs/MJCalibration.cc
     31     - introduced new "fit" flag in DrawProjection allowing to draw
     32       two separate pad with the (fitted) histograms for inner and
     33       outer pixels. This is displayed by MJCalibration if the
     34       kNormalDisplay option is chosen (default).
     35
     36
    2937   * msignal/MArrivalTimeCalc.[h,cc]
    3038     -remove the ReInit() which calls to an MGeomCam which is later not
  • trunk/MagicSoft/Mars/macros/calibration.C

    r3862 r3871  
    8585  //  badcam.AsciiRead("badpixels.dat");
    8686
     87  gStyle->SetOptStat(1);
     88  gStyle->SetOptFit();
     89
    8790  MStatusDisplay *display = new MStatusDisplay;
    8891  display->SetUpdateTime(3000);
  • trunk/MagicSoft/Mars/mjobs/MGCamDisplays.cc

    r3853 r3871  
    3535#include <TCanvas.h>
    3636
     37#include "MH.h"
    3738#include "MHCamera.h"
    3839#include "MGeomCam.h"
    39 #include "TPad.h"
     40#include "TVirtualPad.h"
    4041#include "TProfile.h"
    4142#include "TF1.h"
     43
     44#include "MLog.h"
     45#include "MLogManip.h"
    4246
    4347#include "MStatusDisplay.h"
     
    114118// 3: Triple Gauss (for distributions with inner, outer pixels and outliers)
    115119// 4: flat         (for the probability distributions)
     120// 5: Fit Inner and Outer pixels separately by a single Gaussian
     121//                 (only for MAGIC cameras)
    116122//
    117123// Moreover, sectors 6,1 and 2 of the camera and sectors 3,4 and 5 are
     
    120126void MGCamDisplays::DrawProjection(MHCamera *obj, Int_t fit) const
    121127{
     128 
     129  TArrayI inner(1);
     130  inner[0] = 0;
     131 
     132  TArrayI outer(1);
     133  outer[0] = 1;
     134         
     135  if (fit==5)
     136    {
     137     
     138      if (obj->GetGeomCam().InheritsFrom("MGeomCamMagic"))
     139        {
     140          TArrayI s0(6);
     141          s0[0] = 6;
     142          s0[1] = 1;
     143          s0[2] = 2;
     144          s0[3] = 3;
     145          s0[4] = 4;
     146          s0[5] = 5;
     147
     148          gPad->Clear();
     149          TVirtualPad *pad = gPad;
     150          pad->Divide(2,1);
     151         
     152          TH1D *half[2];
     153          half[0] = obj->ProjectionS(s0, inner, "Inner");
     154          half[1] = obj->ProjectionS(s0, outer, "Outer");
     155         
     156          half[0]->SetDirectory(NULL);
     157          half[1]->SetDirectory(NULL);
     158         
     159          for (int i=0; i<2; i++)
     160            {
     161              pad->cd(i+1);
     162              half[i]->SetLineColor(kRed+i);
     163              half[i]->SetBit(kCanDelete);
     164              half[i]->Draw();
     165              half[i]->Fit("gaus","Q");
     166            }
     167         
     168          gLog << all << obj->GetName()
     169               << Form("%s%5.3f%s%3.2f"," Mean: Inner Pixels: ",
     170                       half[0]->GetFunction("gaus")->GetParameter(1),"+-",
     171                       half[0]->GetFunction("gaus")->GetParError(1));
     172          gLog << Form("%s%5.3f%s%3.2f","  Outer Pixels: ",
     173                       half[1]->GetFunction("gaus")->GetParameter(1),"+-",
     174                       half[1]->GetFunction("gaus")->GetParError(1)) << endl;
     175          gLog << all << obj->GetName()
     176               << Form("%s%5.3f%s%3.2f"," Sigma: Inner Pixels: ",
     177                       half[0]->GetFunction("gaus")->GetParameter(2),"+-",
     178                       half[0]->GetFunction("gaus")->GetParError(2));
     179          gLog << Form("%s%5.3f%s%3.2f","  Outer Pixels: ",
     180                       half[1]->GetFunction("gaus")->GetParameter(2),"+-",
     181                       half[1]->GetFunction("gaus")->GetParError(2)) << endl;
     182         
     183        }
     184      return;
     185    }
    122186 
    123187  TH1D *obj2 = (TH1D*)obj->Projection(obj->GetName());
     
    125189  obj2->Draw();
    126190  obj2->SetBit(kCanDelete);
     191 
    127192 
    128193  if (obj->GetGeomCam().InheritsFrom("MGeomCamMagic"))
     
    138203      s1[2] = 5;
    139204     
    140       TArrayI inner(1);
    141       inner[0] = 0;
    142      
    143       TArrayI outer(1);
    144       outer[0] = 1;
     205     
     206      TH1D *halfInOut[4];
    145207     
    146208      // Just to get the right (maximum) binning
    147       TH1D *half[4];
    148       half[0] = obj->ProjectionS(s0, inner, "Sector 6-1-2 Inner");
    149       half[1] = obj->ProjectionS(s1, inner, "Sector 3-4-5 Inner");
    150       half[2] = obj->ProjectionS(s0, outer, "Sector 6-1-2 Outer");
    151       half[3] = obj->ProjectionS(s1, outer, "Sector 3-4-5 Outer");
     209      halfInOut[0] = obj->ProjectionS(s0, inner, "Sector 6-1-2 Inner");
     210      halfInOut[1] = obj->ProjectionS(s1, inner, "Sector 3-4-5 Inner");
     211      halfInOut[2] = obj->ProjectionS(s0, outer, "Sector 6-1-2 Outer");
     212      halfInOut[3] = obj->ProjectionS(s1, outer, "Sector 3-4-5 Outer");
    152213     
    153214      for (int i=0; i<4; i++)
    154215        {
    155           half[i]->SetLineColor(kRed+i);
    156           half[i]->SetDirectory(0);
    157           half[i]->SetBit(kCanDelete);
    158           half[i]->Draw("same");
     216          halfInOut[i]->SetLineColor(kRed+i);
     217          halfInOut[i]->SetDirectory(0);
     218          halfInOut[i]->SetBit(kCanDelete);
     219          halfInOut[i]->Draw("same");
    159220        }
    160221    }
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r3862 r3871  
    213213
    214214    // Create histograms to display
    215     MHCamera disp1 (geomcam, "Cal;Charge",            "Fitted Mean Charges");
    216     MHCamera disp2 (geomcam, "Cal;SigmaCharge",       "Sigma of Fitted Charges");
    217     MHCamera disp3 (geomcam, "Cal;RSigma",            "Reduced Sigmas");
    218     MHCamera disp4 (geomcam, "Cal;RSigma/Charge",     "Reduced Sigma per Charge");
    219     MHCamera disp5 (geomcam, "Cal;FFactorPhe",        "Nr. of Phe's (F-Factor Method)");
    220     MHCamera disp6 (geomcam, "Cal;FFactorConv",       "Conversion Factor (F-Factor Method)");
    221     MHCamera disp7 (geomcam, "Cal;FFactorFFactor",    "Total F-Factor (F-Factor Method)");
    222     MHCamera disp8 (geomcam, "Cal;CascadesQEFFactor", "Cascades QE (F-Factor Method)");
    223     MHCamera disp9 (geomcam, "Cal;CascadesQEBlindPix","Cascades QE (Blind Pixel Method)");
    224     MHCamera disp10(geomcam, "Cal;CascadesQEPINDiode","Cascades QE (PIN Diode Method)");
    225     MHCamera disp11(geomcam, "Cal;CascadesQECombined","Cascades QE (Combined Method)");
    226     MHCamera disp12(geomcam, "Cal;FFactorValid",      "Pixels with valid F-Factor calibration");
    227     MHCamera disp13(geomcam, "Cal;BlindPixelValid",   "Pixels with valid BlindPixel calibration");
    228     MHCamera disp14(geomcam, "Cal;PINdiodeValid",     "Pixels with valid PINDiode calibration");
    229     MHCamera disp15(geomcam, "Cal;CombinedValid",     "Pixels with valid Combined calibration");
    230     MHCamera disp16(geomcam, "Cal;Saturation",        "Pixels with saturated Hi Gain");
    231     MHCamera disp17(geomcam, "Cal;ConversionMeans",   "Conversion HiGain.vs.LoGain Means");
    232     MHCamera disp18(geomcam, "Cal;ConversionSigmas",  "Conversion HiGain.vs.LoGain Sigmas");
    233     MHCamera disp19(geomcam, "Cal;HiGainPickup",      "Number Pickup events Hi Gain");
    234     MHCamera disp20(geomcam, "Cal;LoGainPickup",      "Number Pickup events Lo Gain");
    235     MHCamera disp21(geomcam, "Cal;HiGainBlackout",    "Number Blackout events Hi Gain");
    236     MHCamera disp22(geomcam, "Cal;LoGainBlackout",    "Number Blackout events Lo Gain");
    237     MHCamera disp23(geomcam, "Cal;Excluded",          "Pixels previously excluded");
     215    MHCamera disp1 (geomcam, "Charge",            "Fitted Mean Charges");
     216    MHCamera disp2 (geomcam, "SigmaCharge",       "Sigma of Fitted Charges");
     217    MHCamera disp3 (geomcam, "RSigma",            "Reduced Sigmas");
     218    MHCamera disp4 (geomcam, "RSigmaPerCharge",   "Reduced Sigma per Charge");
     219    MHCamera disp5 (geomcam, "NumPhes",           "Nr. of Phe's (F-Factor Method)");
     220    MHCamera disp6 (geomcam, "ConvFADC2Phes",     "Conversion Factor (F-Factor Method)");
     221    MHCamera disp7 (geomcam, "TotalFFactor",      "Total F-Factor (F-Factor Method)");
     222    MHCamera disp8 (geomcam, "CascadesQEFFactor", "Cascades QE (F-Factor Method)");
     223    MHCamera disp9 (geomcam, "CascadesQEBlindPix","Cascades QE (Blind Pixel Method)");
     224    MHCamera disp10(geomcam, "CascadesQEPINDiode","Cascades QE (PIN Diode Method)");
     225    MHCamera disp11(geomcam, "CascadesQECombined","Cascades QE (Combined Method)");
     226    MHCamera disp12(geomcam, "FFactorValid",      "Pixels with valid F-Factor calibration");
     227    MHCamera disp13(geomcam, "BlindPixelValid",   "Pixels with valid BlindPixel calibration");
     228    MHCamera disp14(geomcam, "PINdiodeValid",     "Pixels with valid PINDiode calibration");
     229    MHCamera disp15(geomcam, "CombinedValid",     "Pixels with valid Combined calibration");
     230    MHCamera disp16(geomcam, "Saturation",        "Pixels with saturated Hi Gain");
     231    MHCamera disp17(geomcam, "ConversionMeans",   "Conversion HiGain.vs.LoGain Means");
     232    MHCamera disp18(geomcam, "ConversionSigmas",  "Conversion HiGain.vs.LoGain Sigmas");
     233    MHCamera disp19(geomcam, "HiGainPickup",      "Number Pickup events Hi Gain");
     234    MHCamera disp20(geomcam, "LoGainPickup",      "Number Pickup events Lo Gain");
     235    MHCamera disp21(geomcam, "HiGainBlackout",    "Number Blackout events Hi Gain");
     236    MHCamera disp22(geomcam, "LoGainBlackout",    "Number Blackout events Lo Gain");
     237    MHCamera disp23(geomcam, "Excluded",          "Pixels previously excluded");
    238238    MHCamera disp24(geomcam, "Bad;UnSuitable",        "Pixels not suited for further analysis");
    239239    MHCamera disp25(geomcam, "Bad;UnReliable",        "Pixels not reliable for further analysis");
     
    368368      }
    369369   
    370     gStyle->SetOptStat(1111);
    371     gStyle->SetOptFit();
    372 
    373370    if (fDisplayType == kDataCheckDisplay)
    374371      {
     
    428425        c11.Divide(2, 4);
    429426       
    430         CamDraw(c11, 1, 2, disp1, 2, 1);
    431         CamDraw(c11, 2, 2, disp2, 2, 1);
     427        CamDraw(c11, 1, 2, disp1, 5, 1);
     428        CamDraw(c11, 2, 2, disp2, 5, 1);
    432429       
    433430        // Reduced Sigmas
     
    435432        c12.Divide(2,4);
    436433       
    437         CamDraw(c12, 1, 2, disp3, 2, 1);
    438         CamDraw(c12, 2, 2, disp4, 2, 1);
     434        CamDraw(c12, 1, 2, disp3, 5, 1);
     435        CamDraw(c12, 2, 2, disp4, 5, 1);
    439436       
    440437        //  F-Factor
     
    442439        c13.Divide(3,4);
    443440       
    444         CamDraw(c13, 1, 3, disp5, 2, 1);
    445         CamDraw(c13, 2, 3, disp6, 2, 1);
    446         CamDraw(c13, 3, 3, disp7, 2, 1);
     441        CamDraw(c13, 1, 3, disp5, 5, 1);
     442        CamDraw(c13, 2, 3, disp6, 5, 1);
     443        CamDraw(c13, 3, 3, disp7, 5, 1);
    447444       
    448445        // QE's
     
    450447        c14.Divide(4,4);
    451448       
    452         CamDraw(c14, 1, 4, disp8,  2, 1);
    453         CamDraw(c14, 2, 4, disp9,  2, 1);
    454         CamDraw(c14, 3, 4, disp10, 2, 1);
    455         CamDraw(c14, 4, 4, disp11, 2, 1);
     449        CamDraw(c14, 1, 4, disp8,  5, 1);
     450        CamDraw(c14, 2, 4, disp9,  5, 1);
     451        CamDraw(c14, 3, 4, disp10, 5, 1);
     452        CamDraw(c14, 4, 4, disp11, 5, 1);
    456453       
    457454        // Defects
     
    476473        c16.Divide(2,3);
    477474       
    478         CamDraw(c16, 1, 2, disp28, 2);
    479         CamDraw(c16, 2, 2, disp29, 1);
     475        CamDraw(c16, 1, 2, disp28, 5);
     476        CamDraw(c16, 2, 2, disp29, 5);
    480477
    481478        if (fRelTimes)
     
    485482            c17.Divide(2,4);
    486483           
    487             CamDraw(c17, 1, 2, disp30, 2, 1);
    488             CamDraw(c17, 2, 2, disp31, 2, 1);
     484            CamDraw(c17, 1, 2, disp30, 5, 1);
     485            CamDraw(c17, 2, 2, disp31, 5, 1);
    489486          }
    490487       
Note: See TracChangeset for help on using the changeset viewer.