GSI Object Oriented Online Offline (Go4) GO4-6.4.5
Loading...
Searching...
No Matches
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#include "TMath.h"
19
20#include "TMeshB12OutputEvent.h"
21#include "TMeshB1OutputEvent.h"
22#include "TMeshB2OutputEvent.h"
23
24//***********************************************************
25// this one is used in TXXXAnlFact
27 :TGo4EventProcessor(name),fxInput1(nullptr),fxInput2(nullptr)
28{
29 TGo4Log::Info("TMeshB12AnlProc: Create %s", name);
30}
31
33 : TGo4EventProcessor("Processor12"),fxInput1(nullptr),fxInput2(nullptr)
34{
35}
36
40
41//-----------------------------------------------------------
43{
44 if (!fxInput1) {
45 // lazy init for input event from framework
46 TGo4EventElement *providerinput = GetInputEvent("Output1Provider");
47 fxInput1 = dynamic_cast<TMeshB1OutputEvent *>(providerinput);
48 }
49 if (!fxInput2) {
50 // lazy init for input event from framework
51 TGo4EventElement *providerinput = GetInputEvent("Output2Provider");
52 fxInput2 = dynamic_cast<TMeshB2OutputEvent *>(providerinput);
53 }
54
55 if (fxInput1 && fxInput2) {
56 // do the processing here:
57 for (Int_t i = 0; i < 4; i++) {
58 Int_t j = i + 1;
59 if (j > 3)
60 j = 0;
61 Float_t val = 0;
62 if (fxInput2->frData[j])
63 val = TMath::Abs(fxInput1->frData[i] / fxInput2->frData[j]);
64 poutevt->frData[i] = val;
65 }
66 } else {
67 throw TGo4UserException(3, "Error: not all input events available for processor %s", GetName());
68 }
69}
TGo4EventProcessor(const char *name)
TGo4EventElement * GetInputEvent()
Access to external raw event which is set as association member.
friend class TGo4EventElement
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
Definition TGo4Log.cxx:302
Exception to be thrown by analysis user.
void Analysis(TMeshB12OutputEvent *target)
TMeshB2OutputEvent * fxInput2
virtual ~TMeshB12AnlProc()
TMeshB1OutputEvent * fxInput1