Ignore:
Timestamp:
02/22/01 14:30:10 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MAGIC.h

    r604 r609  
    3434// default pipes all output to the stdout
    3535//
     36
     37//This will be fixed soon. It doesn't work with Alphas at the moment
    3638class MLog;
     39#ifndef __CINT__
    3740extern MLog gLog;
     41#endif
    3842
    3943#endif
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r604 r609  
    4646}
    4747
    48 void MLog::Write()
     48void MLog::WriteBuffer()
    4949{
    5050    const int len = fPPtr - fBase;
     
    7676{
    7777//    cout << "*sync*";
    78     Write();
     78    WriteBuffer();
    7979
    8080    if (fDevice&eStdout)
     
    100100    // If the buffer is not really filled i is EOF(-1).
    101101    //
    102     if (fOutputLevel < fDebugLevel)
    103     {
    104         *fPPtr++ = (char)i;
     102    if (fOutputLevel >= fDebugLevel)
     103        return 0;
    105104
    106         if (fPPtr == fEPtr)
    107             Write();
    108     }
     105    *fPPtr++ = (char)i;
     106
     107    if (fPPtr == fEPtr)
     108        WriteBuffer();
    109109
    110110    return 0;
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r604 r609  
    3636    void Init();
    3737
    38     void Write();
     38    void WriteBuffer();
    3939    int sync();
    4040    int overflow(int i); // i=EOF means not a real overflow
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r458 r609  
    1313#include "MParContainer.h"
    1414
    15 #include <iostream.h>    // cout
    16 
    1715#include <TClass.h>      // IsA
    1816#include <TROOT.h>       // TROOT::Identlevel
    1917#include <TVirtualPad.h> // gPad
     18
     19#include "MLog.h"
    2020
    2121ClassImp(MParContainer)
     
    7878
    7979   TROOT::IndentLevel();
    80    cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
     80   *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
    8181        << Int_t(TestBit(kCanDelete)) << endl;
    8282}
     
    8787   // Print MParContainer name and title.
    8888
    89    cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
     89   *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
    9090}
    9191
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r604 r609  
    2020#endif
    2121
    22 class MLog;
    2322class ofstream;
    2423class ifstream;
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r608 r609  
    1515//                                                                         //
    1616/////////////////////////////////////////////////////////////////////////////
    17 
    1817#include "MParList.h"
    1918
    2019#include <TNamed.h>
    2120
    22 #include "MParContainer.h"
     21#include "MLog.h"
    2322
    2423ClassImp(MParList)
     
    5756        cont->SetLogStream(log);
    5857
    59 //    SetLogStream(log);
     58    MParContainer::SetLogStream(log);
    6059}
    6160
     
    7473  if (!obj) return kTRUE;
    7574
    76   cout << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
     75  *fLog << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
    7776  //
    7877  //  check if it is in the list yet
     
    8079  if (fContainer.FindObject(obj))
    8180  {
    82       cout << "WARNING: MParList::add: Container already added" << endl;
     81      *fLog << "WARNING: MParList::add: Container already added" << endl;
    8382      return kTRUE;
    8483  }
     
    9291      if (!fContainer.FindObject(where))
    9392      {
    94           cout << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;
     93          *fLog << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;
    9594          return kFALSE;
    9695      }
     
    9897
    9998  fContainer.Add(obj);
    100   cout << "Done." << endl;
     99  *fLog << "Done." << endl;
    101100
    102101  return kTRUE;
     
    118117  //   print some information about the current status of MParList
    119118  //
    120   cout << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
    121   cout << endl;
     119  *fLog << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
     120  *fLog << endl;
    122121 
    123122}
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r604 r609  
    1414#endif
    1515
    16 #include <iostream.h>
    17 
    1816#ifndef ROOT_TOrdCollection
    1917#include "TOrdCollection.h"
    2018#endif
     19#ifndef MPARCONTAINER_H
     20#include "MParContainer.h"
     21#endif
    2122
    2223class MLog;
    23 class MParContainer;
    2424
    25 class MParList : public TObject
     25class MParList : public MParContainer
    2626{
    2727private:
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r585 r609  
    1515#include "MReadTree.h"
    1616
    17 #include <iostream.h>
    1817#include <fstream.h>
    1918
     
    2221#include <TObjArray.h>
    2322
     23#include "MLog.h"
    2424#include "MTime.h"
    2525#include "MParList.h"
     
    4949    if (!fFile->IsOpen())
    5050    {
    51         cout << "MReadTree::PreProcess: ERROR: Cannot open file '";
    52         cout << fFileName << "'" << endl;
     51        *fLog << "MReadTree::PreProcess: ERROR: Cannot open file '";
     52        *fLog << fFileName << "'" << endl;
    5353        return kFALSE;
    5454    }
     
    5858    if (!fTree)
    5959    {
    60         cout << "MReadTree::PreProcess: ERROR: Cannot open tree '";
    61         cout << fTreeName << "'" << endl;
     60        *fLog << "MReadTree::PreProcess: ERROR: Cannot open tree '";
     61        *fLog << fTreeName << "'" << endl;
    6262        return kFALSE;
    6363    }
     
    6666    fNumEntry   = 0;
    6767
    68     cout << "File: '" << fFileName << "'  Tree: '" << fTreeName;
    69     cout << "' with " << fNumEntries << " Entries opened." << endl;
     68    *fLog << "File: '" << fFileName << "'  Tree: '" << fTreeName;
     69    *fLog << "' with " << fNumEntries << " Entries opened." << endl;
    7070
    7171    //
     
    9696            // if object is not existing in the list try to create one
    9797            //
    98             cout << "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl;
     98            *fLog << "MReadTree::PreProcess - WARNING: '" << name << "' not found... creating." << endl;
    9999
    100100            //
     
    109109                // we cannot proceed reading this branch
    110110                //
    111                 cout << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl;
     111                *fLog << "MReadTree::PreProcess - Warning: Class '" << name << "' not existing in dictionary. Branch skipped." << endl;
    112112                continue;
    113113            }
     
    117117            //
    118118            pcont = (MParContainer*)cls->New();
    119             cout << pcont << endl;
     119            *fLog << pcont << endl;
    120120            pList->AddToList(pcont);
    121121        }
     
    180180    if (fNumEntry < dec/*+1*/)
    181181    {
    182         cout << "MReadTree::SetPrevEvent: WARNING: " << fNumEntry/*-1*/ << "-" << dec << " out of Range." << endl;
     182        *fLog << "MReadTree::SetPrevEvent: WARNING: " << fNumEntry/*-1*/ << "-" << dec << " out of Range." << endl;
    183183        return kFALSE;
    184184    }
     
    203203    if (fNumEntry+inc/*-1*/ >= fNumEntries)
    204204    {
    205         cout << "MReadTree::SkipEvents: WARNING: " << fNumEntry/*-1*/ << "+" << inc << " out of Range." << endl;
     205        *fLog << "MReadTree::SkipEvents: WARNING: " << fNumEntry/*-1*/ << "+" << inc << " out of Range." << endl;
    206206        return kFALSE;
    207207    }
     
    218218    if (nr>=fNumEntries)
    219219    {
    220         cout << "MReadTree::SetEventNum: WARNING: " << nr << " out of Range." << endl;
     220        *fLog << "MReadTree::SetEventNum: WARNING: " << nr << " out of Range." << endl;
    221221        return kFALSE;
    222222    }
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r458 r609  
    3737#include "MTask.h"
    3838
    39 #include <string.h>
    40 #include <iostream.h>
    41 
    4239ClassImp(MTask)
    4340
    4441Bool_t MTask::PreProcess( MParList *pList )
    4542{
    46   //
    47   // This is processed before the eventloop starts
    48   //
    49   // It is the job of the PreProcess to connect the tasks
    50   // with the right container in the parameter list.
    51   //
    52   // the virtual implementation returns kTRUE
    53   //
    54   return kTRUE;
     43    //
     44    // This is processed before the eventloop starts
     45    //
     46    // It is the job of the PreProcess to connect the tasks
     47    // with the right container in the parameter list.
     48    //
     49    // the virtual implementation returns kTRUE
     50    //
     51    return kTRUE;
    5552}
    56 
    5753
    5854Bool_t MTask::Process()
    5955{
    60   //
    61   // This is processed for every event in the eventloop
    62   //
    63   // the virtual implementation returns kTRUE
    64   //
    65   return kTRUE;
     56    //
     57    // This is processed for every event in the eventloop
     58    //
     59    // the virtual implementation returns kTRUE
     60    //
     61    return kTRUE;
    6662}
    6763
    6864Bool_t MTask::PostProcess()
    6965{
    70   //
    71   // This is processed after the eventloop starts
    72   //
    73   // the virtual implementation returns kTRUE
    74   //
    75   return kTRUE;
     66    //
     67    // This is processed after the eventloop starts
     68    //
     69    // the virtual implementation returns kTRUE
     70    //
     71    return kTRUE;
    7672}
    7773
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r604 r609  
    1818class MTask : public MInputStreamID
    1919{
    20     MLog *fLog; //!
    21 
    2220public:
    2321    ~MTask()
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r608 r609  
    99#include "MTaskList.h"
    1010
    11 #include <iostream.h>
    12 
     11#include "MLog.h"
    1312#include "MParList.h"
    1413#include "MInputStreamID.h"
     
    5655        task->SetLogStream(log);
    5756
    58 //    SetLogStream(log);
     57    MParContainer::SetLogStream(log);
    5958}
    6059
     
    7372    if (fTasks.FindObject(task))
    7473    {
    75         cout << "WARNING: MTaskList::AddToList: Task already existing." << endl;
     74        *fLog << "WARNING: MTaskList::AddToList: Task already existing." << endl;
    7675        return kTRUE;
    7776    }
     
    7978    if (fTasks.FindObject(name))
    8079    {
    81         cout << "WARNING: MTaskList::AddToList: '" << name << "' exists in List already." << endl;
     80        *fLog << "WARNING: MTaskList::AddToList: '" << name << "' exists in List already." << endl;
    8281        return kTRUE;
    8382    }
     
    9291    }
    9392
    94     cout << "Adding " << name << " to " << GetName() << " for " << type << "... " << flush;
     93    *fLog << "Adding " << name << " to " << GetName() << " for " << type << "... " << flush;
    9594
    9695    task->SetStreamId(type);
    9796    fTasks.Add(task);
    9897
    99     cout << "Done." << endl;
     98    *fLog << "Done." << endl;
    10099
    101100    return kTRUE;
     
    108107    // do pre processing (before eventloop) of all tasks in the task-list
    109108    //
    110     cout << "Preprocessing... " << flush;
     109    *fLog << "Preprocessing... " << flush;
    111110
    112111    //
     
    122121    while ( (task=(MTask*)Next()) )
    123122    {
    124         cout << task->GetName() << "... " << flush;
     123        *fLog << task->GetName() << "... " << flush;
    125124
    126125        if (!task->PreProcess( pList ))
     
    128127    }
    129128
    130     cout << endl;
     129    *fLog << endl;
    131130
    132131    return kTRUE;
     
    184183  //
    185184
    186     cout << "Postprocessing... " << flush;
     185    *fLog << "Postprocessing... " << flush;
    187186
    188187  //
     
    198197  while ( (task=(MTask*)Next()) )
    199198  {
    200       cout << task->GetName() << "... " << flush;
     199      *fLog << task->GetName() << "... " << flush;
    201200
    202201      if (!task->PostProcess())
     
    204203  }
    205204
    206   cout << endl;
     205  *fLog << endl;
    207206
    208207  return kTRUE;
     
    213212void MTaskList::Print(Option_t *t)
    214213{
    215   cout << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
     214  *fLog << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
    216215 
    217216  fTasks.Print();
    218217
    219   cout << endl;
    220 }
    221 
     218  *fLog << endl;
     219}
     220
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r604 r609  
    2626    TOrdCollection fTasks;      // Container for the ordered list of different tasks
    2727
    28 
    2928public:
    3029    MTaskList(const char *title=NULL);
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r458 r609  
    99#include "MTime.h"
    1010
    11 #include <iostream.h>
    1211#include <iomanip.h>
     12
     13#include "MLog.h"
    1314
    1415ClassImp(MTime)
    1516
    1617void MTime::Print(Option_t *)
    17 {
    18     cout << "MTime Information:  " << hex
    19         << " 0x" <<setfill('0') << setw(2) << fTimeStamp[0]
    20         << " 0x" <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl;
     18{
     19    fLog->setf(ios::showbase);
     20    *fLog << "MTime Information:  " << hex
     21        << " " <<setfill('0') << setw(2) << fTimeStamp[0]
     22        << " " <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl;
    2123}
    22     /*
    23 inline Bool_t operator<(MTime &t1, MTime &t2)
    24 {
    25     return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<t2.GetTimeLo());
    26 }
    2724
    28 inline Bool_t operator>(MTime &t1, MTime &t2)
    29 {
    30     return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>t2.GetTimeLo());
    31 }
    32 
    33 inline Bool_t operator<=(MTime &t1, MTime &t2)
    34 {
    35     return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<=t2.GetTimeLo());
    36 }
    37 
    38 inline Bool_t operator>=(MTime &t1, MTime &t2)
    39 {
    40     return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>=t2.GetTimeLo());
    41 }
    42 
    43 inline Bool_t operator==(MTime &t1, MTime &t2)
    44 {
    45     return (t1.GetTimeLo()==t2.GetTimeLo()) && (t1.GetTimeHi()==t2.GetTimeHi());
    46 }
    47 */
Note: See TracChangeset for help on using the changeset viewer.