00001 // $Id: TMeshB2InputEvent.cxx 999 2013-07-25 11:58:59Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "TMeshB2InputEvent.h" 00015 00016 #include "TGo4Log.h" 00017 #include "TMeshUnpackProc.h" 00018 #include "TGo4FileSource.h" 00019 00020 //*********************************************************** 00021 TMeshB2InputEvent::TMeshB2InputEvent() 00022 :TGo4EventElement("InputEvent2"),fxProcessor(0),fxFile(0) 00023 { 00024 } 00025 //*********************************************************** 00026 TMeshB2InputEvent::TMeshB2InputEvent(const char* name) 00027 :TGo4EventElement(name),fxProcessor(0),fxFile(0) 00028 { 00029 } 00030 //*********************************************************** 00031 TMeshB2InputEvent::~TMeshB2InputEvent() 00032 { 00033 } 00034 //*********************************************************** 00035 00036 //----------------------------------------------------------- 00037 Int_t TMeshB2InputEvent::Init() 00038 { 00039 Int_t rev=0; 00040 //std::cout << "+++ Init event" << std::endl; 00041 Clear(); 00042 // is it used by Unpack step as output? 00043 if(CheckEventSource("TMeshUnpackProc")){ 00044 fxProcessor = dynamic_cast<TMeshUnpackProc*>(GetEventSource()); 00045 TGo4Log::Info("TMeshB2InputEvent init for Unpack step"); 00046 } 00047 // or is it used from provider step as input 00048 else if(CheckEventSource("TGo4FileSource")){ 00049 fxFile = dynamic_cast<TGo4FileSource*> (GetEventSource()); 00050 TGo4Log::Info("TMeshB2InputEvent init for file input"); 00051 } 00052 else rev=1; 00053 return rev; 00054 } 00055 //----------------------------------------------------------- 00056 Int_t TMeshB2InputEvent::Fill() 00057 { 00058 Int_t rev=0; 00059 Clear(); 00060 if(fxProcessor) 00061 fxProcessor->UnpackBranch2(this); 00062 else if(fxFile) 00063 fxFile->BuildEvent(this); 00064 else 00065 rev=1; 00066 return rev; 00067 } 00068 00069 //----------------------------------------------------------- 00070 void TMeshB2InputEvent::Clear(Option_t *t) 00071 { 00072 void* destfield = (void*) &fiCrate2[0]; 00073 memset(destfield,0, sizeof(fiCrate2)); 00074 }