GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TMeshB1AnlProc.cxx
Go to the documentation of this file.
1 // $Id: TMeshB1AnlProc.cxx 999 2013-07-25 11:58:59Z 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 für 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),fxInput(0)
27 {
28  TGo4Log::Info("TMeshB1AnlProc: Create %s", name);
29 }
30 //***********************************************************
32  : TGo4EventProcessor("Processor1"),fxInput(0)
33 {
34 }
35 //***********************************************************
37 {
38 }
39 //***********************************************************
40 
41 //-----------------------------------------------------------
43 {
44  if(poutevt==0) return;
45  if(fxInput==0)
46  {
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  {
59  //std::cout <<"Dump of event "<<fxInput->GetName() << std::endl <<" ";
60  // do the processing here:
61  for(Int_t i=0;i<4;i++)
62  {
63  poutevt->frData[i]=(Float_t)fxInput->fiCrate1[i];
64  //std::cout << fxInput->fiCrate1[i]<<" ";
65  }
66  //std::cout << std::endl;
67  }
68  else
69  {
70  throw TGo4UserException(3,"Error: no input event for processor %s",GetName());
71  }
72 
73 } // BuildCalEvent
74 
TMeshB1InputEvent * fxInput
TMeshB1InputEvent fxSub1
Definition: TMeshRawEvent.h:47
void Analysis(TMeshB1OutputEvent *target)
TGo4EventElement * GetInputEvent()
virtual ~TMeshB1AnlProc()
static void Info(const char *text,...)
Definition: TGo4Log.cxx:283