Ignore:
Timestamp:
04/18/05 10:35:54 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhflux
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r6926 r6949  
    347347    {
    348348        *fLog << "Result:" << endl;
    349         *fLog << " - Significance           " << fSignificance << endl;
    350         *fLog << " - Excess Events          " << fEventsExcess << endl;
    351         *fLog << " - Signal Events          " << fEventsSignal << endl;
    352         *fLog << " - Background Events      " << fEventsBackground << endl;
    353         *fLog << " - Chi^2/ndf (Signal)     " << fChiSqSignal << endl;
    354         *fLog << " - Chi^2/ndf (Background) " << fChiSqBg << endl;
    355         *fLog << " - Signal integrated     " << fIntegralMax << "°" << endl;
    356         *fLog << " - Scale Factor (Off)     " << fScaleFactor << endl;
     349        *fLog << " - Significance (Li/Ma)    " << fSignificance << endl;
     350        *fLog << " - Excess Events           " << fEventsExcess << endl;
     351        *fLog << " - Signal Events           " << fEventsSignal << endl;
     352        *fLog << " - Background Events       " << fEventsBackground << endl;
     353        *fLog << " - Chi^2/ndf (Signal)      " << fChiSqSignal << endl;
     354        *fLog << " - Chi^2/ndf (Background)  " << fChiSqBg << endl;
     355        *fLog << " - Signal integrated up to " << fIntegralMax << "°" << endl;
     356        *fLog << " - Scale Factor (Off)      " << fScaleFactor << endl;
    357357    }
    358358}
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h

    r6892 r6949  
    8686
    8787    void Clear(Option_t *o="");
    88     void Print(Option_t *o="") const;
     88    void Print(Option_t *o="") const; //*MENU*
    8989    void Copy(TObject &o) const;
    9090    /*
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc

    r6283 r6949  
    660660            {
    661661                TVirtualPad *p=gPad->GetPad(x+1)->GetPad(y+1);
    662                 if (!(st = (TPaveStats*)p->GetPrimitive("stats")))
     662                if (!(st = dynamic_cast<TPaveStats*>(p->GetPrimitive("stats"))))
    663663                    continue;
    664664
  • trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc

    r6932 r6949  
    3636
    3737#include <TLine.h>
    38 #include <TCanvas.h>
     38#include <TCanvas.h>
     39#include <TStyle.h>
    3940#include <TProfile.h>
     41#include <TPaveStats.h>
    4042
    4143#include "MString.h"
     
    7880    fHResolution.SetDirectory(NULL);
    7981    fHResolution.SetName("EnergyRes");
    80     fHResolution.SetTitle("Histogram in \\frac{\\Delta lg(E)}{lg(E_{mc})} vs E_{est} and E_{mc}");
     82    fHResolution.SetTitle("Histogram in \\Delta lg(E) vs E_{est} and E_{mc}");
    8183    fHResolution.SetXTitle("E_{est} [GeV]");
    8284    fHResolution.SetYTitle("E_{mc} [GeV]");
    83     fHResolution.SetZTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");
     85    fHResolution.SetZTitle("lg(E_{est}) - lg(E_{mc})");
    8486
    8587    fHImpact.SetDirectory(NULL);
    8688    fHImpact.SetName("Impact");
    87     fHImpact.SetTitle("\\frac{\\Delta lg(E)}{lg(E)} vs Impact parameter");
     89    fHImpact.SetTitle("\\Delta lg(E) vs Impact parameter");
    8890    fHImpact.SetXTitle("Impact parameter [m]");
    89     fHImpact.SetYTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");
     91    fHImpact.SetYTitle("lg(E_{est}) - lg(E_{mc})");
    9092
    9193    fHEnergy.Sumw2();
     
    147149
    148150    fChisq = 0;
     151    fBias  = 0;
    149152    fHEnergy.Reset();
    150153    fHImpact.Reset();
     
    164167    const Double_t imp   = fMatrix ? GetVal(1) : fMcEvt->GetImpact()/100;
    165168    const Double_t theta = fMatrix ? GetVal(2) : fMcEvt->GetTelescopeTheta()*TMath::RadToDeg();
    166     const Double_t res   = (log10(eest)-log10(etru));///log10(etru);
    167     const Double_t resE   = (eest-etru)/etru;
     169    const Double_t res   = log10(eest)-log10(etru);///log10(etru);
     170    const Double_t resE  = (eest-etru)/etru;
    168171
    169172    fHEnergy.Fill(eest, etru, theta, w);
     
    171174    fHImpact.Fill(imp, resE, w);
    172175
    173     fChisq += res*res;
    174     fBias  += res;
     176    //if (etru>125 && etru<750)
     177    //    return kCONTINUE;
     178
     179    // lg(N)  = 4.3*lg(E)-6
     180    // lg(N0) = 4.3*2.2-6
     181
     182    const Double_t n  = 2; //pow(10, -4.3*(log10(etru)-2.2));
     183
     184    fChisq += log10(etru)<2.2? res*res*n/2:res*res;
     185    fBias  += log10(etru)<2.2? res*sqrt(n/2):res;
    175186
    176187    return kTRUE;
     
    192203void MHEnergyEst::Print(Option_t *o) const
    193204{
     205    const Double_t res  =   TMath::Sqrt(fChisq-fBias*fBias);
     206    const Double_t resp =   TMath::Power(10,  res)-1;
     207    const Double_t resm = 1-TMath::Power(10, -res);
     208
     209    if (TMath::IsNaN(res))
     210    {
     211        *fLog << all << "MHEnergyEst::Print: ERROR - Resolution is NaN (not a number)." << endl;
     212        return;
     213    }
     214
    194215    *fLog << all;
    195     *fLog << "Mean log10(Energy) Resoltion: " << Form("%5.2f%%", TMath::Sqrt(fChisq-fBias*fBias)) << endl;
    196     *fLog << "Mean log10(Energy) Bias:      " << Form("%5.2f%%", fBias) << endl;
     216    *fLog << "Mean log10(Energy) Resoltion: +/- " << Form("%4.2f", res) << endl;
     217    *fLog << "Mean log10(Energy) Bias:         "  << Form("%+4.2f", fBias) << endl;
     218    *fLog << "Asymmetric Energy  Resoltion:   +"  << Form("%4.1f%%", resp*100) << " -" << Form("%4.1f%%", resm*100) << endl;
    197219}
    198220
     
    246268
    247269            pad->GetPad(1)->GetPad(2)->cd(2);
    248             /*=*/fHResolution.ProjectionZ("Resolution");
    249             ///*h =*/ fHImpact.ProjectionX("Impact", -1, 9999, "e");
     270            hx = (TH1D*)fHResolution.ProjectionZ("Resolution");
     271            TPaveStats *stats = dynamic_cast<TPaveStats*>(hx->FindObject("stats"));
     272            if (stats)
     273            {
     274                stats->SetBit(BIT(17)); // TStyle.cxx: kTakeStyle=BIT(17)
     275                stats->SetX1NDC(0.63);
     276                stats->SetY1NDC(0.68);
     277            }
     278
     279            hx->Fit("gaus", "Q");
     280            gPad=NULL;
     281            gStyle->SetOptFit(101);
    250282        }
    251283    }
     
    325357//    h1->Draw("Chistsame");
    326358
    327     return h1;
     359    return h2;
    328360}
    329361
     
    415447    //h->SetXTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");
    416448    h->SetYTitle("Counts");
    417     h->SetTitle("Distribution of \\Delta lg(E) / lg(E_{mc})");
     449    h->SetTitle("Distribution of \\Delta lg(E)");
    418450    h->SetDirectory(NULL);
    419451    h->SetBit(kCanDelete);
    420452    h->GetXaxis()->SetRangeUser(-1.3, 1.3);
    421453    h->Draw("");
     454    //h->Fit("gaus");
    422455    // ----------------------------------------
    423456
     
    440473    h = MakePlot(fHResolution, "zy");
    441474    h->SetXTitle("E_{mc} [GeV]");
    442     h->SetYTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");
    443     h->SetTitle("Energy resolution \\Delta lg(E) / lg(E) vs Monte Carlo energy E_{mc}");
     475    h->SetYTitle("lg(E_{est}) - lg(E_{mc})");
     476    h->SetTitle("Energy resolution \\Delta lg(E) vs Monte Carlo energy E_{mc}");
    444477    h->SetMinimum(-1.3);
    445478    h->SetMaximum(1.3);
     
    448481    h = MakePlot(fHResolution, "zx");
    449482    h->SetXTitle("E_{est} [GeV]");
    450     h->SetYTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");
    451     h->SetTitle("Energy Resolution \\Delta lg(E) / lg(E) vs estimated Energy E_{est}");
     483    h->SetYTitle("lg(E_{est}) - lg(E_{mc})");
     484    h->SetTitle("Energy Resolution \\Delta lg(E) vs estimated Energy E_{est}");
    452485    h->SetMinimum(-1.3);
    453486    h->SetMaximum(1.3);
Note: See TracChangeset for help on using the changeset viewer.