GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4HistogramEntry.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 TGO4HISTOGRAMENTRY_H
15 #define TGO4HISTOGRAMENTRY_H
16 
17 #include "TGo4DynamicEntry.h"
18 #include "TString.h"
19 
20 /* maximum dimension of histogram processable in dynamic list */
21 #define __MAXHISDIM__ 3
22 #define __MAXCONDIM__ 2
23 
24 class TH1;
25 class TGo4Condition;
26 class TDataMember;
27 
34 
35  friend class TGo4DynamicList;
36 
37  public:
38 
40 
41  TGo4HistogramEntry(const char *name);
42 
43  virtual ~TGo4HistogramEntry();
44 
46  void SetHistogramName(const char *name) { fxHistogramName = name; }
48  const char *GetHistogramName() const { return fxHistogramName.Data(); }
49 
53  void SetHisVarName(Int_t ix, const char *name);
54  const char *GetHistVarName(Int_t ix) const;
55 
59  void SetHisEventName(Int_t ix, const char *name);
60  const char *GetHistEventName(Int_t ix) const;
61 
63  void SetConditionName(const char *name) { fxConditionName = name; }
64  const char *GetConditionName() const { return fxConditionName.Data(); }
65 
69  void SetConVarName(Int_t ix, const char *name);
70  const char *GetConVarName(Int_t ix) const;
71 
75  void SetConEventName(Int_t ix, const char *name);
76  const char *GetConEventName(Int_t ix) const;
77 
78  Bool_t NeedInitialisation() const { return fbNeedInitialisation; }
79  void SetNeedInitialisation(Bool_t on = kTRUE) { fbNeedInitialisation = on; }
80 
82  void Reset() override;
83 
84  void Print(Option_t *opt = "") const override;
85 
86  void RecursiveRemove(TObject *obj) override;
87 
88  static const char *Get_fgcNOCONDITION();
89 
90  static const char *Get_fgcNODATA();
91 
92  static const char *Get_fgcNOEVENT();
93 
94  protected:
95 
96  void InitHistPointer(Int_t ix, TObject *event, TDataMember *member, Long_t offset);
97 
98  void InitCondPointer(Int_t ix, TObject *event, TDataMember *member, Long_t offset);
99 
100  Double_t GetPtrValue(Int_t type, void *ptr);
101 
102  Bool_t TestConditionNew();
103 
104  void ProcessNew(Bool_t *evvalid);
105 
106  private:
107 
110 
113 
117 
120 
124 
129 
131  TH1 *fxHistogram{nullptr};
132 
135 
136  Bool_t fbNeedInitialisation{kFALSE};
137 
139  TObject *fxHisEvents[__MAXHISDIM__] = { nullptr, nullptr, nullptr };
140 
143  TObject *fxConEvents[__MAXCONDIM__] = { nullptr, nullptr };
144 
146  Int_t fxHistType[__MAXHISDIM__] = { 0, 0, 0 };
147  void *fxHistPtr[__MAXHISDIM__] = { nullptr, nullptr, nullptr };
148 
150  Int_t fxCondType[__MAXCONDIM__] = { 0, 0 };
151  void *fxCondPtr[__MAXCONDIM__] = { nullptr, nullptr };
152 
154  static const char *fgcNOCONDITION;
156  static const char *fgcNODATA;
158  static const char *fgcNOEVENT;
159 
160  ClassDefOverride(TGo4HistogramEntry,3)
161 };
162 
163 #endif //TGO4HISTOGRAMENTRY_H
Double_t GetPtrValue(Int_t type, void *ptr)
static const char * Get_fgcNOCONDITION()
void SetNeedInitialisation(Bool_t on=kTRUE)
static const char * fgcNOEVENT
const char * GetConEventName(Int_t ix) const
void * fxCondPtr[__MAXCONDIM__]
const char * GetHistEventName(Int_t ix) const
const char * GetConVarName(Int_t ix) const
void SetConditionName(const char *name)
static const char * fgcNODATA
Int_t fxCondType[__MAXCONDIM__]
#define __MAXHISDIM__
TString fxConVarName[__MAXCONDIM__]
void SetConEventName(Int_t ix, const char *name)
void SetHistogramName(const char *name)
const char * GetHistogramName() const
static const char * fgcNOCONDITION
void RecursiveRemove(TObject *obj) override
void Print(Option_t *opt="") const override
void InitCondPointer(Int_t ix, TObject *event, TDataMember *member, Long_t offset)
TObject * fxConEvents[__MAXCONDIM__]
Bool_t NeedInitialisation() const
void SetHisEventName(Int_t ix, const char *name)
void * fxHistPtr[__MAXHISDIM__]
Int_t fxHistType[__MAXHISDIM__]
TString fxHisVarName[__MAXHISDIM__]
#define __MAXCONDIM__
static const char * Get_fgcNODATA()
TString fxConEventName[__MAXCONDIM__]
TObject * fxHisEvents[__MAXHISDIM__]
void SetConVarName(Int_t ix, const char *name)
void InitHistPointer(Int_t ix, TObject *event, TDataMember *member, Long_t offset)
const char * GetConditionName() const
void ProcessNew(Bool_t *evvalid)
TString fxHisEventName[__MAXHISDIM__]
static const char * Get_fgcNOEVENT()
TGo4Condition * fxCondition
const char * GetHistVarName(Int_t ix) const
void SetHisVarName(Int_t ix, const char *name)