Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4ExampleMesh/TMeshB12AnlProc.cxx

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

Generated on Tue Nov 8 10:55:55 2005 for Go4-v2.10-5 by doxygen1.2.15