GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ListCond.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 TGO4LISTCOND_H
15#define TGO4LISTCOND_H
16
17#include "TGo4Condition.h"
18#include <vector>
19
24
26public:
28 TGo4ListCond(const char *name, const char *title = "Go4 list condition");
29 TGo4ListCond(const char *name, const char *title, const Int_t num, const Int_t *values);
30 TGo4ListCond(const char *name, const char *title, const Int_t start, const Int_t stop, const Int_t step = 1);
31 virtual ~TGo4ListCond();
32
34 virtual void SetValues(const Int_t num, const Int_t * values);
35 virtual void SetValues(const Int_t start, const Int_t stop, const Int_t step);
36
38 Bool_t Test(Double_t value) override;
39
40 void PrintCondition(Bool_t full = kFALSE) override;
41 void PrintValues();
42
43 Bool_t UpdateFrom(TGo4Condition *cond, Bool_t counts) override;
44
45 UInt_t GetNumValues() const { return fxValues.size(); }
46
47 Int_t GetValue(UInt_t ix) const { return ix < fxValues.size() ? fxValues[ix] : 0; }
48
49 void SetValue(UInt_t ix, Int_t val)
50 {
51 if (ix >= fxValues.size())
52 fxValues.resize(ix);
53 fxValues[ix] = val;
54 }
55
56 void InsertValue(UInt_t ix, Int_t val) { fxValues.insert(fxValues.begin() + ix, val); }
57
58 void RemoveValue(UInt_t ix) { fxValues.erase(fxValues.begin() + ix); }
59
60 void Resize(size_t newsize) { fxValues.resize(newsize); }
61
63 Double_t GetXLow() const override;
64
66 Double_t GetXUp() const override;
67
69 Double_t GetYLow() const override;
70
72 Double_t GetYUp() const override;
73
77 /* virtual TGo4ConditionPainter *CreatePainter();*/
78
79private:
80
81 std::vector<Int_t> fxValues;
82
83// /** number of values in list: todo: use vector here?*/
84// Int_t fiNum;
85// /** array with values to test: todo: use vector here?*/
86// Int_t * fiValues;
87
89};
90
91#endif // TGO4LISTCOND_H
virtual void SetValues()
Set values needed, i.e.
virtual Bool_t Test()
Test if condition is true.
ClassDefOverride(TGo4ListCond, 1)
number of values in list: todo: use vector here?
Double_t GetXLow() const override
For base class displays: minimum value of test list.
void Resize(size_t newsize)
virtual ~TGo4ListCond()
void PrintCondition(Bool_t full=kFALSE) override
Prints counters and boolean members.
Double_t GetYUp() const override
For base class displays: not used for 1d list.
virtual void SetValues()
Set values needed, i.e.
Bool_t UpdateFrom(TGo4Condition *cond, Bool_t counts) override
Copy values from cond to this.
void RemoveValue(UInt_t ix)
UInt_t GetNumValues() const
void InsertValue(UInt_t ix, Int_t val)
Int_t GetValue(UInt_t ix) const
void SetValue(UInt_t ix, Int_t val)
Double_t GetYLow() const override
For base class displays: not used for 1d list.
virtual Bool_t Test()
Test if condition is true.
std::vector< Int_t > fxValues
Factory method to generate the subclass implementation for painter TODO: do we need graphical represe...
Double_t GetXUp() const override
For base class displays: maximum value of test list.