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 "TMeshB2AnlProc.h" 00017 00018 #include <iostream.h> 00019 00020 #include "TMeshRawEvent.h" 00021 #include "TMeshB2OutputEvent.h" 00022 #include "TMeshB2InputEvent.h" 00023 #include "Go4Analysis/TGo4Analysis.h" 00024 00025 //*********************************************************** 00026 // this one is used in TXXXAnlFact 00027 TMeshB2AnlProc::TMeshB2AnlProc(Text_t * name) 00028 :TGo4EventProcessor(name),fxInput(0) 00029 { 00030 cout << "**** TMeshB2AnlProc: Create" << endl; 00031 } 00032 //*********************************************************** 00033 TMeshB2AnlProc::TMeshB2AnlProc() 00034 : TGo4EventProcessor("Processor2"),fxInput(0) 00035 { 00036 } 00037 //*********************************************************** 00038 TMeshB2AnlProc::~TMeshB2AnlProc() 00039 { 00040 } 00041 //*********************************************************** 00042 00043 //----------------------------------------------------------- 00044 void TMeshB2AnlProc::Analysis(TMeshB2OutputEvent* poutevt) 00045 { 00046 if(fxInput==0) 00047 { 00048 // lazy init for input event from framework 00049 TGo4EventElement* providerinput=GetInputEvent("Input2Provider"); 00050 TMeshRawEvent* raw=dynamic_cast<TMeshRawEvent*>(providerinput); 00051 if(raw) 00052 fxInput=&(raw->fxSub2); 00053 // provider delivers full raw event, we use only our component 00054 else 00055 fxInput=dynamic_cast<TMeshB2InputEvent*>(providerinput); 00056 // provider with partial io delivers just our component 00057 } 00058 if(fxInput) 00059 { 00060 // do the processing here: 00061 for(Int_t i=0;i<4;i++) 00062 { 00063 poutevt->frData[i]=(Float_t)fxInput->fiCrate2[i]; 00064 } 00065 00066 00067 } 00068 else 00069 { 00070 throw TGo4UserException(3,"Error: no input event for processor %s",GetName()); 00071 } 00072 00073 } // BuildCalEvent 00074 00075 //----------------------------------------------------------- 00076 ClassImp(TMeshB2AnlProc) 00077 00078 00079 00080 00081 //----------------------------END OF GO4 SOURCE FILE ---------------------