Changeset 9281


Ignore:
Timestamp:
01/29/09 08:54:21 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9278 r9281  
    1818
    1919                                                 -*-*- 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
    2033
    2134 2009/01/27 Thomas Bretz
  • trunk/MagicSoft/Mars/NEWS

    r9274 r9281  
    121121   * If the source position is more than 1deg away from the camera
    122122     center an error is raised now.
     123
     124   * Hopefully fixed the bug ''ganymed crashes when resized''
    123125
    124126 ;sponde
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r8989 r9281  
    6363
    6464#include "MMath.h"
     65#include "MString.h"
    6566
    6667#include "MLogManip.h"
     
    413414    const Int_t    l1 = w<=0 ? 0 : (Int_t)TMath::Ceil(-TMath::Log10(w));
    414415    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);
    420421
    421422    // This is totaly weired but the only way to get both options
     
    525526Bool_t MAlphaFitter::FitEnergy(const TH3D &hon, UInt_t bin, Bool_t paint)
    526527{
    527     const TString name(Form("TempAlphaEnergy%06d", gRandom->Integer(1000000)));
     528    const TString name(MString::Format("TempAlphaEnergy%06d", gRandom->Integer(1000000)));
    528529    TH1D *h = hon.ProjectionZ(name, 0, hon.GetNbinsX()+1, bin, bin, "E");
    529530    h->SetDirectory(0);
     
    536537Bool_t MAlphaFitter::FitTheta(const TH3D &hon, UInt_t bin, Bool_t paint)
    537538{
    538     const TString name(Form("TempAlphaTheta%06d", gRandom->Integer(1000000)));
     539    const TString name(MString::Format("TempAlphaTheta%06d", gRandom->Integer(1000000)));
    539540    TH1D *h = hon.ProjectionZ(name, bin, bin, 0, hon.GetNbinsY()+1, "E");
    540541    h->SetDirectory(0);
     
    562563Bool_t MAlphaFitter::FitAlpha(const TH3D &hon, Bool_t paint)
    563564{
    564     const TString name(Form("TempAlpha%06d", gRandom->Integer(1000000)));
     565    const TString name(MString::Format("TempAlpha%06d", gRandom->Integer(1000000)));
    565566    TH1D *h = hon.ProjectionZ(name, 0, hon.GetNbinsX()+1, 0, hon.GetNbinsY()+1, "E");
    566567    h->SetDirectory(0);
     
    573574Bool_t MAlphaFitter::FitEnergy(const TH3D &hon, const TH3D &hof, UInt_t bin, Bool_t paint)
    574575{
    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)));
    577578
    578579    TH1D *h1 = hon.ProjectionZ(name1, 0, hon.GetNbinsX()+1, bin, bin, "E");
     
    591592Bool_t MAlphaFitter::FitTheta(const TH3D &hon, const TH3D &hof, UInt_t bin, Bool_t paint)
    592593{
    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)));
    595596
    596597    TH1D *h1 = hon.ProjectionZ(name1, bin, bin, 0, hon.GetNbinsY()+1, "E");
     
    633634Bool_t MAlphaFitter::FitAlpha(const TH3D &hon, const TH3D &hof, Bool_t paint)
    634635{
    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)));
    637638
    638639    TH1D *h1 = hon.ProjectionZ(name1, 0, hon.GetNbinsX()+1, 0, hon.GetNbinsY()+1, "E");
     
    651652Bool_t MAlphaFitter::ApplyScaling(const TH3D &hon, TH3D &hof, UInt_t bin) const
    652653{
    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)));
    655656
    656657    TH1D *h1 = hon.ProjectionZ(name1, 0, hon.GetNbinsX()+1, bin, bin, "E");
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.cc

    r9153 r9281  
    6565#include "MHMatrix.h"
    6666
     67#include "MString.h"
    6768#include "MBinning.h"
    6869#include "MParList.h"
     
    234235    fHTime.Reset();
    235236
    236     const TString off(Form("%sOff", fName.Data()));
     237    const TString off(MString::Format("%sOff", fName.Data()));
    237238    if (fName!=off && fOffData==NULL)
    238239    {
    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()));
    240241        MHAlpha *hoff = (MHAlpha*)pl->FindObject(off, ClassName());
    241242        if (!hoff)
     
    325326                binse.SetEdges(*pl, "BinningSize");
    326327
    327         binsa.SetEdges(*pl, Form("Binning%s", ClassName()+2));
     328        binsa.SetEdges(*pl, MString::Format("Binning%s", ClassName()+2));
    328329    }
    329330    else
     
    513514void MHAlpha::PaintText(Double_t val, Double_t error) const
    514515{
    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));
    516517    text.SetBit(TLatex::kTextNDC);
    517518    text.SetTextSize(0.04);
     
    577578        if (hon)
    578579        {
    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);
    580581            dum->SetDirectory(0);
    581582            hon->Reset();
     
    588589                if (hoff)
    589590                {
    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);
    591592                    dum->SetDirectory(0);
    592593                    hoff->Reset();
     
    612613                        hon->SetMinimum(min<0 ? min : 0);
    613614                    }
     615
    614616                }
    615617            }
     
    641643    if (o==(TString)"theta")
    642644    {
    643         TH1 *h = (TH1*)gPad->FindObject(Form("%s_x", fHist.GetName()));
     645        TH1 *h = (TH1*)gPad->FindObject(MString::Format("%s_x", fHist.GetName()));
    644646        if (h)
    645647        {
     
    656658    if (o==(TString)"energy")
    657659    {
    658         TH1 *h = (TH1*)gPad->FindObject(Form("%s_y", fHist.GetName()));
     660        TH1 *h = (TH1*)gPad->FindObject(MString::Format("%s_y", fHist.GetName()));
    659661        if (h)
    660662        {
     
    10011003        wm += wm.IsNull() ? "(" : " (";
    10021004        if (binlo>=1)
    1003             wm += Form("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binlo));
     1005            wm += MString::Format("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binlo));
    10041006        wm += "-";
    10051007        if (binhi<hon->GetNbinsX())
    1006             wm += Form("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binhi+1));
     1008            wm += MString::Format("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binhi+1));
    10071009        wm += ")";
    10081010    }
  • trunk/MagicSoft/Mars/mhflux/MHDisp.cc

    r9153 r9281  
    5151
    5252#include "MMath.h"
     53#include "MString.h"
    5354#include "MBinning.h"
    5455
     
    7071//
    7172MHDisp::MHDisp(const char *name, const char *title)
    72     : fDisp(0), fDeviation(0), fSrcAnti(0), fSmearing(-1), fWobble(kFALSE),
    73     fScaleMin(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)
    7475{
    7576    //
     
    645646
    646647    // ----- Pad number 4 -----
    647     TString name = Form("%s_4", pad->GetName());
     648    TString name = MString::Format("%s_4", pad->GetName());
    648649    TPad *p = new TPad(name,name, 0.525/*0.5025*/, 0.3355, 0.995, 0.995, col, 0, 0);
    649650    p->SetNumber(4);
     
    665666    // ----- Pad number 1 -----
    666667    pad->cd();
    667     name = Form("%s_1", pad->GetName());
     668    name = MString::Format("%s_1", pad->GetName());
    668669    p = new TPad(name,name, 0.005, 0.3355, 0.475/*0.4975*/, 0.995, col, 0, 0);
    669670    p->SetNumber(1);
     
    685686    // ----- Pad number 2 -----
    686687    pad->cd();
    687     name = Form("%s_2", pad->GetName());
     688    name = MString::Format("%s_2", pad->GetName());
    688689    p = new TPad(name,name, 0.005, 0.005, 0.2485, 0.3315, col, 0, 0);
    689690    p->SetNumber(2);
     
    694695    // ----- Pad number 3 -----
    695696    pad->cd();
    696     name = Form("%s_3", pad->GetName());
     697    name = MString::Format("%s_3", pad->GetName());
    697698    p = new TPad(name,name, 0.2525, 0.005, 0.4985, 0.3315, col, 0, 0);
    698699    p->SetNumber(3);
     
    714715    // ----- Pad number 5 -----
    715716    pad->cd();
    716     name = Form("%s_5", pad->GetName());
     717    name = MString::Format("%s_5", pad->GetName());
    717718    p = new TPad(name,name, 0.5025, 0.005, 0.7485, 0.3315, col, 0, 0);
    718719    p->SetNumber(5);
     
    730731    // ----- Pad number 6 -----
    731732    pad->cd();
    732     name = Form("%s_6", pad->GetName());
     733    name = MString::Format("%s_6", pad->GetName());
    733734    p = new TPad(name,name, 0.7525, 0.005, 0.9995, 0.3315, col, 0, 0);
    734735    p->SetNumber(6);
Note: See TracChangeset for help on using the changeset viewer.