Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TMeshB12AnlProc.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 "Riostream.h"
00019 
00020 #include "TGo4UserException.h"
00021 
00022 #include "TMeshB12OutputEvent.h"
00023 #include "TMeshB1OutputEvent.h"
00024 #include "TMeshB2OutputEvent.h"
00025 
00026 //***********************************************************
00027 // this one is used in TXXXAnlFact
00028 TMeshB12AnlProc::TMeshB12AnlProc(const char* name)
00029   :TGo4EventProcessor(name),fxInput1(0),fxInput2(0)
00030 {
00031   cout << "**** TMeshB12AnlProc: Create" << endl;
00032 }
00033 //***********************************************************
00034 TMeshB12AnlProc::TMeshB12AnlProc()
00035   : TGo4EventProcessor("Processor12"),fxInput1(0),fxInput2(0)
00036 {
00037 }
00038 //***********************************************************
00039 TMeshB12AnlProc::~TMeshB12AnlProc()
00040 {
00041 }
00042 //***********************************************************
00043 
00044 //-----------------------------------------------------------
00045 void TMeshB12AnlProc::Analysis(TMeshB12OutputEvent* poutevt)
00046 {
00047  if(fxInput1==0)
00048       {
00049          // lazy init for input event from framework
00050          TGo4EventElement* providerinput=GetInputEvent("Output1Provider");
00051          fxInput1=dynamic_cast<TMeshB1OutputEvent*>(providerinput);
00052       }
00053  if(fxInput2==0)
00054       {
00055          // lazy init for input event from framework
00056          TGo4EventElement* providerinput=GetInputEvent("Output2Provider");
00057          fxInput2=dynamic_cast<TMeshB2OutputEvent*>(providerinput);
00058       }
00059 
00060 
00061    if(fxInput1 && fxInput2)
00062       {
00063          // do the processing here:
00064                for(Int_t i=0;i<4;i++)
00065                {
00066                   Int_t j=i+1;
00067                   if(j>3) j=0;
00068                   Float_t val=0;
00069                   if(fxInput2->frData[j])
00070                      val=TMath::Abs(fxInput1->frData[i]/fxInput2->frData[j]);
00071                   //cout <<"val["<<i<<"]="<<val << endl;
00072                   poutevt->frData[i]=val;
00073                }
00074       }
00075    else
00076       {
00077          throw TGo4UserException(3,"Error: not all input events available for processor %s",GetName());
00078       }
00079 
00080 
00081 
00082 
00083 
00084 
00085 } // BuildCalEvent
00086 
00087 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:10 2008 for Go4-v3.04-1 by  doxygen 1.4.2