Changeset 1554


Ignore:
Timestamp:
10/24/02 17:04:13 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1553 r1554  
    88   * mhist/MHMatrix.cc:
    99     - changed the Print member function to be more flexible
     10
     11   * mhist/MHHadroness.[h,cc]:
     12     - changed fQfac from TH to TGraph
     13     - changed the Qfactor-plot x-axis from Hadronness to Gamma-Acceptance
    1014
    1115
  • trunk/MagicSoft/Mars/macros/multidimdist.C

    r1553 r1554  
    9898    tlist.PrintStatistics();
    9999
    100     fillmat.Print("size");
    101     fillmat2.Print("size");
     100    matrix.Print("size");
     101    matrix2.Print("size");
    102102
    103103    // ---------------------------------------------------------
     
    112112
    113113    MMultiDimDistCalc calc;
    114     calc.SetUseNumRows(0);
    115     calc.SetUseKernelMethod(kTRUE);
     114    calc.SetUseNumRows(15);
     115    //calc.SetUseKernelMethod(kTRUE);
    116116    tlist2.AddToList(&calc);
    117117
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.cc

    r1540 r1554  
    190190    //
    191191    const Float_t ratio = fGeomCam->GetPixRatio(i);
    192     const Float_t pnum  = ratio*pix.GetErrorPhot();
     192    const Float_t pnum  = sqrt(ratio)*pix.GetErrorPhot();
    193193
    194194    (*this)[pix.GetPixId()].SetFillColor(GetColor(pnum, min, max));
  • trunk/MagicSoft/Mars/mhist/MHHadroness.cc

    r1354 r1554  
    105105    fIntPhness->SetYTitle("Acceptance");
    106106
     107    /*
    107108    fQfac = new TH1D("Qfac", "Naive Quality factor", nbins, 0, 1);
    108109    fQfac->SetXTitle("Hadroness");
    109110    fQfac->SetYTitle("Quality");
     111    */
     112    fQfac = new TGraph;
     113    fQfac->SetTitle(" Naive Quality factor ");
    110114
    111115    fMinDist = new TH1D("MinDist", "Minimum Dist to (0, 1)", nbins, 0, 1);
     
    113117    fMinDist->SetYTitle("Distance");
    114118
    115     fQfac->SetDirectory(NULL);
     119    //fQfac->SetDirectory(NULL);
    116120    fGhness->SetDirectory(NULL);
    117121    fPhness->SetDirectory(NULL);
     
    200204
    201205    fGraph->Set(n);
     206    fQfac->Set(n);
    202207
    203208    const Stat_t sumg = fGhness->Integral(1, n+1);
     
    218223
    219224        fMinDist->SetBinContent(i, 1-sqrt(ip*ip + (ig-1)*(ig-1)));
    220         fQfac->SetBinContent(i, ig/sqrt(ip));
     225        fQfac->SetPoint(i, ig, ig/sqrt(ip));
     226        //fQfac->SetBinContent(fQfac->FindBin(ig), ig/sqrt(ip));
     227        *fLog << all << i << ": " << ig << " " << ig/sqrt(ip) << endl;
    221228    }
    222229
     
    279286    *fLog << "  Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(h)*100) << "%, ";
    280287    *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(h)*100) << "%" << endl;
    281     const Int_t q = GetQfac()->GetMaximumBin();
    282     *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << " @ H=";
    283     *fLog << GetQfac()->GetBinCenter(q) << endl;;
    284     *fLog << "  Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(q)*100) << "%, ";
    285     *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(q)*100) << "%" << endl;
     288    /*
     289     const Int_t q = GetQfac()->GetMaximumBin();
     290     *fLog << "Maximum Q-Factor: " << GetQfac()->GetMaximum() << " @ H=";
     291     *fLog << GetQfac()->GetBinCenter(q) << endl;;
     292     *fLog << "  Acc Gammas = " << Form("%3.0f", fIntGhness->GetBinContent(q)*100) << "%, ";
     293     *fLog << "Acc Hadrons = " << Form("%3.0f", fIntPhness->GetBinContent(q)*100) << "%" << endl;
     294     */
    286295    *fLog << endl;
    287296}
     
    303312    Getphness()->SetLineColor(kRed);
    304313    Getphness()->DrawCopy("same");
    305     c.cd(4);
    306     TGraph &g = (TGraph&)*fGraph->DrawClone("AC");
    307     g.SetBit(kCanDelete);
    308     gPad->Modified();
    309     gPad->Update();
    310     if (g.GetHistogram())
    311     {
    312         g.GetXaxis()->SetRangeUser(0, 1);
    313         g.GetXaxis()->SetTitle("Acceptance Hadrons");
    314         g.GetYaxis()->SetTitle("Acceptance Gammas");
    315         g.SetMarkerStyle(kFullDotSmall);
    316         g.Draw("P");
    317 
    318         gPad->Modified();
    319         gPad->Update();
    320     }
    321     const Int_t h = fMinDist->GetMaximumBin();
    322     TMarker *m = new TMarker(fIntPhness->GetBinContent(h),
    323                              fIntGhness->GetBinContent(h), kStar);
    324     m->SetMarkerColor(kBlue);
    325     m->SetBit(kCanDelete);
    326     m->Draw();
    327314    c.cd(2);
    328315    gStyle->SetOptStat(0);
     
    333320    fMinDist->DrawCopy("same");
    334321    c.cd(3);
    335     GetQfac()->DrawCopy();
    336 
    337     return &c;
    338 }
    339 
    340 // --------------------------------------------------------------------------
    341 //
    342 // Draw all histograms. (For the Meaning see class description)
    343 //
    344 void MHHadroness::Draw(Option_t *)
    345 {
    346     if (!gPad)
    347         MakeDefCanvas("Hadroness", fTitle);
    348 
    349     gPad->Divide(2, 2);
    350 
    351     gPad->cd(1);
    352     gStyle->SetOptStat(10);
    353     Getghness()->Draw();
    354     Getphness()->SetLineColor(kRed);
    355     Getphness()->Draw("same");
    356     gPad->cd(4);
    357     fGraph->Draw("AC");
    358     gPad->Modified();
    359     gPad->Update();
    360     if (fGraph->GetHistogram())
    361     {
    362         fGraph->GetXaxis()->SetRangeUser(0, 1);
    363         fGraph->GetXaxis()->SetTitle("Acceptance Hadrons");
    364         fGraph->GetYaxis()->SetTitle("Acceptance Gammas");
    365         fGraph->SetMarkerStyle(kFullDotSmall);
    366         fGraph->Draw("P");
     322    //GetQfac()->DrawCopy();
     323    TGraph &g2 = (TGraph&)*fQfac->DrawClone("AC");
     324    g2.SetBit(kCanDelete);
     325    gPad->Modified();
     326    gPad->Update();
     327    if (g2.GetHistogram())
     328    {
     329        g2.GetXaxis()->SetRangeUser(0, 1);
     330        g2.GetXaxis()->SetTitle("Acceptance Gammas");
     331        g2.GetYaxis()->SetTitle("Quality");
     332        g2.SetMarkerStyle(kFullDotSmall);
     333        g2.Draw("P");
     334
     335        gPad->Modified();
     336        gPad->Update();
     337    }
     338    c.cd(4);
     339    gPad->Modified();
     340    gPad->Update();
     341    TGraph &g = (TGraph&)*fGraph->DrawClone("AC");
     342    g.SetBit(kCanDelete);
     343    gPad->Modified();
     344    gPad->Update();
     345    if (g.GetHistogram())
     346    {
     347        g.GetXaxis()->SetRangeUser(0, 1);
     348        g.GetXaxis()->SetTitle("Acceptance Hadrons");
     349        g.GetYaxis()->SetTitle("Acceptance Gammas");
     350        g.SetMarkerStyle(kFullDotSmall);
     351        g.Draw("P");
     352
    367353        gPad->Modified();
    368354        gPad->Update();
     
    374360    m->SetBit(kCanDelete);
    375361    m->Draw();
     362    return &c;
     363}
     364
     365// --------------------------------------------------------------------------
     366//
     367// Draw all histograms. (For the Meaning see class description)
     368//
     369void MHHadroness::Draw(Option_t *)
     370{
     371    if (!gPad)
     372        MakeDefCanvas("Hadroness", fTitle);
     373
     374    gPad->Divide(2, 2);
     375
     376    gPad->cd(1);
     377    gStyle->SetOptStat(10);
     378    Getghness()->Draw();
     379    Getphness()->SetLineColor(kRed);
     380    Getphness()->Draw("same");
    376381    gPad->cd(2);
    377382    gStyle->SetOptStat(0);
     
    382387    fMinDist->Draw("same");
    383388    gPad->cd(3);
    384     GetQfac()->Draw();
    385 }
     389    //GetQfac()->Draw();
     390    fQfac->Draw("AC");
     391    gPad->Modified();
     392    gPad->Update();
     393    if (fQfac->GetHistogram())
     394    {
     395        fQfac->GetXaxis()->SetRangeUser(0, 1);
     396        fQfac->GetXaxis()->SetTitle("Acceptance Gammas");
     397        fQfac->GetYaxis()->SetTitle("Quality");
     398        fQfac->SetMarkerStyle(kFullDotSmall);
     399        fQfac->Draw("P");
     400
     401        gPad->Modified();
     402        gPad->Update();
     403    }
     404    gPad->cd(4);
     405    gPad->Modified();
     406    gPad->Update();
     407    fGraph->Draw("AC");
     408    gPad->Modified();
     409    gPad->Update();
     410    if (fGraph->GetHistogram())
     411    {
     412        fGraph->GetXaxis()->SetRangeUser(0, 1);
     413        fGraph->GetXaxis()->SetTitle("Acceptance Hadrons");
     414        fGraph->GetYaxis()->SetTitle("Acceptance Gammas");
     415        fGraph->SetMarkerStyle(kFullDotSmall);
     416        fGraph->Draw("P");
     417        gPad->Modified();
     418        gPad->Update();
     419    }
     420    const Int_t h = fMinDist->GetMaximumBin();
     421    TMarker *m = new TMarker(fIntPhness->GetBinContent(h),
     422                             fIntGhness->GetBinContent(h), kStar);
     423    m->SetMarkerColor(kBlue);
     424    m->SetBit(kCanDelete);
     425    m->Draw();
     426}
  • trunk/MagicSoft/Mars/mhist/MHHadroness.h

    r1336 r1554  
    2222    TH1D* fIntPhness;     // Hadrons Acceptance
    2323    TH1D* fIntGhness;     // Gammas Acceptance
    24     TH1D* fQfac;          // Quality factor
    2524    TH1D* fMinDist;       // Minimum Distance to optimum acceptance
    2625
     26    TGraph *fQfac;        // Quality factor
    2727    TGraph *fGraph;       // gamma acceptance vs. hadron acceptance
    2828
     
    3333    Double_t GetGammaAcceptance(Double_t acchad) const;
    3434
    35     TH1D *GetQfac() const    { return fQfac; }
    3635    TH1D *Getghness() const  { return fGhness; }
    3736    TH1D *Getphness() const  { return fPhness; }
  • trunk/MagicSoft/Mars/mhist/MHMatrix.cc

    r1553 r1554  
    324324    TString str(o);
    325325
     326    *fLog << all << flush;
     327
    326328    if (str.Contains("size", TString::kIgnoreCase))
    327329    {
    328         *fLog << all << GetDescriptor() << ": NumColumns=" << fM.GetNcols();
     330        *fLog << GetDescriptor() << ": NumColumns=" << fM.GetNcols();
    329331        *fLog << " NumRows=" << fM.GetNrows() << endl;
    330332    }
    331333
    332334    if (!fData && str.Contains("cols", TString::kIgnoreCase))
    333         *fLog << all << "Sorry, no column information available." << endl;
     335        *fLog << "Sorry, no column information available." << endl;
    334336
    335337    if (fData && str.Contains("cols", TString::kIgnoreCase))
Note: See TracChangeset for help on using the changeset viewer.