GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TMeshB12AnlProc.cxx
Go to the documentation of this file.
1 // $Id: TMeshB12AnlProc.cxx 2627 2019-10-01 08:02:45Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TMeshB12AnlProc.h"
15 
16 #include "TGo4UserException.h"
17 #include "TGo4Log.h"
18 
19 #include "TMeshB12OutputEvent.h"
20 #include "TMeshB1OutputEvent.h"
21 #include "TMeshB2OutputEvent.h"
22 
23 //***********************************************************
24 // this one is used in TXXXAnlFact
26  :TGo4EventProcessor(name),fxInput1(0),fxInput2(0)
27 {
28  TGo4Log::Info("TMeshB12AnlProc: Create %s", name);
29 }
30 //***********************************************************
32  : TGo4EventProcessor("Processor12"),fxInput1(0),fxInput2(0)
33 {
34 }
35 //***********************************************************
37 {
38 }
39 //***********************************************************
40 
41 //-----------------------------------------------------------
43 {
44  if(fxInput1==0)
45  {
46  // lazy init for input event from framework
47  TGo4EventElement* providerinput=GetInputEvent("Output1Provider");
48  fxInput1=dynamic_cast<TMeshB1OutputEvent*>(providerinput);
49  }
50  if(fxInput2==0)
51  {
52  // lazy init for input event from framework
53  TGo4EventElement* providerinput=GetInputEvent("Output2Provider");
54  fxInput2=dynamic_cast<TMeshB2OutputEvent*>(providerinput);
55  }
56 
57 
58  if(fxInput1 && fxInput2)
59  {
60  // do the processing here:
61  for(Int_t i=0;i<4;i++)
62  {
63  Int_t j=i+1;
64  if(j>3) j=0;
65  Float_t val=0;
66  if(fxInput2->frData[j])
67  val=TMath::Abs(fxInput1->frData[i]/fxInput2->frData[j]);
68  //std::cout <<"val["<<i<<"]="<<val << std::endl;
69  poutevt->frData[i]=val;
70  }
71  }
72  else
73  {
74  throw TGo4UserException(3,"Error: not all input events available for processor %s",GetName());
75  }
76 
77 
78 
79 
80 
81 
82 } // BuildCalEvent
TMeshB2OutputEvent * fxInput2
void Analysis(TMeshB12OutputEvent *target)
virtual ~TMeshB12AnlProc()
TGo4EventElement * GetInputEvent()
TMeshB1OutputEvent * fxInput1
static void Info(const char *text,...)
Definition: TGo4Log.cxx:297