Ignore:
Timestamp:
04/22/02 11:28:38 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MFilterList.cc

    r1218 r1283  
    5959    TString str(type);
    6060
    61     if (str.CompareTo("OR", TString::kIgnoreCase)  || str.CompareTo("|"))
     61    if (!str.CompareTo("OR", TString::kIgnoreCase)  || !str.CompareTo("|"))
    6262        fFilterType = kEOr;
    63     if (str.CompareTo("XOR", TString::kIgnoreCase) || str.CompareTo("^"))
     63    if (!str.CompareTo("XOR", TString::kIgnoreCase) || !str.CompareTo("^"))
    6464        fFilterType = kEXor;
    65     if (str.CompareTo("LAND", TString::kIgnoreCase) || str.CompareTo("&&"))
     65    if (!str.CompareTo("LAND", TString::kIgnoreCase) || !str.CompareTo("&&"))
    6666        fFilterType = kELAnd;
    67     if (str.CompareTo("LOR", TString::kIgnoreCase) || str.CompareTo("||"))
     67    if (!str.CompareTo("LOR", TString::kIgnoreCase) || !str.CompareTo("||"))
    6868        fFilterType = kELOr;
    6969}
     
    180180    while ((filter=(MFilter*)Next()))
    181181        if (!filter->PreProcess(pList))
     182        {
     183            *fLog << err << "Error - Preprocessing Filter ";
     184            *fLog << filter->GetName() << " in " << fName << endl;
    182185            return kFALSE;
     186        }
    183187
    184188    return kTRUE;
     
    235239    const Bool_t verbose = str.Contains("V", TString::kIgnoreCase);
    236240
     241    //*fLog << all << "(" << GetName() << "=" << (int)fFilterType << ")";
     242
    237243    *fLog << all << "(";
    238244
     
    250256    }
    251257
    252     do
     258    filter->Print();
     259
     260    while ((filter=(MFilter*)Next()))
    253261    {
    254262        switch (fFilterType)
    255263        {
    256264        case kEAnd:
    257             *fLog << (verbose?" and ":"&");
     265            *fLog << (verbose?" and ":" & ");
    258266            break;
    259267
    260268        case kEOr:
    261             *fLog << (verbose?" or ":"|");
     269            *fLog << (verbose?" or ":" | ");
    262270            break;
    263271
    264272        case kEXor:
    265             *fLog << (verbose?" xor ":"^");
     273            *fLog << (verbose?" xor ":" ^ ");
    266274            break;
    267275
    268276        case kELAnd:
    269             *fLog << (verbose?" land ":"&&");
     277            *fLog << (verbose?" land ":" && ");
    270278            break;
    271279
    272280        case kELOr:
    273             *fLog << (verbose?" lor ":"||");
     281            *fLog << (verbose?" lor ":" || ");
    274282            break;
    275283        }
    276284
    277285        filter->Print();
    278     } while ((filter=(MFilter*)Next()));
     286    }
    279287
    280288    *fLog << ")" << flush;
    281289}
     290
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r1279 r1283  
    319319    return rc;
    320320}
     321
     322TMethodCall *MParContainer::GetterMethod(const char *name) const
     323{
     324    TClass *cls = IsA()->GetBaseDataMember(name);
     325    if (!cls)
     326    {
     327        *fLog << err << "No (base) class containing '" << name << "'." << endl;
     328        return NULL;
     329    }
     330
     331    TDataMember *member = cls->GetDataMember(name);
     332    if (!member)
     333    {
     334        *fLog << err << "Datamember '" << name << "' not in " << GetDescriptor() << endl;
     335        return NULL;
     336    }
     337
     338    TMethodCall *call = member->GetterMethod();
     339    if (!call)
     340    {
     341        *fLog << err << "Sorry, no getter method found for " << name << endl;
     342        return NULL;
     343    }
     344
     345    return call;
     346}
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r1235 r1283  
    2424
    2525class TDataMember;
     26class TMethodCall;
    2627
    2728class MParContainer : public TObject
     
    6667    virtual void   SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; }
    6768
     69    TMethodCall *GetterMethod(const char *name) const;
     70
    6871    Bool_t WriteDataMember(ostream &out, const char *member, Double_t scale=1) const;
    6972    Bool_t WriteDataMember(ostream &out, const TDataMember *member, Double_t scale=1) const;
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r1211 r1283  
    380380    //
    381381    TClass *cls = gROOT->GetClass(cname);
    382 
    383382    if (!cls)
    384383    {
     
    394393    //
    395394    pcont = (MParContainer*)cls->New();
     395    if (!pcont)
     396    {
     397        *fLog << err << dbginf << "Cannot create new instance of class '" << cname << "' (Maybe no def. constructor)" << endl;
     398        return NULL;
     399    }
    396400
    397401    //
     
    424428void MParList::Print(Option_t *t) const
    425429{
    426     *fLog << all << GetDescriptor() << endl;
     430    *fLog << all << " " << GetDescriptor() << endl;
    427431    *fLog << setfill('-') << setw(strlen(GetDescriptor())+2) << "" << endl;
    428432    MParContainer *obj = NULL;
     
    572576    //
    573577    TClass *cls = gROOT->GetClass(cname);
    574 
    575578    if (!cls)
    576579    {
     
    602605        //
    603606        MParContainer *pcont = (MParContainer*)cls->New();
     607        if (pcont)
     608        {
     609            gLog << err << dbginf << "Cannot create new instance of class '" << cname << "' (Maybe no def. constructor)" << endl;
     610            return list;
     611        }
    604612
    605613        //
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r1211 r1283  
    458458        // check if object is existing in the list
    459459        //
    460         *pcont=pList->FindCreateObj(oname);
     460        *pcont=pList->FindCreateObj(branch->GetClassName(), oname);
    461461
    462462        if (!*pcont)
     
    466466            // we cannot proceed reading this branch
    467467            //
    468             *fLog << warn << dbginf << "Warning: Class '" << oname << "' not existing in dictionary. Branch skipped." << endl;
     468            *fLog << warn << dbginf << "Warning: Class '" << branch->GetClassName();
     469            *fLog << "' for " << oname << " not existing in dictionary. Branch skipped." << endl;
    469470            DisableSubBranches(branch);
    470471            continue;
     
    484485        //
    485486        fChain->SetBranchAddress(bname, pcont);
    486         *fLog << inf << "Master branch address " << bname << " setup for reading." << endl;
     487
     488        *fLog << inf << "Master branch address " << bname << " [";
     489        *fLog << branch->GetClassName() << "] setup for reading." << endl;
    487490
    488491        //*fLog << "Branch " << bname << " autodel: " << (int)branch->IsAutoDelete() << endl;
     
    568571//
    569572#if ROOT_VERSION_CODE < ROOT_VERSION(3,02,06)
    570 //#include "../mraw/MRawEvtData.h"
    571573#include "MRawEvtData.h"
    572574#endif
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1280 r1283  
    5858
    5959#include <TClass.h>
     60#include <TBaseClass.h>
    6061#include <TOrdCollection.h>
    6162
     
    259260// --------------------------------------------------------------------------
    260261//
     262// Check whether this task (or one of it's base classes) overloads
     263// MTask::Process. Only if this function is overloaded this task is
     264// added to the fTaskProcess-List. This makes the execution of the
     265// tasklist a little bit (only a little bit) faster, bacause tasks
     266// doing no Processing are not Processed.
     267//
     268Bool_t MTaskList::CheckClassForProcess(TClass *cls)
     269{
     270    //
     271    // Check whether the class itself overloads the Process function
     272    //
     273    if (cls->GetName()=="MTask")
     274        return kFALSE;
     275
     276    if (cls->GetMethodAny("Process"))
     277        return kTRUE;
     278
     279    //
     280    // If the class itself doesn't overload it check all it's base classes
     281    //
     282    TBaseClass *base=NULL;
     283    TIter NextBase(cls->GetListOfBases());
     284    while ((base=(TBaseClass*)NextBase()))
     285    {
     286        if (CheckClassForProcess(base->GetClassPointer()))
     287            return kTRUE;
     288    }
     289
     290    return kFALSE;
     291}
     292
     293// --------------------------------------------------------------------------
     294//
    261295//  do pre processing (before eventloop) of all tasks in the task-list
    262296//
    263 #include <TMethod.h>
    264 #include <TBaseClass.h>
    265297Bool_t MTaskList::PreProcess(MParList *pList)
    266298{
     
    283315    while ((task=(MTask*)Next()))
    284316    {
    285         *fLog << all << task->GetName() << "... " << flush;
    286 
    287         //
    288         // Check whether this task (or one of it's base classes) overloads
    289         // MTask::Process. Only if this function is overloaded this task is
    290         // added to the fTaskProcess-List. This makes the execution of the
    291         // tasklist a little bit (only a little bit) faster, bacause tasks
    292         // doing no Processing are not Processed.
    293         //
    294         TBaseClass *cls=NULL;
    295         TIter NextBase(task->IsA()->GetListOfBases());
    296         while ((cls=(TBaseClass*)NextBase()))
    297         {
    298             if (cls->GetName()=="MTask")
    299                 break;
    300 
    301             if (!cls->GetClassPointer()->GetMethodAny("Process"))
    302                 continue;
    303 
     317        if (CheckClassForProcess(task->IsA()))
    304318            fTasksProcess.Add(task);
    305             break;
    306         }
    307319
    308320        //
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r1269 r1283  
    3030    enum { kIsOwner = BIT(14) };
    3131
    32     void Remove(MTask *task);
     32    void   Remove(MTask *task);
     33    Bool_t CheckClassForProcess(TClass *cls);
    3334
    3435public:
Note: See TracChangeset for help on using the changeset viewer.