Changeset 8091


Ignore:
Timestamp:
10/17/06 14:39:40 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r8090 r8091  
    4444   * mdata/MDataPhrase.cc:
    4545     - improved output in case of failure
     46
     47   * manalysis/MFiltercutsCalc.[h,cc], mbase/MContinue.cc,
     48     mjoptim/MJOptimize.cc, mjtrain/MJTrainRanForest.cc,
     49     mtools/MTFillMatrix.cc:
     50     - replaced MFDataChain by MFDataPhrase
     51
     52   * mfbase/FBaseLinkDef.h, mfbase/Makefile:
     53     - added new class MFDataPhrase
     54
     55   * mfbase/MF.[h,cc]:
     56     - replaced all the parsing stuff by the usage of MFDataPhrase
     57
     58   * mfbase/MFDataPhrase.[h,cc]:
     59     - added
    4660
    4761
  • trunk/MagicSoft/Mars/NEWS

    r8089 r8091  
    33 *** <cvs>
    44
    5    - mtools: MRolke.[cc,h]: Modification of TRolke from root_v5.12.00b.
     5   - general: MRolke.[cc,h]: Modification of TRolke from root_v5.12.00b.
    66     Class for calculation of confidence intervals (upper limits).
    77     Use model 3 or 4 for upper limit calculation for MAGIC observations.
    88     Please read the class instruction of TRolke for more information.
    99
    10 
    11 
    12  *** <cvs>
    13 
    1410   - general: The programs now return 0xfe if the requested resource file
    1511     doesn't exist.
     
    1713   - general: Errors comming from root itself are now not output to
    1814     stderr anymore but to our default (colored) log-stream.
     15
     16   - general: Changed the interface to TFormula such that now everything
     17     is parsed by TFormula, which should allow to use phrases even
     18     without paranthesis correctly parsed.
    1919
    2020
  • trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.cc

    r2206 r8091  
    4040#include "MLogManip.h"
    4141
    42 #include "MF.h"
    43 #include "MFDataChain.h"
     42#include "MFDataPhrase.h"
    4443#include "MParList.h"
    4544#include "MFilterList.h"
     
    9897}
    9998
     99/*
    100100// --------------------------------------------------------------------------
    101101//
    102102// There is MUCH space for speed improvement!
    103 // Add MF(lo<name && name<up) to the filter list (&&),
    104 // for more details see MF::MF(), too.
     103// Add MFDataPhrase(lo<name && name<up) to the filter list (&&),
     104// for more details see MFDataPhrase::MFDataPhrase(), too.
    105105//
    106106void MFiltercutsCalc::AddCut(const char *name, Double_t lo, Double_t up)
    107107{
    108     AddToList(new MFDataChain(name, '>', lo));
    109     AddToList(new MFDataChain(name, '<', up));
     108    AddToList(new MFDataPhrase(Form("%s>%.15f", name, lo));
     109    AddToList(new MFDataPhrase(name, '<', up));
    110110}
    111111
     
    113113//
    114114// There is MUCH space for speed improvement!
    115 // Add MF(fabs(name)<val) to the filter list (&&),
    116 // for more details see MF::MF(), too.
     115// Add MFDataPhrase(fabs(name)<val) to the filter list (&&),
     116// for more details see MFDataPhrase::MFDataPhrase(), too.
    117117//
    118118void MFiltercutsCalc::AddCut(const char *name, Double_t val)
     
    120120    AddToList(new MFDataChain(Form("fabs(%s)", name), '<', val));
    121121}
     122*/
    122123
    123124// --------------------------------------------------------------------------
     
    125126// There is MUCH space for speed improvement!
    126127// Add 'cut' as MF(cut) to the filter list (&&),
    127 // for more details see MF::MF(), too.
     128// for more details see MFDataPhrase::MFDataPhrase(), too.
    128129//
    129130void MFiltercutsCalc::AddCut(const char *cut)
    130131{
    131     AddToList(new MF(cut));
     132    AddToList(new MFDataPhrase(cut));
    132133}
    133134
     
    135136//
    136137// There is MUCH space for speed improvement!
    137 // Add cut to filter list (&&), for more details see MF::MF(), too.
     138// Add cut to filter list (&&), for more details see MFDataPhrase::MFDataPhrase(), too.
    138139//
    139140void MFiltercutsCalc::AddCut(MFilter *f)
  • trunk/MagicSoft/Mars/manalysis/MFiltercutsCalc.h

    r2206 r8091  
    3636    TString GetHadronnessName() const { return fHadronnessName; }
    3737
    38     void AddCut(const char *name, Double_t lo, Double_t up);
    39     void AddCut(const char *name, Double_t val);
     38    //void AddCut(const char *name, Double_t lo, Double_t up);
     39    //void AddCut(const char *name, Double_t val);
    4040    void AddCut(const char *cut);
    4141    void AddCut(MFilter *f);
  • trunk/MagicSoft/Mars/mdata/MDataPhrase.cc

    r8083 r8091  
    352352    {
    353353        *fLog << err << dbginf << "Syntax Error: TFormula::Compile failed..."<< endl;
    354         *fLog << " > " << rule << endl;
    355         *fLog << " > " << txt << endl;
     354        *fLog << " Full Rule:  " << rule << endl;
     355        *fLog << " Parsed Rule: " << txt << endl;
    356356        Clear();
    357357        return kFALSE;
  • trunk/MagicSoft/Mars/mfbase/FBaseLinkDef.h

    r3330 r8091  
    1212#pragma link C++ class MFDataChain+;
    1313#pragma link C++ class MFDataMember+;
     14#pragma link C++ class MFDataPhrase+;
    1415#pragma link C++ class MFRealTimePeriod+;
    1516
  • trunk/MagicSoft/Mars/mfbase/MF.cc

    r7804 r8091  
    8888#include "MParList.h"
    8989
    90 #include "MFilterList.h"
    91 #include "MFDataChain.h"
    92 #include "MFDataMember.h"
     90//#include "MFilterList.h"
     91#include "MFDataPhrase.h"
     92//#include "MFDataMember.h"
    9393
    9494#include "MLog.h"
     
    123123
    124124    *fLog << inf << "Parsing filter rule... " << flush;
     125    fF = new MFDataPhrase(text);
     126    /*
    125127    if (!(fF=ParseString(text, 1)))
    126128    {
     
    128130        return;
    129131    }
    130 
     132    */
    131133    *fLog << inf << "found: ";
    132134    fF->Print();
     
    143145        delete fF;
    144146}
    145 
     147/*
    146148// --------------------------------------------------------------------------
    147149//
     
    348350    return filter0;
    349351}
     352*/
    350353
    351354// --------------------------------------------------------------------------
     
    481484
    482485    /*
     486     // It is assumed that each filter itself calls MFilter::ReadEnv
     487     // to process the Inverted directive
    483488     Bool_t rc = MFilter::ReadEnv(env, prefix, print);
    484489     if (rc==kERROR)
    485      return kERROR;
    486     */
     490        return kERROR;
     491        */
    487492    if (IsEnvDefined(env, prefix, "Condition", print))
    488493    {
     
    523528        SetAllowEmpty(kFALSE);
    524529
     530        const Int_t fg = rule.First('>');
     531        const Int_t fl = rule.First('<');
     532
     533        if (fg<0 && fl<0)
     534        {
     535            MFilter *f = (MFilter*)GetNewObject(rule, MFilter::Class());
     536            if (!f)
     537            {
     538                *fLog << err << dbginf << "Syntax Error: '" << rule << "' is neither a MFilter nor conditional sign found." << endl;
     539                return kERROR;
     540            }
     541            fF = f;
     542        }
     543        else
     544            fF = new MFDataPhrase(rule);
     545        /*
    525546        if (!(fF=ParseString(rule, 1)))
    526547        {
     
    528549            return kERROR;
    529550        }
    530 
     551        */
    531552        if (print)
    532553        {
  • trunk/MagicSoft/Mars/mfbase/MF.h

    r7804 r8091  
    2323    MFilter *fF;                     // Filter
    2424    Bool_t fAllowEmpty;              // Not a Bit to be stored
    25 
     25/*
    2626    Int_t IsRule(TString &txt, TString &rule) const;
    2727    Int_t IsVal(const TString &txt) const;
     
    3030    MFilter *ParseRule(TString &txt, MFilter *filter0, Int_t level) const;
    3131    MFilter *ParseString(TString txt, Int_t level);
    32 
     32  */
    3333    void StreamPrimitive(ostream &out) const;
    3434
  • trunk/MagicSoft/Mars/mfbase/Makefile

    r3927 r8091  
    1616
    1717SRCFILES = MF.cc \
     18           MFDataPhrase.cc \
    1819           MFilterList.cc \
    1920           MFEventSelector.cc \
  • trunk/MagicSoft/Mars/mjoptim/MJOptimize.cc

    r7633 r8091  
    113113
    114114// filters
    115 #include "MF.h"
     115#include "MFDataPhrase.h"
    116116#include "MFilterList.h"
    117117
     
    319319void MJOptimize::AddFilter(const char *rule)
    320320{
    321     fFilter.Add(new MF(rule));
     321    fFilter.Add(new MFDataPhrase(rule));
    322322}
    323323
     
    330330void MJOptimize::AddPreCut(const char *rule)
    331331{
    332     MFilter *f = new MF(rule);
     332    MFilter *f = new MFDataPhrase(rule);
    333333    f->SetBit(kCanDelete);
    334334    AddPreCut(f);
  • trunk/MagicSoft/Mars/mjtrain/MJTrainRanForest.cc

    r7749 r8091  
    3737#include "MLogManip.h"
    3838
    39 #include "MF.h"
     39#include "MFDataPhrase.h"
    4040#include "MParameterCalc.h"
    4141
     
    5454void MJTrainRanForest::AddCut(TList &l, const char *rule)
    5555{
    56     MFilter *f = new MF(rule);
     56    MFilter *f = new MFDataPhrase(rule);
    5757    f->SetBit(kCanDelete); //FIXME!!!! Why does not any other list delete it???
    5858    Add(l, f);
  • trunk/MagicSoft/Mars/mtools/MTFillMatrix.cc

    r7687 r8091  
    9898
    9999// filters
    100 #include "MF.h"
     100#include "MFDataPhrase.h"
    101101#include "MFilterList.h"
    102102#include "MFEventSelector.h"
     
    202202void MTFillMatrix::AddPreCut(const char *rule)
    203203{
    204     MFilter *f = new MF(rule);
     204    MFilter *f = new MFDataPhrase(rule);
    205205    f->SetBit(kCanDelete);
    206206    AddPreCut(f);
     
    369369    // entries in MTaskList
    370370    tlist.AddToList(fReader);        // Read events
    371     tlist.AddToList(fPreTasks);      // PreTasks
     371    tlist.AddToList(fPreTasks, 0);   // PreTasks
    372372    if (fPreCuts.GetEntries()>0)
    373373        tlist.AddToList(&cont0);     // PreCuts
     
    375375        tlist.AddToList(&cont);      // select a sample of events
    376376    tlist.AddToList(&invsplit);      // process invsplit (which implicitly processes split)
    377     tlist.AddToList(fPostTasks);     // PostTasks
     377    tlist.AddToList(fPostTasks, 0);  // PostTasks
    378378    if (fDestMatrix1)
    379379        tlist.AddToList(&fill1);     // fill matrix 1
Note: See TracChangeset for help on using the changeset viewer.