GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TMeshB12AnlProc.cxx
Go to the documentation of this file.
1 // $Id$
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(nullptr),fxInput2(nullptr)
27 {
28  TGo4Log::Info("TMeshB12AnlProc: Create %s", name);
29 }
30 
32  : TGo4EventProcessor("Processor12"),fxInput1(nullptr),fxInput2(nullptr)
33 {
34 }
35 
37 {
38 }
39 
40 //-----------------------------------------------------------
42 {
43  if (!fxInput1) {
44  // lazy init for input event from framework
45  TGo4EventElement *providerinput = GetInputEvent("Output1Provider");
46  fxInput1 = dynamic_cast<TMeshB1OutputEvent *>(providerinput);
47  }
48  if (!fxInput2) {
49  // lazy init for input event from framework
50  TGo4EventElement *providerinput = GetInputEvent("Output2Provider");
51  fxInput2 = dynamic_cast<TMeshB2OutputEvent *>(providerinput);
52  }
53 
54  if (fxInput1 && fxInput2) {
55  // do the processing here:
56  for (Int_t i = 0; i < 4; i++) {
57  Int_t j = i + 1;
58  if (j > 3)
59  j = 0;
60  Float_t val = 0;
61  if (fxInput2->frData[j])
62  val = TMath::Abs(fxInput1->frData[i] / fxInput2->frData[j]);
63  poutevt->frData[i] = val;
64  }
65  } else {
66  throw TGo4UserException(3, "Error: not all input events available for processor %s", GetName());
67  }
68 }
TMeshB2OutputEvent * fxInput2
static void Info(const char *text,...) GO4_PRINTF_ARGS
Definition: TGo4Log.cxx:294
void Analysis(TMeshB12OutputEvent *target)
virtual ~TMeshB12AnlProc()
TGo4EventElement * GetInputEvent()
TMeshB1OutputEvent * fxInput1