00001 // $Id: TMeshB12AnlProc.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 "TMeshB12AnlProc.h" 00015 00016 #include "TGo4UserException.h" 00017 #include "TGo4Log.h" 00018 00019 #include "TMeshB12OutputEvent.h" 00020 #include "TMeshB1OutputEvent.h" 00021 #include "TMeshB2OutputEvent.h" 00022 00023 //*********************************************************** 00024 // this one is used in TXXXAnlFact 00025 TMeshB12AnlProc::TMeshB12AnlProc(const char* name) 00026 :TGo4EventProcessor(name),fxInput1(0),fxInput2(0) 00027 { 00028 TGo4Log::Info("TMeshB12AnlProc: Create %s", name); 00029 } 00030 //*********************************************************** 00031 TMeshB12AnlProc::TMeshB12AnlProc() 00032 : TGo4EventProcessor("Processor12"),fxInput1(0),fxInput2(0) 00033 { 00034 } 00035 //*********************************************************** 00036 TMeshB12AnlProc::~TMeshB12AnlProc() 00037 { 00038 } 00039 //*********************************************************** 00040 00041 //----------------------------------------------------------- 00042 void TMeshB12AnlProc::Analysis(TMeshB12OutputEvent* poutevt) 00043 { 00044 if(fxInput1==0) 00045 { 00046 // lazy init for input event from framework 00047 TGo4EventElement* providerinput=GetInputEvent("Output1Provider"); 00048 fxInput1=dynamic_cast<TMeshB1OutputEvent*>(providerinput); 00049 } 00050 if(fxInput2==0) 00051 { 00052 // lazy init for input event from framework 00053 TGo4EventElement* providerinput=GetInputEvent("Output2Provider"); 00054 fxInput2=dynamic_cast<TMeshB2OutputEvent*>(providerinput); 00055 } 00056 00057 00058 if(fxInput1 && fxInput2) 00059 { 00060 // do the processing here: 00061 for(Int_t i=0;i<4;i++) 00062 { 00063 Int_t j=i+1; 00064 if(j>3) j=0; 00065 Float_t val=0; 00066 if(fxInput2->frData[j]) 00067 val=TMath::Abs(fxInput1->frData[i]/fxInput2->frData[j]); 00068 //std::cout <<"val["<<i<<"]="<<val << std::endl; 00069 poutevt->frData[i]=val; 00070 } 00071 } 00072 else 00073 { 00074 throw TGo4UserException(3,"Error: not all input events available for processor %s",GetName()); 00075 } 00076 00077 00078 00079 00080 00081 00082 } // BuildCalEvent