Changeset 9301 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 02/07/09 16:11:57 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc
r9153 r9301 45 45 #include "MLogManip.h" 46 46 47 #include "MString.h" 47 48 #include "MBinning.h" 48 49 … … 300 301 // GetCollectionAreaEff(), 301 302 // 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()); 304 305 305 306 TLatex text(0.31, 0.95, txt); -
trunk/MagicSoft/Mars/mhflux/MHDisp.cc
r9281 r9301 624 624 h2->Fit(&func, "IQ", "", 0, 1.0); 625 625 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))); 627 628 } 628 629 } -
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
r9153 r9301 399 399 TH1 *MHEnergyEst::MakeProf(TH2 &h) 400 400 { 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"); 402 402 p->SetDirectory(NULL); 403 403 p->SetBit(kCanDelete); -
trunk/MagicSoft/Mars/mhflux/MHFalseSource.cc
r9153 r9301 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.2 3 2008-11-11 11:42:14tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHFalseSource.cc,v 1.24 2009-02-07 16:11:57 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 144 144 #include "MAlphaFitter.h" 145 145 146 #include "MString.h" 146 147 #include "MBinning.h" 147 148 #include "MParList.h" … … 409 410 const Float_t cut1 = axe.GetBinLowEdge(f); 410 411 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)); 412 413 413 414 // Get projection for range … … 446 447 axe.SetRangeUser(0, fAlphaCut); 447 448 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)); 449 450 450 451 // Get projection for range … … 606 607 // Than for their projections 607 608 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)); 609 610 610 611 TH1D *ho=0; … … 934 935 histb->Reset(); 935 936 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)); 938 939 hists->SetName("Excess"); 939 940 histb->SetName("Background"); … … 1052 1053 h0b.GetXaxis()->SetRangeUser(0, maxalpha0*1.5); 1053 1054 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)); 1056 1057 1057 1058 //hists->SetMinimum(GetMinimumGT(*hists)); … … 1142 1143 if (maxx>0 && maxy>0) 1143 1144 { 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); 1147 1148 1148 1149 h = fHist.ProjectionZ("AlphaFit", maxx, maxx, maxy, maxy); … … 1188 1189 } 1189 1190 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); 1192 1193 f1.SetParameters(maxpar.GetArray()); 1193 1194 f2.SetParameters(maxpar.GetArray()); … … 1204 1205 leg->SetBorderSize(1); 1205 1206 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); 1207 1208 //leg->AddText(0.5, 0.82, "A * exp(-(\\frac{x-\\mu}{\\sigma})^{2}/2) + b*x^{2} + a")->SetTextAlign(22); 1208 1209 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); 1214 1215 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); 1216 1217 leg->SetBit(kCanDelete); 1217 1218 leg->Draw(); … … 1249 1250 leg->SetBorderSize(1); 1250 1251 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)); 1252 1253 leg->SetBit(kCanDelete); 1253 1254 leg->Draw(); … … 1356 1357 TString str2("el.SetY1(gPad->GetY1()+0.9*(gPad->GetY2()-gPad->GetY1()));"); 1357 1358 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)); 1363 1364 1364 1365 TLatex tex; … … 1391 1392 "y.GetBinLowEdge(y.GetLast()+1));"); 1392 1393 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)); 1395 1396 // str3.ReplaceAll("pad", Form("((TPad*)(%p))", pad)); 1396 1397 -
trunk/MagicSoft/Mars/mhflux/MHThreshold.cc
r9153 r9301 46 46 #include "MLogManip.h" 47 47 48 #include "MString.h" 48 49 #include "MBinning.h" 49 50 … … 115 116 116 117 TH1D h(fHEnergy); 118 h.SetDirectory(0); 117 119 118 120 #if ROOT_VERSION_CODE<ROOT_VERSION(5,20,00) … … 138 140 const Axis_t maxe = TMath::Sqrt(axe.GetBinLowEdge(bin)*axe.GetBinUpEdge(bin)); 139 141 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)))); 143 145 text.SetBit(TLatex::kTextNDC); 144 146 text.SetTextSize(0.04);
Note:
See TracChangeset
for help on using the changeset viewer.