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

/Go4ExampleMesh/TMeshRawEvent.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 "TMeshRawEvent.h"
00017 
00018 #include <iostream.h>
00019 
00020 //***********************************************************
00021 TMeshRawEvent::TMeshRawEvent()
00022   :TGo4EventElement("RawEvent"),fxUnpacker(0),fxFile(0)
00023 {
00024 }
00025 //***********************************************************
00026 TMeshRawEvent::TMeshRawEvent(Text_t * name)
00027   :TGo4EventElement(name),fxUnpacker(0),fxFile(0)
00028 {
00029 }
00030 //***********************************************************
00031 TMeshRawEvent::~TMeshRawEvent()
00032 {
00033 }
00034 //***********************************************************
00035 
00036 //-----------------------------------------------------------
00037 Int_t TMeshRawEvent::Init()
00038 {
00039   Int_t rev=0;
00040   //cout << "+++ Init event" << endl;
00041   Clear();
00042   if(CheckEventSource("TMeshUnpackProc"))
00043    {  
00044       fxUnpacker = dynamic_cast<TMeshUnpackProc*>(GetEventSource());
00045       // for the subcomponents, we have to set unpacker as source ?:
00046       // only if we would use the subcomponents' Fill() methodsin our Fill() 
00047       //      fxSub1.SetEventSource(fxUnpacker);
00048       //      fxSub1.Init();
00049       //      fxSub2.SetEventSource(fxUnpacker);
00050       //      fxSub1.Init();
00051       //      fxSub3.SetEventSource(fxUnpacker);
00052       //      fxSub1.Init();
00053       cout << "**** TMeshRawEvent init for Unpack step"<< endl;  
00054    }
00055   else if(CheckEventSource("TGo4FileSource"))
00056    {
00057       fxFile = dynamic_cast<TGo4FileSource*> (GetEventSource());
00058       cout << "**** TMeshRawEvent init for file input"<< endl;
00059    }
00060   else          
00061    rev=1;
00062   return rev;
00063 }
00064 //-----------------------------------------------------------
00065 Int_t TMeshRawEvent::Fill()
00066 {
00067    Int_t rev=0;
00068    Clear();
00069    if(fxUnpacker)
00070       {
00071          fxUnpacker->Unpack(this);  // user event processing method
00072          // alternatively, we could work with the Fill() of the subcomponents:
00073          //         fxSub1.Fill();
00074          //         fxSub2.Fill();
00075          //         fxSub3.Fill();
00076       }
00077    else if(fxFile)
00078       fxFile->BuildEvent(this); // method from framework to restore event from file
00079    else
00080       rev=1;
00081    return rev;
00082 }
00083 
00084 //-----------------------------------------------------------
00085 void  TMeshRawEvent::Clear(Option_t *t)
00086 {
00087    fxSub1.Clear(t);
00088    fxSub2.Clear(t);
00089    fxSub3.Clear(t);
00090 }
00091 
00092 ClassImp(TMeshRawEvent)
00093 
00094 
00095 
00096 
00097 //----------------------------END OF GO4 SOURCE FILE ---------------------

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