GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4EventElement.h
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#ifndef TGO4EVENTELEMENT_H
15#define TGO4EVENTELEMENT_H
16
17#include "TNamed.h"
18
19class TGo4EventSource;
20class TBranch;
21class TTree;
22
38
39class TGo4EventElement : public TNamed {
40 public:
41
43
44 TGo4EventElement(const char *name);
45 TGo4EventElement(const char *aName, const char *aTitle, Short_t aBaseCat = 0);
46
47 virtual ~TGo4EventElement();
48
50 void SetValid(Bool_t on) { fbIsValid = on; }
51
53 Bool_t IsValid() const { return fbIsValid; }
54
57
59 void SetParent(TGo4EventElement *par) { fxParent = par; }
60
61 void SetKeepContents(Bool_t on = kTRUE) { fbKeepContents = on; }
62
63 inline TGo4EventElement *GetParent() const { return fxParent; }
64
65 virtual TGo4EventElement *GetChild(const char *name);
66
67 inline TGo4EventSource *GetEventSource() const { return fxEventSource; }
68
73 Bool_t CheckEventSource(const char *classname);
74
83 virtual Int_t Fill();
84
88 virtual Int_t Init();
89
91 virtual void PrintEvent();
92
93 virtual void makeBranch(TBranch *parent) {}
94 virtual void deactivate();
95 virtual void activate();
96
97 void Clear(Option_t *opt = "") override;
98 virtual void clearAll(Int_t) {}
99 virtual Bool_t isComposed() { return kFALSE; }
100 virtual Short_t getId() { return fIdentifier; }
101 virtual void setDebug (Bool_t debug) { fDebug = debug; }
102 virtual TGo4EventElement &operator[](Int_t) { return *this; }
103
104 void Print(Option_t *option = "") const override;
105
107 virtual void synchronizeWithTree(TTree *tree, TGo4EventElement **var_ptr = nullptr);
108
109 virtual Int_t activateBranch(TBranch *branch, Int_t index = 0, TGo4EventElement **var_ptr = nullptr);
110
111 virtual TTree *CreateSampleTree(TGo4EventElement **sample = nullptr);
112
113 void ShowSampleTree();
114
115 private:
116
120 Bool_t fbIsValid{kTRUE};
121
125
133
134 protected:
135 Short_t fIdentifier{-1}; // Identifier
136 Bool_t fDebug{kFALSE};
137
139 Bool_t fbKeepContents{kFALSE};
140
141 ClassDefOverride(TGo4EventElement,3)
142};
143
144#endif //TGO4EVENTELEMENT_H
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
void SetValid(Bool_t on)
Switches the valid state of this event.
virtual void activate()
TGo4EventElement * fxParent
The higher level event element that owns this instance 1.
Bool_t IsValid() const
Returns the valid state of this event.
virtual Int_t Init()
Method called on initialization of event classes.
virtual TTree * CreateSampleTree(TGo4EventElement **sample=nullptr)
virtual void makeBranch(TBranch *parent)
virtual void deactivate()
virtual TGo4EventElement * GetChild(const char *name)
void SetKeepContents(Bool_t on=kTRUE)
TGo4EventSource * GetEventSource() const
virtual void PrintEvent()
Method prints content of the event.
virtual Short_t getId()
virtual void setDebug(Bool_t debug)
virtual void synchronizeWithTree(TTree *tree, TGo4EventElement **var_ptr=nullptr)
Use this method to map event structure with the Tree branch(es)
void SetEventSource(TGo4EventSource *src)
Setter for the event source that is currently used by the Fill method.
virtual Int_t Fill()
Method called by the event owner (analysis step) to fill the event element from the set event source.
Bool_t fbIsValid
Indicates if this event is valid or not.
void Clear(Option_t *opt="") override
TGo4EventElement * GetParent() const
virtual void clearAll(Int_t)
void Print(Option_t *option="") const override
virtual Int_t activateBranch(TBranch *branch, Int_t index=0, TGo4EventElement **var_ptr=nullptr)
virtual TGo4EventElement & operator[](Int_t)
Bool_t CheckEventSource(const char *classname)
Check if event source is valid.
virtual Bool_t isComposed()
void SetParent(TGo4EventElement *par)
Setter for the parent event structure reference.
Bool_t fbKeepContents
Debug level.
TGo4EventSource * fxEventSource
The external event source instance which is used to fill this event structure from the raw event.