00001 // $Id: TMeshProviderProc.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 "TMeshProviderProc.h" 00015 00016 #include "TGo4Log.h" 00017 #include "TGo4Analysis.h" 00018 #include "TGo4EventElement.h" 00019 #include "TGo4UserException.h" 00020 00021 //*********************************************************** 00022 // this one is used in TXXXAnlFact 00023 TMeshProviderProc::TMeshProviderProc(const char* name) 00024 :TGo4EventProcessor(name) 00025 { 00026 TGo4Log::Info("TMeshProviderProc: Create %s", name); 00027 } 00028 //*********************************************************** 00029 TMeshProviderProc::TMeshProviderProc() 00030 : TGo4EventProcessor("ProviderProcessor") 00031 { 00032 } 00033 //*********************************************************** 00034 TMeshProviderProc::~TMeshProviderProc() 00035 { 00036 } 00037 //*********************************************************** 00038 00039 //----------------------------------------------------------- 00040 void TMeshProviderProc::SetRealInput() 00041 { 00042 TGo4EventElement* myinput=GetInputEvent(); 00043 if(myinput==0 || 00044 (myinput!=0 && myinput->CheckEventSource("TGo4EventProcessor"))) 00045 { 00046 // source of our input event is processor and not file: 00047 // we have to reset the pointer from framework! 00048 // the trick is: name of this processor (up to the "_") is name of required event 00049 // note that TGo4StepFactory forbids to use same name for different objects, 00050 // since object name is used as pointer name in the processline call 00051 TString eventname=GetName(); 00052 eventname.Resize(eventname.Index("_",1)); // 00053 //std::cout <<"SetRealInput of"<<GetName()<<" sees eventname "<<eventname.Data() << std::endl; 00054 myinput=TGo4Analysis::Instance()->GetEventStructure(eventname.Data()); 00055 if(myinput==0) 00056 throw TGo4UserException(3,"Error setting real input event %s", GetName()); 00057 else 00058 SetInputEvent(myinput); 00059 } 00060 //else if(myinput!=0 && myinput->CheckEventSource("TGo4FileSource")) 00061 // { 00062 // // this provider reads from file. ok 00063 // 00064 // } 00065 //else 00066 // { 00067 // // neither processor or file input: something is very wrong 00068 // throw TGo4UserException(3,"No source found for provider %s", GetName()); 00069 // } 00070 // we skip the last checks for performance reasons... 00071 00072 }