Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4GUI/TGo4EventInfoStatus.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4EventInfoStatus.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TTree.h"
00021 
00022 #include "Go4LockGuard/TGo4LockGuard.h"
00023 #include "Go4Event/TGo4EventElement.h"
00024 
00025 TGo4EventInfoStatus::TGo4EventInfoStatus(const char* name, const char* title)
00026     :TGo4Status(name, title),
00027     fiEventNum(10),fiSubId(-1),fbLong(kTRUE),fbHex(kTRUE),fbData(kFALSE),
00028     fbRemotePrint(kTRUE), fbTreeMode(kFALSE),fxEventTree(0),fxEvent(0)
00029 {
00030 }
00031 
00032 TGo4EventInfoStatus::~TGo4EventInfoStatus()
00033 {
00034 TGo4LockGuard Global;
00035 delete fxEventTree;
00036 delete fxEvent;
00037 }
00038 
00039 void TGo4EventInfoStatus::SetEvent(TTree* tree)
00040 {
00041 if(tree==0) return;
00042 TGo4LockGuard Global;
00043 delete fxEvent;
00044 fxEvent=0;
00045 delete fxEventTree;
00046 fxEventTree= (TTree*) tree->Clone();
00047 PrintEventSample();
00048 }
00049 
00050 void TGo4EventInfoStatus::SetEvent(TGo4EventElement* eve)
00051 {
00052 if(eve==0) return;
00053 TGo4LockGuard Global;
00054 delete fxEventTree;
00055 fxEventTree=0;
00056 delete fxEvent;
00057 fxEvent= (TGo4EventElement*) eve->Clone();
00058 PrintEventSample();
00059 }
00060 
00061 void TGo4EventInfoStatus::PrintEventSample()
00062  {
00063   // provide event printout buffer:
00065 // TTree::Show() uses printf().
00066 //ios::sync_with_stdio(true);
00067 //cout.flush();
00068 //ostringstream strout;
00069 //streambuf* cout_buffer = cout.rdbuf();
00070 //cout.rdbuf(strout.rdbuf());
00071 TGo4LockGuard Global;
00072 if(fxEventTree)
00073    {
00074    // sample is tree
00075    fxEventTree->Show(0);
00076    //cout <<"I show the tree on printf, this is cout!" << endl;
00077    }
00078 else if (fxEvent)
00079    {
00080       // sample is event
00081       fxEvent->PrintEvent();
00082       //cout <<"I print event somewhere, this is cout!" << endl;
00083    }
00084 else
00085    cout <<"No event sample available!" << endl;
00086 //cout << endl;
00087 //cout.flush();
00088 //cout.rdbuf(cout_buffer);
00089 //fxEventPrintout=strout.str().c_str();
00090  }
00091 
00092 
00093 
00094 
00095 
00096 
00097 
00098 
00099 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:00 2005 for Go4-v2.10-5 by doxygen1.2.15