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