Ignore:
Timestamp:
12/11/01 15:22:10 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
9 edited

Legend:

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

    r1105 r1108  
    167167//   - The picture is freed as often as it was retrieved from gClient
    168168//
    169 void MGList::AddPicture(const TGPicture *pic)
     169void MGList::AddPicture(const TGPicture *pic, const char *name)
    170170{
    171171    //
     
    174174    if (!pic)
    175175    {
    176         cout << "Warning: Requested picture not found... ignored." << endl;
     176        cout << "Warning: Requested picture '" << name << "' not found... ignored." << endl;
     177        cout << "    Please copy " << name << " to $HOME or $HOME/icons or add" << endl;
     178        cout << "      Unix.*.Gui.IconPath: ~/Path/To/The/Picture" << endl;
     179        cout << "    to [$HOME/].rootrc."  << endl;
    177180        return;
    178181    }
     
    199202{
    200203    const TGPicture *pic = gClient->GetPicture(name);
    201     AddPicture(pic);
     204    AddPicture(pic, name);
    202205    return pic;
    203206}
     
    218221{
    219222    const TGPicture *pic = gClient->GetPicture(name, width, height);
    220     AddPicture(pic);
     223    AddPicture(pic, name);
    221224    return pic;
    222225}
  • trunk/MagicSoft/Mars/mbase/MGList.h

    r1086 r1108  
    1515    Bool_t    IsExisting(TObject *obj) const;
    1616
    17     void      AddPicture(const TGPicture *pic);
     17    void      AddPicture(const TGPicture *pic, const char *name);
    1818
    1919public:
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r1085 r1108  
    149149Bool_t MReadTree::Notify()
    150150{
    151     fNotify->ForEach(TObject, Notify)();
     151    //
     152    // FIXME: This is correct!
     153    //
     154    //   fNotify->ForEach(TObject, Notify)();
     155
     156    fTaskList->ReInit();
     157
    152158    return kTRUE;
    153159}
     
    209215// --------------------------------------------------------------------------
    210216//
     217// Set branch status of branch name
     218//
     219void MReadTree::SetBranchStatus(const char *name, Bool_t status)
     220{
     221    fChain->SetBranchStatus(name, status);
     222
     223    *fLog << inf << (status ? "Enabled" : "Disabled");
     224    *fLog << " subbranch '" << name << "'." << endl;
     225}
     226
     227// --------------------------------------------------------------------------
     228//
    211229// Checks whether a branch with the given name exists in the chain
    212230// and sets the branch status of this branch corresponding to status.
     
    222240    // Check whether this branch really exists
    223241    //
    224     if (!fChain->GetBranch(name))
     242    if (fChain->GetBranch(name))
     243        SetBranchStatus(name, status);
     244
     245    //
     246    // Remove trailing '.' if one and try to enable the subbranch without
     247    // the master barnch name. This is to be compatible with older mars
     248    // and camera files.
     249    //
     250    const char *dot = strrchr(name, '.');
     251    if (!dot)
    225252        return;
    226253
    227     //
    228     // Set the branch status
    229     //
    230     fChain->SetBranchStatus(name, status);
    231     *fLog << inf << (status ? "Enabled" : "Disabled");
    232     *fLog << " subbranch '" << name << "'." << endl;
     254    if (fChain->GetBranch(dot+1))
     255        SetBranchStatus(dot+1, kTRUE);
    233256}
    234257
     
    265288    // check whether branch choosing must be switched on
    266289    //
    267     EnableBranchChoosing();
     290    //EnableBranchChoosing();
    268291
    269292    //
     
    324347Bool_t MReadTree::PreProcess(MParList *pList)
    325348{
     349    fTaskList = (MTaskList*)pList->FindObject("MTaskList");
     350
    326351    //
    327352    // get number of events in this tree
  • trunk/MagicSoft/Mars/mbase/MReadTree.h

    r1086 r1108  
    88class TChain;
    99class TBranch;
     10class MTaskList;
    1011class TGProgressBar;
    1112
     
    2425    TList  *fNotify;           // List of TObjects to notify when switching files
    2526
     27    MTaskList      *fTaskList; //! Tasklist for reinitialization
    2628    TGProgressBar  *fProgress; //! Possible display of status
    2729
    2830    void SetBranchStatus(const TList *list, Bool_t status);
    2931    void SetBranchStatus(TObject *branch, Bool_t status);
     32    void SetBranchStatus(const char *name, Bool_t status);
    3033
    3134    void DisableSubBranches(TBranch *b);
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r1086 r1108  
    100100// recommended method is to call this function for exactly all
    101101// branches you want to have, eg:
     102//  AddToBranchList("MMcTrig.fNumFirstLevel");
    102103//  AddToBranchList("MMcTrig;1.fNumFirstLevel");
    103104//  AddToBranchList("MMcTrig;2.fNumFirstLevel");
     
    181182// --------------------------------------------------------------------------
    182183//
     184// This is reinit function
     185//
     186// This function is called asynchronously if the tasks in the tasklist need
     187// reinitialization. This for example happens when the eventloop switches
     188// from one group of events to another one (eg. switching between events
     189// of different runs means reading a new run header and a new run header
     190// may mean that some value must be reinitialized)
     191//
     192// the virtual implementation returns kTRUE
     193//
     194Bool_t MTask::ReInit(MParList *pList)
     195{
     196    return kTRUE;
     197}
     198
     199// --------------------------------------------------------------------------
     200//
    183201// This is processed before the eventloop starts
    184202//
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r1084 r1108  
    7474    UInt_t GetNumExecutions() { return fNumExecutions; }
    7575
     76    virtual Bool_t ReInit(MParList *pList);
     77
    7678    virtual Bool_t CallPreProcess(MParList *plist);
    7779    virtual Bool_t CallProcess();
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1086 r1108  
    214214// --------------------------------------------------------------------------
    215215//
     216//  do reinit of all tasks in the task-list
     217//
     218Bool_t MTaskList::ReInit(MParList *pList)
     219{
     220    *fLog << all << "Reinit... " << flush;
     221
     222    //
     223    //  create the Iterator over the tasklist
     224    //
     225    TIter Next(fTasks);
     226
     227    MTask *task=NULL;
     228
     229    //
     230    // loop over all tasks for preproccesing
     231    //
     232    while ((task=(MTask*)Next()))
     233    {
     234        *fLog << all << task->GetName() << "... " << flush;
     235
     236        if (!task->ReInit(pList?fParList:pList))
     237            return kFALSE;
     238    }
     239
     240    *fLog << all << endl;
     241
     242    return kTRUE;
     243}
     244
     245// --------------------------------------------------------------------------
     246//
    216247//  do pre processing (before eventloop) of all tasks in the task-list
    217248//
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r1083 r1108  
    4242    TObject *FindObject(const TObject *obj) const;
    4343
     44    Bool_t ReInit(MParList *pList=NULL);
     45
    4446    Bool_t PreProcess(MParList *pList);
    4547    Bool_t Process();
  • trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc

    r1086 r1108  
    286286        // The containers should be written in Splitlevel=1
    287287        //
    288         branch = tree->Branch(cname, cont->ClassName(), entry->GetAddress());
     288        TString branchname(cname);
     289        branchname.Append(".");
     290        branch = tree->Branch(branchname, cont->ClassName(), entry->GetAddress());
    289291
    290292        *fLog << "Created Branch " << cname << " of " << cont->ClassName() << "." << endl;
Note: See TracChangeset for help on using the changeset viewer.