GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TMeshB1InputEvent.cxx
Go to the documentation of this file.
1 // $Id: TMeshB1InputEvent.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 "TMeshB1InputEvent.h"
15 
16 #include "TGo4Log.h"
17 #include "TMeshUnpackProc.h"
18 #include "TGo4FileSource.h"
19 
20 //***********************************************************
22  :TGo4EventElement("InputEvent1"),fxProcessor(0),fxFile(0)
23 {
24 }
25 //***********************************************************
27  :TGo4EventElement(name),fxProcessor(0),fxFile(0)
28 {
29 }
30 //***********************************************************
32 {
33 }
34 //***********************************************************
35 
36 //-----------------------------------------------------------
38 {
39  Int_t rev=0;
40  //std::cout << "+++ Init event" << std::endl;
41  Clear();
42  // is it used by Unpack step as output?
43  if(CheckEventSource("TMeshUnpackProc")){
44  fxProcessor = dynamic_cast<TMeshUnpackProc*>(GetEventSource());
45  TGo4Log::Info("TMeshB1InputEvent init for Unpack step");
46  }
47  // or is it used from provider step as input
48  else if(CheckEventSource("TGo4FileSource")){
49  fxFile = dynamic_cast<TGo4FileSource*> (GetEventSource());
50  TGo4Log::Info("TMeshB1InputEvent init for file input");
51  }
52  else rev=1;
53  return rev;
54 }
55 //-----------------------------------------------------------
57 {
58  Int_t rev=0;
59  Clear();
60  if(fxProcessor)
62  else if(fxFile)
63  fxFile->BuildEvent(this);
64  else
65  rev=1;
66  return rev;
67 }
68 
69 //-----------------------------------------------------------
70 void TMeshB1InputEvent::Clear(Option_t *t)
71 {
72 void* destfield;
73  //std::cout << "+++ event clear" << std::endl;
74  destfield = (void*) &fiCrate1[0];
75  memset(destfield,0, sizeof(fiCrate1));
76  //std::cout << "+++ event clear" << std::endl;
77 }
void UnpackBranch1(TMeshB1InputEvent *target)
TGo4EventSource * GetEventSource() const
TGo4FileSource * fxFile
Don't put this to file.
Bool_t CheckEventSource(const char *classname)
virtual Bool_t BuildEvent(TGo4EventElement *dest)
TMeshUnpackProc * fxProcessor
static void Info(const char *text,...)
Definition: TGo4Log.cxx:283
void Clear(Option_t *t="")