Ignore:
Timestamp:
12/12/03 09:04:01 (21 years ago)
Author:
gaug
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.cc

    r2660 r2661  
    4545#include <TF1.h>
    4646#include <TH2.h>
     47#include <TProfile.h>
    4748#include <TCanvas.h>
    4849#include <TPad.h>
     
    8586        fTimeProb(-1.),
    8687        fTimeNdf(-1),
    87         fUseLoGain(kFALSE)
     88        fUseLoGain(kFALSE),
     89        fOffset(0.),
     90        fSlope(0.)
    8891{
    8992
     
    391394    }
    392395
    393     gStyle->SetOptFit(0);
    394     gStyle->SetOptStat(1111111);
     396  TProfile *hist = new TProfile("PePe","Shit is still moving",100,0.,1000.,0.,1000.);
     397
     398  for (Int_t i=0;i<fTotalEntries;i++)
     399      hist->Fill(fHiGains->At(i),fLoGains->At(i),1);
     400
     401  gStyle->SetOptFit(0);
     402  gStyle->SetOptStat(1111111);
    395403   
    396404    TCanvas *c = MakeDefCanvas(this,600,900);
     
    432440        gROOT->SetSelectedPad(NULL);
    433441        gStyle->SetOptFit();
    434         fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete);
    435         fHiGainvsLoGain->Fit("p1","q");
     442        //      fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete);
     443        //      fHiGainvsLoGain->Fit("p1","q");
     444        hist->Draw("prof");
     445        hist->Fit("pol1","pepe","markus",hist->GetMean()-3.*hist->GetRMS(),hist->GetMean()+2.*hist->GetRMS());
     446
     447        fOffset = hist->GetFunction("pepe")->GetParameter(0);
     448        fSlope  = hist->GetFunction("pepe")->GetParameter(1);
     449
     450        cout << "Pepe: " << fOffset << " Markus: " << fSlope << endl;
     451
     452
    436453        gPad->Modified();
    437454        gPad->Update();
     
    467484        gROOT->SetSelectedPad(NULL);
    468485        gStyle->SetOptFit();
    469         fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete);
    470         fHiGainvsLoGain->Fit("p1","q");
     486        hist->Draw("prof");
     487        hist->Fit("p1","pepe","markus",hist->GetMean()-3.*hist->GetRMS(),hist->GetMean()+3.*hist->GetRMS());
     488        //      fHiGainvsLoGain->DrawClone("Apq")->SetBit(kCanDelete);
     489        //      fHiGainvsLoGain->Fit("p1","q");
    471490        gPad->Modified();
    472491        gPad->Update();
  • trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.h

    r2658 r2661  
    8585
    8686  Bool_t fUseLoGain;
     87
     88  Double_t fOffset;
     89  Double_t fSlope;
    8790 
    8891  virtual void DrawLegend();
     
    137140  const TH1I *GetHChargevsN()               { return fHChargevsNHiGain; }
    138141  const TH1I *GetHChargevsN()         const { return fHChargevsNHiGain; }
     142
     143  Double_t GetOffset()  { return fOffset; }
     144  Double_t GetSlope()   { return fSlope;  }
    139145 
    140146  Bool_t FitChargeHiGain(Option_t *option="RQ0"); 
Note: See TracChangeset for help on using the changeset viewer.