Changeset 4326 for trunk/MagicSoft


Ignore:
Timestamp:
06/22/04 18:20:04 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4324 r4326  
    4444    - upper histogram limit lowered for the better visibility in the
    4545      data check.
     46
     47  * mcalib/MHCalibrationChargeCam.[h,cc]
     48    - adapted Draw for the datacheck
    4649
    4750
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc

    r4315 r4326  
    141141#include <TVirtualPad.h>
    142142#include <TCanvas.h>
     143#include <TStyle.h>
     144#include <TF1.h>
     145#include <TH2D.h>
     146#include <TLine.h>
     147#include <TLatex.h>
     148#include <TLegend.h>
    143149
    144150ClassImp(MHCalibrationChargeCam);
     
    150156const Float_t MHCalibrationChargeCam::fgTimeLowerLimit           = 1.;
    151157const Float_t MHCalibrationChargeCam::fgTimeUpperLimit           = 2.;
     158const Int_t   MHCalibrationChargeCam::gkNumRefColours            = 6;
    152159// --------------------------------------------------------------------------
    153160//
     
    173180  SetTimeLowerLimit();
    174181  SetTimeUpperLimit();
     182
     183  gkHiGainInnerRefLines.Set(gkNumRefColours);
     184  gkHiGainOuterRefLines.Set(gkNumRefColours);
     185  gkLoGainInnerRefLines.Set(gkNumRefColours);
     186  gkLoGainOuterRefLines.Set(gkNumRefColours);
     187
     188  gkHiGainInnerRefLines.AddAt(245. ,0);
     189  gkHiGainOuterRefLines.AddAt(217. ,0);
     190  gkLoGainInnerRefLines.AddAt(20.8 ,0);
     191  gkLoGainOuterRefLines.AddAt(18.9 ,0);
     192
     193  gkHiGainInnerRefLines.AddAt(323. ,1);
     194  gkHiGainOuterRefLines.AddAt(307.5,1);
     195  gkLoGainInnerRefLines.AddAt(28.0 ,1);
     196  gkLoGainOuterRefLines.AddAt(26.0 ,1);
     197
     198  gkHiGainInnerRefLines.AddAt(1065.,2);
     199  gkHiGainOuterRefLines.AddAt(932. ,2);
     200  gkLoGainInnerRefLines.AddAt(121. ,2);
     201  gkLoGainOuterRefLines.AddAt(108.3,2);
     202
     203  gkHiGainInnerRefLines.AddAt(1467.,3);
     204  gkHiGainOuterRefLines.AddAt(1405.,3);
     205  gkLoGainInnerRefLines.AddAt(200.2,3);
     206  gkLoGainOuterRefLines.AddAt(198. ,3);
     207
     208  gkHiGainInnerRefLines.AddAt(180.,4);
     209  gkHiGainOuterRefLines.AddAt(167.,4);
     210  gkLoGainInnerRefLines.AddAt(16.5,4);
     211  gkLoGainOuterRefLines.AddAt(14.0,4);
     212
     213  gkHiGainInnerRefLines.AddAt(211.,5);
     214  gkHiGainOuterRefLines.AddAt(183.5,5);
     215  gkLoGainInnerRefLines.AddAt(13.5,5);
     216  gkLoGainOuterRefLines.AddAt(11.,5);
    175217}
    176218
     
    312354        MHCalibrationChargePix &hist = (MHCalibrationChargePix&)GetAverageHiGainArea(j);
    313355
    314         hist.GetHGausHist()->SetTitle("Summed FADC slices average HiGain Area Idx ");
    315356        hist.SetNbins(fAverageNbins);
    316357        hist.SetLast(2.*hist.GetLast());
    317358        hist.GetHAbsTime()->SetTitle("Absolute Arrival Time average HiGain Area Idx ");
    318359
    319         InitHists(hist,fCam->GetAverageBadArea(j),j);
    320 
     360        if (fGeom->InheritsFrom("MGeomCamMagic"))
     361          {
     362            hist.GetHGausHist()->SetTitle(Form("%s%s%s","Signal averaged on event-by-event basis ",
     363                                               j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: "));
     364            hist.InitBins();
     365            hist.SetEventFrequency(fPulserFrequency);
     366          }
     367        else
     368          {
     369            hist.GetHGausHist()->SetTitle("Signal averaged on event-by-event basis High Gain Area Idx ");
     370            InitHists(hist,fCam->GetAverageBadArea(j),j);
     371          }
    321372      }
    322373  }
     
    335386        MHCalibrationChargePix &hist = (MHCalibrationChargePix&)GetAverageLoGainArea(j);
    336387
    337         hist.GetHGausHist()->SetTitle("Summed FADC slices average LoGain Area Idx ");
    338388        hist.SetNbins(fAverageNbins);
    339389        hist.GetHAbsTime()->SetTitle("Absolute Arrival Time average LoGain Area Idx ");
    340390
    341         InitHists(hist,fCam->GetAverageBadArea(j),j);
    342 
     391        if (fGeom->InheritsFrom("MGeomCamMagic"))
     392          {
     393            hist.GetHGausHist()->SetTitle(Form("%s%s%s","Signal averaged on event-by-event basis ",
     394                                               j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: "));
     395            hist.InitBins();
     396            hist.SetEventFrequency(fPulserFrequency);
     397          }
     398        else
     399          {
     400            hist.GetHGausHist()->SetTitle("Signal averaged on event-by-event basis High Gain Area Idx ");
     401            InitHists(hist,fCam->GetAverageBadArea(j),j);
     402          }
    343403        }
    344404    }
     
    833893    {
    834894      pad->cd(2*(i+1)-1);
    835       GetAverageHiGainArea(i).Draw("datacheck");
     895      MHCalibrationChargePix &hipix = (MHCalibrationChargePix&)GetAverageHiGainArea(i);
     896
     897      if (i==0)
     898        DrawDataCheckPixel(hipix,gkHiGainInnerRefLines);
     899      else
     900        DrawDataCheckPixel(hipix,gkHiGainOuterRefLines);
     901
    836902      pad->cd(2*(i+1));
    837       GetAverageLoGainArea(i).Draw("datacheck");
     903
     904      MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainArea(i);
     905
     906      if (i==0)
     907        DrawDataCheckPixel(lopix,gkLoGainInnerRefLines);
     908      else
     909        DrawDataCheckPixel(lopix,gkLoGainOuterRefLines);
     910
    838911    }     
    839912}
     
    907980}
    908981
     982void MHCalibrationChargeCam::DrawDataCheckPixel(MHCalibrationChargePix &pix, const TArrayF &refline)
     983{
     984 
     985  TVirtualPad *newpad = gPad;
     986  newpad->Divide(1,2);
     987  newpad->cd(1);
     988 
     989  gPad->SetTicks();
     990  if (!pix.IsEmpty())
     991    gPad->SetLogy();
     992
     993  gStyle->SetOptStat(0);
     994
     995  TH1F *hist = pix.GetHGausHist();
     996 
     997
     998  TH2D *null = new TH2D("Null",hist->GetTitle(),100,pix.GetFirst(),pix.GetLast(),
     999                        100,0.,hist->GetEntries()/10.);
     1000
     1001  null->SetDirectory(NULL);
     1002  null->SetBit(kCanDelete);
     1003  null->GetXaxis()->SetTitle(hist->GetXaxis()->GetTitle());
     1004  null->GetYaxis()->SetTitle(hist->GetYaxis()->GetTitle()); 
     1005  null->GetXaxis()->CenterTitle();
     1006  null->GetYaxis()->CenterTitle();
     1007  null->Draw();
     1008  hist->Draw("same");
     1009
     1010  gStyle->SetOptFit();
     1011
     1012  if (pix.GetFGausFit())
     1013  {
     1014      pix.GetFGausFit()->SetLineColor(pix.IsGausFitOK() ? kGreen : kRed);
     1015      pix.GetFGausFit()->Draw("same");
     1016  }
     1017
     1018  DisplayRefLines(null,refline);
     1019
     1020
     1021  newpad->cd(2);
     1022  gPad->SetTicks();
     1023
     1024  pix.DrawEvents();
     1025  return;
     1026 
     1027}
     1028
     1029
     1030void  MHCalibrationChargeCam::DisplayRefLines(const TH2D *hist, const TArrayF &refline) const
     1031{
     1032
     1033  TLine *green1 = new TLine(refline.At(0),0.,refline.At(0),hist->GetYaxis()->GetXmax());
     1034  green1->SetBit(kCanDelete);
     1035  green1->SetLineColor(kGreen);
     1036  green1->SetLineStyle(2);
     1037  green1->SetLineWidth(3);
     1038  green1->Draw();
     1039
     1040  TLine *blue1   = new TLine(refline.At(1),0.,refline.At(1),hist->GetYaxis()->GetXmax());
     1041  blue1->SetBit(kCanDelete);
     1042  blue1->SetLineColor(007);
     1043  blue1->SetLineStyle(2);
     1044  blue1->SetLineWidth(3);
     1045  blue1->Draw();
     1046
     1047  TLine *blue5   = new TLine(refline.At(2),0.,refline.At(2),hist->GetYaxis()->GetXmax());
     1048  blue5->SetBit(kCanDelete);
     1049  blue5->SetLineColor(062);
     1050  blue5->SetLineStyle(2);
     1051  blue5->SetLineWidth(3);
     1052  blue5->Draw();
     1053
     1054  TLine *blue10   = new TLine(refline.At(3),0.,refline.At(3),hist->GetYaxis()->GetXmax());
     1055  blue10->SetBit(kCanDelete);
     1056  blue10->SetLineColor(004);
     1057  blue10->SetLineStyle(2);
     1058  blue10->SetLineWidth(3);
     1059  blue10->Draw();
     1060
     1061  TLine *uv10    = new TLine(refline.At(4),0.,refline.At(4),hist->GetYaxis()->GetXmax());
     1062  uv10->SetBit(kCanDelete);
     1063  uv10->SetLineColor(106);
     1064  uv10->SetLineStyle(2);
     1065  uv10->SetLineWidth(3);
     1066  uv10->Draw();
     1067
     1068  TLine *ct1    = new TLine(refline.At(5),0.,refline.At(5),hist->GetYaxis()->GetXmax());
     1069  ct1->SetBit(kCanDelete);
     1070  ct1->SetLineColor(006);
     1071  ct1->SetLineStyle(2);
     1072  ct1->SetLineWidth(3);
     1073  ct1->Draw();
     1074
     1075  TLegend *leg = new TLegend(0.4,0.75,0.7,0.99);
     1076  leg->SetBit(kCanDelete);
     1077  leg->AddEntry(green1,"1 Led GREEN","l");
     1078  leg->AddEntry(blue1,"1 Led BLUE","l");
     1079  leg->AddEntry(blue5,"5 Leds BLUE","l");
     1080  leg->AddEntry(blue10,"10 Leds BLUE","l");
     1081  leg->AddEntry(uv10,"10 Leds UV","l");
     1082  leg->AddEntry(ct1,"CT1-Pulser","l");
     1083
     1084  leg->Draw();
     1085}
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.h

    r4315 r4326  
    66#endif
    77
     8#ifndef ROOT_TArrayF
     9#include "TArrayF.h"
     10#endif
     11
     12class TH2D;
    813class MRawEvtData;
    914class MExtractedSignalCam;
     
    1823  static const Float_t fgTimeLowerLimit;             //! Default for fTimeLowerLimit    (now set to: 1.)
    1924  static const Float_t fgTimeUpperLimit;             //! Default for fTimeUpperLimit    (now set to: 2.)
     25  static const Int_t   gkNumRefColours;
     26 
     27  TArrayF gkHiGainInnerRefLines;
     28  TArrayF gkHiGainOuterRefLines;
     29  TArrayF gkLoGainInnerRefLines;
     30  TArrayF gkLoGainOuterRefLines;
    2031 
    2132  Float_t fTimeLowerLimit;            // Limit dist. to first signal slice (in units of FADC slices)
     
    3748  void   FinalizeBadPixels();
    3849
    39 
    40  public:
     50  void   DrawDataCheckPixel(MHCalibrationChargePix &pix, const TArrayF &refline);
     51  void   DisplayRefLines(const TH2D *hist, const TArrayF &refline) const;
     52 
     53public:
    4154
    4255  MHCalibrationChargeCam(const char *name=NULL, const char *title=NULL);
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeLoGainPix.cc

    r4325 r4326  
    4242const Int_t   MHCalibrationChargeLoGainPix::fgChargeNbins     = 350;
    4343const Axis_t  MHCalibrationChargeLoGainPix::fgChargeFirst     = -0.5;
    44 const Axis_t  MHCalibrationChargeLoGainPix::fgChargeLast      = 249.5;
     44const Axis_t  MHCalibrationChargeLoGainPix::fgChargeLast      = 349.5;
    4545const Int_t   MHCalibrationChargeLoGainPix::fgAbsTimeNbins    = 15;
    4646const Axis_t  MHCalibrationChargeLoGainPix::fgAbsTimeFirst    = -0.5;
Note: See TracChangeset for help on using the changeset viewer.