GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TMeshB1AnlProc.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 "TMeshB1AnlProc.h"
15 
16 #include "TGo4UserException.h"
17 #include "TGo4Log.h"
18 
19 #include "TMeshRawEvent.h"
20 #include "TMeshB1OutputEvent.h"
21 #include "TMeshB1InputEvent.h"
22 
23 //***********************************************************
24 // this one is used in TXXXAnlFact
26  :TGo4EventProcessor(name)
27 {
28  TGo4Log::Info("TMeshB1AnlProc: Create %s", name);
29 }
30 
31 //***********************************************************
33  : TGo4EventProcessor("Processor1")
34 {
35 }
36 
37 //***********************************************************
39 {
40 }
41 
42 //-----------------------------------------------------------
44 {
45  if(!poutevt) return;
46  if(!fxInput) {
47  // lazy init for input event from framework
48  TGo4EventElement *providerinput = GetInputEvent("Input1Provider");
49  TMeshRawEvent *raw = dynamic_cast<TMeshRawEvent *>(providerinput);
50  if (raw)
51  fxInput = &(raw->fxSub1);
52  // provider delivers full raw event, we use only our component
53  else
54  fxInput = dynamic_cast<TMeshB1InputEvent *>(providerinput);
55  // provider with partial io delivers just our component
56  }
57  if (fxInput) {
58  // do the processing here:
59  for (Int_t i = 0; i < 4; i++) {
60  poutevt->frData[i] = (Float_t)fxInput->fiCrate1[i];
61  }
62  } else {
63  throw TGo4UserException(3, "Error: no input event for processor %s", GetName());
64  }
65 }
static void Info(const char *text,...) GO4_PRINTF_ARGS
Definition: TGo4Log.cxx:294
TMeshB1InputEvent * fxInput
TMeshB1InputEvent fxSub1
Definition: TMeshRawEvent.h:47
void Analysis(TMeshB1OutputEvent *target)
TGo4EventElement * GetInputEvent()
virtual ~TMeshB1AnlProc()