Ignore:
Timestamp:
02/07/09 20:48:57 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhflux
Files:
4 edited

Legend:

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

    r9281 r9303  
    4646#include "MHAlpha.h"
    4747
    48 #include <TF1.h>
    49 #include <TGraph.h>
    5048#include <TStyle.h>
    5149#include <TLatex.h>
    5250#include <TCanvas.h>
    5351#include <TPaveStats.h>
    54 #include <TStopwatch.h>
    5552
    5653#include "MSrcPosCam.h"
     
    8279MHAlpha::MHAlpha(const char *name, const char *title)
    8380    : fNameParameter("MHillasSrc"), fParameter(0),
    84     fOffData(0), fResult(0), fEnergy(0), fBin(0),
     81    fOffData(0), fResult(0), fSigma(0), fEnergy(0), fBin(0),
    8582    fPointPos(0), fTimeEffOn(0), fTime(0), fNumTimeBins(10),
    8683    fHillas(0), fMatrix(0), fSkipHistTime(kFALSE), fSkipHistTheta(kFALSE),
     
    10097    fHist.SetDirectory(NULL);
    10198    fHist.UseCurrentStyle();
     99    fHist.Sumw2();
    102100
    103101    // Main histogram
     
    107105    fHistTime.UseCurrentStyle();
    108106    fHistTime.SetDirectory(NULL);
    109 
     107    fHistTime.Sumw2();
    110108
    111109    fHEnergy.SetName("Excess");
     
    115113    fHEnergy.SetDirectory(NULL);
    116114    fHEnergy.UseCurrentStyle();
     115    fHEnergy.Sumw2();
    117116
    118117    fHTheta.SetName("ExcessTheta");
     
    123122    fHTheta.UseCurrentStyle();
    124123    fHTheta.SetMinimum(0);
     124    fHTheta.Sumw2();
    125125
    126126    // effective on time versus time
     
    10241024    pave->SetLabel(title);
    10251025
    1026     char txt[1000];
    1027     TText *ptxt;
    1028     sprintf(txt, " ");
    1029     ptxt = pave->AddText(txt);
     1026    TText *ptxt = pave->AddText(" ");
    10301027    ptxt->SetTextAlign(23);
    10311028
    1032     //sprintf(txt, "Significance %.1f\\sigma,  off-scale %.2f  (\\omega=%.2f\\circ)",
    1033     //        fFit.GetSignificance(), fFit.GetScaleFactor(), fFit.GetGausSigma());
    1034     sprintf(txt, "Significance %.1f\\sigma,  off-scale %.2f",
    1035             fit.GetSignificance(), fit.GetScaleFactor());
    1036     ptxt = pave->AddText(txt);
     1029    ptxt = pave->AddText(MString::Format("Significance %.1f\\sigma,  off-scale %.2f",
     1030                                         fit.GetSignificance(), fit.GetScaleFactor()));
    10371031    ptxt->SetTextAlign(23);
    10381032
    1039     sprintf(txt, "%.1f excess events,  %.1f background events",
    1040             fit.GetEventsExcess(), fit.GetEventsBackground());
    1041     ptxt = pave->AddText(txt);
     1033    ptxt = pave->AddText(MString::Format("%.1f excess events,  %.1f background events",
     1034                                         fit.GetEventsExcess(), fit.GetEventsBackground()));
    10421035    ptxt->SetTextAlign(23);
    10431036    pave->SetBit(kCanDelete);
     
    10621055    if (!fSkipHistEnergy)
    10631056    {
    1064         *fLog << inf << "Processing energy bins..." << endl;
     1057        *fLog << inf3 << "Processing energy bins..." << endl;
    10651058        FitEnergyBins();
    10661059    }
    10671060    if (!fSkipHistTheta)
    10681061    {
    1069         *fLog << inf << "Processing theta bins..." << endl;
     1062        *fLog << inf3 << "Processing theta bins..." << endl;
    10701063        FitThetaBins();
    10711064    }
    10721065    if (!fSkipHistTime)
    10731066    {
    1074         *fLog << inf << "Processing time bins..." << endl;
     1067        *fLog << inf3 << "Processing time bins..." << endl;
    10751068        UpdateAlphaTime(kTRUE);
    10761069        MH::RemoveFirstBin(fHTime);
     
    11641157    return gPad->GetPad(1)->DistancetoPrimitive(px,py)==0 ? 0 : 9999;
    11651158}
     1159
     1160void MHAlpha::RecursiveRemove(TObject *obj)
     1161{
     1162    if (obj==fOffData)
     1163        fOffData = 0;
     1164}
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.h

    r9153 r9303  
    152152    void Paint(Option_t *opt="");
    153153    void Draw(Option_t *option="");
     154    void RecursiveRemove(TObject *obj);
    154155
    155156    // MParContainer
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc

    r9292 r9303  
    280280
    281281#include "MTime.h"
     282#include "MString.h"
    282283#include "MParameters.h"
    283284#include "MPointingPos.h"
     
    609610
    610611    // Use a random name to make sure the object is unique
    611     const TString name = Form("CalcTheta%d", (UInt_t)gRandom->Uniform(999999999));
     612    const TString name = MString::Format("CalcTheta%d", (UInt_t)gRandom->Uniform(999999999));
    612613
    613614    // nbins = number of Theta bins
     
    795796    text.SetTextSize(0.04);
    796797
    797     TString txt = Form("T_{eff} = %.1fs \\pm %.1fs", val, error);
     798    TString txt = MString::Format("T_{eff} = %.1fs \\pm %.1fs", val, error);
    798799    if (range>0)
    799         txt += Form("     T_{axe} = %.1fs", range);
     800        txt += MString::Format("     T_{axe} = %.1fs", range);
    800801    if (fTotalTime>0)
    801         txt += Form("     T_{max} = %.1fs", fTotalTime);
     802        txt += MString::Format("     T_{max} = %.1fs", fTotalTime);
    802803
    803804    text.SetText(0.35, 0.94, txt);
     
    807808void MHEffectiveOnTime::PaintText(Double_t *res) const
    808809{
    809     TLatex text(0.27, 0.94, Form("T_{eff}=%.1fs\\pm%.1fs  \\lambda=%.1f\\pm%.1fHz  p=%.1f%%  \\chi^{2}/%d=%.1f",
    810                                  res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5]));
     810    TLatex text(0.27, 0.94, MString::Format("T_{eff}=%.1fs\\pm%.1fs  \\lambda=%.1f\\pm%.1fHz  p=%.1f%%  \\chi^{2}/%d=%.1f",
     811                                            res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5]));
    811812    text.SetBit(TLatex::kTextNDC);
    812813    text.SetTextSize(0.04);
     
    828829        return;
    829830
    830     TLatex text(0.47, 0.94, Form("\\bar{p} = %.1f%%", sum/n));
     831    TLatex text(0.47, 0.94, MString::Format("\\bar{p} = %.1f%%", sum/n));
    831832    text.SetBit(TLatex::kTextNDC);
    832833    text.SetTextSize(0.04);
  • trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc

    r9301 r9303  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.24 2009-02-07 16:11:57 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.25 2009-02-07 20:47:33 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    243243    fMm2Deg = geom->GetConvMm2Deg();
    244244
    245     const TString off(Form("%sOff", fName.Data()));
     245    const TString off(MString::Format("%sOff", fName.Data()));
    246246    if (fName!=off && fHistOff==NULL)
    247247    {
    248         const TString desc(Form("%s [%s] found... using ", off.Data(), ClassName()));
     248        const TString desc(MString::Format("%s [%s] found... using ", off.Data(), ClassName()));
    249249        MHFalseSource *hoff = (MHFalseSource*)plist->FindObject(off, ClassName());
    250250        if (!hoff)
     
    11431143    if (maxx>0 && maxy>0)
    11441144    {
    1145         const char *title = MString::Format(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ",
    1146                                             hist->GetXaxis()->GetBinCenter(maxx),
    1147                                             hist->GetYaxis()->GetBinCenter(maxy), maxs);
     1145        const TString title = MString::Format(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ",
     1146                                              hist->GetXaxis()->GetBinCenter(maxx),
     1147                                              hist->GetYaxis()->GetBinCenter(maxy), maxs);
    11481148
    11491149        h = fHist.ProjectionZ("AlphaFit", maxx, maxx, maxy, maxy);
Note: See TracChangeset for help on using the changeset viewer.