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