00001 // $Id: TMeshFinalProc.cxx 933 2013-01-29 15:27:58Z 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 "TMeshFinalProc.h" 00015 00016 #include "TGo4Log.h" 00017 #include "TMeshFinalEvent.h" 00018 00019 //*********************************************************** 00020 // this one is used in TXXXAnlFact 00021 TMeshFinalProc::TMeshFinalProc(const char* name) 00022 :TGo4EventProcessor(name),fxInput1(0),fxInput2(0),fxInput3(0),fxInput12(0) 00023 { 00024 TGo4Log::Info("TMeshFinalProc: Create %s", name); 00025 } 00026 //*********************************************************** 00027 TMeshFinalProc::TMeshFinalProc() 00028 : TGo4EventProcessor("FinalProcessor"),fxInput1(0),fxInput2(0),fxInput3(0),fxInput12(0) 00029 { 00030 } 00031 //*********************************************************** 00032 TMeshFinalProc::~TMeshFinalProc() 00033 { 00034 } 00035 //*********************************************************** 00036 00037 //----------------------------------------------------------- 00038 void TMeshFinalProc::Analysis(TMeshFinalEvent* poutevt) 00039 { 00040 if(poutevt==0) return; 00042 if(fxInput1==0) 00043 { 00044 fxInput1=dynamic_cast<TMeshB1OutputEvent*>(GetInputEvent("Output1Provider")); 00045 } 00046 if(fxInput2==0) 00047 { 00048 fxInput2=dynamic_cast<TMeshB2OutputEvent*>(GetInputEvent("Output2Provider")); 00049 } 00050 if(fxInput3==0) 00051 { 00052 fxInput3=dynamic_cast<TMeshB3OutputEvent*>(GetInputEvent("Output3Provider")); 00053 } 00054 if(fxInput12==0) 00055 { 00056 fxInput12=dynamic_cast<TMeshB12OutputEvent*>(GetInputEvent("Output12Provider")); 00057 } 00058 00060 //if(fxInput12 && fxInput3) 00061 // { 00062 // // normal case, combine all final results 00063 // 00064 // } 00065 //else if (fxInput1 && fxInput2 && fxInput3 ) 00066 // { 00067 // // work on these. any combination of inputs may be processed 00068 // // depending on the previous setup 00069 // // we might steer the final processing via parameter 00070 // } 00071 //else 00072 // { 00073 // throw TGo4UserException(3,"Error: not all input events available for processor %s",GetName();); 00074 // } 00075 00076 // for the moment, we just copy the component results into final event; 00077 if(fxInput1) 00078 poutevt->fxB1=*fxInput1; // be sure assignment operator is correct! 00079 if(fxInput2) 00080 poutevt->fxB2=*fxInput2; // be sure assignment operator is correct! 00081 if(fxInput3) 00082 poutevt->fxB3=*fxInput3; // be sure assignment operator is correct! 00083 if(fxInput12) 00084 poutevt->fxB12=*fxInput12; // be sure assignment operator is correct! 00085 00086 00087 }