GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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//***********************************************************
25
26//***********************************************************
28 :TGo4EventElement(name)
29{
30}
31
32//***********************************************************
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//-----------------------------------------------------------
80void TMeshRawEvent::Clear(Option_t *opt)
81{
82 fxSub1.Clear(opt);
83 fxSub2.Clear(opt);
84 fxSub3.Clear(opt);
85}
TGo4EventSource * GetEventSource() const
Bool_t CheckEventSource(const char *classname)
Check if event source is valid.
Raw event source which reads entries from a root TTree in a TFile.
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
Definition TGo4Log.cxx:294
TMeshUnpackProc * fxUnpacker
TMeshB3InputEvent fxSub3
Int_t Fill() override
Method called by the event owner (analysis step) to fill the event element from the set event source.
void Clear(Option_t *opt="") override
Method called by the event owner (analysis step) to clear the event element.
TMeshB2InputEvent fxSub2
Int_t Init() override
Method called on initialization of event classes.
virtual ~TMeshRawEvent()
TMeshB1InputEvent fxSub1
we compose data structure from subbranches:
TGo4FileSource * fxFile
Don't put this to file.