Changeset 7777 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
07/05/06 11:41:13 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7776 r7777  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2006/07/05 Thomas Bretz
     22
     23   * datacenter/macros/checkfileavail.C,
     24     datacenter/macros/checkstardone.C,
     25     datacenter/macros/doexclusions.C,
     26     datacenter/macros/filldotraw.C,
     27     datacenter/macros/fillganymed.C,
     28     datacenter/macros/fillsignal.C,
     29     datacenter/macros/fillstar.C,
     30     datacenter/macros/setupdb.C:
     31     - make sure that 'res' is correctly deleted
     32     
     33   * datacenter/macros/doexclusions.C:
     34     - fixed some variable name overrides
     35
     36   * mhflux/MAlphaFitter.[h,cc]:
     37     - added the possibility to DrawResult()
     38
     39
    2040
    2141 2006/07/04 Daniela Dorner
  • trunk/MagicSoft/Mars/datacenter/macros/checkfileavail.C

    r7528 r7777  
    7777    }
    7878
    79     TSQLRow *row=0;
    80     while ((row = res->Next()))
    81     {
    82 //        TString entry=(*row)[0];
    83 //        if (entry=="1970-01-01 00:00:00")
    84 //            return "";
    85         return (*row)[0];
    86     }
     79    TString rc = (*row)[0];
    8780
    88     return "";
     81    delete res;
     82
     83    return rc;
    8984}
    9085
     
    138133        cout << "run#: " << runno << endl;
    139134        //if one value returns "" (i.e. column is NULL), 0 is returned
    140         if (GetStatus(serv, rc, runno, "RunProcessStatus", "fCCFileAvail")==""
    141             || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileAvail")==""
    142             || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileFound")==""
    143             || GetStatus(serv, rc, runno, "RunProcessStatus", "fTimingCorrection")==""
     135        if (GetStatus(serv, rc, runno, "RunProcessStatus", "fCCFileAvail").IsNull()
     136            || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileAvail").IsNull()
     137            || GetStatus(serv, rc, runno, "RunProcessStatus", "fCaCoFileFound").IsNull()
     138            || GetStatus(serv, rc, runno, "RunProcessStatus", "fTimingCorrection").IsNull()
    144139//            || GetStatus(serv, rc, runno, "RunProcessStatus", "fTimingCorrection")=="1970-01-01 00:00:00"
    145             || GetStatus(serv, rc, runno, "RunProcessStatus", "fRawFileAvail")=="")
     140            || GetStatus(serv, rc, runno, "RunProcessStatus", "fRawFileAvail").IsNull())
    146141            return 2;
    147142    }
  • trunk/MagicSoft/Mars/datacenter/macros/checkstardone.C

    r7528 r7777  
    7474    }
    7575
    76     TSQLRow *row=0;
    77     while ((row = res->Next()))
    78         return (*row)[0];
     76    TString rc = (*row)[0];
    7977
    80     return "";
     78    delete res;
     79
     80    return rc;
    8181}
    8282
     
    100100
    101101    //check if fStar not NULL for sequence
    102     if (GetStatus(serv, rc, datasetno, "SequenceProcessStatus", "fStar")=="")
     102    if (GetStatus(serv, rc, datasetno, "SequenceProcessStatus", "fStar").IsNull())
    103103        return 2;
    104104
  • trunk/MagicSoft/Mars/datacenter/macros/doexclusions.C

    r7528 r7777  
    174174        //get importance of exclusion-reason from database
    175175        TString query(Form("SELECT fExcludedFDAImportance from ExcludedFDA where fExcludedFDAKEY=%s ", key.Data()));
    176         TSQLResult *res = serv.Query(query);
    177         if (!res)
     176        TSQLResult *res2 = serv.Query(query);
     177        if (!res2)
    178178        {
    179179            cout << "Error - could not get importance." << endl;
     
    181181        }
    182182
    183         TSQLRow *row2=res->Next();
     183        TSQLRow *row2=res2->Next();
    184184        Int_t newimp=atoi((*row2)[0]);
    185         delete res;
     185        delete res2;
    186186
    187187        //get current importance from database
     
    210210        cout << query << endl;
    211211
    212         res = serv.Query(query);
    213         if (!res)
     212        res2 = serv.Query(query);
     213        if (!res2)
    214214        {
    215215            cout << "Error - no runs to exclude" << endl;
     
    219219        //compare new and old importance
    220220        //change or keep the exclusion-reason accordingly
    221         while ((row2 = res->Next()))
     221        while ((row2 = res2->Next()))
    222222        {
    223223            if (TString((*row2)[1]).IsNull() || atoi((*row2)[1])>newimp)
     
    227227                                   key.Data(), (*row2)[0]));
    228228                cout << "QU: " << query << endl;
    229                 TSQLResult *res = serv.Query(query);
    230                 if (!res)
     229                TSQLResult *res3 = serv.Query(query);
     230                if (!res3)
    231231                {
    232232                    cout << "Error - could not insert exclusion" << endl;
    233233                    return 2;
    234234                }
    235                 delete res;
     235                delete res3;
    236236                continue;
    237237            }
     
    239239            cout << "run#: " << (*row2)[0] << " reason for exclusion is still the same" << endl;
    240240        }
    241         delete res;
     241        delete res2;
    242242    }
    243243    delete res;
  • trunk/MagicSoft/Mars/datacenter/macros/filldotraw.C

    r7635 r7777  
    9494    }
    9595
    96     return atoi((*row)[0]);
     96    Int_t rc = atoi((*row)[0]);
     97
     98    delete res;
     99
     100    return rc;
    97101}
    98102
     
    168172        return 2;
    169173    }
    170 
     174    delete res;
    171175    return 1;
    172176}
  • trunk/MagicSoft/Mars/datacenter/macros/fillganymed.C

    r7528 r7777  
    212212        return 2;
    213213    }
     214    delete res;
    214215    return 1;
    215216}
  • trunk/MagicSoft/Mars/datacenter/macros/fillsignal.C

    r7528 r7777  
    235235        return 2;
    236236    }
    237 
     237    delete res;
    238238    return 1;
    239239}
  • trunk/MagicSoft/Mars/datacenter/macros/fillstar.C

    r7759 r7777  
    337337        return 2;
    338338    }
     339    delete res;
    339340
    340341    return 1;
  • trunk/MagicSoft/Mars/datacenter/macros/setupdb.C

    r7761 r7777  
    140140            fields += ", ";
    141141    }
     142
     143    delete res;
    142144
    143145    return fields;
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc

    r7741 r7777  
    330330    // Assuming that bg and fit2.GetEventsBackground() are rather identical:
    331331    const Double_t sc = er*er / fit.GetEventsBackground();
    332     /*
     332
    333333     cout << MMath::SignificanceLiMaSigned(hon.Integral(1, bin), fit.GetEventsBackground()/sc, sc) << " ";
    334334     cout << sc << " ";
    335335     cout << fit.fChiSqBg << endl;
    336      */
     336
    337337    return sc;
    338338}
     
    404404}
    405405
    406 void MAlphaFitter::PaintResult(Float_t x, Float_t y, Float_t size) const
     406void MAlphaFitter::PaintResult(Float_t x, Float_t y, Float_t size, Bool_t draw) const
    407407{
    408408    const Double_t w  = GetGausSigma();
     
    413413    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",
    414414                             l1<1?1:l1+1, l2<1?1:l2+1);
    415 
    416     TLatex text(x, y, Form(fmt.Data(), fSignificance, w, (int)fEventsExcess,
    417                            (int)fEventsBackground, m, fChiSqBg, fChiSqSignal,
    418                            fCoefficients[3], fScaleFactor));
    419 
     415    const TString txt = Form(fmt.Data(), fSignificance, w, (int)fEventsExcess,
     416                             (int)fEventsBackground, m, fChiSqBg, fChiSqSignal,
     417                             fCoefficients[3], fScaleFactor);
     418
     419    // This is totaly weired but the only way to get both options
     420    // working with this nonsense implementation of TLatex
     421    TLatex text(x, y, txt);
    420422    text.SetBit(TLatex::kTextNDC);
    421423    text.SetTextSize(size);
    422     text.Paint();
     424    if (draw)
     425        text.DrawLatex(x, y, txt);
     426    else
     427        text.Paint();
    423428
    424429    TLine line;
    425430    line.SetLineColor(14);
    426     line.PaintLine(m, gPad->GetUymin(), m, gPad->GetUymax());
     431    if (draw)
     432        line.DrawLine(m, gPad->GetUymin(), m, gPad->GetUymax());
     433    else
     434        line.PaintLine(m, gPad->GetUymin(), m, gPad->GetUymax());
    427435}
    428436
  • trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h

    r7720 r7777  
    237237
    238238    // Interface to result
    239     void PaintResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035) const;
     239    void PaintResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035, Bool_t draw=kFALSE) const;
     240    void DrawResult(Float_t x=0.04, Float_t y=0.94, Float_t size=0.035) const { PaintResult(x, y, size, kTRUE); }
    240241
    241242    // MTask
Note: See TracChangeset for help on using the changeset viewer.