GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TMeshRawEvent.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 "TMeshRawEvent.h"
15 
16 #include "TMeshUnpackProc.h"
17 #include "TGo4FileSource.h"
18 #include "TGo4Log.h"
19 
20 //***********************************************************
22  :TGo4EventElement("RawEvent")
23 {
24 }
25 
26 //***********************************************************
28  :TGo4EventElement(name)
29 {
30 }
31 
32 //***********************************************************
34 {
35 }
36 
37 //-----------------------------------------------------------
39 {
40  Int_t rev = 0;
41  Clear();
42  if(CheckEventSource("TMeshUnpackProc")) {
43  fxUnpacker = dynamic_cast<TMeshUnpackProc*>(GetEventSource());
44  // for the subcomponents, we have to set unpacker as source ?:
45  // only if we would use the subcomponents' Fill() methodsin our Fill()
46  // fxSub1.SetEventSource(fxUnpacker);
47  // fxSub1.Init();
48  // fxSub2.SetEventSource(fxUnpacker);
49  // fxSub1.Init();
50  // fxSub3.SetEventSource(fxUnpacker);
51  // fxSub1.Init();
52  TGo4Log::Info("TMeshRawEvent init for Unpack step");
53  } else if(CheckEventSource("TGo4FileSource")) {
54  fxFile = dynamic_cast<TGo4FileSource*> (GetEventSource());
55  TGo4Log::Info("TMeshRawEvent init for file input");
56  } else {
57  rev = 1;
58  }
59  return rev;
60 }
61 //-----------------------------------------------------------
63 {
64  Int_t rev = 0;
65  Clear();
66  if(fxUnpacker) {
67  fxUnpacker->Unpack(this); // user event processing method
68  // alternatively, we could work with the Fill() of the subcomponents:
69  // fxSub1.Fill();
70  // fxSub2.Fill();
71  // fxSub3.Fill();
72  } else if(fxFile)
73  fxFile->BuildEvent(this); // method from framework to restore event from file
74  else
75  rev = 1;
76  return rev;
77 }
78 
79 //-----------------------------------------------------------
80 void TMeshRawEvent::Clear(Option_t *opt)
81 {
82  fxSub1.Clear(opt);
83  fxSub2.Clear(opt);
84  fxSub3.Clear(opt);
85 }
TGo4EventSource * GetEventSource() const
TGo4FileSource * fxFile
Don&#39;t put this to file.
Definition: TMeshRawEvent.h:53
Bool_t BuildEvent(TGo4EventElement *dest) override
void Clear(Option_t *opt="") override
TMeshUnpackProc * fxUnpacker
Definition: TMeshRawEvent.h:52
Int_t Fill() override
static void Info(const char *text,...) GO4_PRINTF_ARGS
Definition: TGo4Log.cxx:294
void Clear(Option_t *opt="") override
TMeshB1InputEvent fxSub1
Definition: TMeshRawEvent.h:47
Bool_t CheckEventSource(const char *classname)
virtual ~TMeshRawEvent()
Int_t Init() override
void Unpack(TMeshRawEvent *target)
TMeshB2InputEvent fxSub2
Definition: TMeshRawEvent.h:48
TMeshB3InputEvent fxSub3
Definition: TMeshRawEvent.h:49
void Clear(Option_t *opt="") override
void Clear(Option_t *opt="") override