Changeset 1666 for trunk/MagicSoft


Ignore:
Timestamp:
11/22/02 09:23:54 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1665 r1666  
    11                                                               -*-*- END -*-*-
     2
     3 2002/11/22: Thomas Bretz
     4
     5   * macros/threshold.C:
     6     - Simplified the new writing routine
     7
     8   * mbase/MLog.h:
     9     - added a Getter-function for the debug level
     10
     11   * mbase/MTaskList.cc:
     12     - added another debugging output
     13
     14   * mfilter/MF.[h,cc]:
     15     - made the automatically created chain names unique
     16
     17   * mfilter/MFDataChain.cc:
     18     - corrected the GetRule stuff ({} were missing)
     19
     20   * mhist/MH3.cc:
     21     - added MBinning as class type to FindObject
     22     - added BinningHist (without the X) as binning name for a 1D histogram
     23
     24
    225
    326 2002/11/22: Abelardo Moralejo
     
    629     - Added 2nd argument to write an output file containing the
    730       energy spectrum histogram.
     31
     32
    833
    934 2002/11/21: Thomas Bretz
  • trunk/MagicSoft/Mars/macros/threshold.C

    r1665 r1666  
    2424
    2525
    26 void threshold(char* filename="data/camera.root", char* outname="")
     26void threshold(TString filename="data/camera.root", TString outname="")
    2727{
    2828    //
     
    106106
    107107    // Write histogram to a file in case an output filename has been supplied:
    108     if (strlen(outname) > 0)
    109       {
    110         TFile* f = new TFile(outname,"recreate");
    111         if (f)
    112           {
    113             TH1F* hc = ((MHMcEnergy*)parlist.FindObject("MHMcEnergy"))->GetHistByName("MHMcEnergy");
    114             hc->Write();
    115             f.Close();
    116           }
    117       }
     108    if (outname.IsNull())
     109        return;
     110
     111    TFile f(outname, "recreate");
     112    if (!f)
     113        return;
     114
     115    parlist.FindObject("MHMcEnergy")->Write();
    118116}
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r1524 r1666  
    6565
    6666    void SetDebugLevel(int i)           { fDebugLevel  =  i;  }
     67    int GetDebugLevel() const           { return fDebugLevel; }
    6768    void SetOutputLevel(int i)          { fOutputLevel =  i;  }
    6869    void SetOutputDevice(int i)         { fDevice      =  i;  }
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1661 r1666  
    141141    //
    142142    if (!task)
     143    {
     144        *fLog << err << "ERROR - task argument=NULL." << endl;
    143145        return kFALSE;
     146    }
    144147
    145148    //
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc

    r1664 r1666  
    540540    fin.read(cheadertitle, iHEADERTITLELENGTH);
    541541
    542     Float_t fpreprocversion, structversion, dummy;
     542    Float_t fpreprocversion, structversion;
     543    Int_t dummyi;
    543544
    544545    sscanf(cheadertitle, cTITLE_TEMPLATE,
    545546           &fpreprocversion, &structversion,
    546            &dummy, &dummy, &dummy, &dummy);
     547           &dummyi, &dummyi, &dummyi, &dummyi);
    547548
    548549    if (fpreprocversion < 0.6)
  • trunk/MagicSoft/Mars/mfilter/MF.cc

    r1661 r1666  
    155155}
    156156
    157 MFilter *MF::ParseRule(TString &txt, MFilter *filter0) const
     157MFilter *MF::ParseRule(TString &txt, MFilter *filter0, Int_t level) const
    158158{
    159159    TString text;
     
    243243    MFilter *newfilter;
    244244    if (isrule)
     245    {
    245246        newfilter = new MFDataChain(text.Data(), c, num);
     247        newfilter->SetName(Form("Chain%02d%c%f", level, c, num));
     248    }
    246249    else
     250    {
    247251        newfilter = new MFDataMember(text.Data(), c, num);
    248 
    249     newfilter->SetName(Form("%s%c%f", text.Data(), c, num));
     252        newfilter->SetName(Form("%s%c%f", text.Data(), c, num));
     253    }
    250254
    251255    return newfilter;
     
    367371
    368372        default:
    369             newfilter = ParseRule(txt, filter0);
     373            newfilter = ParseRule(txt, filter0, level++);
    370374            if (!newfilter)
    371375            {
  • trunk/MagicSoft/Mars/mfilter/MF.h

    r1661 r1666  
    2525    Int_t IsAlNum(TString txt) const;
    2626
    27     MFilter *ParseRule(TString &txt, MFilter *filter0) const;
     27    MFilter *ParseRule(TString &txt, MFilter *filter0, Int_t level) const;
    2828    MFilter *ParseString(TString txt, Int_t level);
    2929
  • trunk/MagicSoft/Mars/mfilter/MFDataChain.cc

    r1661 r1666  
    6464    fTitle = title ? title : "Filter using any data member of a class";
    6565
    66     AddToBranchList(member);
     66    //AddToBranchList(member);
    6767
    6868    fFilterType = (type=='<' ? kELowerThan : kEGreaterThan);
     
    111111TString MFDataChain::GetRule() const
    112112{
    113     TString ret = fData.GetRule();
     113    TString ret = "{";
     114    ret += fData.GetRule();
     115    ret += "}";
    114116    ret += fFilterType==kELowerThan?"<":">";
    115117
  • trunk/MagicSoft/Mars/mhist/MH3.cc

    r1599 r1666  
    223223    {
    224224    case 3:
    225         binsz = (MBinning*)plist->FindObject(bname+"Z");
     225        binsz = (MBinning*)plist->FindObject(bname+"Z", "MBinning");
    226226        if (!binsz)
    227227        {
     
    235235            return kFALSE;
    236236    case 2:
    237         binsy = (MBinning*)plist->FindObject(bname+"Y");
     237        binsy = (MBinning*)plist->FindObject(bname+"Y", "MBinning");
    238238        if (!binsy)
    239239        {
     
    247247            return kFALSE;
    248248    case 1:
    249         binsx = (MBinning*)plist->FindObject(bname+"X");
     249        binsx = (MBinning*)plist->FindObject(bname+"X", "MBinning");
    250250        if (!binsx)
    251251        {
    252             *fLog << err << dbginf << "MBinning '" << bname << "X' not found... aborting." << endl;
    253             return kFALSE;
     252            if (fDimension==1)
     253                binsx = (MBinning*)plist->FindObject(bname, "MBinning");
     254
     255            if (!binsx)
     256            {
     257                *fLog << err << dbginf << "Neither MBinning '" << bname << "X' nor '" << bname << "' found... aborting." << endl;
     258                return kFALSE;
     259            }
    254260        }
    255261        if (binsx->IsLogarithmic())
Note: See TracChangeset for help on using the changeset viewer.