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

Legend:

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

    r9153 r9301  
    4545#include "MLogManip.h"
    4646
     47#include "MString.h"
    4748#include "MBinning.h"
    4849
     
    300301        //                         GetCollectionAreaEff(),
    301302        //                         GetCollectionAreaAbs(), fMcAreaRadius);
    302         const TString txt = Form("r_{max}=%.0fm --> A_{max}=%.0fm^{2}",
    303                                  fMcAreaRadius, GetCollectionAreaAbs());
     303        const TString txt = MString::Format("r_{max}=%.0fm --> A_{max}=%.0fm^{2}",
     304                                            fMcAreaRadius, GetCollectionAreaAbs());
    304305
    305306        TLatex text(0.31, 0.95, txt);
  • trunk/MagicSoft/Mars/mhflux/MHDisp.cc

    r9281 r9301  
    624624            h2->Fit(&func, "IQ", "", 0, 1.0);
    625625
    626             h2->SetTitle(Form("P=(%.2f\\circ/%.2f\\circ) \\omega=%.2f\\circ f=%.2f", x0, y0, func.GetParameter(2), TMath::Abs(scale)));
     626            h2->SetTitle(MString::Format("P=(%.2f\\circ/%.2f\\circ) \\omega=%.2f\\circ f=%.2f",
     627                                         x0, y0, func.GetParameter(2), TMath::Abs(scale)));
    627628        }
    628629    }
  • trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc

    r9153 r9301  
    399399TH1 *MHEnergyEst::MakeProf(TH2 &h)
    400400{
    401     TH1 *p = h.ProfileX(Form("Prof%s", h.GetName()), -1, -1, "s");
     401    TH1 *p = h.ProfileX(MString::Format("Prof%s", h.GetName()), -1, -1, "s");
    402402    p->SetDirectory(NULL);
    403403    p->SetBit(kCanDelete);
  • trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc

    r9153 r9301  
    11/* ======================================================================== *\
    2 ! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.23 2008-11-11 11:42:14 tbretz Exp $
     2! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.24 2009-02-07 16:11:57 tbretz Exp $
    33! --------------------------------------------------------------------------
    44!
     
    144144#include "MAlphaFitter.h"
    145145
     146#include "MString.h"
    146147#include "MBinning.h"
    147148#include "MParList.h"
     
    409410    const Float_t cut1 = axe.GetBinLowEdge(f);
    410411    const Float_t cut2 = axe.GetBinUpEdge(l);
    411     h2->SetTitle(Form("Distribution of %.1f\\circ<|\\alpha|<%.1f\\circ in x,y", cut1, cut2));
     412    h2->SetTitle(MString::Format("Distribution of %.1f\\circ<|\\alpha|<%.1f\\circ in x,y", cut1, cut2));
    412413
    413414    // Get projection for range
     
    446447    axe.SetRangeUser(0, fAlphaCut);
    447448    const Float_t cut = axe.GetBinUpEdge(axe.GetLast());
    448     h3->SetTitle(Form("Distribution of |\\alpha|<%.1f\\circ in x,y", cut));
     449    h3->SetTitle(MString::Format("Distribution of |\\alpha|<%.1f\\circ in x,y", cut));
    449450
    450451    // Get projection for range
     
    606607            // Than for their projections
    607608            TH1 *h = fHist.ProjectionZ("Alpha_z", maxx, maxx, maxy, maxy);
    608             h->SetTitle(Form("Distribution of \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma)", x, y, s));
     609            h->SetTitle(MString::Format("Distribution of \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma)", x, y, s));
    609610
    610611            TH1D *ho=0;
     
    934935    histb->Reset();
    935936    hist->SetNameTitle("Significance",
    936                        Form("Fit Region: Signal<%.1f\\circ, %.1f\\circ<Bg<%.1f\\circ",
    937                             sigmax, bgmin, bgmax));
     937                       MString::Format("Fit Region: Signal<%.1f\\circ, %.1f\\circ<Bg<%.1f\\circ",
     938                                       sigmax, bgmin, bgmax));
    938939    hists->SetName("Excess");
    939940    histb->SetName("Background");
     
    10521053    h0b.GetXaxis()->SetRangeUser(0, maxalpha0*1.5);
    10531054
    1054     hists->SetTitle(Form("Excess events for \\alpha<%.0f\\circ (N_{max}=%d)", sigint, (int)hists->GetMaximum()));
    1055     histb->SetTitle(Form("Background events for \\alpha<%.0f\\circ", sigint));
     1055    hists->SetTitle(MString::Format("Excess events for \\alpha<%.0f\\circ (N_{max}=%d)", sigint, (int)hists->GetMaximum()));
     1056    histb->SetTitle(MString::Format("Background events for \\alpha<%.0f\\circ", sigint));
    10561057
    10571058    //hists->SetMinimum(GetMinimumGT(*hists));
     
    11421143    if (maxx>0 && maxy>0)
    11431144    {
    1144         const char *title = Form(" \\alpha for x=%.2f y=%.2f (S_{max}=%.1f\\sigma) ",
    1145                                  hist->GetXaxis()->GetBinCenter(maxx),
    1146                                  hist->GetYaxis()->GetBinCenter(maxy), maxs);
     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);
    11471148
    11481149        h = fHist.ProjectionZ("AlphaFit", maxx, maxx, maxy, maxy);
     
    11881189        }
    11891190
    1190         TF1 f1("f1", Form("gaus(0) + pol%d(3)", fHistOff ? 0 : polynom), 0, 90);
    1191         TF1 f2("f2", Form("gaus(0) + pol%d(3)", fHistOff ? 0 : polynom), 0, 90);
     1191        TF1 f1("f1", MString::Format("gaus(0) + pol%d(3)", fHistOff ? 0 : polynom), 0, 90);
     1192        TF1 f2("f2", MString::Format("gaus(0) + pol%d(3)", fHistOff ? 0 : polynom), 0, 90);
    11921193        f1.SetParameters(maxpar.GetArray());
    11931194        f2.SetParameters(maxpar.GetArray());
     
    12041205        leg->SetBorderSize(1);
    12051206        leg->SetTextSize(0.04);
    1206         leg->AddText(0.5, 0.82, Form("A * exp(-(\\frac{x-\\mu}{\\sigma})^{2}/2) + pol%d", polynom))->SetTextAlign(22);
     1207        leg->AddText(0.5, 0.82, MString::Format("A * exp(-(\\frac{x-\\mu}{\\sigma})^{2}/2) + pol%d", polynom))->SetTextAlign(22);
    12071208        //leg->AddText(0.5, 0.82, "A * exp(-(\\frac{x-\\mu}{\\sigma})^{2}/2) + b*x^{2} + a")->SetTextAlign(22);
    12081209        leg->AddLine(0, 0.65, 0, 0.65);
    1209         leg->AddText(0.06, 0.54, Form("A=%.2f", maxpar[0]))->SetTextAlign(11);
    1210         leg->AddText(0.06, 0.34, Form("\\sigma=%.2f", maxpar[2]))->SetTextAlign(11);
    1211         leg->AddText(0.06, 0.14, Form("\\mu=%.2f (fix)", maxpar[1]))->SetTextAlign(11);
    1212         leg->AddText(0.60, 0.54, Form("a=%.2f", maxpar[3]))->SetTextAlign(11);
    1213         leg->AddText(0.60, 0.34, Form("b=%.2f (fix)", maxpar[4]))->SetTextAlign(11);
     1210        leg->AddText(0.06, 0.54, MString::Format("A=%.2f", maxpar[0]))->SetTextAlign(11);
     1211        leg->AddText(0.06, 0.34, MString::Format("\\sigma=%.2f", maxpar[2]))->SetTextAlign(11);
     1212        leg->AddText(0.06, 0.14, MString::Format("\\mu=%.2f (fix)", maxpar[1]))->SetTextAlign(11);
     1213        leg->AddText(0.60, 0.54, MString::Format("a=%.2f", maxpar[3]))->SetTextAlign(11);
     1214        leg->AddText(0.60, 0.34, MString::Format("b=%.2f (fix)", maxpar[4]))->SetTextAlign(11);
    12141215        if (polynom>1)
    1215             leg->AddText(0.60, 0.14, Form("c=%.2f", !fHistOff?maxpar[5]:0))->SetTextAlign(11);
     1216            leg->AddText(0.60, 0.14, MString::Format("c=%.2f", !fHistOff?maxpar[5]:0))->SetTextAlign(11);
    12161217        leg->SetBit(kCanDelete);
    12171218        leg->Draw();
     
    12491250        leg->SetBorderSize(1);
    12501251        leg->SetTextSize(0.1);
    1251         leg->AddText(Form("S_{max}=%.1f\\sigma at \\alpha_{max}=%d\\circ", maxsig, max));
     1252        leg->AddText(MString::Format("S_{max}=%.1f\\sigma at \\alpha_{max}=%d\\circ", maxsig, max));
    12521253        leg->SetBit(kCanDelete);
    12531254        leg->Draw();
     
    13561357    TString str2("el.SetY1(gPad->GetY1()+0.9*(gPad->GetY2()-gPad->GetY1()));");
    13571358
    1358     str1.ReplaceAll("el.", Form("((TEllipse*)%p)->", el));
    1359     str2.ReplaceAll("el.", Form("((TEllipse*)%p)->", el));
    1360 
    1361     str1.ReplaceAll("0.9", Form("%f", x0));
    1362     str2.ReplaceAll("0.9", Form("%f", y0));
     1359    str1.ReplaceAll("el.", MString::Format("((TEllipse*)%p)->", el));
     1360    str2.ReplaceAll("el.", MString::Format("((TEllipse*)%p)->", el));
     1361
     1362    str1.ReplaceAll("0.9", MString::Format("%f", x0));
     1363    str2.ReplaceAll("0.9", MString::Format("%f", y0));
    13631364
    13641365    TLatex tex;
     
    13911392                 "y.GetBinLowEdge(y.GetLast()+1));");
    13921393
    1393     str3.ReplaceAll("x.", Form("((TAxis*)%p)->", &x));
    1394     str3.ReplaceAll("y.", Form("((TAxis*)%p)->", &y));
     1394    str3.ReplaceAll("x.", MString::Format("((TAxis*)%p)->", &x));
     1395    str3.ReplaceAll("y.", MString::Format("((TAxis*)%p)->", &y));
    13951396    // str3.ReplaceAll("pad", Form("((TPad*)(%p))", pad));
    13961397
  • trunk/MagicSoft/Mars/mhflux/MHThreshold.cc

    r9153 r9301  
    4646#include "MLogManip.h"
    4747
     48#include "MString.h"
    4849#include "MBinning.h"
    4950
     
    115116
    116117    TH1D h(fHEnergy);
     118    h.SetDirectory(0);
    117119
    118120#if ROOT_VERSION_CODE<ROOT_VERSION(5,20,00)
     
    138140    const Axis_t maxe = TMath::Sqrt(axe.GetBinLowEdge(bin)*axe.GetBinUpEdge(bin));
    139141
    140     TLatex text(0.30, 0.95, Form("E_{max}=%dGeV (%dGeV,%dGeV)", TMath::Nint(maxe),
    141                                  TMath::Nint(axe.GetBinLowEdge(bin)),
    142                                  TMath::Nint(axe.GetBinUpEdge(bin))));
     142    TLatex text(0.30, 0.95, MString::Format("E_{max}=%dGeV (%dGeV,%dGeV)", TMath::Nint(maxe),
     143                                            TMath::Nint(axe.GetBinLowEdge(bin)),
     144                                            TMath::Nint(axe.GetBinUpEdge(bin))));
    143145    text.SetBit(TLatex::kTextNDC);
    144146    text.SetTextSize(0.04);
Note: See TracChangeset for help on using the changeset viewer.