Changeset 9576


Ignore:
Timestamp:
04/22/10 11:43:42 (15 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r9574 r9576  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2010/04/22 Thomas Bretz
     22
     23   * showplot.cc:
     24     - added --debug-mem option
     25
     26   * mbase/MParSpline.cc, mhbase/MH3.cc, mhbase/MHn.cc,
     27     mhflux/MHAlpha.cc, mhist/MHCamEvent.cc:
     28     - added missing call to the RecursiveRemove of the base class
     29
     30   * mfileio/MReadTree.cc:
     31     - In the case Notify failed since about two years accidentaly
     32       kTRUE instead of kERROR was returned
     33
     34   * mfileio/MWriteRootFile.cc:
     35     - added some more debug output
     36
     37   * mhflux/MAlphaFitter.cc:
     38     - Return if fit failed
     39
     40   * mhflux/MHPhi.cc:
     41     - avoid inf and nan when producing histogram (the divisor could
     42       have been zero in case of the inetgral of an empty histogram)
     43
     44
    2045
    2146 2010/04/21 Thomas Bretz
     
    4772
    4873
     74 2010/04/20 Thomas Bretz
     75
     76   * mfileio/MReadTree.cc:
     77     - no error was returned anymore when Notify() failed. Fixed.
     78
     79
     80
    4981 2010/04/19 Thomas Bretz
    5082
    51    * mase/MStatusArray.cc:
     83   * mbase/MStatusArray.cc:
    5284     - added a workaround to prevent crashes in case of double
    5385       deleteion of the fHistogram in TGraphs
  • trunk/MagicSoft/Mars/mbase/MParSpline.cc

    r9518 r9576  
    327327    if (obj==fSpline)
    328328        fSpline=0;
    329 }
     329
     330    MParContainer::RecursiveRemove(obj);
     331}
  • trunk/MagicSoft/Mars/mfileio/MReadTree.cc

    r9103 r9576  
    10011001        case MChain::kFatalError:
    10021002            *fLog << err << GetDescriptor() << " - ERROR: Notify() failed." << endl;
    1003             return kTRUE;
     1003            return kERROR;
    10041004        case MChain::kCannotAccessFile:
    10051005            *fLog << err << GetDescriptor() << " - ERROR: TChain::LoadTree is unable to access requested file." << endl;
  • trunk/MagicSoft/Mars/mfileio/MWriteRootFile.cc

    r9472 r9576  
    716716            if (!b->GetBranch()->Fill())
    717717            {
    718                 *fLog << err << "ERROR - Zero bytes written to branch '" << b->GetBranch()->GetName() << "'... abort." << endl;
     718                *fLog << err << "ERROR - MWriteRootFile: Zero bytes written to branch '" << b->GetBranch()->GetName() << "'... abort." << endl;
    719719                return kFALSE;
    720720            }
     
    730730    {
    731731        TTree *t = (TTree*)fTrees[idx];
     732        if (!t)
     733        {
     734            *fLog << err << "ERROR - MWriteRootFile: The Tree with index " << idx << endl;
     735            *fLog << " in fTrees is NULL. This should never happen. Please send" << endl;
     736            *fLog << " a bug report." << endl;
     737            return kFALSE;
     738        }
    732739
    733740        //
     
    746753        if (!t->Fill())
    747754        {
    748             *fLog << err << "ERROR - Zero bytes written to tree '" << t->GetName() << "'... abort." << endl;
     755            *fLog << err << "ERROR - MWriteRootFiole: Zero bytes written to tree '" << t->GetName() << "'... abort." << endl;
    749756            return kFALSE;
    750757        }
  • trunk/MagicSoft/Mars/mhbase/MH3.cc

    r9518 r9576  
    13061306    if (obj==fHist)
    13071307        fHist = 0;
    1308 }
     1308
     1309    MH::RecursiveRemove(obj);
     1310}
  • trunk/MagicSoft/Mars/mhbase/MHn.cc

    r9518 r9576  
    609609            fHist[i]->RecursiveRemove(obj);
    610610    }
    611 }
     611
     612    MH::RecursiveRemove(obj);
     613}
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r9525 r9576  
    208208    //           Q  quiet mode
    209209    //           E  Perform better Errors estimation using Minos technique
    210     h.Fit(fFunc, "NQI", "", fBgMin, fBgMax);
     210    if (h.Fit(fFunc, "NQI", "", fBgMin, fBgMax))
     211        return kFALSE;
     212
    211213    fChiSqBg = fFunc->GetChisquare()/fFunc->GetNDF();
    212214
  • trunk/MagicSoft/Mars/mhflux/MHAlpha.cc

    r9411 r9576  
    11531153    if (obj==fOffData)
    11541154        fOffData = 0;
    1155 }
     1155
     1156    MH::RecursiveRemove(obj);
     1157}
  • trunk/MagicSoft/Mars/mhflux/MHPhi.cc

    r9153 r9576  
    355355    TVirtualPad *pad4 = gPad->GetPad(4);
    356356
     357    const Double_t i2 = fHInhom.Integral();
     358/*
    357359    Double_t sig2 = 0;
    358360    Double_t bg2  = 0;
    359361    Double_t f2   = 1;
     362*/
    360363    TH1D *htemp = pad1 ? dynamic_cast<TH1D*>(pad1->FindObject("Template")) : NULL;
    361364    if (htemp)
     
    373376            fHPhi.Copy(*res);
    374377
     378            const Double_t i0 = res->Integral(fNumBinsSignal+1, 9999);
     379            const Double_t i1 = fHInhom.Integral(fNumBinsSignal+1, 9999);
     380            const Double_t i3 = htemp->Integral();
     381            const Double_t i4 = htemp->Integral(fNumBinsSignal+1, 9999);
     382
    375383            // Scale inhomogeneity to match the phi-plot in the off-region
    376             sc1 = res->Integral(fNumBinsSignal+1, 9999)/fHInhom.Integral(fNumBinsSignal+1, 9999);
     384            sc1 = i1==0 ? 0 : i0/i1;
    377385            // Scale inhomogeneity to match the phi-plot in the off-region
    378             sc2 = fHInhom.Integral()/htemp->Integral();
     386            sc2 = i3==0 ? 0 : i2/i3;
    379387
    380388            res->Add(&fHInhom, -sc1);
     
    383391            res->SetDirectory(0);
    384392
    385             htemp->Scale(res->Integral(fNumBinsSignal+1, 9999)/htemp->Integral(fNumBinsSignal+1, 9999));
    386 
    387             sig2 = res->Integral(1, fNumBinsSignal);
    388             bg2  = fHPhi.Integral(fNumBinsSignal+1, 9999);
    389             f2   = htemp->Integral(1, fNumBinsSignal)/htemp->Integral(fNumBinsSignal+1, 9999);
     393            htemp->Scale(i4==0 ? 0 : i0/i4);
     394
     395            //sig2 = res->Integral(1, fNumBinsSignal);
     396            //bg2  = fHPhi.Integral(fNumBinsSignal+1, 9999);
     397            //f2   = htemp->Integral(1, fNumBinsSignal)/i4;
    390398        }
    391399
     
    403411    if (htemp)
    404412    {
     413        const Double_t integ = htemp->Integral();
     414
    405415        fHTemplate.Copy(*htemp);
    406         htemp->Scale(fHInhom.Integral()/htemp->Integral());
     416        htemp->Scale(integ==0 ? 0 : i2/integ);
    407417        htemp->SetName("Template");
    408418        htemp->SetDirectory(0);
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r9518 r9576  
    409409    if (obj==fSum)
    410410        fSum = 0;
    411 }
     411
     412    MH::RecursiveRemove(obj);
     413}
  • trunk/MagicSoft/Mars/showplot.cc

    r9276 r9576  
    33#include <TGClient.h>
    44#include <TRint.h>
     5#include <TObjectTable.h>
    56
    67#include "MLog.h"
     
    6869    gLog << "   --auto-size               Determin optimum size (not available in batch mode)" << endl;
    6970    gLog << endl;
     71    gLog << "   --debug-mem               Debug memory usage" << endl;
    7072    gLog << "   --version, -V             Show startup message with version number" << endl;
    7173    gLog << "   -?, -h, --help            This help" << endl;
     
    165167    const Bool_t kBatch      = arg.HasOnlyAndRemove("-b");
    166168    const Bool_t kRoot       = arg.HasOnlyAndRemove("-r");
     169    const Bool_t kDebugMem   = arg.HasOnlyAndRemove("--debug-mem");
    167170
    168171    const Int_t  kTab        = arg.GetIntAndRemove("--tab=", -1);
     
    231234        return 3;
    232235    }
     236
     237    if (kDebugMem)
     238        TObject::SetObjectStat(kTRUE);
    233239
    234240    //
     
    314320    app->Run(kFALSE);
    315321    delete app;
     322
     323    if (TObject::GetObjectStat())
     324    {
     325        TObject::SetObjectStat(kFALSE);
     326        gObjectTable->Print();
     327    }
     328
    316329    return 0;
    317330}
Note: See TracChangeset for help on using the changeset viewer.