GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TMeshB2AnlProc.cxx
Go to the documentation of this file.
1 // $Id: TMeshB2AnlProc.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 "TMeshB2AnlProc.h"
15 
16 #include "TGo4Log.h"
17 #include "TGo4UserException.h"
18 
19 #include "TMeshRawEvent.h"
20 #include "TMeshB2OutputEvent.h"
21 #include "TMeshB2InputEvent.h"
22 
23 //***********************************************************
24 // this one is used in TXXXAnlFact
26  :TGo4EventProcessor(name),fxInput(0)
27 {
28  TGo4Log::Info("TMeshB2AnlProc: Create %s", name);
29 }
30 //***********************************************************
32  : TGo4EventProcessor("Processor2"),fxInput(0)
33 {
34 }
35 //***********************************************************
37 {
38 }
39 //***********************************************************
40 
41 //-----------------------------------------------------------
43 {
44  if(fxInput==0)
45  {
46  // lazy init for input event from framework
47  TGo4EventElement* providerinput=GetInputEvent("Input2Provider");
48  TMeshRawEvent* raw=dynamic_cast<TMeshRawEvent*>(providerinput);
49  if(raw)
50  fxInput=&(raw->fxSub2);
51  // provider delivers full raw event, we use only our component
52  else
53  fxInput=dynamic_cast<TMeshB2InputEvent*>(providerinput);
54  // provider with partial io delivers just our component
55  }
56  if(fxInput)
57  {
58  // do the processing here:
59  for(Int_t i=0;i<4;i++)
60  {
61  poutevt->frData[i]=(Float_t)fxInput->fiCrate2[i];
62  }
63 
64 
65  }
66  else
67  {
68  throw TGo4UserException(3,"Error: no input event for processor %s",GetName());
69  }
70 
71 } // BuildCalEvent
virtual ~TMeshB2AnlProc()
TMeshB2InputEvent fxSub2
Definition: TMeshRawEvent.h:48
void Analysis(TMeshB2OutputEvent *target)
TMeshB2InputEvent * fxInput
TGo4EventElement * GetInputEvent()
static void Info(const char *text,...)
Definition: TGo4Log.cxx:297