Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TMeshRawEvent.cxx

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

Generated on Fri Nov 28 12:59:11 2008 for Go4-v3.04-1 by  doxygen 1.4.2