Changeset 9281
- Timestamp:
- 01/29/09 08:54:21 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9278 r9281 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2009/01/29 Thomas Bretz 22 23 * melectronics/MPulseShape.cc: 24 - changed spline range from -25/25 to -8/8 25 26 * mhflux/MAlphaFitter.cc, mhflux/MHAlpha.cc, mhflux/MHDisp.cc: 27 - for sanity (thread safety) replaced Form by MString::Format 28 29 * mhflux/MHDisp.cc: 30 - initialize fHalf as suggested by valgrind 31 32 20 33 21 34 2009/01/27 Thomas Bretz -
trunk/MagicSoft/Mars/NEWS
r9274 r9281 121 121 * If the source position is more than 1deg away from the camera 122 122 center an error is raised now. 123 124 * Hopefully fixed the bug ''ganymed crashes when resized'' 123 125 124 126 ;sponde -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r8989 r9281 63 63 64 64 #include "MMath.h" 65 #include "MString.h" 65 66 66 67 #include "MLogManip.h" … … 413 414 const Int_t l1 = w<=0 ? 0 : (Int_t)TMath::Ceil(-TMath::Log10(w)); 414 415 const Int_t l2 = m<=0 ? 0 : (Int_t)TMath::Ceil(-TMath::Log10(m)); 415 const TString fmt = Form("\\sigma_{L/M}=%%.1f \\omega=%%.%df\\circ E=%%d B=%%d x<%%.%df \\tilde\\chi_{b}=%%.1f \\tilde\\chi_{s}=%%.1f c=%%.1f f=%%.2f",416 l1<1?1:l1+1, l2<1?1:l2+1);417 const TString txt = Form(fmt.Data(), fSignificance, w, (int)fEventsExcess,418 (int)fEventsBackground, m, fChiSqBg, fChiSqSignal,419 fCoefficients[3], fScaleFactor);416 const TString fmt = MString::Format("\\sigma_{L/M}=%%.1f \\omega=%%.%df\\circ E=%%d B=%%d x<%%.%df \\tilde\\chi_{b}=%%.1f \\tilde\\chi_{s}=%%.1f c=%%.1f f=%%.2f", 417 l1<1?1:l1+1, l2<1?1:l2+1); 418 const TString txt = MString::Format(fmt.Data(), fSignificance, w, (int)fEventsExcess, 419 (int)fEventsBackground, m, fChiSqBg, fChiSqSignal, 420 fCoefficients[3], fScaleFactor); 420 421 421 422 // This is totaly weired but the only way to get both options … … 525 526 Bool_t MAlphaFitter::FitEnergy(const TH3D &hon, UInt_t bin, Bool_t paint) 526 527 { 527 const TString name( Form("TempAlphaEnergy%06d", gRandom->Integer(1000000)));528 const TString name(MString::Format("TempAlphaEnergy%06d", gRandom->Integer(1000000))); 528 529 TH1D *h = hon.ProjectionZ(name, 0, hon.GetNbinsX()+1, bin, bin, "E"); 529 530 h->SetDirectory(0); … … 536 537 Bool_t MAlphaFitter::FitTheta(const TH3D &hon, UInt_t bin, Bool_t paint) 537 538 { 538 const TString name( Form("TempAlphaTheta%06d", gRandom->Integer(1000000)));539 const TString name(MString::Format("TempAlphaTheta%06d", gRandom->Integer(1000000))); 539 540 TH1D *h = hon.ProjectionZ(name, bin, bin, 0, hon.GetNbinsY()+1, "E"); 540 541 h->SetDirectory(0); … … 562 563 Bool_t MAlphaFitter::FitAlpha(const TH3D &hon, Bool_t paint) 563 564 { 564 const TString name( Form("TempAlpha%06d", gRandom->Integer(1000000)));565 const TString name(MString::Format("TempAlpha%06d", gRandom->Integer(1000000))); 565 566 TH1D *h = hon.ProjectionZ(name, 0, hon.GetNbinsX()+1, 0, hon.GetNbinsY()+1, "E"); 566 567 h->SetDirectory(0); … … 573 574 Bool_t MAlphaFitter::FitEnergy(const TH3D &hon, const TH3D &hof, UInt_t bin, Bool_t paint) 574 575 { 575 const TString name1( Form("TempAlpha%06d_on", gRandom->Integer(1000000)));576 const TString name0( Form("TempAlpha%06d_off", gRandom->Integer(1000000)));576 const TString name1(MString::Format("TempAlpha%06d_on", gRandom->Integer(1000000))); 577 const TString name0(MString::Format("TempAlpha%06d_off", gRandom->Integer(1000000))); 577 578 578 579 TH1D *h1 = hon.ProjectionZ(name1, 0, hon.GetNbinsX()+1, bin, bin, "E"); … … 591 592 Bool_t MAlphaFitter::FitTheta(const TH3D &hon, const TH3D &hof, UInt_t bin, Bool_t paint) 592 593 { 593 const TString name1( Form("TempAlpha%06d_on", gRandom->Integer(1000000)));594 const TString name0( Form("TempAlpha%06d_off", gRandom->Integer(1000000)));594 const TString name1(MString::Format("TempAlpha%06d_on", gRandom->Integer(1000000))); 595 const TString name0(MString::Format("TempAlpha%06d_off", gRandom->Integer(1000000))); 595 596 596 597 TH1D *h1 = hon.ProjectionZ(name1, bin, bin, 0, hon.GetNbinsY()+1, "E"); … … 633 634 Bool_t MAlphaFitter::FitAlpha(const TH3D &hon, const TH3D &hof, Bool_t paint) 634 635 { 635 const TString name1( Form("TempAlpha%06d_on", gRandom->Integer(1000000)));636 const TString name0( Form("TempAlpha%06d_off", gRandom->Integer(1000000)));636 const TString name1(MString::Format("TempAlpha%06d_on", gRandom->Integer(1000000))); 637 const TString name0(MString::Format("TempAlpha%06d_off", gRandom->Integer(1000000))); 637 638 638 639 TH1D *h1 = hon.ProjectionZ(name1, 0, hon.GetNbinsX()+1, 0, hon.GetNbinsY()+1, "E"); … … 651 652 Bool_t MAlphaFitter::ApplyScaling(const TH3D &hon, TH3D &hof, UInt_t bin) const 652 653 { 653 const TString name1( Form("TempAlpha%06d_on", gRandom->Integer(1000000)));654 const TString name0( Form("TempAlpha%06d_off", gRandom->Integer(1000000)));654 const TString name1(MString::Format("TempAlpha%06d_on", gRandom->Integer(1000000))); 655 const TString name0(MString::Format("TempAlpha%06d_off", gRandom->Integer(1000000))); 655 656 656 657 TH1D *h1 = hon.ProjectionZ(name1, 0, hon.GetNbinsX()+1, bin, bin, "E"); -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r9153 r9281 65 65 #include "MHMatrix.h" 66 66 67 #include "MString.h" 67 68 #include "MBinning.h" 68 69 #include "MParList.h" … … 234 235 fHTime.Reset(); 235 236 236 const TString off( Form("%sOff", fName.Data()));237 const TString off(MString::Format("%sOff", fName.Data())); 237 238 if (fName!=off && fOffData==NULL) 238 239 { 239 const TString desc( Form("%s [%s] found... using ", off.Data(), ClassName()));240 const TString desc(MString::Format("%s [%s] found... using ", off.Data(), ClassName())); 240 241 MHAlpha *hoff = (MHAlpha*)pl->FindObject(off, ClassName()); 241 242 if (!hoff) … … 325 326 binse.SetEdges(*pl, "BinningSize"); 326 327 327 binsa.SetEdges(*pl, Form("Binning%s", ClassName()+2));328 binsa.SetEdges(*pl, MString::Format("Binning%s", ClassName()+2)); 328 329 } 329 330 else … … 513 514 void MHAlpha::PaintText(Double_t val, Double_t error) const 514 515 { 515 TLatex text(0.45, 0.94, Form("N_{exc} = %.1f \\pm %.1f", val, error));516 TLatex text(0.45, 0.94, MString::Format("N_{exc} = %.1f \\pm %.1f", val, error)); 516 517 text.SetBit(TLatex::kTextNDC); 517 518 text.SetTextSize(0.04); … … 577 578 if (hon) 578 579 { 579 TH1D *dum = fHist.ProjectionZ("dum ", 0, fHist.GetNbinsX()+1, 0, fHist.GetNbinsY()+1);580 TH1D *dum = fHist.ProjectionZ("dumab", 0, fHist.GetNbinsX()+1, 0, fHist.GetNbinsY()+1); 580 581 dum->SetDirectory(0); 581 582 hon->Reset(); … … 588 589 if (hoff) 589 590 { 590 TH1D *dum = fOffData->ProjectionZ("dum ", 0, fOffData->GetNbinsX()+1, 0, fOffData->GetNbinsY()+1);591 TH1D *dum = fOffData->ProjectionZ("dumxy", 0, fOffData->GetNbinsX()+1, 0, fOffData->GetNbinsY()+1); 591 592 dum->SetDirectory(0); 592 593 hoff->Reset(); … … 612 613 hon->SetMinimum(min<0 ? min : 0); 613 614 } 615 614 616 } 615 617 } … … 641 643 if (o==(TString)"theta") 642 644 { 643 TH1 *h = (TH1*)gPad->FindObject( Form("%s_x", fHist.GetName()));645 TH1 *h = (TH1*)gPad->FindObject(MString::Format("%s_x", fHist.GetName())); 644 646 if (h) 645 647 { … … 656 658 if (o==(TString)"energy") 657 659 { 658 TH1 *h = (TH1*)gPad->FindObject( Form("%s_y", fHist.GetName()));660 TH1 *h = (TH1*)gPad->FindObject(MString::Format("%s_y", fHist.GetName())); 659 661 if (h) 660 662 { … … 1001 1003 wm += wm.IsNull() ? "(" : " ("; 1002 1004 if (binlo>=1) 1003 wm += Form("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binlo));1005 wm += MString::Format("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binlo)); 1004 1006 wm += "-"; 1005 1007 if (binhi<hon->GetNbinsX()) 1006 wm += Form("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binhi+1));1008 wm += MString::Format("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binhi+1)); 1007 1009 wm += ")"; 1008 1010 } -
trunk/MagicSoft/Mars/mhflux/MHDisp.cc
r9153 r9281 51 51 52 52 #include "MMath.h" 53 #include "MString.h" 53 54 #include "MBinning.h" 54 55 … … 70 71 // 71 72 MHDisp::MHDisp(const char *name, const char *title) 72 : fDisp(0), fDeviation(0), fSrcAnti(0), f Smearing(-1), fWobble(kFALSE),73 f ScaleMin(0.325), fScaleMax(0.475)73 : fDisp(0), fDeviation(0), fSrcAnti(0), fHalf(kFALSE), fSmearing(-1), 74 fWobble(kFALSE), fScaleMin(0.325), fScaleMax(0.475) 74 75 { 75 76 // … … 645 646 646 647 // ----- Pad number 4 ----- 647 TString name = Form("%s_4", pad->GetName());648 TString name = MString::Format("%s_4", pad->GetName()); 648 649 TPad *p = new TPad(name,name, 0.525/*0.5025*/, 0.3355, 0.995, 0.995, col, 0, 0); 649 650 p->SetNumber(4); … … 665 666 // ----- Pad number 1 ----- 666 667 pad->cd(); 667 name = Form("%s_1", pad->GetName());668 name = MString::Format("%s_1", pad->GetName()); 668 669 p = new TPad(name,name, 0.005, 0.3355, 0.475/*0.4975*/, 0.995, col, 0, 0); 669 670 p->SetNumber(1); … … 685 686 // ----- Pad number 2 ----- 686 687 pad->cd(); 687 name = Form("%s_2", pad->GetName());688 name = MString::Format("%s_2", pad->GetName()); 688 689 p = new TPad(name,name, 0.005, 0.005, 0.2485, 0.3315, col, 0, 0); 689 690 p->SetNumber(2); … … 694 695 // ----- Pad number 3 ----- 695 696 pad->cd(); 696 name = Form("%s_3", pad->GetName());697 name = MString::Format("%s_3", pad->GetName()); 697 698 p = new TPad(name,name, 0.2525, 0.005, 0.4985, 0.3315, col, 0, 0); 698 699 p->SetNumber(3); … … 714 715 // ----- Pad number 5 ----- 715 716 pad->cd(); 716 name = Form("%s_5", pad->GetName());717 name = MString::Format("%s_5", pad->GetName()); 717 718 p = new TPad(name,name, 0.5025, 0.005, 0.7485, 0.3315, col, 0, 0); 718 719 p->SetNumber(5); … … 730 731 // ----- Pad number 6 ----- 731 732 pad->cd(); 732 name = Form("%s_6", pad->GetName());733 name = MString::Format("%s_6", pad->GetName()); 733 734 p = new TPad(name,name, 0.7525, 0.005, 0.9995, 0.3315, col, 0, 0); 734 735 p->SetNumber(6);
Note:
See TracChangeset
for help on using the changeset viewer.