Ignore:
Timestamp:
01/30/05 16:18:58 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc

    r5940 r6131  
    119119#include <TLegend.h>
    120120#include <TGraph.h>
     121#include <TEnv.h>
    121122
    122123ClassImp(MHCalibrationRelTimeCam);
     
    134135const TString MHCalibrationRelTimeCam::gsHistXTitle = "Arr. Time [FADC slices]";
    135136const TString MHCalibrationRelTimeCam::gsHistYTitle = "Nr. events";
     137const TString MHCalibrationRelTimeCam::fgReferenceFile = "mjobs/calibrationref.rc";
    136138// --------------------------------------------------------------------------
    137139//
     
    170172  SetHistYTitle(gsHistYTitle.Data());
    171173
     174  SetReferenceFile();
     175
     176  fInnerRefTime  = 2.95;   
     177  fOuterRefTime  = 3.6;
    172178}
    173179
     
    195201  cam->fFirst                  = fFirst;
    196202  cam->fLast                   = fLast;
     203
     204  cam->fReferenceFile          = fReferenceFile;
     205  cam->fInnerRefTime           = fInnerRefTime;
     206  cam->fOuterRefTime           = fOuterRefTime;
    197207
    198208  //
     
    648658        {
    649659           MHCalibrationPix &lopix = GetAverageLoGainArea(i);
    650            DrawDataCheckPixel(lopix,0.);
     660           DrawDataCheckPixel(lopix,i ? fOuterRefTime+1.5 : fInnerRefTime+1.5);
    651661         }
    652662       else
    653          DrawDataCheckPixel(hipix,0.);
     663         DrawDataCheckPixel(hipix,i ? fOuterRefTime : fInnerRefTime);
    654664    }     
    655665}
     
    751761  }
    752762
    753   //  DisplayRefLines(null,refline);
    754 
    755   gPad->Modified();
    756   gPad->Update();
     763  DisplayRefLines(null,refline);
    757764
    758765  newpad->cd(2);
     
    793800}
    794801
     802void  MHCalibrationRelTimeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const
     803{
     804
     805  TGraph *gr = new TGraph(2);
     806  gr->SetPoint(0,refline,0.);
     807  gr->SetPoint(1,refline,hist->GetMaximum());
     808  gr->SetBit(kCanDelete);
     809  gr->SetLineColor(kGreen);
     810  gr->SetLineStyle(2);
     811  gr->SetLineWidth(3);
     812  gr->Draw("L");
     813
     814  TLegend *leg = new TLegend(0.8,0.65,0.99,0.99);
     815  leg->SetBit(kCanDelete);
     816  leg->AddEntry(gr,"Trigger Time Calib.","l");
     817  leg->Draw();
     818}
     819
     820Int_t MHCalibrationRelTimeCam::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     821{
     822
     823  Bool_t rc = kFALSE;
     824
     825  if (IsEnvDefined(env, prefix, "ReferenceFile", print))
     826    {
     827      SetReferenceFile(GetEnvValue(env,prefix,"ReferenceFile",fReferenceFile.Data()));
     828      rc = kTRUE;
     829    }
     830
     831  TEnv refenv(fReferenceFile);
     832
     833  fInnerRefTime = refenv.GetValue("InnerRefTime",fInnerRefTime);
     834  fOuterRefTime = refenv.GetValue("OuterRefTime",fOuterRefTime);
     835
     836  return MHCalibrationCam::ReadEnv(env,prefix,print) ? kTRUE : rc;
     837
     838}
Note: See TracChangeset for help on using the changeset viewer.