Changeset 4636 for trunk/MagicSoft


Ignore:
Timestamp:
08/16/04 17:55:36 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r4634 r4636  
    4646     - replace two gLog by *fLog
    4747     - add the pulser color (needed for the datacheck histograms)
     48     - some modifications in the data-check display, discussed with Florian
    4849
    4950   * mjobs/MJCalibration.[h,cc]
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeCam.cc

    r4602 r4636  
    121121#include "MHCalibrationChargePix.h"
    122122
     123#include "MCalibrationCam.h"
     124
    123125#include "MCalibrationChargeCam.h"
    124126#include "MCalibrationChargePix.h"
     
    362364          {
    363365            hist.GetHGausHist()->SetTitle(Form("%s%s%s","Signal averaged on event-by-event basis ",
    364                                                j==0 ? "Inner Pixels " : "Outer Pixels ","High Gain Runs: "));
     366                                               j==0 ? "Inner Pixels " : "Outer Pixels ","Low Gain Runs: "));
    365367            hist.InitBins();
    366368            hist.SetEventFrequency(fPulserFrequency);
     
    388390          hist.GetHGausHist()->SetTitle("Summed FADC slices average HiGain Sector ");
    389391          hist.SetNbins(fAverageNbins);
    390           hist.SetLast (2.*hist.GetLast());
    391392          hist.GetHAbsTime()->SetTitle("Absolute Arrival Time average HiGain Sector ");
    392393
     
    550551      const Int_t npix = fAverageAreaNum[j];
    551552
     553      if (npix == 0)
     554        continue;
     555
    552556      MHCalibrationChargePix &hipix = (MHCalibrationChargePix&)GetAverageHiGainArea(j);
    553557      MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainArea(j);
     
    556560      lopix.FillHistAndArray(sumloarea[j]/npix);
    557561
    558       hipix.SetSaturated((Float_t)sathiarea[j]/npix);
    559       lopix.SetSaturated((Float_t)satloarea[j]/npix);
     562      hipix.SetSaturated(sathiarea[j]/npix);
     563      lopix.SetSaturated(satloarea[j]/npix);
    560564
    561565      hipix.FillAbsTime(timehiarea[j]/npix);
     
    569573      const Int_t npix = fAverageSectorNum[j];
    570574
     575      if (npix == 0)
     576        continue;
     577
    571578      MHCalibrationChargePix &hipix = (MHCalibrationChargePix&)GetAverageHiGainSector(j);
    572579      MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainSector(j);
     
    575582      lopix.FillHistAndArray(sumlosector[j]/npix);
    576583
    577       hipix.SetSaturated((Float_t)sathisector[j]/npix);
    578       lopix.SetSaturated((Float_t)satlosector[j]/npix);
     584      hipix.SetSaturated(sathisector[j]/npix);
     585      lopix.SetSaturated(satlosector[j]/npix);
    579586
    580587      hipix.FillAbsTime(timehisector[j]/npix);
     
    871878  TVirtualPad *pad = gPad ? gPad : MH::MakeDefCanvas(this); 
    872879  pad->SetBorderMode(0);
    873 
    874   pad->Divide(2,nareas);
    875 
     880  pad->Divide(1,nareas);
     881
     882  //
     883  // Loop over inner and outer pixels
     884  // 
    876885  for (Int_t i=0; i<nareas;i++)
    877     {
    878       pad->cd(2*(i+1)-1);
    879       MHCalibrationChargePix &hipix = (MHCalibrationChargePix&)GetAverageHiGainArea(i);
    880 
    881       if (i==0)
    882         DrawDataCheckPixel(hipix,gkHiGainInnerRefLines);
    883       else
    884         DrawDataCheckPixel(hipix,gkHiGainOuterRefLines);
    885 
    886       pad->cd(2*(i+1));
    887 
    888       MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainArea(i);
    889 
    890       if (i==0)
    891         DrawDataCheckPixel(lopix,gkLoGainInnerRefLines);
    892       else
    893         DrawDataCheckPixel(lopix,gkLoGainOuterRefLines);
    894 
     886     {
     887       
     888       pad->cd(i+1);
     889       
     890       MHCalibrationChargePix &hipix = (MHCalibrationChargePix&)GetAverageHiGainArea(i);
     891       MHCalibrationChargePix &lopix = (MHCalibrationChargePix&)GetAverageLoGainArea(i);
     892       //
     893       // Ask for Hi-Gain saturation
     894       //
     895       if (hipix.GetSaturated() > fNumHiGainSaturationLimit*hipix.GetHGausHist()->GetEntries())
     896         DrawDataCheckPixel(lopix,i ? gkLoGainOuterRefLines : gkLoGainInnerRefLines);
     897       else
     898         DrawDataCheckPixel(hipix,i ? gkHiGainOuterRefLines : gkHiGainInnerRefLines);
    895899    }     
    896900}
     
    928932
    929933  for (int i=0; i<navhi; i++)
    930     (*cam->fAverageHiGainAreas)[i] = (*fAverageHiGainAreas)[i]->Clone();
     934    (*cam->fAverageHiGainAreas)  [i] = (*fAverageHiGainAreas)  [i]->Clone();
    931935  for (int i=0; i<navlo; i++)
    932     (*cam->fAverageLoGainAreas)[i] = (*fAverageLoGainAreas)[i]->Clone();
     936    (*cam->fAverageLoGainAreas)  [i] = (*fAverageLoGainAreas)  [i]->Clone();
    933937  for (int i=0; i<nsehi; i++)
    934938    (*cam->fAverageHiGainSectors)[i] = (*fAverageHiGainSectors)[i]->Clone();
     
    945949  cam->fRunNumbers             = fRunNumbers;
    946950
     951  cam->fColor                  = fColor;
    947952  cam->fPulserFrequency        = fPulserFrequency;
    948953  cam->fAverageNbins           = fAverageNbins;
     
    967972  TH1F *hist = pix.GetHGausHist();
    968973 
    969 
    970   TH2D *null = new TH2D("Null",hist->GetTitle(),100,pix.GetFirst(),pix.GetLast(),
     974  TH2D *null = new TH2D("Null",hist->GetTitle(),100,pix.GetFirst() > -1. ? 0. : 100.,pix.GetLast()/2.,
    971975                        100,0.,hist->GetEntries()/10.);
    972976
    973977  null->SetDirectory(NULL);
    974978  null->SetBit(kCanDelete);
    975   null->GetXaxis()->SetTitle(hist->GetXaxis()->GetTitle());
    976   null->GetYaxis()->SetTitle(hist->GetYaxis()->GetTitle()); 
    977   null->GetXaxis()->CenterTitle();
    978   null->GetYaxis()->CenterTitle();
     979  //
     980  // set the labels bigger
     981  //
     982  TAxis *xaxe = null->GetXaxis();
     983  TAxis *yaxe = null->GetYaxis();
     984  xaxe->CenterTitle();
     985  yaxe->CenterTitle();   
     986  xaxe->SetTitleSize(0.07);
     987  yaxe->SetTitleSize(0.07);   
     988  xaxe->SetTitleOffset(0.7);
     989  yaxe->SetTitleOffset(0.55);   
     990  xaxe->SetLabelSize(0.06);
     991  yaxe->SetLabelSize(0.06);   
     992
     993  xaxe->SetTitle(hist->GetXaxis()->GetTitle());
     994  yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 
    979995  null->Draw();
    980996  hist->Draw("same");
     
    9841000  if (pix.GetFGausFit())
    9851001  {
    986       pix.GetFGausFit()->SetLineColor(pix.IsGausFitOK() ? kGreen : kRed);
    987       pix.GetFGausFit()->Draw("same");
     1002    switch ( fColor )
     1003      {
     1004      case MCalibrationCam::kGREEN:
     1005        pix.GetFGausFit()->SetLineColor(kGreen);
     1006        break;
     1007      case MCalibrationCam::kBLUE:
     1008        pix.GetFGausFit()->SetLineColor(kBlue);
     1009        break;
     1010      case MCalibrationCam::kUV: 
     1011        pix.GetFGausFit()->SetLineColor(106);
     1012        break;
     1013      case MCalibrationCam::kCT1:
     1014        pix.GetFGausFit()->SetLineColor(006);
     1015        break;
     1016      default:
     1017        pix.GetFGausFit()->SetLineColor(kRed);
     1018      }
     1019    pix.GetFGausFit()->Draw("same");
    9881020  }
    9891021
    9901022  DisplayRefLines(null,refline);
    991 
    9921023
    9931024  newpad->cd(2);
     
    10191050  TLine *blue1   = new TLine(refline[1],0.,refline[1],hist->GetYaxis()->GetXmax());
    10201051  blue1->SetBit(kCanDelete);
    1021   blue1->SetLineColor(007);
     1052  blue1->SetLineColor(227);
    10221053  blue1->SetLineStyle(2);
    10231054  blue1->SetLineWidth(3);
     
    10261057  TLine *blue5   = new TLine(refline[2],0.,refline[2],hist->GetYaxis()->GetXmax());
    10271058  blue5->SetBit(kCanDelete);
    1028   blue5->SetLineColor(062);
     1059  blue5->SetLineColor(68);
    10291060  blue5->SetLineStyle(2);
    10301061  blue5->SetLineWidth(3);
     
    10331064  TLine *blue10   = new TLine(refline[3],0.,refline[3],hist->GetYaxis()->GetXmax());
    10341065  blue10->SetBit(kCanDelete);
    1035   blue10->SetLineColor(004);
     1066  blue10->SetLineColor(4);
    10361067  blue10->SetLineStyle(2);
    10371068  blue10->SetLineWidth(3);
     
    10471078  TLine *ct1    = new TLine(refline[5],0.,refline[5],hist->GetYaxis()->GetXmax());
    10481079  ct1->SetBit(kCanDelete);
    1049   ct1->SetLineColor(006);
     1080  ct1->SetLineColor(6);
    10501081  ct1->SetLineStyle(2);
    10511082  ct1->SetLineWidth(3);
    10521083  ct1->Draw();
    10531084
    1054   TLegend *leg = new TLegend(0.4,0.75,0.7,0.99);
     1085  TLegend *leg = new TLegend(0.7,0.35,0.9,0.99);
    10551086  leg->SetBit(kCanDelete);
    10561087  leg->AddEntry(green1,"1 Led GREEN","l");
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.cc

    r4582 r4636  
    128128  MHGausEvents::InitBins();
    129129  fHAbsTime.SetBins(fAbsTimeNbins,fAbsTimeFirst,fAbsTimeLast);
    130 }
    131 
    132 // --------------------------------------------------------------------------
    133 //
    134 // Sets:
    135 // - fSaturated to 0.
    136 //
    137 // Executes:
    138 // - MHGausEvents::Clear()
    139 //
    140 void MHCalibrationChargePix::Clear(Option_t *o)
    141 {
    142 
    143   fSaturated = 0.;
    144 
    145   MHGausEvents::Clear();
    146   return;
    147130}
    148131
  • trunk/MagicSoft/Mars/mcalib/MHCalibrationChargePix.h

    r4582 r4636  
    3232  ~MHCalibrationChargePix() {}
    3333
    34   virtual void Clear(Option_t *o="");
    3534  virtual void Reset(); 
    3635  virtual void InitBins();
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.cc

    r4547 r4636  
    225225  fSigmaErr          = 0.;
    226226  fProb              = 0.;
    227  
     227
     228  fSaturated         = 0;
    228229  fCurrentSize       = 0;
    229230
  • trunk/MagicSoft/Mars/mcalib/MHGausEvents.h

    r4547 r4636  
    5353  Int_t    fNbins;                     // Number histogram bins for fHGausHist (used by InitBins())
    5454  Int_t    fNDFLimit;                  // NDF limit for judgement if fit is OK
    55   Float_t  fSaturated;                 // Number of events classified as saturated
     55  Int_t    fSaturated;                 // Number of events classified as saturated
    5656  Double_t fSigma;                     // Sigma of the Gauss fit
    5757  Double_t fSigmaErr;                  // Error of the sigma of the Gauss fit
     
    8181  // Draws
    8282  virtual void Draw(Option_t *option="");         // Default Draw
    83   void DrawEvents();                                  // Draw graph of fEvents
     83  void DrawEvents();                              // Draw graph of fEvents
    8484 
    8585  // Getters
     
    136136                   const Double_t xmax=0.);       // Fit the histogram HGausHist with a Gaussian
    137137  Bool_t RepeatFit(const Option_t *option="RQ0"); // Repeat fit within limits defined by fPickupLimit
    138   void BypassFit();                               // Take mean and RMS from the histogram
     138  void   BypassFit();                             // Take mean and RMS from the histogram
    139139 
    140140  // Prints
     
    158158  void  SetProb             ( const Double_t d                   ) { fProb           = d;   }
    159159  void  SetProbLimit        ( const Float_t  lim=fgProbLimit     ) { fProbLimit      = lim; }
    160   void  SetSaturated        ( const Float_t f                    ) { fSaturated     += f;   }
     160  void  SetSaturated        ( const Int_t    i                   ) { fSaturated     += i;   }
    161161  void  SetSigma            ( const Double_t d                   ) { fSigma          = d;   }
    162162  void  SetSigmaErr         ( const Double_t d                   ) { fSigmaErr       = d;   }
  • trunk/MagicSoft/Mars/mjobs/MJCalibration.cc

    r4626 r4636  
    14331433    // As long as there are no DM's, have to colour by hand
    14341434    //
     1435    chargecam.SetColor    (fColor);
    14351436    calcalc.SetPulserColor(fColor);
    14361437
Note: See TracChangeset for help on using the changeset viewer.